scapy学习笔记(4)简单的sniffing 嗅探
转载请注明:@小五义:http://www.cnblogs/xiaowuyi
利用sniff命令进行简单的嗅探,可以抓到一些简单的包。当不指定接口时,将对每一个接口进行嗅探,当指定接口时,仅对该接口进行。
如;
>>> sniff(filter="icmp and host 61.135.169.125",count=)
结果:
<Sniffed: TCP:0 UDP:0 ICMP:0 Other:0>
再比如对ppp0端口的嗅探:
>>> sniff(iface="ppp0",prn=lambda x:x.summary())
此时浏览一下百度,结果如下:
IP / UDP 27.214.219.76:53144 > 122.225.83.67:http / Raw
IP / UDP / DNS Qry "suggestion.baidu.com."
IP / UDP / DNS Qry "suggestion.baidu.com."
IP / UDP / DNS Ans "suggestion.a.shifen.com."
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http S
IP / UDP / DNS Ans "suggestion.a.shifen.com."
IP / ICMP / IPerror / UDPerror / DNS Ans "suggestion.a.shifen.com."
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 SA
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http A
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http PA / Raw
IP / UDP 122.225.83.67:http > 27.214.219.76:53144 / Raw
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 A
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 PA / Raw
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http A
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 PA / Raw
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http A
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http PA / Raw
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 A
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 PA / Raw
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http A
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 PA / Raw
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http A
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http S
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 SA
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http PA / Raw
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 PA / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 A / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 61.135.169.125:http > 27.214.219.76:45639 PA / Raw
IP / TCP 27.214.219.76:45639 > 61.135.169.125:http A
IP / TCP 27.214.219.76:55193 > 60.55.35.47:http S
IP / UDP / DNS Qry "t11.baidu.com."
IP / UDP / DNS Qry "t12.baidu.com."
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http S
IP / UDP / DNS Ans "image.jomodns.com."
IP / TCP 27.214.219.76:49797 > 119.188.9.119:http S
IP / TCP 27.214.219.76:49798 > 119.188.9.119:http S
IP / TCP 27.214.219.76:49799 > 119.188.9.119:http S
IP / UDP / DNS Ans "image.jomodns.com."
IP / TCP 27.214.219.76:39103 > 119.188.9.118:http S
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 SA
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 119.188.9.119:http > 27.214.219.76:49797 SA
IP / TCP 27.214.219.76:49797 > 119.188.9.119:http A
IP / TCP 119.188.9.119:http > 27.214.219.76:49798 SA
IP / TCP 27.214.219.76:49798 > 119.188.9.119:http A
IP / TCP 119.188.9.119:http > 27.214.219.76:49799 SA
IP / TCP 27.214.219.76:49799 > 119.188.9.119:http A
IP / TCP 60.55.35.47:http > 27.214.219.76:55193 SA
IP / TCP 27.214.219.76:55193 > 60.55.35.47:http A
IP / TCP 27.214.219.76:55193 > 60.55.35.47:http PA / Raw
IP / TCP 119.188.9.118:http > 27.214.219.76:39103 SA
IP / TCP 27.214.219.76:39103 > 119.188.9.118:http A
IP / TCP 60.55.35.47:http > 27.214.219.76:55193 A
IP / TCP 60.55.35.47:http > 27.214.219.76:55193 PA / Raw
IP / TCP 27.214.219.76:55193 > 60.55.35.47:http A
IP / TCP 27.214.219.76:55193 > 60.55.35.47:http PA / Raw
IP / TCP 27.214.219.76:49797 > 119.188.9.119:http PA / Raw
IP / TCP 27.214.219.76:49798 > 119.188.9.119:http PA / Raw
IP / TCP 27.214.219.76:49799 > 119.188.9.119:http PA / Raw
IP / TCP 27.214.219.76:39103 > 119.188.9.118:http PA / Raw
IP / TCP 27.214.219.76:38864 > 61.135.169.105:http S
IP / UDP / DNS Qry "a.baidu.com."
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http PA / Raw
IP / TCP 27.214.219.76:59062 > 119.188.9.40:http S
IP / TCP 27.214.219.76:59063 > 119.188.9.40:http S
IP / TCP 119.188.9.119:http > 27.214.219.76:49797 A
IP / TCP 119.188.9.119:http > 27.214.219.76:49797 PA / Raw
IP / TCP 27.214.219.76:49797 > 119.188.9.119:http A
IP / TCP 27.214.219.76:38867 > 61.135.169.105:http S
IP / TCP 119.188.9.119:http > 27.214.219.76:49798 A
IP / TCP 119.188.9.119:http > 27.214.219.76:49798 PA / Raw
IP / TCP 27.214.219.76:49798 > 119.188.9.119:http A
IP / TCP 119.188.9.119:http > 27.214.219.76:49799 A
IP / TCP 119.188.9.119:http > 27.214.219.76:49799 PA / Raw
IP / TCP 27.214.219.76:49799 > 119.188.9.119:http A
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http PA / Raw
IP / TCP 27.214.219.76:50355 > 61.135.185.194:http S
IP / UDP / DNS Qry "api.share.baidu.com."
IP / TCP 119.188.9.118:http > 27.214.219.76:39103 A
IP / TCP 119.188.9.118:http > 27.214.219.76:39103 PA / Raw
IP / TCP 27.214.219.76:39103 > 119.188.9.118:http A
IP / UDP / DNS Ans "asp.e.shifen.com."
IP / TCP 60.55.35.47:http > 27.214.219.76:55193 PA / Raw
IP / TCP 27.214.219.76:53605 > 123.125.114.38:http S
IP / TCP 27.214.219.76:53606 > 123.125.114.38:http S
IP / TCP 27.214.219.76:55193 > 60.55.35.47:http FA
IP / TCP 61.135.169.105:http > 27.214.219.76:38864 SA
IP / TCP 27.214.219.76:38864 > 61.135.169.105:http A
IP / TCP 27.214.219.76:38864 > 61.135.169.105:http PA / Raw
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 PA / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http PA / Raw
IP / TCP 119.188.9.40:http > 27.214.219.76:59062 SA
IP / TCP 27.214.219.76:59062 > 119.188.9.40:http A
IP / TCP 119.188.9.40:http > 27.214.219.76:59063 SA
IP / TCP 27.214.219.76:59063 > 119.188.9.40:http A
IP / TCP 61.135.169.105:http > 27.214.219.76:38867 SA
IP / TCP 27.214.219.76:38867 > 61.135.169.105:http A
IP / UDP / DNS Ans "api.share.n.shifen.com."
IP / TCP 27.214.219.76:47655 > 61.135.162.115:http S
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 A
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 PA / Raw
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http A
IP / TCP 123.125.114.101:http > 27.214.219.76:37968 PA / Raw
IP / TCP 27.214.219.76:37968 > 123.125.114.101:http A
IP / TCP 61.135.185.194:http > 27.214.219.76:50355 SA
IP / TCP 27.214.219.76:50355 > 61.135.185.194:http A
IP / TCP 27.214.219.76:50355 > 61.135.185.194:http PA / Raw
IP / TCP 123.125.114.38:http > 27.214.219.76:53605 SA
IP / TCP 27.214.219.76:53605 > 123.125.114.38:http A
IP / TCP 27.214.219.76:53605 > 123.125.114.38:http PA / Raw
IP / TCP 123.125.114.38:http > 27.214.219.76:53606 SA
IP / TCP 27.214.219.76:53606 > 123.125.114.38:http A
IP / TCP 61.135.169.105:http > 27.214.219.76:38864 A
IP / TCP 61.135.169.105:http > 27.214.219.76:38864 PA / Raw
IP / TCP 27.214.219.76:38864 > 61.135.169.105:http A
IP / TCP 61.135.169.105:http > 27.214.219.76:38864 PA / Raw
IP / TCP 27.214.219.76:38864 > 61.135.169.105:http A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 PA / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 61.135.162.115:http > 27.214.219.76:47655 SA
IP / TCP 27.214.219.76:47655 > 61.135.162.115:http A
IP / TCP 27.214.219.76:47655 > 61.135.162.115:http PA / Raw
IP / TCP 60.55.35.47:http > 27.214.219.76:55193 FA
IP / TCP 27.214.219.76:55193 > 60.55.35.47:http A
IP / TCP 61.135.185.194:http > 27.214.219.76:50355 A
IP / TCP 61.135.185.194:http > 27.214.219.76:50355 PA / Raw
IP / TCP 27.214.219.76:50355 > 61.135.185.194:http A
IP / TCP 123.125.114.38:http > 27.214.219.76:53605 A
IP / TCP 123.125.114.38:http > 27.214.219.76:53605 PA / Raw
IP / TCP 27.214.219.76:53605 > 123.125.114.38:http A
IP / TCP 61.135.162.115:http > 27.214.219.76:47655 A
IP / TCP 61.135.162.115:http > 27.214.219.76:47655 PA / Raw
IP / TCP 27.214.219.76:47655 > 61.135.162.115:http A
IP / UDP / DNS Qry "sclick.baidu.com."
IP / UDP / DNS Qry "c.baidu.com."
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http PA / Raw
IP / UDP / DNS Ans "s.a.shifen.com."
IP / TCP 27.214.219.76:47154 > 123.125.115.95:http S
IP / UDP / DNS Ans "c.e.shifen.com."
IP / TCP 27.214.219.76:56976 > 123.125.114.64:http S
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A / Raw
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 PA / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
IP / TCP 27.214.219.76:56977 > 123.125.114.64:http S
IP / TCP 27.214.219.76:47157 > 123.125.115.95:http S
IP / TCP 123.125.115.95:http > 27.214.219.76:47154 SA
IP / TCP 27.214.219.76:47154 > 123.125.115.95:http A
IP / TCP 27.214.219.76:47154 > 123.125.115.95:http PA / Raw
IP / TCP 123.125.114.64:http > 27.214.219.76:56976 SA
IP / TCP 27.214.219.76:56976 > 123.125.114.64:http A
IP / TCP 27.214.219.76:56976 > 123.125.114.64:http PA / Raw
IP / TCP 123.125.114.64:http > 27.214.219.76:56977 SA
IP / TCP 27.214.219.76:56977 > 123.125.114.64:http A
IP / TCP 123.125.115.95:http > 27.214.219.76:47157 SA
IP / TCP 27.214.219.76:47157 > 123.125.115.95:http A
IP / TCP 123.125.115.95:http > 27.214.219.76:47154 A
IP / TCP 123.125.115.95:http > 27.214.219.76:47154 PA / Raw
IP / TCP 27.214.219.76:47154 > 123.125.115.95:http A
IP / TCP 123.125.115.95:http > 27.214.219.76:47154 FA
IP / TCP 27.214.219.76:47154 > 123.125.115.95:http FA
IP / TCP 123.125.114.64:http > 27.214.219.76:56976 A
IP / TCP 123.125.114.64:http > 27.214.219.76:56976 PA / Raw
IP / TCP 27.214.219.76:56976 > 123.125.114.64:http A
IP / TCP 123.125.114.64:http > 27.214.219.76:56976 FA
IP / TCP 27.214.219.76:56976 > 123.125.114.64:http FA
IP / UDP / DNS Qry "trust.baidu.com."
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http PA / Raw
IP / TCP 123.125.115.95:http > 27.214.219.76:47154 A
IP / UDP / DNS Ans "trust.e.shifen.com."
IP / TCP 123.125.114.64:http > 27.214.219.76:56976 A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 A
IP / TCP 119.188.9.40:http > 27.214.219.76:59056 PA / Raw
IP / TCP 27.214.219.76:59056 > 119.188.9.40:http A
^C<Sniffed: TCP:208 UDP:20 ICMP:1 Other:0>
也要以用show()来显示:
>>> sniff(iface="ppp0",prn=lambda x:x.show())
部分结果:
###[ IP ]###
version= 4L
ihl= 5L
tos= 0x0
len= 40
id= 52068
flags= DF
frag= 0L
ttl= 64
proto= tcp
chksum= 0x8151
src= 27.214.219.76
dst= 61.135.185.112
\options\
###[ TCP ]###
sport= 59617
dport= http
seq= 3932617191L
ack= 411565738
dataofs= 5L
reserved= 0L
flags= FA
window= 182
chksum= 0xee34
urgptr= 0
options= {}
^C<Sniffed: TCP:1 UDP:0 ICMP:0 Other:0>
scapy学习笔记(4)简单的sniffing 嗅探的更多相关文章
- JSP学习笔记(三):简单的Tomcat Web服务器
注意:每次对Tomcat配置文件进行修改后,必须重启Tomcat 在E盘的DATA文件夹中创建TomcatDemo文件夹,并将Tomcat安装路径下的webapps/ROOT中的WEB-INF文件夹复 ...
- JAVA WEB学习笔记(三):简单的基于Tomcat的Web页面
注意:每次对Tomcat配置文件进行修改后,必须重启Tomcat 在E盘的DATA文件夹中创建TomcatDemo文件夹,并将Tomcat安装路径下的webapps/ROOT中的WEB-INF文件夹复 ...
- Spark学习笔记0——简单了解和技术架构
目录 Spark学习笔记0--简单了解和技术架构 什么是Spark 技术架构和软件栈 Spark Core Spark SQL Spark Streaming MLlib GraphX 集群管理器 受 ...
- Html学习笔记(二) 简单标签
标签的重点 标签的用途 标签在浏览器中的默认样式 <body>标签: 在网页上显示的内容 <p>标签: 添加段落 <hx>标签: 添加标题 标签一共有6个,h1.h ...
- Netty学习笔记(六) 简单的聊天室功能之WebSocket客户端开发实例
在之前的Netty相关学习笔记中,学习了如何去实现聊天室的服务段,这里我们来实现聊天室的客户端,聊天室的客户端使用的是Html5和WebSocket实现,下面我们继续学习. 创建客户端 接着第五个笔记 ...
- scapy学习笔记(3)发送包,SYN及TCP traceroute 扫描
转载请注明:@小五义:http://www.cnblogs/xiaowuyi 在安装完scapy(前两篇笔记有介绍)后,linux环境下,执行sudo scapy运行scapy. 一.简单的发送包 1 ...
- scapy学习笔记(3)
转自:@小五义:http://www.cnblogs/xiaowuyi 在安装完scapy(前两篇笔记有介绍)后,linux环境下,执行sudo scapy运行scapy. 一.简单的发送包 1.se ...
- Java设计模式学习笔记(二) 简单工厂模式
前言 本篇是设计模式学习笔记的其中一篇文章,如对其他模式有兴趣,可从该地址查找设计模式学习笔记汇总地址 正文开始... 1. 简介 简单工厂模式不属于GoF23中设计模式之一,但在软件开发中应用也较为 ...
- CSS学习笔记09 简单理解BFC
引子 在讲BFC之前,先来看看一个例子 <!DOCTYPE html> <html lang="en"> <head> <meta cha ...
随机推荐
- JavaScript--事件对象(25)
// JavaScript事件的一个重要的方面是它们拥有一些相对一致的特点,可以给开发提供强大的功能; // 最方便和强大的就是事件对象,它们可以帮你处理鼠标事件和键盘敲击方面的情况; // 此外还可 ...
- python-建造者模式
源码地址:https://github.com/weilanhanf/PythonDesignPatterns 说明: 假如要组装一台电脑,将主板,CPU,内存等部件按照某个稳定的步骤组合,基本过程是 ...
- 设计模式(10)--Facade(外观模式)--结构型
作者QQ:1095737364 QQ群:123300273 欢迎加入! 1.模式定义: 外观模式提供了一个统一的接口,用来访问子系统中的一群接口.外观定义了一个高层接口,让子系统更容易使 ...
- 手把手在MyEclipse中搭建Hibernate开发环境
(尊重劳动成果,转载请注明出处:http://blog.csdn.net/qq_25827845/article/details/53414303冷血之心的博客) 在MyEclipse中如何搭建Hib ...
- [Ubuntu] 14.04 外接显示器分辨率调整
最近按照提示更新了一下系统,安装了100多M的更新包,结果系统又读不出外接显示器的信息了,开机显示vga-1:probed a monitor but no|invalid edid,我也不懂. 后来 ...
- springboot 学习之路 15(集成shiro)
shiro: Apache Shiro 是 Java 的一个安全框架.功能强大,使用简单的Java安全框架,它为开发人员提供一个直观而全面的认证,授权,加密及会话管理的解决方案. 更多shiro介 ...
- C# 获得目录下所有文件或指定文件类型文件(包含所有子文件夹)
public partial class FileGet { /// <summary> /// 私有变量 /// </summary> private static List ...
- 免安装PostgreSQL启动服务及创建数据库
安装环境windows7 64位系统 免安装版本postgresql-10.3-1-windows-x64-binaries ===================================== ...
- Python学习---Python环境变量安装问题0907
问题背景: 重新安装操作系统后,原来的环境变量丢失[因Python3.5安装目录是E盘,文件还在,只是丢失了环境变量而已,添加即可] 问题解决: 方法一:使用cmd命令添加path环境变量 在cmd下 ...
- linux操作系统基础讲解
计算机的组成及功能: 现在市场上的计算机组成结构遵循冯 诺依曼体系,由CPU.内存.I/O设备,存储四大部分组成. CPU是整个计算机的核心部件,主要由运算器和控制器组成,它负责整个计算机的程序运行以 ...