经常用tcpdump抓包来倒腾和学习, 但怎么触发tcp包呢? 写一个客户端程序, 然后朝server上发包, 肯定可以, 但还有更简单的方法:
exec 8<>/dev/tcp/10.100.70.139/19006
echo -e "stats" >&8
用tcpdump抓包的结果为:
xxxxxx$ sudo tcpdump -iany port 19006 -Xnlps0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes
23:56:54.177781 IP 10.100.70.139.34209 > 10.100.70.139.19006: Flags [S], seq 2048518213, win 43690, options [mss 65495,sackOK,TS val 1173337789 ecr 0,nop,wscale 8], length 0
0x0000: 4500 003c 5ef8 4000 4006 39e6 0a64 468b E..<^.@.@.9..dF.
0x0010: 0a64 468b 85a1 4a3e 7a19 e845 0000 0000 .dF...J>z..E....
0x0020: a002 aaaa a20c 0000 0204 ffd7 0402 080a ................
0x0030: 45ef b6bd 0000