当我按照文章来解决googleCTF挑战时, 我收到此类型错误:
[+] Opening connection to fridge-todo-list.ctfcompetition.com on port 1337: Done
Traceback (most recent call last):
File "./exploit.py", line 18, in <module>
write_addr = res.split(':', 1)[1][1:].ljust(8, chr[0])
TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
[*] Closed connection to fridge-todo-list.ctfcompetition.com port 1337
当我使用[]访问元素时,我知道调用了 getitem ,但是我不知道如何解决。
本文使用python2。
#!/usr/bin/env python2
from pwn import *
from struct import unpack, pack
错误出现的扇区是:
# store "write_addr"
res = r.readuntil("Hi haxxor,").splitlines()[0]
write_addr = res.split(':', 1)[1][1:].ljust(8, chr[0])
write_addr = unpack("<Q", write_addr)[0]
print write_addr
仅供参考,我看到的内容是这样的: Integer Overflow Exploit | Google CTF #7