Class: Snackhack2::SSHForwardRemote

Inherits:
Object
  • Object
show all
Defined in:
lib/snackhack2/forward_remote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSSHForwardRemote

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

#keyObject

Returns the value of attribute key.



4
5
6
# File 'lib/snackhack2/forward_remote.rb', line 4

def key
  @key
end

#lportObject

Returns the value of attribute lport.



4
5
6
# File 'lib/snackhack2/forward_remote.rb', line 4

def lport
  @lport
end

#lsiteObject

Returns the value of attribute lsite.



4
5
6
# File 'lib/snackhack2/forward_remote.rb', line 4

def lsite
  @lsite
end

#passObject

Returns the value of attribute pass.



4
5
6
# File 'lib/snackhack2/forward_remote.rb', line 4

def pass
  @pass
end

#rportObject

Returns the value of attribute rport.



4
5
6
# File 'lib/snackhack2/forward_remote.rb', line 4

def rport
  @rport
end

#siteObject

Returns the value of attribute site.



4
5
6
# File 'lib/snackhack2/forward_remote.rb', line 4

def site
  @site
end

#userObject

Returns the value of attribute user.



4
5
6
# File 'lib/snackhack2/forward_remote.rb', line 4

def user
  @user
end

Instance Method Details

#runObject



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