Skip to content

Commit b6b5295

Browse files
David MaloneyDavid Maloney
authored andcommitted
set ssh to non-interactive
have to set the non-interactive flag so that it does not prompt the user on an incorrect password MS-1688
1 parent 01d0d17 commit b6b5295

19 files changed

+44
-23
lines changed

lib/metasploit/framework/login_scanner/ssh.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ def attempt_login(credential)
5050
self.ssh_socket = nil
5151
factory = Rex::Socket::SSHFactory.new(framework,framework_module, proxies)
5252
opt_hash = {
53-
:port => port,
54-
:use_agent => false,
55-
:config => false,
56-
:verbose => verbosity,
57-
:proxy => factory
53+
:port => port,
54+
:use_agent => false,
55+
:config => false,
56+
:verbose => verbosity,
57+
:proxy => factory,
58+
:non_interactive => true
5859
}
5960
case credential.private_type
6061
when :password, nil

modules/auxiliary/gather/apache_karaf_command_execution.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ def do_login(user, pass, ip)
8181
:config => false,
8282
:password => pass,
8383
:record_auth_info => true,
84-
:proxy => factory
84+
:proxy => factory,
85+
:non_interactive => true
8586
}
8687

8788
opts.merge!(:verbose => :debug) if datastore['SSH_DEBUG']

modules/auxiliary/scanner/ssh/apache_karaf_command_execution.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def do_login(user, pass, ip)
7777
:config => false,
7878
:password => pass,
7979
:record_auth_info => true,
80-
:proxy => factory
80+
:proxy => factory,
81+
:non_interactive => true
8182
}
8283

8384
opts.merge!(:verbose => :debug) if datastore['SSH_DEBUG']

modules/auxiliary/scanner/ssh/fortinet_backdoor.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def run_host(ip)
4646
ssh_opts = {
4747
port: rport,
4848
auth_methods: ['fortinet-backdoor'],
49-
proxy: factory
49+
proxy: factory,
50+
:non_interactive => true
5051
}
5152

5253
ssh_opts.merge!(verbose: :debug) if datastore['SSH_DEBUG']

modules/auxiliary/scanner/ssh/juniper_backdoor.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def run_host(ip)
4747
port: rport,
4848
auth_methods: ['password', 'keyboard-interactive'],
4949
password: %q{<<< %s(un='%s') = %u},
50-
proxy: factory
50+
proxy: factory,
51+
:non_interactive => true
5152
}
5253

5354
ssh_opts.merge!(verbose: :debug) if datastore['SSH_DEBUG']

modules/auxiliary/scanner/ssh/ssh_enumusers.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def check_user(ip, user, port)
8686
:use_agent => false,
8787
:password => pass,
8888
:config => false,
89-
:proxy => factory
89+
:proxy => factory,
90+
:non_interactive => true
9091
}
9192

9293
opt_hash.merge!(:verbose => :debug) if datastore['SSH_DEBUG']

modules/auxiliary/scanner/ssh/ssh_identify_pubkeys.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ def do_login(ip, port, user)
214214
:skip_private_keys => true,
215215
:config =>false,
216216
:accepted_key_callback => Proc.new {|key| accepted << { :data => key_data, :key => key, :info => key_info } },
217-
:proxy => factory
217+
:proxy => factory,
218+
:non_interactive => true
218219
}
219220

220221
opt_hash.merge!(:verbose => :debug) if datastore['SSH_DEBUG']

modules/exploits/apple_ios/ssh/cydia_default_ssh.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def do_login(user, pass)
8282
:config => false,
8383
:password => pass,
8484
:record_auth_info => true,
85-
:proxy => factory
85+
:proxy => factory,
86+
:non_interactive => true
8687
}
8788

8889
opts.merge!(:verbose => :debug) if datastore['SSH_DEBUG']

modules/exploits/linux/ssh/ceragon_fibeair_known_privkey.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def do_login(user)
8282
:use_agent => false,
8383
:config => false,
8484
:record_auth_info => true,
85-
:proxy => factory
85+
:proxy => factory,
86+
:non_interactive => true
8687
}
8788
opt_hash.merge!(:verbose => :debug) if datastore['SSH_DEBUG']
8889
begin

modules/exploits/linux/ssh/exagrid_known_privkey.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def do_login(user)
8484
port: rport,
8585
proxy: factory,
8686
record_auth_info: true,
87+
non_interactive: true
8788
}
8889
ssh_options.merge!(verbose: :debug) if datastore['SSH_DEBUG']
8990

0 commit comments

Comments
 (0)