Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an IP packet with x bytes of custom header coming in on an interface. Is there a way to tell tcpdump or tshark to ignore the first x bytes and decode and display the IP packet? Any pointers would be helpful; I don't want to write a custom discector

share|improve this question
    
I wonder if you could use wireshark instead. You could try the Disable Protocol, it helped me to skip a socks header. –  ott-- Jan 29 '13 at 23:03
    
@ott-- i have only command line access –  Mike Ryan Jan 29 '13 at 23:37
    
then write your pcap based sniffer –  warl0ck Jan 30 '13 at 4:02
    
See ask.wireshark.org/questions/5613/… –  jofel Jan 30 '13 at 8:10
add comment

1 Answer 1

Wireshark's editcap has a "chop" feature (-C) which can top and tail packets for exactly this purpose.

You can do it real-time like this:

 tcpdump -w - [...filter...] | editcap -F libpcap -C 16 - - | tcpdump -nlvvv -r -
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.