Skip to content

Instantly share code, notes, and snippets.

@danielpyon
Created August 22, 2022 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpyon/61f9d7f45d664328b437162de3d484b9 to your computer and use it in GitHub Desktop.
Save danielpyon/61f9d7f45d664328b437162de3d484b9 to your computer and use it in GitHub Desktop.
pwn template
from pwn import *
import struct
def p64(x):
return struct.pack('Q', x)
def u64(x):
return struct.unpack('Q', x)[0]
def p32(x):
return struct.pack('<I', x)
def u32(x):
return struct.unpack('<I', x)[0]
if __name__ == '__main__':
local, debug = True, True
if local:
p = process('./chall')
gdb.attach(p, '''
set follow-fork-mode child
break *main
continue
''')
else:
p = remote('chall.org', 1234)
# print(p.recvuntil(b':'))
# p.sendline()
p.interactive()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment