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.
8 9 10 11 12 13 14 15 16 |
# File 'lib/snackhack2/forward_remote.rb', line 8 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.
6 7 8 |
# File 'lib/snackhack2/forward_remote.rb', line 6 def key @key end |
#lport ⇒ Object
Returns the value of attribute lport.
6 7 8 |
# File 'lib/snackhack2/forward_remote.rb', line 6 def lport @lport end |
#lsite ⇒ Object
Returns the value of attribute lsite.
6 7 8 |
# File 'lib/snackhack2/forward_remote.rb', line 6 def lsite @lsite end |
#pass ⇒ Object
Returns the value of attribute pass.
6 7 8 |
# File 'lib/snackhack2/forward_remote.rb', line 6 def pass @pass end |
#rport ⇒ Object
Returns the value of attribute rport.
6 7 8 |
# File 'lib/snackhack2/forward_remote.rb', line 6 def rport @rport end |
#site ⇒ Object
Returns the value of attribute site.
6 7 8 |
# File 'lib/snackhack2/forward_remote.rb', line 6 def site @site end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/snackhack2/forward_remote.rb', line 6 def user @user end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/snackhack2/forward_remote.rb', line 18 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 |