sshdump - Provide interfaces to capture from a remote host through SSH using a remote capture binary.
sshdump [ --help ] [ --version ] [ --extcap-interfaces ] [ --extcap-dlts ] [ --extcap-interface=<interface> ] [ --extcap-config ] [ --extcap-capture-filter=<capture filter> ] [ --capture ] [ --fifo=<path to file or pipe> ] [ --remote-host=<IP address> ] [ --remote-port=<TCP port> ] [ --remote-username=<username> ] [ --remote-password=<password> ] [ --sshkey=<public key path<gt ]> [ --remote-interface=<interface> ] [ --remote-capture-bin=<capture binary> ]
sshdump --extcap-interfaces
sshdump --extcap-interface=<interface> [ --extcap-dlts ]
sshdump --extcap-interface=<interface> [ --extcap-config ]
sshdump --extcap-interface=<interface> --fifo=<path to file or pipe> --capture --remote-host=myremotehost --remote-port=22 --remote-username=user --remote-interface=eth2 --remote-capture-bin=/usr/sbin/dumpcap
Sshdump is a extcap tool that allows to run a remote capture tool in a SSH connection. The requirement is that the capture executable must have the capabilities to capture from the wanted interface.
The feature is functionally equivalent to run commands like
$ ssh remoteuser@remotehost -p 22222 'dumpcap -i IFACE -P -w -' > FILE & $ wireshark FILE
$ ssh remoteuser@remotehost '/sbin/dumpcap -i IFACE -P -w - -f "not port 22"' > FILE & $ wireshark FILE
Supported interfaces:
Print program arguments.
Print program version.
List available interfaces.
Use specified interfaces.
List DLTs of specified interface.
List configuration options of specified interface.
Start capturing from specified interface save saved it in place specified by --fifo.
Save captured packet to file or send it through pipe.
The address of the remote host for capture.
The SSH port of the remote host.
The username for ssh authentication.
The password to use (if not ssh-agent and pubkey are used). WARNING: the passwords are stored in plaintext and visible to all users on this system. It is recommended to use keyfiles with a SSH agent.
The path to a private key for authentication.
The remote network interface to capture from.
The remote capture binary.
The capture filter
To see program arguments:
sshdump --help
To see program version:
sshdump --version
To see interfaces:
sshdump --extcap-interfaces
Only one interface (ssh) is supported.
Output:
interface {value=ssh}{display=SSH remote capture}
To see interface DLTs:
sshdump --extcap-interface=ssh --extcap-dlts
Output:
dlt {number=147}{name=ssh}{display=Remote capture dependant DLT}
To see interface configuration options:
sshdump --extcap-interface=ssh --extcap-config
Output:
arg {number=0}{call=--remote-host}{display=Remote SSH server address}{type=string}{default=127.0.0.1}
{tooltip=The remote SSH host. It can be both an IP address or an hostname}
arg {number=1}{call=--remote-port}{display=Remote SSH server port}{type=unsigned}{default=22}
{tooltip=The remote SSH host port}
arg {number=2}{call=--remote-username}{display=Remote SSH server username}{type=string}{default=dario}
{tooltip=The remote SSH username. If not provided, the current user will be used}
arg {number=3}{call=--remote-password}{display=Remote SSH server password}{type=string}
{tooltip=The SSH password. SSH agent and certificate are used before it.If they fail, password will
be used, and, if it fails, the connection is not established.}
arg {number=4}{call=--remote-interface}{display=Remote SSH server interface}{type=string}{default=eth0}
{tooltip=The remote network interface used for capture}
arg {number=5}{call=--remote-capture-bin}{display=Remote SSH capture bin}{type=string}{default=dumpcap}
{tooltip=The remote dumcap binary used for capture.}
arg {number=6}{call=--extcap-capture-filter}{display=Capture filter}{type=string}{default=not host hardcore}
{tooltip=The capture filter}
To capture:
sshdump --extcap-interface=ssh --fifo=/tmp/ssh.pcapng --capture --remote-host 192.168.1.10
--remote-username user --extcap-capture-filter "not port 22"
NOTE: To stop capturing CTRL+C/kill/terminate application.
wireshark(1), tshark(1), dumpcap(1), extcap(4)
Sshdump is part of the Wireshark distribution. The latest version of Wireshark can be found at https://www.wireshark.org.
HTML versions of the Wireshark project man pages are available at: https://www.wireshark.org/docs/man-pages.
Original Author
-------- ------
Dario Lombardo <lomato[AT]gmail.com>