Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] Stop crashing if a connection times out #89

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading