<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Rop on 4mN3s14 | CTF Player &amp; Student</title><link>https://john-jkar.github.io/myblog/tags/rop/</link><description>Recent content in Rop on 4mN3s14 | CTF Player &amp; Student</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 15 Feb 2026 06:00:00 +0000</lastBuildDate><atom:link href="https://john-jkar.github.io/myblog/tags/rop/index.xml" rel="self" type="application/rss+xml"/><item><title>Simple ROP Writeup</title><link>https://john-jkar.github.io/myblog/posts/rop/</link><pubDate>Sun, 15 Feb 2026 06:00:00 +0000</pubDate><guid>https://john-jkar.github.io/myblog/posts/rop/</guid><description>&lt;h1 id="simple-rop-alpacahack--writeup"&gt;Simple ROP Alpacahack — Writeup&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Category:&lt;/strong&gt; Pwn&lt;br&gt;
&lt;strong&gt;Difficulty:&lt;/strong&gt; Hard&lt;br&gt;
&lt;strong&gt;Goal:&lt;/strong&gt; Call&lt;/p&gt;
&lt;p&gt;&lt;code&gt;win(0xdeadbeefcafebabe, 0x1122334455667788, 0xabcdabcdabcdabcd)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;to spawn a shell and read &lt;code&gt;/flag.txt&lt;/code&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="understanding-the-binary"&gt;Understanding the Binary&lt;/h1&gt;
&lt;p&gt;The vulnerable code:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;char buffer[64]; gets(buffer);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gets()&lt;/code&gt; allows unlimited input → &lt;strong&gt;buffer overflow vulnerability&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;win()&lt;/code&gt; function checks 3 arguments:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;param1 == 0xdeadbeefcafebabe param2 == 0x1122334455667788 param3 == 0xabcdabcdabcdabcd&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If all pass → &lt;code&gt;/bin/sh&lt;/code&gt; is executed.&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="security-protections"&gt;Security Protections&lt;/h1&gt;
&lt;p&gt;From &lt;code&gt;checksec&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Arch: amd64 RELRO: Full RELRO Stack: No canary NX: Enabled PIE: Enabled SHSTK: Enabled IBT: Enabled&lt;/code&gt;&lt;/p&gt;</description></item></channel></rss>