pwntools

# Exploit development library 

# import all from module 
from pwn import *

# Cyclic pattern for overflow 
print.(cyclic(50))

# Work with shell code or assembly 
print(shellcract.sh())
print(hexdump(asm(shellcraft.sh())))

# Start a local process 
p = process("/bin/sh")
p.sendline("echo hello;")
p.interactive()

# Start a remote process
## Declare remote IP and port
r = remote("127.0.0.1", 1234)
# send command
r.sendline("hello!")
# Create interactive shell 
r.interactive()
# Close the connection
r.close()

# Pack numbers 
print(p32(0x13371337))

# Unpack numbers 
print(u32(0x13371337))

# Load files 
l = ELF('/bin/bash')

print(hex(l.address))

# See entry point 
print(hex(l.entry))

# Find information about a binary 
print(hex(l.got['write']))
print(hex(l.plt['write']))

# Encryption 
print(xor("A", "B"))

print(b64e(b"test"))

print(md5sumhex(b"hello"))
print(sha1sumhex(b"hello"))

Last updated