學習記錄:pwntools安裝及其環境配置

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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章