Answer the question
In order to leave comments, you need to log in
What are the analogues of tcpdump with support for trapping packets by data pattern?
I need to filter packets according to a certain pattern (for example, with certain initial two bytes of data). Googling, I did not find anything about filtering traffic by data patterns in tcpdump. If there is no such possibility in tcpdump, please tell me alternative sniffers, preferably not heavy and without gui (for use on a server with CentOS).
Answer the question
In order to leave comments, you need to log in
I need to filter packets according to a certain pattern (for example, with certain initial two bytes of data). Googling, I did not find anything about filtering traffic by data patterns in tcpdump.Look here , page 11. Briefly, the relevant Berkeley packet filter syntax is this:
protocol[start:count]=0xHEXTEMPLATE
If there is no such possibility in tcpdump, please tell me alternative sniffers, preferably not heavy and without gui (for use on a server with CentOS).tcpdump has such an option (if I understood your problem correctly), but I recommend paying attention to tshark, the console version of wireshark. To capture traffic, they use bpf filters; filters for displaying traffic can be configured more flexibly, in my opinion.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question