Skip to content

Commit

Permalink
Stop crashing if a connection times out (#89)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyle  Fleming <[email protected]>
  • Loading branch information
radman404 and Kylef0404 authored Dec 17, 2024
1 parent ce6b641 commit 1fd071d
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions coercer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,11 @@ def main():
reporter.print_info("Scanning target %s" % target)
# Checking credentials if any
if not "msrpc" in options.filter_transport_name or try_login(credentials, target, verbose=options.verbose):
# Starting action
action_coerce(target, available_methods, options, credentials, reporter)

try:
# Starting action
action_coerce(target, available_methods, options, credentials, reporter)
except Exception as e:
reporter.print_warn("An unexpected error occurred: %s" % e)
elif options.mode == "scan":
reporter.print_info("Starting scan mode")
if credentials.is_anonymous():
Expand All @@ -246,9 +248,11 @@ def main():
reporter.print_info("Scanning target %s" % target)
# Checking credentials if any
if not "msrpc" in options.filter_transport_name or try_login(credentials, target, verbose=options.verbose):
# Starting action
action_scan(target, available_methods, options, credentials, reporter)

try:
# Starting action
action_scan(target, available_methods, options, credentials, reporter)
except Exception as e:
reporter.print_warn("An unexpected error occurred: %s" % e)
# Reporting results
if options.export_json is not None:
reporter.exportJSON(options.export_json)
Expand All @@ -268,9 +272,11 @@ def main():
reporter.print_info("Fuzzing target %s" % target)
# Checking credentials if any
if not "msrpc" in options.filter_transport_name or try_login(credentials, target, verbose=options.verbose):
# Starting action
action_fuzz(target, available_methods, options, credentials, reporter)

try:
# Starting action
action_fuzz(target, available_methods, options, credentials, reporter)
except Exception as e:
reporter.print_warn("An unexpected error occurred: %s" % e)
# Reporting results
if options.export_json is not None:
reporter.exportJSON(options.export_json)
Expand Down

0 comments on commit 1fd071d

Please sign in to comment.