码迷,mamicode.com
首页 > 编程语言 > 详细

python scapy学习笔记

时间:2016-05-14 17:14:19      阅读:1079      评论:0      收藏:0      [点我收藏+]

标签:python   ubuntu   

1. ubuntu下安装gnuplot
转自:http://blog.163.com/gz_ricky/blog/static/182049118201362501316961/

流程为

NumPy -> x11 -> Gnuplot ->GnuplotPy


大概的命令就是

sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose


sudo apt-get install gnuplot-x11
sudo apt-get install libx11-dev libxt-dev libreadline-gplv2-dev glib-2.0


cd ~/Downloads/gnuplot-4.6.3/

./configure
make
sudo make install


cd gnuplot-py-1.8/

python setup.py install

2.安装PyX
sudo pip install pyx==0.12.1

3.安装scapy
pip install scapy

二.SCAPY
参考文档 http://www.secdev.org/projects/scapy/doc/usage.html
主要函数:
send, sr, sr1 , sniff, rdpcap,   meke_table,
sr(IP(dst="192.168.1.1")/TCP(sport=RandShort(),dport=[440,441,442,443],flags="S"))
ans,unans = sr(IP(dst=["192.168.1.1","yahoo.com","slashdot.org"])/TCP(dport=[22,80,443],flags="S"))
 ans.summay, ans.filter,
 a=rdpcap("/spare/captures/isakmp.cap")

   sniff(iface="wifi0", filter=‘icmp and host 1.1.1.1‘,prn=lambda x: x.summary()) #x.show
   
   pkts = sniff(prn=lambda x:x.sprintf("{IP:%IP.src% -> %IP.dst%\n}{Raw:%Raw.load%\n}"))
   
   
   p = sniff(iface="wifi0", filter=‘tcp and host 1.1.1.1‘,count=1)
   p.show()
   p[0]
   p[0].src , p[0].dst,


本文出自 “9523704” 博客,请务必保留此出处http://9533704.blog.51cto.com/9523704/1773277

python scapy学习笔记

标签:python   ubuntu   

原文地址:http://9533704.blog.51cto.com/9523704/1773277

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!