1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| from pwn import *
context.arch="amd64" # amd64(64位) i386(32位)
context.os="linux"
context.log_level="debug" #开启 debug 模式
elf=ELF("./lottery_debug")
libc=ELF("./libc.so.6") #如果有
def conn():
if args.REMOTE:
host=""
port=
return remote(host,port)
else:
return process("")
def exploit(io):
io.recvuntil(b"")
line=io.recvline().decode().split()
payload=
io.sendline(payload)
io.interactive()
if __name__=='__main__':
io=conn()
exploit(io)
|