Skip to content

Commit d207b8b

Browse files
committed
Improve Wireshark remote capture documentation
Add sshdump as the recommended method for remote packet capture, replacing the manual SSH pipe approach. Includes SSH key setup and configuration table for sshdump settings.
1 parent e7a3b1b commit d207b8b

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

content/docs/wiki/general/traffic-sniffing.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ You can use mitmproxy, mitmweb or mitmdump. I prefered mitmweb
5858
./mitmweb --verbose --web-host 0.0.0. --mode transparent --set client_certs=/root/client.pem --ssl-insecure -s /root/toniebox.cert-validity.py
5959
```
6060

61-
## Using wireshark over ssh
62-
You'll need to install tcpdump on you target system. I also disabled password auth for sudoing tcpdump.
61+
## Using Wireshark over SSH
62+
63+
You'll need to install tcpdump on your target system. I also disabled password auth for sudoing tcpdump.
6364
```
6465
$ nano /etc/sudoers.d/tcpdump
6566
@@ -70,6 +71,32 @@ Attach pcap-group to tcpdump
7071
sudo chgrp pcap /usr/bin/tcpdump
7172
sudo chmod 750 /usr/bin/tcpdump
7273
```
74+
75+
### SSH key authentication
76+
For secure and convenient authentication, create a dedicated SSH key for remote capture:
77+
```
78+
ssh-keygen -t ed25519 -f ~/.ssh/wireshark_capture -C "wireshark remote capture"
79+
ssh-copy-id -i ~/.ssh/wireshark_capture.pub user@hackiebox
80+
```
81+
82+
### Remote capture with sshdump (recommended)
83+
Wireshark includes **sshdump**, an extcap utility that captures packets from remote hosts over SSH directly within Wireshark's interface. This is the recommended cross-platform approach.
84+
85+
Open Wireshark and look for **SSH remote capture** interfaces in the interface list. Double-click to configure:
86+
| Setting | Value |
87+
|---------|-------|
88+
| Remote SSH server address | `hackiebox` |
89+
| Remote SSH server port | `22` |
90+
| Remote interface | `ens19` |
91+
| Remote capture command | `tcpdump` |
92+
| Use sudo on the remote machine | enable |
93+
| Remote capture filter | `not port 22` |
94+
| Path to SSH private key | `~/.ssh/wireshark_capture` |
95+
96+
- [Wireshark sshdump manual](https://www.wireshark.org/docs/man-pages/sshdump.html)
97+
- [Video tutorial: Remote Packet Capture with Wireshark](https://www.youtube.com/watch?v=jYuHS-2g0BM)
98+
99+
### Using pipes (alternative)
73100
I suggest you to ssh once into your machine to confirm the signature. Then you can run wireshark over the command and then enter the password to start tcpdump
74101
```
75102
ssh user@hackiebox sudo tcpdump -i ens19 -U -s0 -w - 'not port 22' | wireshark -k -i -

0 commit comments

Comments
 (0)