Python Scapy Learning Notes

Source: Internet
Author: User

1. Install Gnuplot from Ubuntu: http://blog.163.com/gz_ricky/blog/static/182049118201362501316961/

Process is

NumPy, X11, Gnuplot->gnuplotpy


The approximate order is

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. Install pyx
sudo pip install pyx==0.12.1

3. Install scapy
Pip install scapy 

Two. scapy
Reference Document http://www.secdev.org/projects/scapy/doc/usage.html
Main functions:
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}")
   
   
& nbsp  p = Sniff (iface= "Wifi0", filter= ' TCP and Host 1.1.1.1 ', count=1)
   p.show ()
   p[0]
   P[0].SRC, P[0].DST,


This article is from the "9523704" blog, please be sure to keep this source http://9533704.blog.51cto.com/9523704/1773277

Python Scapy Learning Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.