您的位置:首页 > 编程语言 > Python开发

学习记录:pwntools安装及其环境配置

2016-08-13 11:03 369 查看
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()


然后 建立自己的startup.py

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息