Skip to content

Instantly share code, notes, and snippets.

@KINGSABRI
Created October 7, 2015 12:42
Show Gist options
  • Select an option

  • Save KINGSABRI/5c3b0f0273f717bddb1e to your computer and use it in GitHub Desktop.

Select an option

Save KINGSABRI/5c3b0f0273f717bddb1e to your computer and use it in GitHub Desktop.
ssh forward tunnel
#!/usr/bin/evn ruby
require 'net/ssh'
Net::SSH.start("127.0.0.1", 'fish', :password => 'fisheye', :verbose => :debug) do |ssh|
# Forward connections coming on port 3333 to port 3389 of attacker.zone
ssh.forward.local('0.0.0.0', 3333, "172.16.16.136", 80)
puts "[+] Starting SSH port forward tunnel"
ssh.loop { true }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment