Python SSH Tunnel

Goal and Scenario:

  • - Access web server from Kali machine. 
  • - Kali machine have no access to web server directly
  • - Assuming Ubuntu machine already compromised, running python script inside.



  1. = Kali machine
  2. = Web server



1. Setting up Kali machine as SSH Server

2. Running python script from paramiko, inside Ubuntu machine *

3. When tunnel established, testing by opening browser in Kali machine.


*python -p 8080 -r --user paul --password


Source : Black Hat Python - Justin Seitz - No Starch Press