Remove verifying host keys for all exploits
parent
09434bd57c
commit
cd01f11fd2
|
@ -79,13 +79,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def do_login(user, pass)
|
||||
factory = ssh_socket_factory
|
||||
opts = {
|
||||
auth_methods: ['password', 'keyboard-interactive'],
|
||||
port: rport,
|
||||
use_agent: false,
|
||||
config: false,
|
||||
password: pass,
|
||||
proxy: factory,
|
||||
non_interactive: true
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:password => pass,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
opts.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
|
||||
|
|
|
@ -74,13 +74,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def do_login(user)
|
||||
factory = Rex::Socket::SSHFactory.new(framework,self, datastore['Proxies'])
|
||||
opt_hash = {
|
||||
auth_methods: ['publickey'],
|
||||
port: rport,
|
||||
key_data: [ key_data ],
|
||||
use_agent: false,
|
||||
config: false,
|
||||
proxy: factory,
|
||||
non_interactive: true
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:key_data => [ key_data ],
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
opt_hash.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
|
||||
begin
|
||||
|
|
|
@ -118,13 +118,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
factory = ssh_socket_factory
|
||||
|
||||
ssh_options = {
|
||||
auth_methods: ['publickey'],
|
||||
config: false,
|
||||
use_agent: false,
|
||||
key_data: [ key_data ],
|
||||
port: rport,
|
||||
proxy: factory,
|
||||
non_interactive: true
|
||||
:auth_methods => ['publickey'],
|
||||
:config => false,
|
||||
:use_agent => false,
|
||||
:key_data => [ key_data ],
|
||||
:port => rport,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
ssh_options.merge!(verbose: :debug) if datastore['SSH_DEBUG']
|
||||
|
||||
|
|
|
@ -77,13 +77,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
factory = Rex::Socket::SSHFactory.new(framework, self, datastore['Proxies'])
|
||||
|
||||
opt_hash = {
|
||||
auth_methods: ['publickey'],
|
||||
port: rport,
|
||||
key_data: [ key_data ],
|
||||
use_agent: false,
|
||||
config: false,
|
||||
proxy: factory,
|
||||
non_interactive: true
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:key_data => [ key_data ],
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
opt_hash[:verbose] = :debug if datastore['SSH_DEBUG']
|
||||
|
||||
|
|
|
@ -71,13 +71,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def do_login(user)
|
||||
factory = ssh_socket_factory
|
||||
opt_hash = {
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:key_data => [ key_data ],
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:proxy => factory,
|
||||
:non_interactive => true
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:key_data => [ key_data ],
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
opt_hash.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
|
||||
begin
|
||||
|
|
|
@ -74,13 +74,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def exploit
|
||||
factory = ssh_socket_factory
|
||||
ssh_options = {
|
||||
auth_methods: ['publickey'],
|
||||
config: false,
|
||||
use_agent: false,
|
||||
key_data: [ ssh_priv_key ],
|
||||
port: rport,
|
||||
proxy: factory,
|
||||
non_interactive: true
|
||||
:auth_methods => ['publickey'],
|
||||
:config => false,
|
||||
:use_agent => false,
|
||||
:key_data => [ ssh_priv_key ],
|
||||
:port => rport,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
ssh_options.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
|
||||
|
|
|
@ -70,13 +70,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def do_login(user)
|
||||
factory = ssh_socket_factory
|
||||
opt_hash = {
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:key_data => [ key_data ],
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:proxy => factory,
|
||||
:non_interactive => true
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:key_data => [ key_data ],
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
opt_hash.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
|
||||
begin
|
||||
|
|
|
@ -82,13 +82,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def do_login(user, pass)
|
||||
factory = ssh_socket_factory
|
||||
opts = {
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => true,
|
||||
:password => pass,
|
||||
:proxy => factory,
|
||||
:non_interactive => true
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => true,
|
||||
:password => pass,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
opts.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
|
||||
|
|
|
@ -75,13 +75,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def exploit
|
||||
factory = ssh_socket_factory
|
||||
opts = {
|
||||
:auth_methods => ['keyboard-interactive'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:password => password,
|
||||
:proxy => factory,
|
||||
:non_interactive => true
|
||||
:auth_methods => ['keyboard-interactive'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:password => password,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
opts.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
|
||||
|
|
|
@ -86,13 +86,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def do_login(user, pass)
|
||||
factory = ssh_socket_factory
|
||||
opts = {
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:password => pass,
|
||||
:proxy => factory,
|
||||
:non_interactive => true
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:password => pass,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
opts.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
|
||||
|
|
|
@ -124,13 +124,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
factory = ssh_socket_factory
|
||||
|
||||
ssh_opts = {
|
||||
port: datastore['SSH_PORT'],
|
||||
auth_methods: %w{publickey password},
|
||||
key_data: [private_key],
|
||||
non_interactive: true,
|
||||
config: false,
|
||||
use_agent: false,
|
||||
proxy: factory
|
||||
:port => datastore['SSH_PORT'],
|
||||
:auth_methods => %w{publickey password},
|
||||
:key_data => [private_key],
|
||||
:non_interactive => true,
|
||||
:config => false,
|
||||
:use_agent => false,
|
||||
:proxy => factory,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
ssh_opts.merge!(verbose: :debug) if datastore['SSH_DEBUG']
|
||||
|
|
|
@ -70,13 +70,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def do_login()
|
||||
factory = Rex::Socket::SSHFactory.new(framework,self, datastore['Proxies'])
|
||||
opt_hash = {
|
||||
auth_methods: ['publickey'],
|
||||
port: rport,
|
||||
key_data: [ key_data ],
|
||||
use_agent: false,
|
||||
config: false,
|
||||
proxy: factory,
|
||||
non_interactive: true
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:key_data => [ key_data ],
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
opt_hash.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
|
||||
begin
|
||||
|
|
|
@ -147,13 +147,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
def do_login(ip, user, pass, port)
|
||||
factory = ssh_socket_factory
|
||||
opt_hash = {
|
||||
auth_methods: ['password', 'keyboard-interactive'],
|
||||
port: port,
|
||||
use_agent: false,
|
||||
config: false,
|
||||
password: pass,
|
||||
proxy: factory,
|
||||
non_interactive: true
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => port,
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:password => pass,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
opt_hash[:verbose] = :debug if (datastore['SSH_DEBUG'])
|
||||
|
|
|
@ -101,13 +101,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
|
||||
factory = ssh_socket_factory
|
||||
opts = {
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => true,
|
||||
:key_data => key_data,
|
||||
:proxy => factory,
|
||||
:non_interactive => true
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => true,
|
||||
:key_data => key_data,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
opts
|
||||
|
@ -117,13 +118,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
print_status("#{rhost}:#{rport} - Attempting to login with '#{user}:#{pass}'")
|
||||
factory = ssh_socket_factory
|
||||
opts = {
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => true,
|
||||
:password => pass,
|
||||
:proxy => factory,
|
||||
:non_interactive => true
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => true,
|
||||
:password => pass,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
opts
|
||||
|
|
|
@ -186,7 +186,11 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
end
|
||||
|
||||
def init_ssh(user)
|
||||
opts = {:user=>user, :port=>rport}
|
||||
opts = {
|
||||
:user => user,
|
||||
:port => rport,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
options = Net::SSH::Config.for(rhost, Net::SSH::Config.default_files).merge(opts)
|
||||
transport = Net::SSH::Transport::Session.new(rhost, options)
|
||||
connection = Net::SSH::Connection::Session.new(transport, options)
|
||||
|
|
|
@ -80,12 +80,13 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
|
||||
def setup_ssh_options
|
||||
{
|
||||
password: rand_text_alpha(8),
|
||||
port: datastore['RPORT'],
|
||||
timeout: 1,
|
||||
proxies: datastore['Proxies'],
|
||||
key_data: OpenSSL::PKey::RSA.new(2048).to_pem,
|
||||
auth_methods: ['publickey']
|
||||
:password => rand_text_alpha(8),
|
||||
:port => datastore['RPORT'],
|
||||
:timeout => 1,
|
||||
:proxies => datastore['Proxies'],
|
||||
:key_data => OpenSSL::PKey::RSA.new(2048).to_pem,
|
||||
:auth_methods => ['publickey'],
|
||||
:verify_host_key => :never
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -202,7 +202,8 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
timeout: 1,
|
||||
proxy: factory,
|
||||
config: false,
|
||||
non_interactive: true
|
||||
non_interactive: true,
|
||||
verify_host_key: :never
|
||||
)
|
||||
|
||||
::Timeout.timeout(1) { ssh.close }
|
||||
|
|
Loading…
Reference in New Issue