[研究] Scapy 2.2.0 交談式封包處理工具安裝與簡易教學 (CentOS 6.5 x64)
2014-01-12
官方網站
http://www.secdev.org/projects/scapy/
目前最新版疑似 2011年2月28日釋出的 2.2.0 版 (zip版,tar.gz版為 2.1.0 版)
安裝說明
http://www.secdev.org/projects/scapy/doc/installation.html#installing-scapy-v2-x
DEMO
http://www.secdev.org/projects/scapy/doc/introduction.html#quick-demo
教學文件
http://www.secdev.org/projects/scapy/doc/
http://www.secdev.org/projects/scapy/doc/usage.html#interactive-tutorial
安裝
wget http://www.secdev.org/projects/scapy/files/scapy-latest.zip
unzip scapy-latest.zip
cd scapy-2.*
python setup.py install
測試
[root@localhost scapy-2.2.0]# scapy <=== 啟動
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
WARNING: No route found for IPv6 destination :: (no default route?)
/usr/lib/python2.6/site-packages/scapy/crypto/cert.py:10: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import os, sys, math, socket, struct, sha, hmac, string, time
/usr/lib/python2.6/site-packages/scapy/crypto/cert.py:11: DeprecationWarning: The popen2 module is deprecated. Use the subprocess module.
import random, popen2, tempfile
Welcome to Scapy (2.2.0)
>>> help() <=== 線上說明
Welcome to Python 2.6! This is the online help utility.
If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/tutorial/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".
To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".
help> quit <=== 離開線上說明
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)". Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
>>> ls() <=== 列出命令 (太長了,不列)
>>> ls(IP) <== 列出 IP 封包內容
version : BitField = (4)
ihl : BitField = (None)
tos : XByteField = (0)
len : ShortField = (None)
id : ShortField = (1)
flags : FlagsField = (0)
frag : BitField = (0)
ttl : ByteField = (64)
proto : ByteEnumField = (0)
chksum : XShortField = (None)
src : Emph = (None)
dst : Emph = ('127.0.0.1')
options : PacketListField = ([])
>>>
>>> myip=IP(dst='www.hinet.net', src='192.168.100.100') <== 定義一個 IP 封包
>>> ls(myip) <== 列出 IP 封包內容
version : BitField = 4 (4)
ihl : BitField = None (None)
tos : XByteField = 0 (0)
len : ShortField = None (None)
id : ShortField = 1 (1)
flags : FlagsField = 0 (0)
frag : BitField = 0 (0)
ttl : ByteField = 64 (64)
proto : ByteEnumField = 0 (0)
chksum : XShortField = None (None)
src : Emph = '192.168.100.100' (None)
dst : Emph = Net('www.hinet.net') ('127.0.0.1')
options : PacketListField = [] ([])
>>>
>>> exit() <=== 離開
[root@localhost scapy-2.2.0]#
功能太多,請自己參考官方文件。
(完)
相關文章
[研究] Scapy 2.2.0 交談式封包處理工具安裝與簡易教學 (CentOS 6.5 x64)
http://shaurong.blogspot.com/2014/01/scapy-220-centos-65-x64.html
http://forum.icst.org.tw/phpbb/viewtopic.php?f=24&t=80684
[研究] Scapy 2.2.0 交談式封包處理工具安裝與簡易教學 (CentOS 6.0 x86)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=20316
[研究] Scapy 交談式封包處理工具安裝與簡易教學 (Fedora 15 x86)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=20386
沒有留言:
張貼留言