【脚本语言系列】关于Python网络分析Scapy,你需要知道的事
2017-06-13 10:42
711 查看
如何进行网络分析
# -*- coding:utf-8 -*- import sys if len(sys.argv) != 2: print "Usage: arping2tex <net>\n eg: arping2tex 192.168.1.0/24" sys.exit(1) from scapy.all import srp,Ether,ARP,conf conf.verb=0 ans,unans=srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=sys.argv[1]), timeout=2) print r"\begin{tabular}{|l|l|}" print r"\hline" print r"MAC & IP\\" print r"\hline" for snd,rcv in ans: print rcv.sprintf(r"%Ether.src% & %ARP.psrc%\\") print r"\hline" print r"\end{tabular}"
什么是网络分析
通过网络分析可以分析网络协议的运行过程,排除网络运行中出现的过程。网络应用中,可以使用抓包进行网络分析。
对于通讯报文进行直接抓取不仅知道网络连接中出现的问题,
还可以通过数据来分析通讯协议
目前最为通用的网络分析工具是Wireshark软件,其基于抓包库libcap。
scapy也是基于libcap的交互式网络分析工具。
相关文章推荐
- 【脚本语言系列】关于Python网络应用Telnet,你需要知道的事
- 【脚本语言系列】关于Python性能分析工具timeit, 你需要知道的事
- 【脚本语言系列】关于Python网络通讯Twisted网络框架,你需要知道的事
- 【脚本语言系列】关于Python网络通讯socket,你需要知道的事
- 【脚本语言系列】关于Python网络应用SNMP,你需要知道的事
- 【脚本语言系列】关于Python统计分析statsmodel,你需要知道的事
- 【脚本语言系列】关于 Python 数据分析,你需要知道的事
- 【脚本语言系列】关于Python实现网络模式发布-订阅,你需要知道的事
- 【脚本语言系列】关于Python算法分析,你需要知道的事
- 【脚本语言系列】关于Python代码分析工具line_profiler,你需要知道的事
- 【脚本语言系列】关于Python音频处理DirectSound, 你需要知道的事
- 【脚本语言系列】关于Python邮件服务smtplib,你需要知道的事
- 【脚本语言系列】关于Python测试工具lettuce, 你需要知道的事
- 【脚本语言系列】关于Python游戏工具Pygame,你需要知道的事
- 【脚本语言系列】关于PythonGUI界面PyQT,你需要知道的事
- 【脚本语言系列】关于Python数值计算Pandas,你需要知道的事
- 【脚本语言系列】关于Python文本解析XML,你需要知道的事
- 【脚本语言系列】关于Python机器学习scikits-learn,你需要知道的事
- 【脚本语言系列】关于Python测试工具Pyflakes, 你需要知道的事
- 【脚本语言系列】关于Python测试工具unittest, 你需要知道的事