Skip to content

Commit 74398c4

Browse files
committed
Allow using a single URI and/or a list of URIs
1 parent a8d919f commit 74398c4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

modules/auxiliary/scanner/http/ntlm_info_enumeration.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ def run_host(ip)
3636
if datastore['TARGET_URI']
3737
test_path = normalize_uri(datastore['TARGET_URI'])
3838
result = check_url(test_path)
39-
handle_result(test_path, result) if result
40-
return
41-
elsif datastore['TARGET_URIS_FILE']
39+
if result
40+
handle_result(test_path, result)
41+
return
42+
end
43+
end
44+
if datastore['TARGET_URIS_FILE'] and datastore['TARGET_URIS_FILE'].length > 0
4245
File.open(datastore['TARGET_URIS_FILE'], 'rb').each_line do |line|
4346
test_uri = line.chomp
4447
test_path = normalize_uri(test_uri)
@@ -48,8 +51,8 @@ def run_host(ip)
4851
return
4952
end
5053
end
51-
else
52-
fail_with "Either TARGET_URI or TARGET_URIS_FILE must be specified."
54+
elsif not datastore['TARGET_URI']
55+
fail_with(Failure::BadConfig, "Either TARGET_URI or TARGET_URIS_FILE must be specified.")
5356
end
5457
end
5558

0 commit comments

Comments
 (0)