我在 64b 上安装 Ubuntu 18。
安装pwntools,我已经运行:
$ sudo apt install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
$ sudo python3 -m pip install pwntools
当我运行时pwn
,它给出了以下错误:
$ pwn
Traceback (most recent call last):
File "/usr/local/bin/pwn", line 5, in <module>
from pwnlib.commandline.main import main
File "/usr/local/lib/python3.6/dist-packages/pwnlib/__init__.py", line 43, in <module>
importlib.import_module('.%s' % module, 'pwnlib')
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.6/dist-packages/pwnlib/args.py", line 61, in <module>
from pwnlib import term
File "/usr/local/lib/python3.6/dist-packages/pwnlib/term/__init__.py", line 5, in <module>
from pwnlib.term import completer
File "/usr/local/lib/python3.6/dist-packages/pwnlib/term/completer.py", line 6, in <module>
from pwnlib.term import readline
File "/usr/local/lib/python3.6/dist-packages/pwnlib/term/readline.py", line 7, in <module>
from pwnlib.term import term
File "/usr/local/lib/python3.6/dist-packages/pwnlib/term/term.py", line 167
def goto((r, c)):
^
SyntaxError: invalid syntax
我该如何修复这个问题才能运行 pwntools?
答案1
TL;DR:运行
sudo python3 -m pip install --upgrade git+https://github.com/Gallopsled/pwntools.git@dev3
pwntools 的 pip 版本不是最新的,我目前在 pip 中看到的是 3.12.2 版本。这个旧版本无法与 python3 正常工作。
安装说明建议直接从 git repo 安装:https://github.com/Gallopsled/pwntools/#installation
修复已在此提交中完成: https://github.com/Gallopsled/pwntools/commit/6c794022d50fcb5c9eeafec3cfc5bdf7728f8a5e
我遇到了同样的问题,这个问题页面是 Google 上的第一个搜索结果。希望它能帮到大家!:)