Skip to content

Commit d1d8e3a

Browse files
committed
Let's not rescue everything.....
1 parent 6752770 commit d1d8e3a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/exploits/multi/ssh/sshexec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ def initialize
135135
def execute_command(cmd, opts = {})
136136
vprint_status("Executing #{cmd}")
137137
begin
138-
Timeout.timeout(3) do
138+
Timeout.timeout(5) do
139139
self.ssh_socket.exec!("#{cmd}\n")
140140
end
141-
rescue ::Exception
141+
rescue Timeout::Error
142+
print_error("SSH Timeout Exception will say the Exploit Failed; do not believe it.")
143+
print_good("You will likely still get a shell; run sessions -l to be sure.")
142144
end
143145
end
144146

@@ -175,7 +177,6 @@ def do_login(ip, user, pass, port)
175177
end
176178

177179
def exploit
178-
execute_command('uname -a')
179180
do_login(datastore['RHOST'], datastore['USERNAME'], datastore['PASSWORD'], datastore['RPORT'])
180181
print_status("#{datastore['RHOST']}:#{datastore['RPORT']} - Sending stager...")
181182
if target['Platform'] == 'python'

0 commit comments

Comments
 (0)