1,环境:kali2.0 64位
2,安装pwntools
安装 capstone
cd ~
git clone https://github.com/aquynh/capstone
cd capstone
make
make install
cd ~
git clone https://github.com/Gallopsled/pwntools
cd pwntools
python setup.py install
cd ~
python
>>> import pw
>>> pwn.asm("xor eax,eax")
'1\xc0'
安装成功
3,python 自动补全
首先查看自己的python路径
python
>>> import sys
>>> sys.path
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/wx-3.0-gtk2']
>>> exit()
vi /usr/lib/python2.7/startup.py
1 #!/usr/bin/python
2 # python tab file
3
4 import sys
5 import readline
6 import rlcompleter
7 import atexit
8 import os
9 #tab completion
10 readline.parse_and_bind('tab: complete')
11 #history file
12 histfile = os.path.join(os.environ['HOME'],'.pythonhistory')
13 try:
14 readline.read_history_file(histfile)
15 except IOError:
16 pass
17 atexit.register(readline.write_history_file,histfile)
18 del os,histfile,readline,rlcompleter
实践:(双击tab 自动补全)
root@kali:~# python
Python 2.7.11 (default, Jan 11 2016, 21:04:40)
[GCC 5.3.1 20160101] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import startup
>>> import sys
>>> sys.
参考文章:http://www.cnblogs.com/pcat/p/5451780.html
http://www.tuicool.com/articles/iAfuamr
http://www.cnblogs.com/crazyforever/p/5014024.html