I'm trying to capture syn packets going to a given destination port with tcpdump with the following command :
tcpdump dst port 80 "(tcp-syn) !=0"
but it says
tcp: syntax error
Any idea how to select those two filters ?
I'm trying to capture syn packets going to a given destination port with tcpdump with the following command :
tcpdump dst port 80 "(tcp-syn) !=0"
but it says
tcp: syntax error
Any idea how to select those two filters ?
There are two problems with your command:
and between port and packet typetcp-syn is a constant - because of this the comparison in quotes is always true.This should behave correctly:
tcpdump dst port 80 and "tcp[tcpflags] & tcp-syn != 0"