@@ -19,34 +19,37 @@ def initialize
19
19
resources which permit NTLM authentication, a blank NTLM type 1 message
20
20
is sent to enumerate a a type 2 message from the target server. The type
21
21
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).
23
24
} ,
24
25
'Author' => 'Brandon Knight' ,
25
26
'License' => MSF_LICENSE
26
27
)
27
28
register_options (
28
29
[
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" ) ] ) ,
31
32
] , self . class )
32
33
end
33
34
34
35
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 ' ] )
37
38
result = check_url ( test_path )
38
39
handle_result ( test_path , result ) if result
39
40
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
49
50
end
51
+ else
52
+ fail_with "Either TARGET_URI or TARGET_URIS_FILE must be specified."
50
53
end
51
54
end
52
55
0 commit comments