{"id":124,"date":"2021-10-07T18:46:52","date_gmt":"2021-10-07T16:46:52","guid":{"rendered":"https:\/\/areyou1or0.it\/?p=124"},"modified":"2021-10-10T21:13:21","modified_gmt":"2021-10-10T19:13:21","slug":"slae64-assignment-3-egghunters","status":"publish","type":"post","link":"https:\/\/areyou1or0.it\/index.php\/2021\/10\/07\/slae64-assignment-3-egghunters\/","title":{"rendered":"SLAE64: Assignment 3 &#8211; Egghunters"},"content":{"rendered":"\n<p>This blog post has been created for completing the requirements of the SecurityTube Linux Assembly Expert (SLAE64) certification:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.pentesteracademy.com\/course?id=7\">https:\/\/www.pentesteracademy.com\/course?id=7<\/a><\/p>\n\n\n\n<p>Student-ID:&nbsp;<strong>PA-15847<\/strong><\/p>\n\n\n\n<p>The Objectives for the Assignment:<\/p>\n\n\n\n<p><code><strong>study about egg hunter shellcode<br>create a working demo of the egghunter<br>should be configurable for different payloads<\/strong><\/code><\/p>\n\n\n\n<p>An Egg Hunter is the first stage of a multistage payload. It consists of a piece of code that scans&nbsp;<strong>memory<\/strong>&nbsp;for a specific pattern and moves execution to that location.<\/p>\n\n\n\n<p>So let&#8217;s explain the assembly code step by step:<\/p>\n\n\n\n<p>In the beginning, we&#8217;ll clear the registers<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"912\" height=\"150\" src=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.18.png\" alt=\"\" class=\"wp-image-130\" srcset=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.18.png 912w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.18-300x49.png 300w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.18-768x126.png 768w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.18-600x99.png 600w\" sizes=\"(max-width: 912px) 100vw, 912px\" \/><\/figure>\n\n\n\n<p>We&#8217;ll set page size alignment in the next function<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"836\" height=\"118\" src=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.40.png\" alt=\"\" class=\"wp-image-132\" srcset=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.40.png 836w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.40-300x42.png 300w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.40-768x108.png 768w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.40-600x85.png 600w\" sizes=\"(max-width: 836px) 100vw, 836px\" \/><\/figure>\n\n\n\n<p>Incremet function is simply serving the purpose of incrementing rdx register<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"778\" height=\"110\" src=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.44.png\" alt=\"\" class=\"wp-image-133\" srcset=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.44.png 778w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.44-300x42.png 300w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.44-768x109.png 768w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.09.44-600x85.png 600w\" sizes=\"(max-width: 778px) 100vw, 778px\" \/><\/figure>\n\n\n\n<p>Now the magic happens in the following function to hunt the egg<\/p>\n\n\n\n<p>I gave the descriptions for the code below<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"485\" src=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.10.19-1024x485.png\" alt=\"\" class=\"wp-image-134\" srcset=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.10.19-1024x485.png 1024w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.10.19-300x142.png 300w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.10.19-768x364.png 768w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.10.19-600x284.png 600w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.10.19.png 1258w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>We&#8217;ll use the following C code to execute the egghunter and shellcode:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"324\" src=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.10-1024x324.png\" alt=\"\" class=\"wp-image-135\" srcset=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.10-1024x324.png 1024w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.10-300x95.png 300w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.10-768x243.png 768w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.10-1536x487.png 1536w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.10-2048x649.png 2048w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.10-1568x497.png 1568w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.10-600x190.png 600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Compile the C code and run to get the reverse shell<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"226\" src=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.58-1024x226.png\" alt=\"\" class=\"wp-image-136\" srcset=\"https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.58-1024x226.png 1024w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.58-300x66.png 300w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.58-768x169.png 768w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.58-1536x339.png 1536w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.58-1568x346.png 1568w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.58-600x132.png 600w, https:\/\/areyou1or0.it\/wp-content\/uploads\/2021\/10\/Screenshot-2021-10-07-at-20.11.58.png 1688w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>For the full code, you can refer to my Github repository<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/areyou1or0\/SLAE64\/tree\/main\">https:\/\/github.com\/areyou1or0\/SLAE64\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post has been created for completing the requirements of the SecurityTube Linux Assembly Expert (SLAE64) certification: https:\/\/www.pentesteracademy.com\/course?id=7 Student-ID:&nbsp;PA-15847 The Objectives for the Assignment: study about egg hunter shellcodecreate a working demo of the egghuntershould be configurable for different payloads An Egg Hunter is the first stage of a multistage payload. It consists of&hellip; <a class=\"more-link\" href=\"https:\/\/areyou1or0.it\/index.php\/2021\/10\/07\/slae64-assignment-3-egghunters\/\">Continue reading <span class=\"screen-reader-text\">SLAE64: Assignment 3 &#8211; Egghunters<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts\/124"}],"collection":[{"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/comments?post=124"}],"version-history":[{"count":4,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":161,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/posts\/124\/revisions\/161"}],"wp:attachment":[{"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/areyou1or0.it\/index.php\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}