American Communications Cooperative Forum Index American Communications Cooperative
Dedicated to advancements in communications worldwide
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Remote Wireshark Packet Capture using SSH

 
Post new topic   Reply to topic    American Communications Cooperative Forum Index -> Linux
View previous topic :: View next topic  
Author Message
C4colo
Co-Op-Founder


Joined: 16 Apr 2007
Posts: 52

PostPosted: Wed Oct 22, 2008 5:39 pm    Post subject: Remote Wireshark Packet Capture using SSH Reply with quote

Recently I needed to debug some traffic on a connection running through a router that was on another network segment than I was on. Running tcpdump on the console is only so useful and I wanted to be able to watch the connection in real time (instead of saving a pcap file and transferring it).

The computer running Wireshark must be a linux computer (if you figure out how to do this on windows let me know).

With a little research I pulled this info together from multiple sites. Here is how I did it:

On the computer running Wireshark:

1) Create a pipe on your filesystem
Code:

mkfifo /tmp/wspipe &


2) Start Wireshark from the command line listening to the pipe
Code:

wireshark -k -i /tmp/wspipe


3) Start the ssh connection executing a remote command:
Code:

ssh root@some-server tcpdump not port 22 -w - > /tmp/wspipe

(If you do not have certificates set up it will prompt for the password before connecting)

Change the tcpdump parameters to suit your needs ... remember to exclude the host that is running Wireshark, or exclude port 22.

The above command basically runs a remote command via ssh on the server, then pipes the result out to stdout (-w -), which is piped on the local machine to /tmp/wspipe/

Let me know if you have any suggestions.

Clifford
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    American Communications Cooperative Forum Index -> Linux All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group