File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
modules/exploits/linux/ssh Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff 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' )
You can’t perform that action at this time.
0 commit comments