Skip to content

Commit

Permalink
Add --stop-on-ntlm-auth switch to scan mode args
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianVollmer committed Jun 25, 2024
1 parent 28f3851 commit 6e3cc84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions coercer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def parseArgs():
mode_scan_advanced_config.add_argument("--dce-port", default=135, type=int, help="DCERPC port (default: 135)")
mode_scan_advanced_config.add_argument("--dce-ports", default=[], nargs='+', type=int, help="DCERPC ports")
mode_scan_advanced_config.add_argument("--auth-type", default=None, type=str, help="Desired authentication type ('smb' or 'http').")
mode_scan_advanced_config.add_argument("--stop-on-ntlm-auth", default=False, action="store_true", help="Move on to next target on successful NTLM authentication.")
# Filters
mode_scan_filters = mode_scan.add_argument_group("Filtering")
mode_scan_filters.add_argument("--filter-method-name", default=[], action='append', type=str, help="")
Expand Down
8 changes: 8 additions & 0 deletions coercer/core/modes/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def action_scan(target, available_methods, options, credentials, reporter):
if result == TestResult.NCA_S_UNK_IF:
stop_exploiting_this_function = True

if options.stop_on_ntlm_auth and result in [TestResult.SMB_AUTH_RECEIVED_NTLMv1, TestResult.SMB_AUTH_RECEIVED_NTLMv2]:
print("[!] NTLM authentication received; moving on to next target")
return None

if options.delay is not None:
# Sleep between attempts
time.sleep(options.delay)
Expand Down Expand Up @@ -213,6 +217,10 @@ def action_scan(target, available_methods, options, credentials, reporter):
if result == TestResult.NCA_S_UNK_IF:
stop_exploiting_this_function = True

if options.stop_on_ntlm_auth and result in [TestResult.SMB_AUTH_RECEIVED_NTLMv1, TestResult.SMB_AUTH_RECEIVED_NTLMv2]:
print("[!] NTLM authentication received; moving on to next target")
return None

if options.delay is not None:
# Sleep between attempts
time.sleep(options.delay)
Expand Down

0 comments on commit 6e3cc84

Please sign in to comment.