IT日志之Linux运维:安全与监控
tcpdump抓包命令
[选项]
-i:指定监控的网络接口 -A:转换为ACSII码方便阅读/
-w:将数据包信息保存到指定文件
-r:从指定文件读取数据包信息 -c:定义抓包个数
-nn:不解析域名
过滤条件:
类型:host, net, port, portrange 600-800
方向:src, dst
协议:tcp, udp, ip, wlan, arp
[root@localhost ~]# tcpdump -A dst host 192.168.1.190 and tcp port 3305
tcpdump: NFLOG link-layer type filtering not implemented
[root@localhost ~]# tcpdump -A -w ftp.cap host 192.168.1.190 and tcp port 21
tcpdump: NFLOG link-layer type filtering not implemented
测试抓取ftp服务的访问数据包
[ ]
[ ]
[ ]
[ ]
[ ]
[ ]
Connected to 192.168.1.188 (192.168.1.188).
220 (vsFTPd 3.0.2)
Name (192.168.1.188:root): tommy
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
19:05:27.295525 IP 192.168.1.160.49890 > localhost.localdomain.ftp: Flags [P.], seq 1:18, ack 21, win 229, options [nop,nop,TS val 1953678316 ecr 1171271], length 17: FTP
E..EX.@.@.]7............w...u{r......?.....
tr.....GUSER g11..tommy