Class: Snackhack2::SSHForwardRemote
- Inherits:
-
Object
- Object
- Snackhack2::SSHForwardRemote
- Defined in:
- lib/snackhack2/forward_remote.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#lport ⇒ Object
Returns the value of attribute lport.
-
#lsite ⇒ Object
Returns the value of attribute lsite.
-
#pass ⇒ Object
Returns the value of attribute pass.
-
#rport ⇒ Object
Returns the value of attribute rport.
-
#site ⇒ Object
Returns the value of attribute site.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize ⇒ SSHForwardRemote
constructor
A new instance of SSHForwardRemote.
- #run ⇒ Object
Constructor Details
#initialize ⇒ SSHForwardRemote
Returns a new instance of SSHForwardRemote.
6 7 8 9 10 11 12 13 14 |
# File 'lib/snackhack2/forward_remote.rb', line 6 def initialize @site = site @user = user @pass = pass @key = key @lport = lport @lsite = lsite @rport = rport end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
4 5 6 |
# File 'lib/snackhack2/forward_remote.rb', line 4 def key @key end |
#lport ⇒ Object
Returns the value of attribute lport.
4 5 6 |
# File 'lib/snackhack2/forward_remote.rb', line 4 def lport @lport end |
#lsite ⇒ Object
Returns the value of attribute lsite.
4 5 6 |
# File 'lib/snackhack2/forward_remote.rb', line 4 def lsite @lsite end |
#pass ⇒ Object
Returns the value of attribute pass.
4 5 6 |
# File 'lib/snackhack2/forward_remote.rb', line 4 def pass @pass end |
#rport ⇒ Object
Returns the value of attribute rport.
4 5 6 |
# File 'lib/snackhack2/forward_remote.rb', line 4 def rport @rport end |
#site ⇒ Object
Returns the value of attribute site.
4 5 6 |
# File 'lib/snackhack2/forward_remote.rb', line 4 def site @site end |
#user ⇒ Object
Returns the value of attribute user.
4 5 6 |
# File 'lib/snackhack2/forward_remote.rb', line 4 def user @user end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/snackhack2/forward_remote.rb', line 16 def run Net::SSH.start(@site, @user, :password => @pass, :keys => @key) do |ssh| ssh.forward.remote(@lport, @lsite, @rport) puts "[+] Starting SSH remote forward tunnel" ssh.loop { true } end end |