Skip to content

Commit

Permalink
Merge pull request #1 from p0dalirius/master
Browse files Browse the repository at this point in the history
Stop crashing if a connection times out (p0dalirius#89)
  • Loading branch information
p0rtL6 authored Dec 20, 2024
2 parents ce6b641 + 1fd071d commit f78887e
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 f78887e

Please sign in to comment.