Skip to content

Commit 6e3cc84

Browse files
committed
Add --stop-on-ntlm-auth switch to scan mode args
1 parent 28f3851 commit 6e3cc84

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

coercer/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def parseArgs():
5151
mode_scan_advanced_config.add_argument("--dce-port", default=135, type=int, help="DCERPC port (default: 135)")
5252
mode_scan_advanced_config.add_argument("--dce-ports", default=[], nargs='+', type=int, help="DCERPC ports")
5353
mode_scan_advanced_config.add_argument("--auth-type", default=None, type=str, help="Desired authentication type ('smb' or 'http').")
54+
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.")
5455
# Filters
5556
mode_scan_filters = mode_scan.add_argument_group("Filtering")
5657
mode_scan_filters.add_argument("--filter-method-name", default=[], action='append', type=str, help="")

coercer/core/modes/scan.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ def action_scan(target, available_methods, options, credentials, reporter):
145145
if result == TestResult.NCA_S_UNK_IF:
146146
stop_exploiting_this_function = True
147147

148+
if options.stop_on_ntlm_auth and result in [TestResult.SMB_AUTH_RECEIVED_NTLMv1, TestResult.SMB_AUTH_RECEIVED_NTLMv2]:
149+
print("[!] NTLM authentication received; moving on to next target")
150+
return None
151+
148152
if options.delay is not None:
149153
# Sleep between attempts
150154
time.sleep(options.delay)
@@ -213,6 +217,10 @@ def action_scan(target, available_methods, options, credentials, reporter):
213217
if result == TestResult.NCA_S_UNK_IF:
214218
stop_exploiting_this_function = True
215219

220+
if options.stop_on_ntlm_auth and result in [TestResult.SMB_AUTH_RECEIVED_NTLMv1, TestResult.SMB_AUTH_RECEIVED_NTLMv2]:
221+
print("[!] NTLM authentication received; moving on to next target")
222+
return None
223+
216224
if options.delay is not None:
217225
# Sleep between attempts
218226
time.sleep(options.delay)

0 commit comments

Comments
 (0)