You can easily remove TCP payload with Python scapy module
before
[ mpenning@hotcoffee tshark_wd]$ tcpdump -n -r sample.pcap reading from file sample.pcap, link-type EN10MB (Ethernet) 00:25:42.443559 IP 192.168.12.237.1052 > 192.168.12.236.22: Flags [P.], seq 2445372969:2445373021, ack 1889447842, win 63432, length 52 00:25:42.443607 IP 192.168.12.236.22 > 192.168.12.237.1052: Flags [.], ack 52, win 65535, length 0 00:25:42.443980 IP 192.168.12.236.22 > 192.168.12.237.1052: Flags [P.], seq 1:389, ack 52, win 65535, length 388
PAYLOAD STRIPPING
Doing this as root in linux ...
after
[ mpenning@hotcoffee tshark_wd]$ tcpdump -n -r stripped.pcap reading from file sample.pcap, link-type EN10MB (Ethernet) 00:25:42.443559 IP truncated-ip - 52 bytes missing! 192.168.12.237.1052 > 192.168.12.236.22: Flags [P.], seq 2445372969:2445373021, ack 1889447842, win 63432, length 52 00:25:42.443607 IP 192.168.12.236.22 > 192.168.12.237.1052: Flags [.], ack 52, win 65535, length 0 00:25:42.443980 IP truncated-ip - 388 bytes missing! 192.168.12.236.22 > 192.168.12.237.1052: Flags [P.], seq 1:389, ack 52, win 65535, length 388
In tcpdump above, pay attention to "XX bytes missing!". Messages This is because we removed the TCP payload.
source share