1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-10-29 18:07:27 +01:00

This commit allows ssh_login to use socks proxies. Net::SSH::Transport::Session could take a :proxy option,

but it expects a factory object not a string, when setting :proxy => datastore['Proxies'] user got:
"Auxiliary failed: NoMethodError private method `open' called for \"socks4:localhost:1080\":String."
VALID_OPTIONS in ssh.rb now takes :proxies option which is passed to the Rex socket in
Net::SSH::Transport::Session.new.

Testing: block all outgoing to SSH server, try to connect with a proxy. Try with :proxy option,
then merge this pull request and try again.
This commit is contained in:
RageLtMan 2012-08-12 16:01:52 -04:00
parent 67cdea1788
commit c9690033c7
3 changed files with 5 additions and 2 deletions

View File

@ -72,7 +72,8 @@ module Net
:rekey_limit, :rekey_packet_limit, :timeout, :verbose,
:global_known_hosts_file, :user_known_hosts_file, :host_key_alias,
:host_name, :user, :properties, :passphrase, :msframework, :msfmodule,
:record_auth_info, :skip_private_keys, :accepted_key_callback, :disable_agent
:record_auth_info, :skip_private_keys, :accepted_key_callback, :disable_agent,
:proxies
]
# The standard means of starting a new SSH connection. When used with a

View File

@ -74,6 +74,7 @@ module Net; module SSH; module Transport
Rex::Socket::Tcp.create(
'PeerHost' => @host,
'PeerPort' => @port,
'Proxies' => options[:proxies],
'Context' => {
'Msf' => options[:msframework],
'MsfExploit' => options[:msfmodule]

View File

@ -70,7 +70,8 @@ class Metasploit3 < Msf::Auxiliary
:port => port,
:disable_agent => true,
:password => pass,
:config => false
:config => false,
:proxies => datastore['Proxies']
}
opt_hash.merge!(:verbose => :debug) if datastore['SSH_DEBUG']