0
buf = '' buf += '1'*32 buf += p64(0) * 7 buf += p64(cookie) buf += p64(0)
这是前辈的shellcode的脚本的一部分,但是如果我写同样的脚本就会有这样的问题
root@gavin:/home/gavin/angstromCTF2020# python3 Python 3.7.5 (default, Nov 20 2019, 09:21:52) [GCC 9.2.1 20191008] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pwn import * >>> buf="a"*10 >>> buf+=p64(0xdeadbeef) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate str (not "bytes") to str >>>
有没有大佬能出来解决一下,难道是因为Python2和Python3之间的区别么??
0
buf="a"*10 改成 buf=b"a"*10 就行了
你在python3里用python2的语法当然报错了