File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
modules/exploits/windows/smb Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -807,8 +807,18 @@ def initialize(info = {})
807
807
808
808
def exploit
809
809
810
- connect ( )
811
- smb_login ( )
810
+ begin
811
+ connect ( )
812
+ smb_login ( )
813
+ rescue Rex ::Proto ::SMB ::Exceptions ::LoginError => e
814
+ if ( e . message =~ /Connection reset/ )
815
+ print_error ( "Connection reset during login" )
816
+ print_error ( "This most likely means a previous exploit attempt caused the service to crash" )
817
+ return
818
+ else
819
+ raise e
820
+ end
821
+ end
812
822
813
823
# Use a copy of the target
814
824
mytarget = target
@@ -1052,6 +1062,14 @@ def check
1052
1062
rescue Rex ::ConnectionError => e
1053
1063
print_error ( "Connection failed: #{ e . class } : #{ e } " )
1054
1064
return
1065
+ rescue Rex ::Proto ::SMB ::Exceptions ::LoginError => e
1066
+ if ( e . message =~ /Connection reset/ )
1067
+ print_error ( "Connection reset during login" )
1068
+ print_error ( "This most likely means a previous exploit attempt caused the service to crash" )
1069
+ return Msf ::Exploit ::CheckCode ::Unknown
1070
+ else
1071
+ raise e
1072
+ end
1055
1073
end
1056
1074
1057
1075
#
You can’t perform that action at this time.
0 commit comments