This section covers many of the useful features of the Pwntools library. All of this information comes straight from the Pwntools documentation.
All of our exploits will be written in Python3, so we will use the Python3 version of Pwntools.
Pwntools can be installed on Linux systems using:
pip3 install pwntools
Pwntools can be imported into a Python3 script using:
from pwn import *
This imports every function from Pwntools into the current namespace. This includes several functions.
context.binarycontext.log_levelcontext.archcontext.osremote()process()listen()ssh()asm()disasm()shellcraftELF()ROP()DynELF()pack()unpack()p32() / p64()u32() / u64()gdb.attach()gdb.debug()hexdump()read() and write()enhex() and unhex()align() and align_down()urlencode() and urldecode()The following are automatically imported:
import osimport sysimport timeimport randomimport requestsimport re