{"id":7035,"date":"2011-05-12T12:58:09","date_gmt":"2011-05-12T10:58:09","guid":{"rendered":"https:\/\/www.corelan.be\/?p=7035"},"modified":"2011-05-12T12:58:09","modified_gmt":"2011-05-12T10:58:09","slug":"hack-notes-ropping-eggs-for-breakfast","status":"publish","type":"post","link":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/","title":{"rendered":"Hack Notes : Ropping eggs for breakfast"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>I think we all agree that bypassing DEP (and ASLR) is no longer a luxury today. As operating systems (such as Windows 7) continue to gain popularity, exploit developers are <a class=\"thickbox\" href=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/breakfast1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"breakfast1\" border=\"0\" alt=\"breakfast1\" align=\"right\" src=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/breakfast1_thumb.png\" width=\"173\" height=\"216\" \/><\/a>forced to deal with increasingly more memory protection mechanisms, including DEP and ASLR. From a defense perspective, this is a good thing. But we all know there are ways around it when the stars and moon are properly aligned.<\/p>\n<p>One of the most popular techniques used to bypass DEP is ROP (also called &quot;code reuse&quot;). As explained in <a href=\"http:\/\/www.corelan.be\/index.php\/2010\/06\/16\/exploit-writing-tutorial-part-10-chaining-dep-with-rop-the-rubikstm-cube\/\" target=\"_blank\" rel=\"noopener\">one of my previous articles<\/a>, the concept behind this technique is that you would chain a series of pointers together, each pointing to a series of already existing executable instructions that will lead to setting up the arguments of a function that would allow you to disable DEP or bypass it.<\/p>\n<p>After the rop chain has set up the arguments and after the function gets called, you should be able to execute your shellcode.<\/p>\n<p>The most important functions to do this on Windows 7 are :<\/p>\n<ul>\n<li><span style=\"color: #c2c2c2\">VirtualProtect (change the protection of a given region)<\/span><\/li>\n<li><span style=\"color: #c2c2c2\">VirtualAlloc + a function to copy or move shellcode into the newly allocated region. Depending on the type of payload, one of the following functions should allow you to do this : strcpy(), strncpy(), memcpy(), memmove(), etc<\/span><\/li>\n<\/ul>\n<p>With a few exceptions, that's about it.&#160; NtSetInformationProcess() and SetProcessDEPPolicy() are no longer usable on Windows 7.<\/p>\n<p>For the sake of this &quot;hack note&quot; post, I'll assume that you know how to build your ROP chain, how to pick up a reliable pointer to those functions and how to execute your shellcode. If you don't, check the tutorial or one of the &quot;<a href=\"http:\/\/www.corelan.be\/index.php\/security\/corelan-training\/\" target=\"_blank\" rel=\"noopener\">Corelan Live<\/a>&quot; training sessions at a con near you \ud83d\ude42<\/p>\n<p>Today, I will elaborate more on the use of an egghunter in a DEP bypass exploit.<\/p>\n<h3>What if you have to use an egghunter ?<\/h3>\n<p>As explained in the aforementioned tutorial, executing an <a href=\"http:\/\/www.corelan.be\/index.php\/2010\/01\/09\/exploit-writing-tutorial-part-8-win32-egg-hunting\/\" target=\"_blank\" rel=\"noopener\">egghunter<\/a> is not different than executing other shellcode. However there is an additional issue we need to solve.<\/p>\n<p>As you can see in the screenshot below, by default, immediately after the eggunter has located the egg (= your real payload) in memory, it will simply jump to that egg. (jmp edi)<\/p>\n<p><a href=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image_thumb.png\" width=\"551\" height=\"176\" \/><\/a><\/p>\n<p>With DEP enabled, this will most likely fail (unless you accidentally marked the egg as executable too, or if you are on an older OS &amp; you are in the very fortunate position to be able to use NtSetInformationProcess() or SetProcessDEPPolicy())<\/p>\n<p>Furthermore, it's very likely that, since you have to use an egghunter, your payload size is limited too.&#160; That means we have to solve the issue as efficient as possible (as small as possible).<\/p>\n<p>In the tutorial, I explained how you can add a custom routine to the egghunter (before jumping to the payload), which would dynamically find a pointer to VirtualProtect() and eventually call it to mark the discovered egg as executable.&#160; Although that code is generic and dynamic, it's quite big.&#160; It works, but it's not efficient enough.<\/p>\n<p>So I decided to take a shortcut and modified the egghunter implementation in metasploit, allowing you to mark a found egg as executable, based on the following idea :<\/p>\n<ul>\n<li>Since you already had to use a technique to mark the egghunter itself as executable, that means that you have been able to pick up a pointer to the required windows functions (virtualprotect(), virtualalloc(), strncpy(), memcpy() etc).<\/li>\n<li>Since you already have a pointer, we can simply re-use it and call it again to mark the egg as executable.<\/li>\n<\/ul>\n<p>The only thing you will need to do, in order to make this idea work, is to put the pointer to either virtualprotect(), or to one of the copy\/move functions into a register prior to getting the egghunter to run.<\/p>\n<p>As soon as the hunter has discovered the egg, it will take that pointer (by default from ESI), set up stack parameters, call the function, and execute the payload.<\/p>\n<p>Since the original egghunter code was null byte free, I decided to make the added code null byte free as well, which means it's slightly bigger.&#160; But with a total of 20 extra bytes for the entire routine, it won't hurt that much\u2026<\/p>\n<h3>Metasploit usage<\/h3>\n<p>First of all, update your metasploit repository and verify that you are running revision 12637 or above.<\/p>\n<p>This his how it works :<\/p>\n<h4>General<\/h4>\n<p>Creating an egg hunter in metasploit requires you to do the following things<\/p>\n<ul>\n<li>use the Egghunter mixin in your module<\/li>\n<li>create a hash array with the egg options (the options you want to pass on to the egghunter creation routine in Metasploit)<\/li>\n<li>call the egghunter creation routine<\/li>\n<li>place the hunter and egg in your payload<\/li>\n<\/ul>\n<p>Including the mixin is as easy as including this statement at the top of your code :<\/p>\n<pre style=\"border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #252525; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px\">include Msf::Exploit::Remote::Egghunter<\/pre>\n<p>\n  <br \/>Next, set the options : <\/p>\n<p><\/p>\n<pre style=\"border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #252525; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px\">badchars=&quot;&quot;\neggoptions =\n{\n   :checksum =&gt; false,\n   :eggtag =&gt; &quot;W00T&quot;\n}<\/pre>\n<p>The additional options that will allow you to manipulate the way the DEP bypass technique works are :<\/p>\n<h5><span style=\"text-decoration: underline\">Mandatory<\/span><\/h5>\n<p><strong>:depmethod =&gt; &quot;<em>function<\/em>&quot;<\/strong><\/p>\n<p>where &quot;<em>function<\/em>&quot; can be one of the following :<\/p>\n<ul>\n<li>&quot;virtualprotect&quot;<\/li>\n<li>&quot;copy&quot;<\/li>\n<li>&quot;copy_size&quot;<\/li>\n<\/ul>\n<p>&quot;<strong>Virtualprotect<\/strong>&quot; will (obviously) call virtualprotect on the found egg, marking it as executable.&#160; By default, it will take twice the size of the payload as size parameter (so self-modifying\/decoding\/growing shellcode will still run fine). You can overrule this by using the depsize parameter (see below).<\/p>\n<p>&quot;<strong>copy<\/strong>&quot; will set up the arguments for a function that will copy data from an address, to another address, until a null byte is found.&#160; It doesn't really matter which function you use, as long as it takes 2 arguments : destination and source, and stops when a null byte is found.<\/p>\n<p>&quot;<strong>copy_size<\/strong>&quot;will set up the arguments for a function that will copy a given amount of bytes from an address, to another address.&#160; Again, it does not matter which function you tell it to use, as long as it takes 3 arguments : destination, source and size (nr of bytes to copy).&#160; By default, it will use the payload length as size parameter.<\/p>\n<p>In all cases, the routine will assume the function pointer is in ESI at the time the egg hunter starts to run (unless you've overruled this by using the depreg option (see below)). EDI will point at the begin of the shellcode after it has been prepared for execution (which means that you can use EDI, just like before, as bufferregister for your payload)<\/p>\n<h5><span style=\"text-decoration: underline\">Optional<\/span><\/h5>\n<p><strong>:depreg =&gt; reg<\/strong><\/p>\n<p>where reg is a valid register. When not specified, the code will assume the API pointer is in ESI. If you specify a register, the egghunter will start by moving the dword in that register into ESI.<\/p>\n<p><strong>:depsize =&gt; value<\/strong><\/p>\n<p>where value is the size (numeric value) to be used as size parameter for the function you want it to call. If you are using the &quot;<strong>copy<\/strong>&quot; depmethod, this option will be ignored. As explained earlier, if you omit this parameter it will use (payload.length * 2) when using the &quot;virtualprotect&quot; method, and payload.length when using the &quot;copy_size&quot; method.<\/p>\n<p><strong>:depdest =&gt; reg<\/strong><\/p>\n<p>where reg is a valid register.&#160; This register indicates the location of the egghunter (so it can be used as the destination for a copy or move operation executed after the hunter has found the egg). This option only works with the &quot;copy&quot; or &quot;copy_size&quot; method and will prevent the egghunter from using a GetPC routine to find itself (= slightly shorter code)<\/p>\n<p>&#160;<\/p>\n<h4>VirtualProtect()<\/h4>\n<p>VirtualProtect() needs a pointer to virtualprotect in one of the registers (ESI by default).&#160; The other parameters will be created at runtime.<\/p>\n<pre style=\"border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #252525; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px\">badchars=&quot;&quot;\neggoptions =\n{\n   :checksum =&gt; false,\n   :eggtag =&gt; &quot;W00T&quot;\n   :depmethod =&gt; &quot;virtualprotect&quot;\n   :depreg =&gt; &quot;esi&quot;\n}<\/pre>\n<p>When using the virtualprotect() function, this is what the produced egghunter will look like :<\/p>\n<p><a class=\"thickbox\" href=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image_thumb1.png\" width=\"673\" height=\"286\" \/><\/a><\/p>\n<p>So, instead of jumping directly to edi, it will set up the stack arguments for virtualprotect and will call that function.&#160; Since it already has a pointer to the shellcode in EDI, it can use that pointer for the lpAddress and returnTo parameters.<\/p>\n<p>In order to make the code null byte free, I used a series of add instructions (doubling the value of the register every time). This, of course, makes the code somewhat longer. If null bytes are not an issue, you could edit the code and just push the desired value onto the stack.<\/p>\n<p>&#160;<\/p>\n<h4>Alloc + Copy_to_self()<\/h4>\n<p>This technique is based on the following concept :<\/p>\n<p>Using a rop chain, you allocate executable memory and copy the egghunter to that location<\/p>\n<p>the egghunter will locate the egg, copy the egg to self, thus overwriting itself, and the return to self (memory is executable already).<\/p>\n<p>The code supports 2 types of copy\/move operations : one that will copy until it sees a nullbyte, and one that will copy a given amount of bytes.<\/p>\n<h5>&quot;copy&quot;<\/h5>\n<p>If you allocated executable memory in your rop chain, transferred the egghunter to the new location and executed it, then you can re-use that memory. In the &quot;copy&quot; and &quot;copy_size&quot; modes, the discovered shellcode will be copied to the current location (overwriting the hunter itself). After the copy or move, the copy\/move function will return to the copied\/moved shellcode and execute it.<\/p>\n<p>Let's say we have a pointer to strcpy() in edi, and since we just copied the egghunter to our new (executable) memory location, we also have a pointer to that memory location in ebp.&#160; The egghunter options will look like this :<\/p>\n<pre style=\"border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #252525; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px\">badchars=&quot;&quot;\neggoptions =\n{\n   :checksum =&gt; false,\n   :eggtag =&gt; &quot;W00T&quot;\n   :depmethod =&gt; &quot;copy&quot;\n   :depreg =&gt; &quot;edi&quot;,\n   :depdest =&gt; &quot;ebp&quot;\n}<\/pre>\n<p>The generated egghunter for this strcpy() will look like this :<\/p>\n<p><a href=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image5.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image_thumb5.png\" width=\"618\" height=\"204\" \/><\/a><\/p>\n<p>First, the pointer to strcpy() is saved in ESI (so it can be called later on).&#160; Until 100B001E we see the normal egghunter routine which will locate the double tag in memory. Next, the pointer to the egg (EDI) is pushed onto the stack.<\/p>\n<p>We specified a depdest parameter (basically telling the hunter that it can copy the egg to the location referenced by that register. In our case this is EBP. The code pushes it on the stack twice (on time as &quot;returnto&quot; argument, one time as &quot;destination&quot; for the strcpy().&#160; Finally, EBP is put in EDI too (so if your payload needs a bufferregister, you can still use EDI)<\/p>\n<p>The copy\/move will grab the shellcode and copy it, overwriting the hunter code (or any other location you told it to write to), and then jumps (returns) to it.<\/p>\n<p>If you don't specify the depdest option, the generated egghunter will contain a getPC routine in order to dynamically locate it's own address (which will be the destination for the copy\/move operation). The code will be slightly longer (7 bytes) and looks like this :<\/p>\n<p><a href=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image6.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image_thumb6.png\" width=\"622\" height=\"231\" \/><\/a><\/p>\n<p>As explained earlier, the &quot;copy&quot; technique requires you to figure out a way to allocate RWX memory first and to copy the hunter into that region.&#160; Make sure to allocate enough space so it would hold the egg as well.<\/p>\n<p>&#160;<\/p>\n<h5>&quot;copy_size&quot;<\/h5>\n<p>Very similar to the &quot;copy&quot; routine, this technique will prepare the arguments for a copy\/move function which takes a source, a destination and the number of bytes to copy.<\/p>\n<pre style=\"border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #252525; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px\">badchars=&quot;&quot;\neggoptions =\n{\n   :checksum =&gt; false,\n   :eggtag =&gt; &quot;W00T&quot;\n   :depmethod =&gt; &quot;copy_size&quot;\n   :depreg =&gt; &quot;edi&quot;\n}<\/pre>\n<p>If no size is specified using the depsize option, the payload length is used. A null byte free routine is used to put the size in a register. If no depdest option is specified, the routine will obviously contain a getpc stub.<\/p>\n<p><a href=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image7.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image_thumb7.png\" width=\"647\" height=\"288\" \/><\/a><\/p>\n<p>This routine will end up calling strncpy() with the following arguments :<\/p>\n<p><a href=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image8.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 7px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/image_thumb8.png\" width=\"627\" height=\"66\" \/><\/a><\/p>\n<p>The copy\/move function will copy the egg on top of the hunter and finally execute it.<\/p>\n<p>Note : make sure to allocate sufficient space to host the egg as well<\/p>\n<p>That's it !<\/p>\n<p>&#160;<\/p>\n<h3>Example<\/h3>\n<p>You can find an example on how to use the hunter here<\/p>\n<h3>Credits<\/h3>\n<p>Of course, Corelan Team, for giving me the inspiration and motiviation to go on, Lincoln for starting to write the msf module (see 'Example'), and _sinn3r, for testing the modified hunter.<\/p>\n<p>&quot;Egg&quot; image : digitalart \/ FreeDigitalPhotos.net<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>Introduction I think we all agree that bypassing DEP (and ASLR) is no longer a luxury today. As operating systems (such as Windows 7) continue to gain popularity, exploit developers are forced to deal with increasingly more memory protection mechanisms, including DEP and ASLR. From a defense perspective, this is a good thing. But we &hellip; <a href=\"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> \"Hack Notes : Ropping eggs for breakfast\"<\/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":[244,245],"tags":[3732,2786,2339,1875,1834,1824],"class_list":["post-7035","post","type-post","status-publish","format-standard","hentry","category-exploit-writing-tutorials","category-exploits","tag-heap-exploitation","tag-egghunter","tag-rop","tag-payload","tag-shellcode","tag-metasploit"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hack Notes : Ropping eggs for breakfast - 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\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hack Notes : Ropping eggs for breakfast - Corelan | Exploit Development &amp; Vulnerability Research\" \/>\n<meta property=\"og:description\" content=\"Introduction I think we all agree that bypassing DEP (and ASLR) is no longer a luxury today. As operating systems (such as Windows 7) continue to gain popularity, exploit developers are forced to deal with increasingly more memory protection mechanisms, including DEP and ASLR. From a defense perspective, this is a good thing. But we &hellip; Continue reading &quot;Hack Notes : Ropping eggs for breakfast&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/\" \/>\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=\"2011-05-12T10:58:09+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/breakfast1_thumb.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\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/\"},\"author\":{\"name\":\"corelanc0d3r\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#\\\/schema\\\/person\\\/3be5542b9b0a0787893db83a5ad68e8f\"},\"headline\":\"Hack Notes : Ropping eggs for breakfast\",\"datePublished\":\"2011-05-12T10:58:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/\"},\"wordCount\":1998,\"publisher\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2011\\\/05\\\/breakfast1_thumb.png\",\"keywords\":[\"heap exploitation\",\"egghunter\",\"rop\",\"payload\",\"shellcode\",\"metasploit\"],\"articleSection\":[\"Exploit Writing Tutorials\",\"Exploits\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/\",\"url\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/\",\"name\":\"Hack Notes : Ropping eggs for breakfast - Corelan | Exploit Development &amp; Vulnerability Research\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2011\\\/05\\\/breakfast1_thumb.png\",\"datePublished\":\"2011-05-12T10:58:09+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/#primaryimage\",\"url\":\"http:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2011\\\/05\\\/breakfast1_thumb.png\",\"contentUrl\":\"http:\\\/\\\/www.corelan.be\\\/wp-content\\\/uploads\\\/2011\\\/05\\\/breakfast1_thumb.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.corelan.be\\\/index.php\\\/2011\\\/05\\\/12\\\/hack-notes-ropping-eggs-for-breakfast\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.corelan.be\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hack Notes : Ropping eggs for breakfast\"}]},{\"@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":"Hack Notes : Ropping eggs for breakfast - 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\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/","og_locale":"en_US","og_type":"article","og_title":"Hack Notes : Ropping eggs for breakfast - Corelan | Exploit Development &amp; Vulnerability Research","og_description":"Introduction I think we all agree that bypassing DEP (and ASLR) is no longer a luxury today. As operating systems (such as Windows 7) continue to gain popularity, exploit developers are forced to deal with increasingly more memory protection mechanisms, including DEP and ASLR. From a defense perspective, this is a good thing. But we &hellip; Continue reading \"Hack Notes : Ropping eggs for breakfast\"","og_url":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/","og_site_name":"Corelan | Exploit Development &amp; Vulnerability Research","article_publisher":"https:\/\/www.facebook.com\/corelanconsulting","article_published_time":"2011-05-12T10:58:09+00:00","og_image":[{"url":"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/breakfast1_thumb.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\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/#article","isPartOf":{"@id":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/"},"author":{"name":"corelanc0d3r","@id":"https:\/\/www.corelan.be\/#\/schema\/person\/3be5542b9b0a0787893db83a5ad68e8f"},"headline":"Hack Notes : Ropping eggs for breakfast","datePublished":"2011-05-12T10:58:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/"},"wordCount":1998,"publisher":{"@id":"https:\/\/www.corelan.be\/#organization"},"image":{"@id":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/#primaryimage"},"thumbnailUrl":"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/breakfast1_thumb.png","keywords":["heap exploitation","egghunter","rop","payload","shellcode","metasploit"],"articleSection":["Exploit Writing Tutorials","Exploits"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/","url":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/","name":"Hack Notes : Ropping eggs for breakfast - Corelan | Exploit Development &amp; Vulnerability Research","isPartOf":{"@id":"https:\/\/www.corelan.be\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/#primaryimage"},"image":{"@id":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/#primaryimage"},"thumbnailUrl":"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/breakfast1_thumb.png","datePublished":"2011-05-12T10:58:09+00:00","breadcrumb":{"@id":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/#primaryimage","url":"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/breakfast1_thumb.png","contentUrl":"http:\/\/www.corelan.be\/wp-content\/uploads\/2011\/05\/breakfast1_thumb.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.corelan.be\/index.php\/2011\/05\/12\/hack-notes-ropping-eggs-for-breakfast\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.corelan.be\/"},{"@type":"ListItem","position":2,"name":"Hack Notes : Ropping eggs for breakfast"}]},{"@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":16820,"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\/7035","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=7035"}],"version-history":[{"count":0,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/posts\/7035\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/media?parent=7035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/categories?post=7035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.corelan.be\/index.php\/wp-json\/wp\/v2\/tags?post=7035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}