You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quintin edited this page Sep 10, 2022
·
3 revisions
pwntools is essential to automating any cybersecurity work, and is especially useful in CTF competitions. Take a look at the documentation: https://docs.pwntools.com/en/stable/ and inventory all the different modules and functions. You will most often see this library present in good writeups after competition, so look at those as a guide.
frompwnimport*elf=context.binary=ELF('./vuln') # Tell pwntools what binary you are operating onio=process() # Start the processout=io.recvuntil(b'enter your favorite address?\n') # Read from the process stdoutprint(out)
io.sendline(b'AAAA') # Write to the process stinio.interactive() # Open up stdin/stdout to your control, useful after you pop a shell
Packing a pointer with pwntools (note the Endianess):