Hi All, I am trying to do SSH tunnelling from remote machine and redirect that message to dumpcap which is running on local machine, as shown below. ssh [email protected] "/upapps/ptc/cbtcpa/bin/dumpcap -i eth0 -w -" | /upapps/ptc/cbtcpa/bin/dumpcap -i - -f "port not 22" -a duration:60 -b duration:60 -w test.pcap But i am facing problem in the capture filter "-f "port not 22"", when i capture from the standard input. It is not filtering the desired packets. The file contains all the packets. Does the capture filter not work with the above syntax, that is when capturing packets with interface specified as "-" standard input. So, request your help to solve this. Thanks in advance. Kiran Kumar G asked 04 Jun '11, 20:46 Kiran Kumar G |
One Answer:
IIRC capture filters in dumpcap don't work when reading from a file or a pipe. But even if it did, you want to filter on the capturing host, not on saving host. And the syntax is "not port 22" instead of "port not 22". So you would want to use something like:
Please note that combining -a and -b options might give you unexpected results. You have to use either the -a options or the -b options. answered 05 Jun '11, 00:33 SYN-bit ♦♦ |
Hi SYNbit,
But i am facing issue with this, which is, if there are no packets captured for the above given capture command with the capture filter criteria then there will be no packets (file) dumped on the local machine. This is not the case with dumpcap, it will start dumping the packets into the file even if there are no packets captured.
Sorry there is a mistake in the sentence, plese find below the correct sentence.
Actually there is a requirement to use tcpdump on the remote machine to capture the data and send over SSH tunnel to the local dumpcap to store packets on the local machine. As given below.