Make style consistent
parent
45e0b53fc8
commit
60c0272270
|
@ -48,15 +48,15 @@ class MetasploitModule < Msf::Auxiliary
|
|||
factory = ssh_socket_factory
|
||||
|
||||
ssh_opts = {
|
||||
:port => rport,
|
||||
port: rport,
|
||||
# The auth method is converted into a class name for instantiation,
|
||||
# so fortinet-backdoor here becomes FortinetBackdoor from the mixin
|
||||
:auth_methods => ['fortinet-backdoor'],
|
||||
:non_interactive => true,
|
||||
:config => false,
|
||||
:use_agent => false,
|
||||
:proxy => factory,
|
||||
:verify_host_key => :never
|
||||
auth_methods: ['fortinet-backdoor'],
|
||||
non_interactive: true,
|
||||
config: false,
|
||||
use_agent: false,
|
||||
verify_host_key: :never,
|
||||
proxy: factory
|
||||
}
|
||||
|
||||
ssh_opts.merge!(verbose: :debug) if datastore['SSH_DEBUG']
|
||||
|
|
|
@ -80,12 +80,12 @@ class MetasploitModule < Msf::Auxiliary
|
|||
pass = Rex::Text.rand_text_alphanumeric(64_000)
|
||||
factory = ssh_socket_factory
|
||||
opt_hash = {
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => port,
|
||||
:use_agent => false,
|
||||
:password => pass,
|
||||
:config => false,
|
||||
:proxy => factory,
|
||||
:auth_methods => ['password', 'keyboard-interactive'],
|
||||
:port => port,
|
||||
:use_agent => false,
|
||||
:password => pass,
|
||||
:config => false,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
|
|
@ -74,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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']
|
||||
|
||||
|
|
|
@ -74,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,14 +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,
|
||||
:verify_host_key => :never
|
||||
port: datastore['SSH_PORT'],
|
||||
auth_methods: %w{publickey password},
|
||||
key_data: [private_key],
|
||||
non_interactive: true,
|
||||
config: false,
|
||||
use_agent: false,
|
||||
verify_host_key: :never,
|
||||
proxy: factory
|
||||
}
|
||||
|
||||
ssh_opts.merge!(verbose: :debug) if datastore['SSH_DEBUG']
|
||||
|
|
|
@ -70,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,14 +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,
|
||||
:verify_host_key => :never
|
||||
:auth_methods => ['publickey'],
|
||||
:port => rport,
|
||||
:use_agent => false,
|
||||
:config => true,
|
||||
:key_data => key_data,
|
||||
:proxy => factory,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
||||
opts
|
||||
|
@ -118,14 +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,
|
||||
:verify_host_key => :never
|
||||
: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,10 +186,10 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
end
|
||||
|
||||
def init_ssh(user)
|
||||
opts = {
|
||||
:user => user,
|
||||
:port => rport,
|
||||
:verify_host_key => :never
|
||||
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)
|
||||
|
|
|
@ -80,13 +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'],
|
||||
:verify_host_key => :never
|
||||
: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
|
||||
|
||||
|
|
|
@ -138,13 +138,13 @@ RSpec.describe Metasploit::Framework::LoginScanner::SSH do
|
|||
it 'calls Net::SSH with the correct arguments' do
|
||||
factory = Rex::Socket::SSHFactory.new(nil,nil,nil)
|
||||
opt_hash = {
|
||||
:port => ssh_scanner.port,
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:verbose => ssh_scanner.verbosity,
|
||||
:proxy => factory,
|
||||
:auth_methods => ['password','keyboard-interactive'],
|
||||
:password => private,
|
||||
:port => ssh_scanner.port,
|
||||
:use_agent => false,
|
||||
:config => false,
|
||||
:verbose => ssh_scanner.verbosity,
|
||||
:proxy => factory,
|
||||
:auth_methods => ['password','keyboard-interactive'],
|
||||
:password => private,
|
||||
:non_interactive => true,
|
||||
:verify_host_key => :never
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue