<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Capture the Flag on Christoph Kemetmüller</title><link>https://xn--kemetmller-feb.com/tags/capture-the-flag/</link><description>Recent content in Capture the Flag on Christoph Kemetmüller</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Christoph Kemetmüller</copyright><lastBuildDate>Wed, 27 May 2026 13:38:30 +0200</lastBuildDate><atom:link href="https://xn--kemetmller-feb.com/tags/capture-the-flag/index.xml" rel="self" type="application/rss+xml"/><item><title>SANS Holiday Hack Challenge 2017 Solution</title><link>https://xn--kemetmller-feb.com/blog/sans-holiday-hack-challenge-2017-solution/</link><pubDate>Mon, 01 Jan 2018 01:23:27 +0000</pubDate><guid>https://xn--kemetmller-feb.com/blog/sans-holiday-hack-challenge-2017-solution/</guid><description>&lt;p&gt;Letters to Santa app contains a reference to a development system in a HTML comment section.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c"&gt;&amp;lt;!-- Development version --&amp;gt;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;http://dev.northpolechristmastown.com&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;display: none;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Access Development Version&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&#10;&#10;&lt;p&gt;The development interface is based on Apache struts.&#10;The utilized version is vulnerable to CVE 2017-9805.&#10;A respective script can be found on &lt;a href="https://github.com/chrisjd20/cve-2017-9805.py/blob/master/cve-2017-9805.py" target="_blank" rel="noreferrer"&gt;github&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Vulnhub - Breach 3 boot2root CTF walkthrough</title><link>https://xn--kemetmller-feb.com/blog/vulnhub-breach-3-boot2root-ctf-walkthrough/</link><pubDate>Sun, 30 Apr 2017 20:21:59 +0000</pubDate><guid>https://xn--kemetmller-feb.com/blog/vulnhub-breach-3-boot2root-ctf-walkthrough/</guid><description>&lt;p&gt;The third boot2root system in the Breach series is an intermediate challenge.&#10;This time the VM will automatically acquire an IP address via DHCP.&lt;/p&gt;&#10;&#10;&#10;&lt;p&gt;First, let&amp;rsquo;s identify the target system.&#10;With netdiscover this is quite an easy task.&lt;/p&gt;&#10;&#10;&lt;figure&gt;&#10; &lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt=""&#10; width="790"&#10; height="176"&#10; src="https://xn--kemetmller-feb.com/blog/vulnhub-breach-3-boot2root-ctf-walkthrough/images/discovery-1_1_hu_1fb8b827b2ffab07.png"&#10; srcset="https://xn--kemetmller-feb.com/blog/vulnhub-breach-3-boot2root-ctf-walkthrough/images/discovery-1_1_hu_1fb8b827b2ffab07.png 800w,/blog/vulnhub-breach-3-boot2root-ctf-walkthrough/images/discovery-1_1_hu_e44598805c9bdc41.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://xn--kemetmller-feb.com/blog/vulnhub-breach-3-boot2root-ctf-walkthrough/images/discovery-1_1.png"&#10; /&gt;&#10; &#10; &lt;figcaption&gt;The target is at 10.0.2.9.&lt;/figcaption&gt;&#10; &lt;/figure&gt;&#10;&lt;p&gt;After identifying the target system at 10.0.2.9 a port scan to discover a potential attack vector for the breach.&#10;The SYN scan did not yield any results, all ports seem to be closed.&#10;The UDP scan shows that a service on port 161/udp is listening.&lt;/p&gt;</description></item><item><title>Vulnhub - Breach 2.1 boot2root CTF walkthrough</title><link>https://xn--kemetmller-feb.com/blog/vulnhub-breach-2.1-boot2root-ctf-walkthrough/</link><pubDate>Wed, 08 Mar 2017 22:22:59 +0000</pubDate><guid>https://xn--kemetmller-feb.com/blog/vulnhub-breach-2.1-boot2root-ctf-walkthrough/</guid><description>&lt;p&gt;Breach 2.1 is meant to be beginner to intermediate boot2root/CTF challenge.&#10;The VM is configured with a static IP address (192.168.110.151) so you will need to configure your host-only adaptor to this subnet.&lt;/p&gt;&#10;&#10;&#10;&lt;p&gt;The VM is configured to the IP address 192.168.110.151.&#10;Let&amp;rsquo;s start by scanning the target via nmap.&lt;/p&gt;</description></item><item><title>Vulnhub - Breach 1 boot2root CTF walkthrough</title><link>https://xn--kemetmller-feb.com/blog/vulnhub-breach-1-boot2root-ctf-walkthrough/</link><pubDate>Thu, 02 Mar 2017 10:46:59 +0000</pubDate><guid>https://xn--kemetmller-feb.com/blog/vulnhub-breach-1-boot2root-ctf-walkthrough/</guid><description>&lt;p&gt;Breach 1.0 is meant to be beginner to intermediate boot2root/CTF challenge.&#10;The VM is configured with a static IP address (192.168.110.140) so you will need to configure your host-only adaptor to this subnet.&lt;/p&gt;&#10;&#10;&#10;&lt;p&gt;The VM is configured to the IP address 192.168.110.140.&#10;Let&amp;rsquo;s start by scanning the target via nmap.&lt;/p&gt;</description></item><item><title>The 2015 SANS Holiday Hack Challenge - Solution</title><link>https://xn--kemetmller-feb.com/blog/the-2015-sans-holiday-hack-challenge-solution/</link><pubDate>Tue, 05 Jan 2016 01:23:27 +0000</pubDate><guid>https://xn--kemetmller-feb.com/blog/the-2015-sans-holiday-hack-challenge-solution/</guid><description>&lt;ol&gt;&#10;&lt;li&gt;Which commands are sent across the Gnome’s command-and-control channel?&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;EXEC:iwconfig&lt;/code&gt; in packet 363&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;EXEC:cat /tmp/iwlistscan.txt&lt;/code&gt; in packet 573&lt;/li&gt;&#10;&lt;li&gt;What image appears in the photo the Gnome sent across the channel from the Dosis home?&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;A tidy children&amp;rsquo;s room is depicted in the photo. The photo includes something like legs that are probably attached to the camera. At the bottom is a label with &amp;ldquo;GnomeNet-NorthAmerica&amp;rdquo;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;ol start="3"&gt;&#10;&lt;li&gt;What operating system and CPU type are used in the Gnome? What type of web framework is the Gnome web interface built in?&lt;/li&gt;&#10;&lt;li&gt;OpenWRT (r47650) on ARM&lt;/li&gt;&#10;&lt;li&gt;NodeJS with Mongodb&lt;/li&gt;&#10;&lt;li&gt;What kind of a database engine is used to support the Gnome web interface? What is the plaintext password stored in the Gnome database?&lt;/li&gt;&#10;&lt;li&gt;MongoDB&lt;/li&gt;&#10;&lt;li&gt;The following credentials are stored in the firmware image&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;admin&lt;/code&gt; : &lt;code&gt;SittingOnAShelf&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;user&lt;/code&gt; : &lt;code&gt;user&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;What are the IP addresses of the five SuperGnomes scattered around the world, as verified by Tom Hessman in the Dosis neighborhood?&lt;/li&gt;&#10;&lt;li&gt;SG-01 52.2.229.189 (United States, Ashburn)&lt;/li&gt;&#10;&lt;li&gt;SG-02 52.34.3.80 (United States, Boardman)&lt;/li&gt;&#10;&lt;li&gt;SG-03 52.64.191.71 (Australia, Sydney)&lt;/li&gt;&#10;&lt;li&gt;SG-04 52.192.152.132 (Japan, Tokyo)&lt;/li&gt;&#10;&lt;li&gt;SG-05 54.233.105.81 (Brazil)&lt;/li&gt;&#10;&lt;li&gt;Where is each SuperGnome located geographically?&lt;/li&gt;&#10;&lt;li&gt;Describe the vulnerabilities you discovered in the Gnome firmware.&lt;/li&gt;&#10;&lt;li&gt;Storage of clear text passwords in the MongoDB database.&lt;/li&gt;&#10;&lt;li&gt;Local file inclusion via directory traversal in &lt;code&gt;routes/index.js:195&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The code checks whether the requested file path contains a &amp;ldquo;.png&amp;rdquo;.&lt;/li&gt;&#10;&lt;li&gt;The file upload can be utilized to create a temporary folder with a suitable name.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;ol start="3"&gt;&#10;&lt;li&gt;Possible NoSQL injection for the login post in &lt;code&gt;routes/index.js:109&lt;/code&gt;.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Might not possible as &amp;ldquo;extended = false&amp;rdquo; for the firmware as described in &lt;a href="https://stackoverflow.com/questions/24330014/bodyparser-is-deprecated-express-4#comment-49638474" target="_blank" rel="noreferrer"&gt;bodyParser is deprecated express 4&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;ol start="4"&gt;&#10;&lt;li&gt;Possible server side javascript injection for file upload in &lt;code&gt;routes/index.js:166&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The user provided parameter: &lt;code&gt;posproc&lt;/code&gt; is utilized in an unsanatized &lt;code&gt;eval()&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;ol start="5"&gt;&#10;&lt;li&gt;Stack based buffer overflow in sgnet_readn that is utilized in &lt;code&gt;sgstatd.c:147:&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The stack canary is static and can easily be repaired.&lt;/li&gt;&#10;&lt;li&gt;The stack canary includes a &lt;code&gt;JMP ESP&lt;/code&gt; as a partial command. This assembly instruction is crucial for exploitation.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;ol start="8"&gt;&#10;&lt;li&gt;Describe the technique you used to gain access to each SuperGnome’s gnome.conf file.&lt;/li&gt;&#10;&lt;li&gt;SG-01: Administrative credentials from the firmware image provided full access.&lt;/li&gt;&#10;&lt;li&gt;SG-02: A path traversal vulnerability allowed to download arbitrary files in the context of a standard user.&lt;/li&gt;&#10;&lt;li&gt;SG-03: A NoSQL injection in the login form was exploited in order to login as admin user.&lt;/li&gt;&#10;&lt;li&gt;SG-04: The system was compromised via server side javascript injection in NodeJS.&lt;/li&gt;&#10;&lt;li&gt;SG-05: Weaponize remote exploit for sgstadt (4242/tcp) in order to a reverse shell.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&#10;&#10;&lt;p&gt;The packet capture includes mostly traffic on port 53/udp.&#10;A client system at 52.2.229.189 is querying the dns server at 10.42.0.18 for a TXT record.&#10;In packet 363 the server responds with a base64 encoded string &lt;code&gt;EXEC:iwconfig&lt;/code&gt;.&#10;Subsequently, the client starts sending TXT responses with base64 encoded data to the server.&#10;The response starts with a start marker &lt;code&gt;EXEC:START_STATE&lt;/code&gt;.&#10;The end of the exec output is marked by an encoded &lt;code&gt;EXEC:STOP&lt;/code&gt;.&#10;In packet 573 another command is scheduled by the server: &lt;code&gt;EXEC:cat /tmp/iwlistscan.txt&lt;/code&gt;.&#10;Finally, in packet 875 the server requests a file with &lt;code&gt;FILE:/root/Pictures/snapshot_CURRENT.jpg&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Exploit Exercises - Protostar - Final levels</title><link>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-final-levels/</link><pubDate>Sun, 02 Nov 2014 16:55:26 +0200</pubDate><guid>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-final-levels/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://www.vulnhub.com/entry/exploit-exercises-protostar-v2,32/" target="_blank" rel="noreferrer"&gt;Exploit-Exercises: Protostar&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&#10;&lt;p&gt;For this level we have got a binary listening on port 2995.&lt;/p&gt;&#10;&#10;&#10;&lt;p&gt;Let&amp;rsquo;s find out what this binary is up to.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code class="language-c-objdump" data-lang="c-objdump"&gt;0x08049833 &amp;lt;main+0&amp;gt;: push %ebp&#10;0x08049834 &amp;lt;main+1&amp;gt;: mov %esp,%ebp&#10;0x08049836 &amp;lt;main+3&amp;gt;: and $0xfffffff0,%esp&#10;0x08049839 &amp;lt;main+6&amp;gt;: sub $0x20,%esp&#10;0x0804983c &amp;lt;main+9&amp;gt;: movl $0x0,0x8(%esp)&#10;0x08049844 &amp;lt;main+17&amp;gt;: movl $0x0,0x4(%esp)&#10;0x0804984c &amp;lt;main+25&amp;gt;: movl $0x8049c74,(%esp) ; &amp;#34;final0&amp;#34;&#10;0x08049853 &amp;lt;main+32&amp;gt;: call 0x8048e58 &amp;lt;background_process&amp;gt;&#10;0x08049858 &amp;lt;main+37&amp;gt;: movl $0xbb3,(%esp)&#10;0x0804985f &amp;lt;main+44&amp;gt;: call 0x80492f5 &amp;lt;serve_forever&amp;gt;&#10;0x08049864 &amp;lt;main+49&amp;gt;: mov %eax,0x18(%esp)&#10;0x08049868 &amp;lt;main+53&amp;gt;: mov 0x18(%esp),%eax&#10;0x0804986c &amp;lt;main+57&amp;gt;: mov %eax,(%esp)&#10;0x0804986f &amp;lt;main+60&amp;gt;: call 0x80493d5 &amp;lt;set_io&amp;gt;&#10;0x08049874 &amp;lt;main+65&amp;gt;: call 0x804975a &amp;lt;get_username&amp;gt;&#10;0x08049879 &amp;lt;main+70&amp;gt;: mov %eax,0x1c(%esp)&#10;0x0804987d &amp;lt;main+74&amp;gt;: mov $0x8049c7b,%eax ; &amp;#34;No such user %s\n&amp;#34;&#10;0x08049882 &amp;lt;main+79&amp;gt;: mov 0x1c(%esp),%edx&#10;0x08049886 &amp;lt;main+83&amp;gt;: mov %edx,0x4(%esp)&#10;0x0804988a &amp;lt;main+87&amp;gt;: mov %eax,(%esp)&#10;0x0804988d &amp;lt;main+90&amp;gt;: call 0x8048bac &amp;lt;printf@plt&amp;gt;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;p&gt;We have got a service waiting for our commands.&#10;The magic is happening in get_username().&lt;/p&gt;</description></item><item><title>Exploit Exercises - Protostar - Heap levels</title><link>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-heap-levels/</link><pubDate>Sat, 01 Nov 2014 11:52:17 +0200</pubDate><guid>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-heap-levels/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://www.vulnhub.com/entry/exploit-exercises-protostar-v2,32/" target="_blank" rel="noreferrer"&gt;Exploit-Exercises: Protostar&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&#10;&lt;p&gt;For this scenario we need to run the winner() function.&#10;To get a better idea about the binary a look at the assembly helps.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code class="language-c-objdump" data-lang="c-objdump"&gt;0x08048492 &amp;lt;main+6&amp;gt;: sub $0x20,%esp&#10;0x08048495 &amp;lt;main+9&amp;gt;: movl $0x40,(%esp)&#10;0x0804849c &amp;lt;main+16&amp;gt;: call 0x8048388 &amp;lt;malloc@plt&amp;gt; ; malloc(64)&#10;0x080484a1 &amp;lt;main+21&amp;gt;: mov %eax,0x18(%esp) ; store address&#10;0x080484a5 &amp;lt;main+25&amp;gt;: movl $0x4,(%esp)&#10;0x080484ac &amp;lt;main+32&amp;gt;: call 0x8048388 &amp;lt;malloc@plt&amp;gt; ; malloc(4)&#10;0x080484b1 &amp;lt;main+37&amp;gt;: mov %eax,0x1c(%esp) ; store address&#10;0x080484b5 &amp;lt;main+41&amp;gt;: mov $0x8048478,%edx ; nowinner()&#10;0x080484ba &amp;lt;main+46&amp;gt;: mov 0x1c(%esp),%eax&#10;0x080484be &amp;lt;main+50&amp;gt;: mov %edx,(%eax)&#10;0x080484c0 &amp;lt;main+52&amp;gt;: mov $0x80485f7,%eax ; &amp;#34;data is at %p, fp is at %p\n&amp;#34;&#10;0x080484dd &amp;lt;main+81&amp;gt;: mov 0xc(%ebp),%eax&#10;...&#10;0x080484e0 &amp;lt;main+84&amp;gt;: add $0x4,%eax&#10;0x080484e3 &amp;lt;main+87&amp;gt;: mov (%eax),%eax&#10;0x080484e5 &amp;lt;main+89&amp;gt;: mov %eax,%edx&#10;0x080484e7 &amp;lt;main+91&amp;gt;: mov 0x18(%esp),%eax&#10;0x080484eb &amp;lt;main+95&amp;gt;: mov %edx,0x4(%esp)&#10;0x080484ef &amp;lt;main+99&amp;gt;: mov %eax,(%esp)&#10;0x080484f2 &amp;lt;main+102&amp;gt;: call 0x8048368 &amp;lt;strcpy@plt&amp;gt; ; vulnerable function&#10;0x080484f7 &amp;lt;main+107&amp;gt;: mov 0x1c(%esp),%eax ; load pointer&#10;0x080484fb &amp;lt;main+111&amp;gt;: mov (%eax),%eax ; follow pointer&#10;0x080484fd &amp;lt;main+113&amp;gt;: call %eax ; execute function pointer&lt;/code&gt;&lt;/pre&gt;&#10;&lt;p&gt;So, the binary allocates 64+4 bytes on the heap.&#10;Afterwards, the argument is copied into the first allocated memory part.&#10;As strcpy does not limit the length, we can write into the second variable.&#10;That variable contains a function pointer that is executed afterwards.&lt;/p&gt;</description></item><item><title>Exploit Exercises - Protostar - Network levels</title><link>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-network-levels/</link><pubDate>Thu, 18 Sep 2014 13:21:27 +0200</pubDate><guid>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-network-levels/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://www.vulnhub.com/entry/exploit-exercises-protostar-v2,32/" target="_blank" rel="noreferrer"&gt;Exploit-Exercises: Protostar&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&#10;&lt;p&gt;For this exercise we have got a service listening on port 2999.&#10;Let&amp;rsquo;s connect and see what it does.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;user@protostar:/opt/protostar/bin$ telnet 127.0.0.1 2999&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;Connected to 127.0.0.1.&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;Please send &amp;#39;12992273&amp;#39; as a little endian 32bit int&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;AAAA&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;I&amp;#39;m sorry, you sent 1094795585 instead&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;The challenge changes for every run.&#10;So we have to write a script that extracts the challenge.&#10;Subsequently, we have to calculate the correct response.&lt;/p&gt;</description></item><item><title>Exploit Exercises - Protostar - Format String levels</title><link>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-format-string-levels/</link><pubDate>Tue, 16 Sep 2014 13:21:27 +0200</pubDate><guid>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-format-string-levels/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://www.vulnhub.com/entry/exploit-exercises-protostar-v2,32/" target="_blank" rel="noreferrer"&gt;Exploit-Exercises: Protostar&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&#10;&lt;p&gt;First of all, we take a look at the disassembly.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code class="language-c-objdump" data-lang="c-objdump"&gt;...&#10;0x08048431 &amp;lt;main+6&amp;gt;: sub $0x10,%esp&#10;0x08048434 &amp;lt;main+9&amp;gt;: mov 0xc(%ebp),%eax ; load pointer to the address of first argument&#10;0x08048437 &amp;lt;main+12&amp;gt;: add $0x4,%eax ; increment to get to the pointer of the second argument&#10;0x0804843a &amp;lt;main+15&amp;gt;: mov (%eax),%eax ; resolve pointer-pointer&#10;0x0804843c &amp;lt;main+17&amp;gt;: mov %eax,(%esp) ; store at address of esp&#10;0x0804843f &amp;lt;main+20&amp;gt;: call 0x80483f4 &amp;lt;vuln&amp;gt;&#10;...&#10;0x080483fa &amp;lt;vuln+6&amp;gt;: movl $0x0,-0xc(%ebp)&#10;0x08048401 &amp;lt;vuln+13&amp;gt;: mov 0x8(%ebp),%eax&#10;0x08048404 &amp;lt;vuln+16&amp;gt;: mov %eax,0x4(%esp)&#10;0x08048408 &amp;lt;vuln+20&amp;gt;: lea -0x4c(%ebp),%eax ; load address of target buffer&#10;0x0804840b &amp;lt;vuln+23&amp;gt;: mov %eax,(%esp) ; load address of second argument&#10;0x0804840e &amp;lt;vuln+26&amp;gt;: call 0x8048300 &amp;lt;sprintf@plt&amp;gt;&#10;0x08048413 &amp;lt;vuln+31&amp;gt;: mov -0xc(%ebp),%eax&#10;0x08048416 &amp;lt;vuln+34&amp;gt;: cmp $0xdeadbeef,%eax&#10;0x0804841b &amp;lt;vuln+39&amp;gt;: jne 0x8048429 &amp;lt;vuln+53&amp;gt;&#10;0x0804841d &amp;lt;vuln+41&amp;gt;: movl $0x8048510,(%esp)&#10;0x08048424 &amp;lt;vuln+48&amp;gt;: call 0x8048330 &amp;lt;puts@plt&amp;gt;&#10;...&lt;/code&gt;&lt;/pre&gt;&#10;&lt;p&gt;So this program takes a startup argument.&#10;This input is then utilized in the sprintf at 0x0804840e.&#10;So to exploit this sample we have to perform a format string attack.&#10;The format string variable is located at EBP-0x4c.&#10;The variable for the challenge relevant comparison is located at EBP-0xc.&#10;So we need to write 64 bytes to align the payload of 0xdeadbeef.&#10;To write 64 bytes the format string expression %64x will suffice.&#10;Finally, we can complete the level with the following command.&lt;/p&gt;</description></item><item><title>Exploit Exercises - Protostar - Stack levels</title><link>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-stack-levels/</link><pubDate>Sun, 31 Aug 2014 16:07:14 +0200</pubDate><guid>https://xn--kemetmller-feb.com/blog/exploit-exercises-protostar-stack-levels/</guid><description>&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://www.vulnhub.com/entry/exploit-exercises-protostar-v2,32/" target="_blank" rel="noreferrer"&gt;Exploit-Exercises: Protostar&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&#10;&lt;p&gt;For this scenario we need to overwrite the stack variable $modified.&#10;To get a better idea about the binary a look at the assembly helps.&lt;/p&gt;&#10;&lt;pre tabindex="0"&gt;&lt;code class="language-c-objdump" data-lang="c-objdump"&gt;0x080483f4 &amp;lt;main+0&amp;gt;: push %ebp&#10;0x080483f5 &amp;lt;main+1&amp;gt;: mov %esp,%ebp&#10;0x080483f7 &amp;lt;main+3&amp;gt;: and $0xfffffff0,%esp&#10;0x080483fa &amp;lt;main+6&amp;gt;: sub $0x60,%esp&#10;0x080483fd &amp;lt;main+9&amp;gt;: movl $0x0,0x5c(%esp)&#10;0x08048405 &amp;lt;main+17&amp;gt;: lea 0x1c(%esp),%eax ;load $buffer address into EAX&#10;0x08048409 &amp;lt;main+21&amp;gt;: mov %eax,(%esp) ;set ESP&#10;0x0804840c &amp;lt;main+24&amp;gt;: call 0x804830c &amp;lt;gets@plt&amp;gt; ;vulnerable funtion&#10;0x08048411 &amp;lt;main+29&amp;gt;: mov 0x5c(%esp),%eax ;load $modified into EAX&#10;0x08048415 &amp;lt;main+33&amp;gt;: test %eax,%eax ;Sets ZF&#10;0x08048417 &amp;lt;main+35&amp;gt;: je 0x8048427 &amp;lt;main+51&amp;gt; ;$modified was not modified&#10;0x08048419 &amp;lt;main+37&amp;gt;: movl $0x8048500,(%esp)&#10;0x08048420 &amp;lt;main+44&amp;gt;: call 0x804832c &amp;lt;puts@plt&amp;gt;&#10;0x08048425 &amp;lt;main+49&amp;gt;: jmp 0x8048433 &amp;lt;main+63&amp;gt;&#10;0x08048427 &amp;lt;main+51&amp;gt;: movl $0x8048529,(%esp) ;target for main+35&#10;0x0804842e &amp;lt;main+58&amp;gt;: call 0x804832c &amp;lt;puts@plt&amp;gt;&#10;0x08048433 &amp;lt;main+63&amp;gt;: leave &#10;0x08048434 &amp;lt;main+64&amp;gt;: ret &lt;/code&gt;&lt;/pre&gt;&#10;&lt;p&gt;In order to overwrite the $modified variable the following command is sufficient to do the task.&lt;/p&gt;</description></item></channel></rss>