0%

tcpdump

  • tcp是指tcp包
  • tcp[12:1]是指tcp格式中首部长度部分,字段长度为4bit,所以需要按位与& 0xf0,其单位为4B,所以需要右移2位(即*32
  • 具体请看tcp包格式

http post抓包

1
tcpdump -s 0 -A 'tcp dst port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)

http get

1
tcpdump -s 0 -A 'tcp dst port 80 and tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'

http 响应头和数据

1
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'