7
7
require 'rex'
8
8
9
9
class Metasploit3 < Msf ::Post
10
-
11
- def initialize ( info = { } )
12
- super ( update_info ( info ,
13
- 'Name' => 'Windows Gather Enumerate Domain Group' ,
14
- 'Description' => %q{ This module extracts user accounts from specified group
15
- and stores the results in the loot. It will also verify if session
16
- account is in the group. Data is stored in loot in a format that
17
- is compatible with the token_hunter plugin. This module should be
18
- run over as session with domain credentials.} ,
19
- 'License' => MSF_LICENSE ,
20
- 'Author' =>
21
- [
22
- 'Carlos Perez <carlos_perez[at]darkoperator.com>' ,
23
- 'Stephen Haywood <haywoodsb[at]gmail.com>'
24
- ] ,
25
- 'Platform' => [ 'win' ] ,
26
- 'SessionTypes' => [ 'meterpreter' ]
27
- ) )
10
+ def initialize ( info = { } )
11
+ super ( update_info ( info ,
12
+ 'Name' => 'Windows Gather Enumerate Domain Group' ,
13
+ 'Description' => %q( This module extracts user accounts from specified group
14
+ and stores the results in the loot. It will also verify if session
15
+ account is in the group. Data is stored in loot in a format that
16
+ is compatible with the token_hunter plugin. This module should be
17
+ run over as session with domain credentials.) ,
18
+ 'License' => MSF_LICENSE ,
19
+ 'Author' =>
20
+ [
21
+ 'Carlos Perez <carlos_perez[at]darkoperator.com>' ,
22
+ 'Stephen Haywood <haywoodsb[at]gmail.com>'
23
+ ] ,
24
+ 'Platform' => [ 'win' ] ,
25
+ 'SessionTypes' => [ 'meterpreter' ]
26
+ ) )
28
27
register_options (
29
28
[
30
29
OptString . new ( 'GROUP' , [ true , 'Domain Group to enumerate' , nil ] )
@@ -47,7 +46,7 @@ def run
47
46
domain = get_env ( "USERDOMAIN" )
48
47
49
48
# Show results if we have any, Error if we don't
50
- if ! members . empty?
49
+ if !members . empty?
51
50
52
51
print_status ( "Found users in #{ datastore [ 'GROUP' ] } " )
53
52
@@ -59,9 +58,9 @@ def run
59
58
60
59
# Is our current user a member of this domain and group
61
60
if is_member ( cur_domain , cur_user , domain , members )
62
- print_status ( "Current sessions running as #{ cur_domain } \\ #{ cur_user } is a member of #{ datastore [ 'GROUP' ] } ! !" )
61
+ print_good ( "Current sessions running as #{ cur_domain } \\ #{ cur_user } is a member of #{ datastore [ 'GROUP' ] } !" )
63
62
else
64
- print_error ( "Current session running as #{ cur_domain } \\ #{ cur_user } is not a member of #{ datastore [ 'GROUP' ] } " )
63
+ print_status ( "Current session running as #{ cur_domain } \\ #{ cur_user } is not a member of #{ datastore [ 'GROUP' ] } " )
65
64
end
66
65
67
66
# Store the captured data in the loot.
@@ -70,7 +69,6 @@ def run
70
69
else
71
70
print_error ( "No members found for #{ datastore [ 'GROUP' ] } " )
72
71
end
73
-
74
72
end
75
73
76
74
def get_members ( results )
@@ -88,7 +86,7 @@ def get_members(results)
88
86
end
89
87
end
90
88
91
- return members
89
+ members
92
90
end
93
91
94
92
def is_member ( cur_dom , cur_user , dom , users )
0 commit comments