<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Binary Exploitation on quixel200</title><link>http://mycatpets.me/notes/binary_exploitation/</link><description>Recent content in Binary Exploitation on quixel200</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 25 Oct 2025 08:37:35 +0530</lastBuildDate><atom:link href="http://mycatpets.me/notes/binary_exploitation/index.xml" rel="self" type="application/rss+xml"/><item><title>Pwntools</title><link>http://mycatpets.me/notes/binary_exploitation/pwntools/</link><pubDate>Sat, 25 Oct 2025 08:37:35 +0530</pubDate><guid>http://mycatpets.me/notes/binary_exploitation/pwntools/</guid><description>&lt;h1 id="pwntools-cheatsheet">pwntools cheatsheet&lt;/h1>
&lt;h1 id="program-interaction">Program Interaction&lt;/h1>
&lt;p>start a process&lt;/p>
&lt;pre tabindex="0">&lt;code>p = process(&amp;#34;binary&amp;#34;)
&lt;/code>&lt;/pre>&lt;p>to attach gdb (note: compatable terminal required, I prefer using tmux)&lt;/p>
&lt;pre tabindex="0">&lt;code>p = gdb.debug(&amp;#34;binary&amp;#34;)
p = gdb.debug(&amp;#34;binary&amp;#34;,alsr=False)
&lt;/code>&lt;/pre>&lt;p>To interact with a remote process&lt;/p>
&lt;pre tabindex="0">&lt;code>p = remote(ip,port)
&lt;/code>&lt;/pre>&lt;h2 id="writing-and-reading-data">Writing and reading data&lt;/h2>
&lt;pre tabindex="0">&lt;code>p.send(b&amp;#34;hello&amp;#34;) -&amp;gt; sends &amp;#34;hello&amp;#34;
p.sendline(b&amp;#34;hello&amp;#34;) -&amp;gt; sends &amp;#34;hello\n&amp;#34;

p.recv(100) -&amp;gt; read upto 100 bytes
p.recvline() -&amp;gt; read till a newline(\n) is encountered
p.recvall() -&amp;gt; readall
p.clean(1) -&amp;gt; readall with timeout

p.sendafter(b&amp;#34;some string&amp;#34;,payload) -&amp;gt; sends payload after the string is encountered 
p.sendlineafter(b&amp;#34;some string&amp;#34;,payload) -&amp;gt; same as sendafter but with newline at end


p.interactive() -&amp;gt; interact manually
&lt;/code>&lt;/pre>&lt;h2 id="setting-context">Setting context&lt;/h2>
&lt;p>important when writing assembly and doing ROP&lt;/p></description></item></channel></rss>