{"id":956,"date":"2020-11-10T10:20:31","date_gmt":"2020-11-10T07:20:31","guid":{"rendered":"https:\/\/macrosec.tech\/?p=956"},"modified":"2021-05-03T15:45:09","modified_gmt":"2021-05-03T12:45:09","slug":"dep-bypass-using-rop-chains","status":"publish","type":"post","link":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/","title":{"rendered":"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-parallax-none nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-background-color:#686868;--awb-background-image:url(&quot;https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/01\/85204.jpg&quot;);--awb-background-size:cover;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-padding-top:0%;--awb-padding-right:0%;--awb-padding-bottom:0%;--awb-padding-left:0%;--awb-bg-size:cover;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-column-content-centered\"><div class=\"fusion-column-content\"><div class=\"fusion-text fusion-text-1\"><h2 style=\"text-align: center;font-size: 40px\"><strong><span style=\"text-decoration: underline\">DATA EXECUTION POLICY BYPASS USING RETURN ORIENTED PROGRAMMING CHAINS<\/span><\/strong><\/h2>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-1 hover-type-none\"><img decoding=\"async\" width=\"400\" height=\"400\" alt=\"Haystack - Hack The Box Machine\" title=\"DEP-bypass-ROP\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/DEP-bypass-ROP.png\" class=\"img-responsive wp-image-963\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/DEP-bypass-ROP-200x200.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/DEP-bypass-ROP.png 400w\" sizes=\"(max-width: 800px) 100vw, 400px\" \/><\/span><\/div><\/div><\/div><\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-top:30px;--awb-padding-right:50px;--awb-padding-left:50px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;--awb-margin-top:10px;--awb-margin-bottom:10px;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-2\"><p style=\"font-size: 18px;\">This blog post was written by <a href=\"https:\/\/www.linkedin.com\/in\/dharmik-karania-160239b5\/\">Dharmik Karania<\/a>.<\/p>\n<\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-clearfix\" style=\"float:left;margin-top:15px;margin-bottom:15px;width:100%;max-width:35%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;--awb-sep-color:#b51616;border-color:#b51616;border-top-width:1px;\"><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-3\"><p style=\"font-size: 20px\">Data Execution Prevention (DEP) was introduced as a security mechanism in Windows Machines to make parts of memory non-executable, due to which attacks that attempt to execute instructions on the stack will lead to exceptions. But ambitious cybersecurity investigators have found ways to bypass it. In order to understand this, we will first start by understanding buffer overflow exploit development.<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Anatomy of the memory<\/strong><\/h2>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-2 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"1837\" height=\"665\" title=\"1\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/1.png\" alt class=\"img-responsive wp-image-971\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/1-200x72.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/1-400x145.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/1-600x217.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/1-800x290.png 800w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/1-1200x434.png 1200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/1.png 1837w\" sizes=\"(max-width: 800px) 100vw, 1200px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-4\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">We have kernel at the top and text at the bottom. When we think of the kernel, we can think of it as the command line. The stack is used by the processes for the storage of automatic identifiers, register variables and information about function calls. The text segment is a section of a program in the memory and it holds executable instructions. The heap is a segment of memory where dynamic memory allocation takes place.<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Structure of the stack<\/strong><\/h2>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-3 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"212\" title=\"2\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/2.png\" alt class=\"img-responsive wp-image-972\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/2-200x68.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/2-400x136.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/2-600x204.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/2.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-5\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">What usually happens is that the buffer space fills us with characters, so the buffer space will go downwards. With proper sanitation, the characters in the buffer space should not flow beyond the buffer space to the EBP. When a buffer overflow attack occurs, the characters are written beyond the buffer space to the EBP and EIP. This is dangerous because if the attacker gains control over the EIP, the attacker can use the pointer to point to malicious code and gain a reverse shell. However, windows have a protection mechanism called Data Execution Prevention (DEP) and this mechanism makes parts of memory non-executable and thus it prevents buffer overflows from occurring. However, in this blog, I use a method of Return Oriented Programming (ROP) chains to bypass this protection mechanism.<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Tools I used to bypass DEP using ROP chains:<\/strong><\/h2>\n<ol>\n<li style=\"font-size: 20px\">Windows 7 virtual machine<\/li>\n<li style=\"font-size: 20px\">Kali Linux virtual machine<\/li>\n<li style=\"font-size: 20px\">Vulnserver- which is installed in my Windows Machine<\/li>\n<li style=\"font-size: 20px\">Immunity Debugger- which is installed on my Windows Machine<\/li>\n<li style=\"font-size: 20px\">Mona modules- which should be installed in the Immunity debugger folder.<\/li>\n<\/ol>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Steps to conduct a buffer overflow attack<\/strong><\/h2>\n<p style=\"font-size: 20px\"><strong>Spiking<\/strong><br \/>\nThe first step is to disable your Windows defender real-time protection as shown below. This is because vulnserver will be blocked by Windows defender when we run anything malicious against it.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-4 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"626\" height=\"470\" title=\"3\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/3.png\" alt class=\"img-responsive wp-image-974\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/3-200x150.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/3-400x300.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/3-600x450.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/3.png 626w\" sizes=\"(max-width: 800px) 100vw, 626px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-6\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">What spiking does Is that we take each of the commands one at a time and try to overflow the buffer. If it crashes then we can know that that command is vulnerable. To do this, we first run vulnserver as an administrator, and then we run immunity debug also as administrator and we attach the vulnserver to it. We then run the following command on our Kali Linux machine:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-5 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"323\" height=\"228\" title=\"4\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/4.png\" alt class=\"img-responsive wp-image-975\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/4-200x141.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/4.png 323w\" sizes=\"(max-width: 800px) 100vw, 323px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-7\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">We test each of these commands for if they are vulnerable. This process is called spiking. We write a python script as shown.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-6 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"227\" height=\"93\" title=\"5\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/5.png\" alt class=\"img-responsive wp-image-976\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/5-200x82.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/5.png 227w\" sizes=\"(max-width: 800px) 100vw, 227px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-8\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">We send the variable in all different forms and iterations and try to break the program. We run this script as follows:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-7 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"471\" height=\"31\" title=\"6\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/6.png\" alt class=\"img-responsive wp-image-977\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/6-200x13.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/6-400x26.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/6.png 471w\" sizes=\"(max-width: 800px) 100vw, 471px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-9\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">We should perform the above for all the commands. When we run the TRUN command, I notice that there is Access Violation and immunity stops running and the vulnserver has crashed and so we know that TRUN is vulnerable.<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>How to FUZZ the TRUN command with a Python Script<\/strong><\/h2>\n<p style=\"font-size: 20px\">Fuzzing is similar to spiking as I will be trying to send a bunch of characters and I will try to break it. I first attach vulnserver with immunity Debugger and I then run the following script to fuzz. Fuzzing allows us to identify if a command is vulnerable and how many bytes it takes approximately for an overflow.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-8 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"581\" height=\"362\" title=\"7\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/7.png\" alt class=\"img-responsive wp-image-978\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/7-200x125.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/7-400x249.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/7.png 581w\" sizes=\"(max-width: 800px) 100vw, 581px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-10\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">When this command is run, the server crashes and when I kill the command running on my Kali Linux machine, it shows me the exact byte where the program crashed as shown below:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-9 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"467\" title=\"8\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/8.png\" alt class=\"img-responsive wp-image-979\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/8-200x150.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/8-400x299.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/8-600x449.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/8.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-10 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"272\" height=\"66\" title=\"9\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/9.png\" alt class=\"img-responsive wp-image-980\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/9-200x49.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/9.png 272w\" sizes=\"(max-width: 800px) 100vw, 272px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-11\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">We crashed at around 3000 bytes as we take a round figure. The next step is to find the offset.<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Finding the offset<\/strong><\/h2>\n<p style=\"font-size: 20px\">Finding the Extended Instruction Pointer (EIP) in buffer overflows. This allows us to point to a malicious shellcode later on. I then look for where we overwrite the EIP and to do this, I use an inbuilt tool in Kali Linux called Pattern create as shown below:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-11 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"678\" height=\"162\" title=\"10\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/10.png\" alt class=\"img-responsive wp-image-981\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/10-200x48.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/10-400x96.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/10-600x143.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/10.png 678w\" sizes=\"(max-width: 800px) 100vw, 678px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-12\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">I then copy the pattern to a python script under offset as shown:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-12 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"695\" height=\"179\" title=\"11\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/11.png\" alt class=\"img-responsive wp-image-982\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/11-200x52.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/11-400x103.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/11-600x155.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/11.png 695w\" sizes=\"(max-width: 800px) 100vw, 695px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-13\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">I then attach vulnserver to immunity debugger again and run the script and get the following result:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-13 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"447\" title=\"12\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/12.png\" alt class=\"img-responsive wp-image-983\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/12-200x143.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/12-400x287.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/12-600x430.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/12.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-14\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">Vulnserver crashes and it overwrites everything. I am interested in the value of EIP. I then use the value of EIP to get a pattern offset using the following command:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-14 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"45\" title=\"13\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/13.png\" alt class=\"img-responsive wp-image-984\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/13-200x14.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/13-400x29.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/13-600x43.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/13.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-15\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">The information retrieved is important because it tells us that at 2003 bytes we can control the EIP. The next step is to overwrite the EIP.<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Overwriting the EIP<\/strong><\/h2>\n<p style=\"font-size: 20px\">In this step I use a script to control and overwrite the EIP in buffer overflows and thus allowing me to execute malicious code.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-15 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"370\" height=\"214\" title=\"14\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/14.png\" alt class=\"img-responsive wp-image-985\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/14-200x116.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/14.png 370w\" sizes=\"(max-width: 800px) 100vw, 370px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-16\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">I again attach vulnserver to immunity and then run the code and I get the following result:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-16 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"449\" title=\"15\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/15.png\" alt class=\"img-responsive wp-image-986\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/15-200x144.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/15-400x288.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/15-600x432.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/15.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-17\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">If you notice the EIP is 42424242. I only sent 4 bytes of Bs and they all landed on EIP and thus this means we control the EIP now. The next step is to find bad characters.<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Finding bad characters<\/strong><\/h2>\n<p style=\"font-size: 20px\">A bad character is simply a list of unwanted characters that can break the shellcodes. We thus have to identify these bad characters and omit them otherwise we will not be able to get a shell.<br \/>\nI run the following script again on vulnserver which has been attached to immunity.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-17 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"570\" height=\"666\" title=\"16\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/16.png\" alt class=\"img-responsive wp-image-987\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/16-200x234.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/16-400x467.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/16.png 570w\" sizes=\"(max-width: 800px) 100vw, 570px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-18 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"467\" title=\"17\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/17.png\" alt class=\"img-responsive wp-image-988\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/17-200x150.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/17-400x299.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/17-600x449.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/17.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-18\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">Vulnserver crashes and to run the eye test on the bad characters, I right-click on ESP and click on follow in the dump. This takes me to the left screen where I can see all the bad characters. I run an eye test to check whether any of the bad characters have been overwritten. \u201c\\x00\u201d is always a bad character and thus I have omitted it from the script from the beginning.<br \/>\nThe next step is to find the right module.<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Finding the right module<\/strong><\/h2>\n<p style=\"font-size: 20px\">To find the right module, I have installed mona.py (<a href=\"https:\/\/github.com\/corelan\/mona\">https:\/\/github.com\/corelan\/mona<\/a>) from this link and I have placed it in the immunity debugger folder under the Pycommands folder. In my immunity debugger, I run the following command highlighted in the diagram.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-19 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"447\" title=\"18\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/18.png\" alt class=\"img-responsive wp-image-989\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/18-200x143.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/18-400x287.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/18-600x430.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/18.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-19\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">I notice the first one is the best candidate because there are no protection mechanisms in place as all measures are false and thus, I can easily obtain a reverse shell. Since I know that I will be attacking essfunc.dll, I need to know the opcode equivalent of a jump so I am basically trying to convert assembly language into hex code. so I do that in Kali Linux.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-20 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"606\" height=\"90\" title=\"19\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/19.png\" alt class=\"img-responsive wp-image-990\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/19-200x30.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/19-400x59.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/19-600x89.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/19.png 606w\" sizes=\"(max-width: 800px) 100vw, 606px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-20\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">I then use the hex code to find the correct module.<br \/>\nOur JMP ESP opcode equivalent is \u201cFFE4\u201d. Now, I can use Mona again to combine this new information with our previously discovered module to find our pointer address. The pointer address is what we will place into the EIP to point to our malicious shellcode. In our Immunity search bar, I type in: !mona find -s \u201c\\\\xff\\\\xe4\u201d -m essfunc.dll and view the results:<br \/>\nThe syntax means that we find the essfunc.dll module which has an opcode equivalent of FFE4.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-21 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"449\" title=\"20\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/20.png\" alt class=\"img-responsive wp-image-991\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/20-200x144.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/20-400x288.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/20-600x432.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/20.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-21\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">I find 9 pointers. What we have just generated is a list of addresses that we can potentially use as our pointer. The addresses are located on the left side, in white. I am going to select the first address, 625011AF, and add it to my Python code as shown:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-22 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"508\" height=\"321\" title=\"21\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/21.png\" alt class=\"img-responsive wp-image-992\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/21-200x126.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/21-400x253.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/21.png 508w\" sizes=\"(max-width: 800px) 100vw, 508px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-22\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">So, now I replaced our four B\u2019s with our return address. The return address is entered in a Little Endian Format and thus it is written in reverse. We have to use the Little Endian format in x86 architecture because the low-order byte is stored in the memory at the lowest address and the high-order byte is stored at the highest address. Thus, we enter our return address backward.<br \/>\nNow, I need to test out our return address. Again, with a freshly attached Vulnserver, we need to find our return address in Immunity Debugger. To do this, I click on the far-right arrow on the top panel of Immunity as shown:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-23 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"179\" height=\"21\" title=\"22\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/22.png\" alt class=\"img-responsive wp-image-993\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/22-177x21.png 177w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/22.png 179w\" sizes=\"(max-width: 179px) 100vw, 179px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-23\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">Then search for \u201c625011AF\u201d (or the return address you found), without the quotes, in the \u201cEnter expression to follow\u201d prompt. That should bring up the return address, FFE4, JMP ESP location. I then hit F2 and the address should turn blue which shows that we have set the breakpoint.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-24 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"386\" height=\"99\" title=\"23\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/23.jpg\" alt class=\"img-responsive wp-image-994\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/23-200x51.jpg 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/23.jpg 386w\" sizes=\"(max-width: 800px) 100vw, 386px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-24\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">I then execute my code and see whether it triggers the breakpoint. If it triggers in the immunity debugger, that means I can now develop the exploit.<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Generating Shellcode and gaining access<\/strong><\/h2>\n<p style=\"font-size: 20px\">To generate the shell code I create a payload and put the payload in the python script as follows:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-25 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"364\" title=\"24\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/24.png\" alt class=\"img-responsive wp-image-995\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/24-200x117.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/24-400x233.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/24-600x350.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/24.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-26 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"368\" height=\"486\" title=\"25\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/25.png\" alt class=\"img-responsive wp-image-996\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/25-200x264.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/25.png 368w\" sizes=\"(max-width: 800px) 100vw, 368px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-25\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\"><strong>-p<\/strong> is for payload. We are using non-staged windows reverse shell payload.<br \/>\n<strong>LHOST<\/strong> is the ATTACKER\u2019S IP address.<br \/>\n<strong>LPORT<\/strong> is the ATTACKER\u2019S port of choice. Here I am using 4444.<br \/>\n<strong>EXITFUNC=thread<\/strong> adds stability to our payload.<br \/>\n<strong>-f<\/strong> is for the file type. We are going to generate a C file type here.<br \/>\n<strong>-a<\/strong> is for architecture. The machine we are attacking is x86.<br \/>\n<strong>\u2013platform<\/strong> is for OS type. We are attacking a Windows machine.<br \/>\n<strong>-b<\/strong> is for bad characters. Remember, the only bad character we have is the null byte, x00.<br \/>\nI then set up a Netcat listener to receive the connection.<br \/>\nI then run vulnserver only and execute the following code and I get a shell<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-27 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"384\" height=\"412\" title=\"26\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/26.png\" alt class=\"img-responsive wp-image-997\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/26-200x215.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/26.png 384w\" sizes=\"(max-width: 800px) 100vw, 384px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-26\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">I could get this shell because Data Execution Prevention (DEP) was turned off. However Windows machines have DEP protection mechanism enabled and thus if I run the script when this protection mechanism is turned on, then we cannot get a shell.<br \/>\nHowever, a method has been researched where I can get a shell despite the DEP protection mechanism is turned on. I shall discuss this next. The image below shows DEP protection which is turned ON by default on Windows Machines.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-28 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"292\" height=\"415\" title=\"27\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/27.png\" alt class=\"img-responsive wp-image-998\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/27-200x284.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/27.png 292w\" sizes=\"(max-width: 800px) 100vw, 292px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-29 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"446\" title=\"28\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/28.png\" alt class=\"img-responsive wp-image-999\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/28-200x143.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/28-400x286.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/28-600x429.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/28.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-27\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">!mone rop -m *.dll -n -cpb \u201c\\x00\u201d<\/p>\n<p style=\"font-size: 20px\">This command creates a Return Oriented Programming chain.<br \/>\n<strong>-m<\/strong> specifies the module which mona will search through<br \/>\n<strong>-n<\/strong> means that we want the chain to be saved to a file.<br \/>\n<strong>-cpb<\/strong> means that we need to specify the criteria with bad characters by pointing to it.<\/p>\n<p style=\"font-size: 20px\">In order to get a shell despite the DEP protection mechanism being on, I run the above command in the search bar of immunity debugger. This generates a Return Oriented Programming Chain (ROP) and saves it in a file. The file is saved in the Program Files of Immunity debugger. It is called rop_chain.txt. I then transfer the file to the Kali Linux machine.<br \/>\nI open the file in my Kali Linux machine and copy the python code from the Register setup for VirtualProtect() into another python file. I also create another payload as shown above, and the complete code looks as follows:<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-30 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"539\" height=\"572\" title=\"29\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/29.png\" alt class=\"img-responsive wp-image-1000\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/29-200x212.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/29-400x424.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/29.png 539w\" sizes=\"(max-width: 800px) 100vw, 539px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-31 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"624\" height=\"540\" title=\"30\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/30.png\" alt class=\"img-responsive wp-image-1001\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/30-200x173.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/30-400x346.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/30-600x519.png 600w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/30.png 624w\" sizes=\"(max-width: 800px) 100vw, 624px\" \/><\/span><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-no-large-visibility fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:15px;margin-bottom:15px;width:100%;\"><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-32 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"523\" height=\"238\" title=\"31\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/31.png\" alt class=\"img-responsive wp-image-1002\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/31-200x91.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/31-400x182.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/31.png 523w\" sizes=\"(max-width: 800px) 100vw, 523px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-28\"><p>&nbsp;<\/p>\n<p style=\"font-size: 20px\">I set up my listener and run vulnserver and run the code and get a shell.<\/p>\n<\/div><div class=\"fusion-image-element fusion-image-align-center in-legacy-container\" style=\"text-align:center;--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><div class=\"imageframe-align-center\"><span class=\" fusion-imageframe imageframe-none imageframe-33 hover-type-none\" style=\"border:5px solid #e2e0e0;\"><img decoding=\"async\" width=\"493\" height=\"521\" title=\"32\" src=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/32.png\" alt class=\"img-responsive wp-image-1003\" srcset=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/32-200x211.png 200w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/32-400x423.png 400w, https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/32.png 493w\" sizes=\"(max-width: 800px) 100vw, 493px\" \/><\/span><\/div><\/div><div class=\"fusion-text fusion-text-29\"><p>&nbsp;<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Prevention Mechanisms<\/strong><\/h2>\n<p style=\"font-size: 20px\">Enhanced Mitigation Experience Toolkit- By Microsoft. It provides a unified interface to enable and fine-tune Windows security features. It can be used as an extra layer of defense against malware attacks, after the firewall and before antivirus software<br \/>\nRandomizing the location of the code of third-party applications using various narrow-scope code transformations.<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>Detection Mechanism<\/strong><\/h2>\n<p style=\"font-size: 20px\">ROPscan has been implemented as a detection mechanism for ROP chains. ROPscan can detect ROP payloads in the raw network data that are transmitted through the TCP stream.<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"font-size: 24px;color: #b51616;text-align: left\"><strong>References<\/strong><\/h2>\n<p style=\"font-size: 20px\"><a href=\"https:\/\/medium.com\/cybersecurityservices\/dep-bypass-using-rop-chains-garima-chopra-e8b3361e50ce\">https:\/\/medium.com\/cybersecurityservices\/dep-bypass-using-rop-chains-garima-chopra-e8b3361e50ce<\/a><br \/>\n<a href=\"https:\/\/medium.com\/4ndr3w\/linux-x86-bypass-dep-nx-and-aslr-with-return-oriented-programming-ef4768363c9a\">https:\/\/medium.com\/4ndr3w\/linux-x86-bypass-dep-nx-and-aslr-with-return-oriented-programming-ef4768363c9a<\/a><br \/>\n<a href=\"https:\/\/tcm-sec.com\/buffer-overflows-made-easy\/\">https:\/\/tcm-sec.com\/buffer-overflows-made-easy\/<\/a><\/p>\n<\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-clearfix\" style=\"float:left;margin-top:15px;margin-bottom:15px;width:100%;max-width:30%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;--awb-sep-color:#b51616;border-color:#b51616;border-top-width:1px;\"><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-30\"><h2 style=\"font-size: 16px; color: #b51616; text-align: left;\"><strong>Disclaimer<\/strong><\/h2>\n<p style=\"font-size: 10px;\">The MacroSec blogs are solely for informational and educational purposes. Any actions and or activities related to the material contained within this website are solely your responsibility. The misuse of the information on this website can result in criminal charges brought against the persons in question. The authors and MacroSec will not be held responsible in the event any criminal charges be brought against any individuals misusing the information in this website to break the law.<\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":963,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[10,8,13],"tags":[],"class_list":["post-956","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-offensive-security","category-pentesting","category-red-teaming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains &#8212; MacroSEC<\/title>\n<meta name=\"description\" content=\"Bypassing data execution policy using return oriented programming chains to get a reverse shell\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains &#8212; MacroSEC\" \/>\n<meta property=\"og:description\" content=\"Bypassing data execution policy using return oriented programming chains to get a reverse shell\" \/>\n<meta property=\"og:url\" content=\"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/\" \/>\n<meta property=\"og:site_name\" content=\"MacroSEC\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-10T07:20:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-03T12:45:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/DEP-bypass-ROP.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Dharmik Karania\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dharmik Karania\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"56 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/\"},\"author\":{\"name\":\"Dharmik Karania\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#\\\/schema\\\/person\\\/5d4c800b7e603d391fc1db5b09133e25\"},\"headline\":\"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains\",\"datePublished\":\"2020-11-10T07:20:31+00:00\",\"dateModified\":\"2021-05-03T12:45:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/\"},\"wordCount\":11178,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/DEP-bypass-ROP.png\",\"articleSection\":[\"Offensive Security\",\"Penetration Testing\",\"Red Teaming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/\",\"name\":\"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains &#8212; MacroSEC\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/DEP-bypass-ROP.png\",\"datePublished\":\"2020-11-10T07:20:31+00:00\",\"dateModified\":\"2021-05-03T12:45:09+00:00\",\"description\":\"Bypassing data execution policy using return oriented programming chains to get a reverse shell\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/#primaryimage\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/DEP-bypass-ROP.png\",\"contentUrl\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/DEP-bypass-ROP.png\",\"width\":400,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/index.php\\\/2020\\\/11\\\/10\\\/dep-bypass-using-rop-chains\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/macrosec.tech\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#website\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/\",\"name\":\"MacroSEC\",\"description\":\"Your Cybersecurity Partner - Kenya\",\"publisher\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/macrosec.tech\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#organization\",\"name\":\"MacroSec Ltd\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/MobileIcon_Retine.png\",\"contentUrl\":\"https:\\\/\\\/macrosec.tech\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/MobileIcon_Retine.png\",\"width\":400,\"height\":107,\"caption\":\"MacroSec Ltd\"},\"image\":{\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/macrosec.tech\\\/#\\\/schema\\\/person\\\/5d4c800b7e603d391fc1db5b09133e25\",\"name\":\"Dharmik Karania\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ad5f76a88ad63937e5cbdf80605c372cf663716add095d320f7a27bf084809e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ad5f76a88ad63937e5cbdf80605c372cf663716add095d320f7a27bf084809e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2ad5f76a88ad63937e5cbdf80605c372cf663716add095d320f7a27bf084809e?s=96&d=mm&r=g\",\"caption\":\"Dharmik Karania\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains &#8212; MacroSEC","description":"Bypassing data execution policy using return oriented programming chains to get a reverse shell","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:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/","og_locale":"en_US","og_type":"article","og_title":"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains &#8212; MacroSEC","og_description":"Bypassing data execution policy using return oriented programming chains to get a reverse shell","og_url":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/","og_site_name":"MacroSEC","article_published_time":"2020-11-10T07:20:31+00:00","article_modified_time":"2021-05-03T12:45:09+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/DEP-bypass-ROP.png","type":"image\/png"}],"author":"Dharmik Karania","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Dharmik Karania","Est. reading time":"56 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/#article","isPartOf":{"@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/"},"author":{"name":"Dharmik Karania","@id":"https:\/\/macrosec.tech\/#\/schema\/person\/5d4c800b7e603d391fc1db5b09133e25"},"headline":"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains","datePublished":"2020-11-10T07:20:31+00:00","dateModified":"2021-05-03T12:45:09+00:00","mainEntityOfPage":{"@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/"},"wordCount":11178,"commentCount":0,"publisher":{"@id":"https:\/\/macrosec.tech\/#organization"},"image":{"@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/#primaryimage"},"thumbnailUrl":"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/DEP-bypass-ROP.png","articleSection":["Offensive Security","Penetration Testing","Red Teaming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/","url":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/","name":"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains &#8212; MacroSEC","isPartOf":{"@id":"https:\/\/macrosec.tech\/#website"},"primaryImageOfPage":{"@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/#primaryimage"},"image":{"@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/#primaryimage"},"thumbnailUrl":"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/DEP-bypass-ROP.png","datePublished":"2020-11-10T07:20:31+00:00","dateModified":"2021-05-03T12:45:09+00:00","description":"Bypassing data execution policy using return oriented programming chains to get a reverse shell","breadcrumb":{"@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/#primaryimage","url":"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/DEP-bypass-ROP.png","contentUrl":"https:\/\/macrosec.tech\/wp-content\/uploads\/2020\/11\/DEP-bypass-ROP.png","width":400,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/macrosec.tech\/index.php\/2020\/11\/10\/dep-bypass-using-rop-chains\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/macrosec.tech\/"},{"@type":"ListItem","position":2,"name":"Data Execution Policy (DEP) Bypass Using Return Oriented Programming (ROP) Chains"}]},{"@type":"WebSite","@id":"https:\/\/macrosec.tech\/#website","url":"https:\/\/macrosec.tech\/","name":"MacroSEC","description":"Your Cybersecurity Partner - Kenya","publisher":{"@id":"https:\/\/macrosec.tech\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/macrosec.tech\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/macrosec.tech\/#organization","name":"MacroSec Ltd","url":"https:\/\/macrosec.tech\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/macrosec.tech\/#\/schema\/logo\/image\/","url":"https:\/\/macrosec.tech\/wp-content\/uploads\/2018\/04\/MobileIcon_Retine.png","contentUrl":"https:\/\/macrosec.tech\/wp-content\/uploads\/2018\/04\/MobileIcon_Retine.png","width":400,"height":107,"caption":"MacroSec Ltd"},"image":{"@id":"https:\/\/macrosec.tech\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/macrosec.tech\/#\/schema\/person\/5d4c800b7e603d391fc1db5b09133e25","name":"Dharmik Karania","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2ad5f76a88ad63937e5cbdf80605c372cf663716add095d320f7a27bf084809e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2ad5f76a88ad63937e5cbdf80605c372cf663716add095d320f7a27bf084809e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2ad5f76a88ad63937e5cbdf80605c372cf663716add095d320f7a27bf084809e?s=96&d=mm&r=g","caption":"Dharmik Karania"}}]}},"_links":{"self":[{"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":4,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/posts\/956\/revisions"}],"predecessor-version":[{"id":1137,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/posts\/956\/revisions\/1137"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/media\/963"}],"wp:attachment":[{"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/media?parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macrosec.tech\/index.php\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}