首页 > 编程知识 正文

tcpdump抓包命令指定端口,服务器抓包命令

时间:2023-05-03 06:17:37 阅读:131405 作者:2327

格式: tcpdump选项筛选条件

常规选项:

-i指定网络接口

a转换为ACSII码,便于阅读

-r指定读取数据的文件

-c定义包的数量

过滤条件:

类型- -主机网络端口范围

方向-- src dst

协议-- tcp udp ip wlan arp .

多条件- -与或不

[ root @ node-0002~] # tcpdump-ieth0- C3 #从网卡eth0抓起三个包

[ root @ node-0002~] # tcpdump-ieth0- C3-a #-a转换ASCII代码

[ root @ node-0002~~ ] # tcpdump-ieth0- C3-wo S1 #将捕获数据写入OS1文件

[ root @ node-0002~]从# tcpdump-ROS1# os1文件读取数据

[ root @ node-0002~] #读取tcpdump-ROS1- a #数据并进行转码

([ root @ node-0002~] () ) ) ) ) ) )

[ root @ node-0002~~ ] # tcpdump-ieth0tcpport 22抓住来自andsrchost 192.168.1.31-C2 # 1.31的包

例; 获取FTP帐户的密码

[root@node-0001 ~]# id oschina

(uid=1006(Oschina ) uid=1006(Oschina ) groups=1006 (oschina ) ) ) ) ) ) ) )。

[ root @ node-0001~] # systemctlstartvsftpd

从[ root @ node-0001~] # tcpdump-ieth0tcpport 21-wftp.txt #抓起包

tcpdump: listening on eth0,link-typeen 10 MB (以太网),capture size 262144 bytes

客户端登录

[ root @ node-0002~] # FTP 192.168.1.51

连接到192.168.1.51 (192.168.1.51 )。

20(vsftpd3.0.2)。

name(192.168.1.51:根) : oschina

331 Please specify the password。

Password:

230 Login successful。

远程系统类型is UNIX。

使用二进制模式到传输文件。

FTP退出

分析数据

[ root @ node-0001~] # tcpdump-rftp.txt-a|egrep-I ' #关键字分析

示例:分析nginx明文帐户的认证

[ root @ node-0001 nginx-1.12.2 ] # tcpdump-ieth0tcpport 80 andhost 192.168.1.51-w nginx.txt #开始抓住包

[ root @ node-0001 nginx-1.12.2 ] # tcpdump-r nginx.txt-a|grep-I ' auth ' #关键字搜索

自读文件nginx.txt,link-typeen 10 MB (以太网) )。

0336042336019.146336 IP node-0001.http 100.125.27.50.com mplex-link : flags [ p.],seq 1:402,ack 379,weq

e .6@ . @ . } . 3d } .2. p . @ . ul . p . C6 . http/1.1401 unauthorized

ww-authenticate : basic realm=' input password '

401授权要求401授权要求: basic B3 njagluytoxmjm0nty=

授权:基本B3 njagluytoxmjm0nty=

[ root @ node-0001 nginx-1.12.2 ] # echo ' B3 njagluytoxmjm0nty=' |查看base64-d # base64编码的内容

oschina :123456 [ root @ node-0001 nginx-1.12.2 ] # #显示登录的帐户密码

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。