Skip to content

Commit 028f9dd

Browse files
committed
Tidy and rubocop
1 parent e9dc93f commit 028f9dd

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

modules/post/windows/gather/enum_domain_group_users.rb

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,23 @@
77
require 'rex'
88

99
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+
))
2827
register_options(
2928
[
3029
OptString.new('GROUP', [true, 'Domain Group to enumerate', nil])
@@ -47,7 +46,7 @@ def run
4746
domain = get_env("USERDOMAIN")
4847

4948
# Show results if we have any, Error if we don't
50-
if ! members.empty?
49+
if !members.empty?
5150

5251
print_status("Found users in #{datastore['GROUP']}")
5352

@@ -59,9 +58,9 @@ def run
5958

6059
# Is our current user a member of this domain and group
6160
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']}!")
6362
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']}")
6564
end
6665

6766
# Store the captured data in the loot.
@@ -70,7 +69,6 @@ def run
7069
else
7170
print_error("No members found for #{datastore['GROUP']}")
7271
end
73-
7472
end
7573

7674
def get_members(results)
@@ -88,7 +86,7 @@ def get_members(results)
8886
end
8987
end
9088

91-
return members
89+
members
9290
end
9391

9492
def is_member(cur_dom, cur_user, dom, users)

0 commit comments

Comments
 (0)