tcpdump Demo

lxw ~$ tcpdump -i eth0
tcpdump: eth0: You don‘t have permission to capture on that device
(socket: Operation not permitted)
lxw ~$ sudo tcpdump -i eth0 -c 2    #-i指定监听接口interface   -c指定监听个数
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:43:32.336082 IP6 fe80::7520:2ee6:ac6f:c9a4.55407 > ff02::1:3.hostmon: UDP, length 22
15:43:32.336178 IP 192.168.236.1.61092 > 224.0.0.252.hostmon: UDP, length 22
2 packets captured
11 packets received by filter
0 packets dropped by kernel
lxw ~$ sudo tcpdump -i eth0 -c 3 -w 20141227_1546.pcap    #-w写入文件
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
3 packets captured
11 packets received by filter
0 packets dropped by kernel
lxw ~$ tcpdump -r 20141227_1546.pcap     #-r从文件中读取
reading from file 20141227_1546.pcap, link-type EN10MB (Ethernet)
15:47:20.602350 IP 192.168.236.156.21639 > 192.168.236.2.domain: 21637+ A? tiles.services.mozilla.com. (44)
15:47:20.603151 IP 192.168.236.156.24878 > 192.168.236.2.domain: 24280+ AAAA? tiles.services.mozilla.com. (44)
15:47:20.606409 IP 192.168.236.156.10932 > 192.168.236.2.domain: 59168+ A? tiles.services.mozilla.com. (44)
lxw ~$ sudo tcpdump -i eth0 -tttt    #-t/-tt/-ttt/-tttt/-ttttt时间戳(各个含义,参见man tcpdump)
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
2014-12-27 15:58:15.480571 IP 192.168.236.156.56103 > assets-ubuntu-com.eggfruit.canonical.com.http: Flags [.], ack 967272532, win 30248, length 0
...
76 packets captured
83 packets received by filter
0 packets dropped by kernel
lxw ~$ sudo tcpdump -i eth0 arp        #指定抓包的协议类型(ip/ip6/arp/tcp/udp)
lxw ~$ sudo tcpdump -i eth0 tcp and port 80    #指定抓包端口port
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
16:04:46.460864 IP 192.168.236.156.55641 > 59.24.3.173.http: Flags [S], seq 3612921085, win 29200, options [mss 1460,sackOK,TS val 1308393 ecr 0,nop,wscale 7], length 0
lxw ~$ sudo tcpdump -i eth0 tcp and src 192.168.236.156 and port 80

Reference:

tcpdump使用9个实例: http://blog.csdn.net/zj0910/article/details/12869977

时间: 2024-08-08 01:01:49

tcpdump Demo的相关文章

微信h5支付demo微信H5支付demo非微信浏览器支付demo微信wap支付

一.首先先确定H5支付权限已经申请!(需要微信h5支付demo的可以加 851 488 243 备注:h5支付) 二.开发流程 1.用户在商户侧完成下单,使用微信支付进行支付 2.由商户后台向微信支付发起下单请求(调用统一下单接口)注:交易类型trade_type=MWEB 3.统一下单接口返回支付相关参数给商户后台,如支付跳转url(参数名"mweb_url"),商户通过mweb_url调起微信支付中间页 4.中间页进行H5权限的校验,安全性检查(此处常见错误请见下文) 5.如支付成

Maven+SpringMVC+Freemarker入门Demo

1 参考http://blog.csdn.net/haishu_zheng/article/details/51490299,用第二种方法创建一个名为mavenspringmvcfreemarker的Maven工程. 2 文件目录结构如下图所示 3 在pom.xml中添加springmvc和freemarker的依赖包,添加完之后的完整内容为 [html] view plain copy <project xmlns="http://maven.apache.org/POM/4.0.0&q

Spring Security入门Demo

一.spring Security简介 SpringSecurity,这是一种基于Spring AOP和Servlet过滤器的安全框架.它提供全面的安全性解决方案,同时在Web请求级和方法调用级处理身份确认和授权.在Spring Framework基础上,Spring Security充分利用了依赖注入(DI,Dependency Injection)和面向切面技术. 二.建立工程 参考http://blog.csdn.net/haishu_zheng/article/details/51490

沫沫金Echarts移动端demo

鄙视百度!!! 官网给的Demo支持自动大小,确不给完整的源码XXX 自己动手,丰衣足食 http://echarts.baidu.com/demo.html#bar-tick-align 用最基本的柱状图官网代码 简单两步,实现移动端自适应大小 //1.下载Echarts <script src="dep/Echarts/echarts-all-3.js"></script> //2.chart容器宽度自适应 <!-- 为ECharts准备一个具备大小(

Flask---使用Bootstrap新建第一个demo

Flask---使用Bootstrap新建第一个demo 参考自http://www.jianshu.com/p/417bcbad82fb 还有<Flask web开发> 前端用到Bootstrap开源框架,Bootstrap是客户端框架,后台当然就是Flask了. 服务器需要做的只是提供引用了Bootstrap层叠样式表(CSS)和JS文件的html响应,并且在html.css和js代码中实例化需要的组件,这些操作的最理想的执行环境就是模板 关于模板的介绍及其实现原理:https://kb.

网络安全之tcpdump工具

引言 wireshark使用一款非常不错的抓包软件,在图形化界面占绝对统治地位:尽管其在字符界面下有些许选项可供使用,但终究不太方便,下面我再介绍一款NB的终端抓包工具 tcpdump 1.混杂模式 linux的网卡有混杂模式一说,当开启混杂模式后,网卡可以抓取所有的数据包,不管这个包是不是发给自己或自己发出的.由于随意截取别人的数据包存在一定安全问题,因此linux对于网卡默认是关闭混杂模式的,切只有root用户能够开启网卡混杂模式,开启方式: ifconfig ethX promisc 2.

struts2和hibernate整合的小Demo

jar包下载地址 创建一个web项目. 导入jar包 配置web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="

移动端上传照片 预览+draw on Canvas demo(解决iOS等设备照片旋转90度的bug)

背景: 本人的一个移动端H5项目,需求如下: 手机相册选取或拍摄照片后在页面上预览 然后绘制在canvas画布上. 这里,我们先看一个demo(http://jsfiddle.net/q3011893/83qfqpk8/embedded/) 操作步骤: 1.点击选择文件,拍摄一张照片,此时"预览:"文字下会显示你刚才拍摄的照片: 2.再点击"draw on Canvas",该按钮下的画布会绘制你刚才拍摄的照片. 正常的结果: 正文: 让input file支持拍照+

爬虫2:html页面+beautifulsoap模块+post方式+demo

爬取html页面,有时需要设置参数post方式请求,生成json,保存文件中. 1)引入模块 import requests from bs4 import BeautifulSoup url_ = 'http://www.c.....................' 2)设置参数 datas = { 'yyyy':'2014', 'mm':'-12-31', 'cwzb':"incomestatements", 'button2':"%CC%E1%BD%BB",