@@ -232,9 +232,11 @@ def main():
232232 reporter .print_info ("Scanning target %s" % target )
233233 # Checking credentials if any
234234 if not "msrpc" in options .filter_transport_name or try_login (credentials , target , verbose = options .verbose ):
235- # Starting action
236- action_coerce (target , available_methods , options , credentials , reporter )
237-
235+ try :
236+ # Starting action
237+ action_coerce (target , available_methods , options , credentials , reporter )
238+ except Exception as e :
239+ reporter .print_warn ("An unexpected error occurred: %s" % e )
238240 elif options .mode == "scan" :
239241 reporter .print_info ("Starting scan mode" )
240242 if credentials .is_anonymous ():
@@ -246,9 +248,11 @@ def main():
246248 reporter .print_info ("Scanning target %s" % target )
247249 # Checking credentials if any
248250 if not "msrpc" in options .filter_transport_name or try_login (credentials , target , verbose = options .verbose ):
249- # Starting action
250- action_scan (target , available_methods , options , credentials , reporter )
251-
251+ try :
252+ # Starting action
253+ action_scan (target , available_methods , options , credentials , reporter )
254+ except Exception as e :
255+ reporter .print_warn ("An unexpected error occurred: %s" % e )
252256 # Reporting results
253257 if options .export_json is not None :
254258 reporter .exportJSON (options .export_json )
@@ -268,9 +272,11 @@ def main():
268272 reporter .print_info ("Fuzzing target %s" % target )
269273 # Checking credentials if any
270274 if not "msrpc" in options .filter_transport_name or try_login (credentials , target , verbose = options .verbose ):
271- # Starting action
272- action_fuzz (target , available_methods , options , credentials , reporter )
273-
275+ try :
276+ # Starting action
277+ action_fuzz (target , available_methods , options , credentials , reporter )
278+ except Exception as e :
279+ reporter .print_warn ("An unexpected error occurred: %s" % e )
274280 # Reporting results
275281 if options .export_json is not None :
276282 reporter .exportJSON (options .export_json )
0 commit comments