Skip to content

Commit a8d919f

Browse files
committed
use TARGET_URI if given, otherwise TARGET_URIS_FILE
1 parent 12e4e0e commit a8d919f

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

modules/auxiliary/scanner/http/ntlm_info_enumeration.rb

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,37 @@ def initialize
1919
resources which permit NTLM authentication, a blank NTLM type 1 message
2020
is sent to enumerate a a type 2 message from the target server. The type
2121
2 message is then parsed for information such as the Active Directory
22-
domain and NetBIOS name.
22+
domain and NetBIOS name. A single URI can be specified with TARGET_URI
23+
or a file or URIs can be specified with TARGET_URIS_FILE (default).
2324
},
2425
'Author' => 'Brandon Knight',
2526
'License' => MSF_LICENSE
2627
)
2728
register_options(
2829
[
29-
OptString.new('TARGET', [ true, "Target URI information", File.join(Msf::Config.data_directory, "wordlists", "http_owa_common.txt")]),
30-
OptEnum.new('TARGETTYPE', [ true, "Whether TARGET is a file of URIs or a single URI", 'FILE', %w{ FILE URI } ])
30+
OptString.new('TARGET_URI', [ false, "Single target URI", nil]),
31+
OptPath.new('TARGET_URIS_FILE', [ false, "Path to list of URIs to request", File.join(Msf::Config.data_directory, "wordlists", "http_owa_common.txt")]),
3132
], self.class)
3233
end
3334

3435
def run_host(ip)
35-
if datastore['TARGETTYPE'] == 'URI'
36-
test_path = normalize_uri(datastore['TARGET'])
36+
if datastore['TARGET_URI']
37+
test_path = normalize_uri(datastore['TARGET_URI'])
3738
result = check_url(test_path)
3839
handle_result(test_path, result) if result
3940
return
40-
end
41-
42-
File.open(datastore['TARGET'], 'rb').each_line do |line|
43-
test_uri = line.chomp
44-
test_path = normalize_uri(test_uri)
45-
result = check_url(test_path)
46-
if result
47-
handle_result(test_path, result)
48-
return
41+
elsif datastore['TARGET_URIS_FILE']
42+
File.open(datastore['TARGET_URIS_FILE'], 'rb').each_line do |line|
43+
test_uri = line.chomp
44+
test_path = normalize_uri(test_uri)
45+
result = check_url(test_path)
46+
if result
47+
handle_result(test_path, result)
48+
return
49+
end
4950
end
51+
else
52+
fail_with "Either TARGET_URI or TARGET_URIS_FILE must be specified."
5053
end
5154
end
5255

0 commit comments

Comments
 (0)