Categories
Tags
aastra apache asterisk centos cheatsheet chrome cisco comic dd dropbox email esxi fedora file sharing find gmail gnome google grep im feeling lucky linux migration networking olf openfiler openoffice replace rpl scm search security sed sp3 spyware ssh storage subversion tips tomcat twitter ubuntu vmware voip windowsArchives
Remote packet capture
Had a need to capture some traffic on the remote machine and analyze it in Real Time ™. Found to solutions to this. The first, involved just sending the output of tcpdump across the ssh session.
ssh host.example.org tcpump - eth0 -w - > capture.pcap
The other method, picked up from the wireshark wiki allows for the captured traffic to be viewed as it’s being captured in wireshark. This is done using a combination of ssh and a fifo pipe. The exact command can very slightly, and I suggest reading the relevant man pages, but something similar to the following (taken from their wiki) should do the trick.
mkfifo /tmp/pipe
ssh user@remote-host "tshark -w - not port 22" > /tmp/pipe
wireshark -k -i /tmp/pipe
Related posts:
Related posts brought to you by Yet Another Related Posts Plugin.