Search code examples
scapytcpdump

Capturing packets getting only payload


I need to get only the payload of network packets (without Ethernet header). I used TCPDump, I get something like :

 0x0000:  4500 013f 7913 4000 4006 72ee ac10 01e3  E..?y.@.@.r.....
0x0010:  c732 d894 b826 0050 9455 3f65 51f9 a5f4  ./...&.P.U?eQ...
0x0020:  8018 0990 4ee9 0000 0101 080a 0079 6387  ....N........yc.
[...]

I also tried with Scapy :

>>>hexdump(p) 0000 00 19 4B 10 38 79 00 26 5E 17 00 6E 08 00 45 00 ..K.8y.&^..n..E. 0010 00 40 90 E7 40 00 40 11 26 66 C0 A8 01 0E C0 A8 .@..@.@.&f...... 0020 01 01 97 F1 00 35 00 2C 06 5A 6E 18 01 00 00 01 .....5.,.Zn.....

Do you know how to get only the middle column? (preferably all on one line) (I tried Tshark, but it doesn't correspond to my expectations)

Thanks


Solution

  • There is a tcpick project on sourceforge that should do what you want.