@@ -11,7 +11,6 @@ class Metasploit3 < Msf::Post
11
11
include Msf ::Auxiliary ::Report
12
12
include Msf ::Post ::Windows ::LDAP
13
13
14
- SEARCH_FILTER = '(&(objectClass=organizationalPerson)(objectClass=user)(objectClass=person)(!(objectClass=computer)))'
15
14
DEFAULT_FIELDS = [
16
15
'sn' ,
17
16
'givenName' ,
@@ -34,12 +33,11 @@ class Metasploit3 < Msf::Post
34
33
35
34
def initialize ( info = { } )
36
35
super ( update_info ( info ,
37
- 'Name' => 'Windows Gather Words from Active Directory' ,
36
+ 'Name' => 'Windows Active Directory Wordlist Builder ' ,
38
37
'Description' => %q{
39
- This module will enumerate all user accounts in the default Active Domain (AD) directory
40
- and use these as words to seed a wordlist.In cases (like description) where spaces may
41
- occur, some extra processing is done to generate multiple words in addition to one long
42
- one (up to 24 characters). Results are dumped into /tmp
38
+ This module will gather information from the default Active Domain (AD) directory
39
+ and use these words to seed a wordlist. By default it enumerates user accounts to
40
+ build the wordlist
43
41
} ,
44
42
'License' => MSF_LICENSE ,
45
43
'Author' => [ 'Thomas Ring' ] ,
@@ -49,16 +47,17 @@ def initialize(info={})
49
47
50
48
register_options ( [
51
49
OptString . new ( 'FIELDS' , [ true , 'Fields to retrieve (ie, sn, givenName, displayName, description, comment)' , DEFAULT_FIELDS . join ( ',' ) ] ) ,
50
+ OptString . new ( 'FILTER' , [ true , 'Search filter.' , '(&(objectClass=organizationalPerson)(objectClass=user)(objectClass=person)(!(objectClass=computer)))' ] )
52
51
] , self . class )
53
52
end
54
53
55
54
def run
56
55
fields = datastore [ 'FIELDS' ] . gsub ( /\s +/ , '' ) . split ( ',' )
57
-
56
+ search_filter = datastore [ 'FILTER' ]
58
57
q = nil
59
58
60
59
begin
61
- q = query ( SEARCH_FILTER , datastore [ 'MAX_SEARCH' ] , fields )
60
+ q = query ( search_filter , datastore [ 'MAX_SEARCH' ] , fields )
62
61
rescue ::RuntimeError , ::Rex ::Post ::Meterpreter ::RequestError => e
63
62
# Can't bind or in a network w/ limited accounts
64
63
print_error ( e . message )
@@ -75,7 +74,6 @@ def run
75
74
end # q.each
76
75
77
76
# build array of words to output sorted on frequency
78
- output = [ ]
79
77
ordered_dict = @words_dict . sort_by { |k , v | v } . reverse
80
78
ordered_dict . collect! { |k , v | k }
81
79
0 commit comments