Linux抓包:tcp host抓包不到,tcp ip host可以
tcpdump ip host 210.27.48.1

tcpdump 与wireshark

Wireshark(以前是ethereal)是Windows下非常简单易用的抓包工具。但在Linux下很难找到一个好用的图形化抓包工具。还好有Tcpdump。我们可以用Tcpdump + Wireshark 的完美组合实现:在 Linux 里抓包,然后在Windows 里分析包。

tcpdump tcp -i eth1 -t -s 0 -c 100 and dst port ! 22 and src net 192.168.1.0/24 -w ./target.cap

(1)tcp: ip icmp arp rarp 和 tcp、udp、icmp这些选项等都要放到第一个参数的位置,用来过滤数据报的类型
(2)-i eth1 : 只抓经过接口eth1的包
(3)-t : 不显示时间戳
(4)-s 0 : 抓取数据包时默认抓取长度为68字节。加上-S 0 后可以抓到完整的数据包
(5)-c 100 : 只抓取100个数据包
(6)dst port ! 22 : 不抓取目标端口是22的数据包
(7)src net 192.168.1.0/24 : 数据包的源网络地址为192.168.1.0/24
(8)-w ./target.cap : 保存成cap文件,方便用ethereal(即wireshark)分析


分析网络报文,MySQL协议解析中文乱码,netexpert-utf8旧版本可以缓解

mysql:
tcp.dstport == 3306 or tcp.srcport == 3306
tcp.dstport == 3306 and mysql.query contains SELECT

SELECT * FROM bi_report.DM_MOBILE_USERACT_ANAL_DAY_copy limit 10; 
Stream:useCursorFetch=false&defaultFetchSize=-2147483648,2次Response数据量分别是5/5
Wireshark实战之抓包MySQL Java客户端
 
Cursor:useCursorFetch=true&defaultFetchSize=4,3次Response数据量分别是4/4/2
 Wireshark实战之抓包MySQL Java客户端
 
StatementImpl.setMaxRows(int):4、8、12,3次Response数据量分别是4/8/12
Wireshark实战之抓包MySQL Java客户端
 

相关文章:

  • 2021-06-14
  • 2021-11-27
  • 2021-04-27
  • 2021-04-10
  • 2021-07-17
  • 2021-06-22
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2022-01-20
  • 2022-12-23
  • 2021-07-06
  • 2022-01-10
相关资源
相似解决方案