Skip to content

Commit 24eba6b

Browse files
committed
Land rapid7#6956, Check presence in local admin group
2 parents 17f0a07 + 233186c commit 24eba6b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/post/windows/gather/win_privs.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def run
2929
usr_tbl = Rex::Ui::Text::Table.new(
3030
'Header' => 'Current User',
3131
'Indent' => 1,
32-
'Columns' => ['Is Admin', 'Is System', 'UAC Enabled', 'Foreground ID', 'UID']
32+
'Columns' => ['Is Admin', 'Is System', 'Is In Local Admin Group', 'UAC Enabled', 'Foreground ID', 'UID']
3333
)
3434

3535
privs_tbl = Rex::Ui::Text::Table.new(
@@ -39,10 +39,11 @@ def run
3939
)
4040

4141
# Gather data
42-
uac = is_uac_enabled? ? 'True' : 'False'
43-
admin = is_admin? ? 'True' : 'False'
44-
sys = is_system? ? 'True' : 'False'
45-
uid = client.sys.config.getuid.inspect
42+
uac = is_uac_enabled? ? 'True' : 'False'
43+
admin = is_admin? ? 'True' : 'False'
44+
admin_group = is_in_admin_group? ? 'True' : 'False'
45+
sys = is_system? ? 'True' : 'False'
46+
uid = client.sys.config.getuid.inspect
4647
begin
4748
# Older OS might not have this (min support is XP)
4849
fid = client.railgun.kernel32.WTSGetActiveConsoleSessionId["return"]
@@ -52,7 +53,7 @@ def run
5253
privs = client.sys.config.getprivs
5354

5455
# Store in tables
55-
usr_tbl << [admin, sys, uac, fid, uid]
56+
usr_tbl << [admin, sys, admin_group, uac, fid, uid]
5657
privs.each do |priv|
5758
privs_tbl << [priv]
5859
end

0 commit comments

Comments
 (0)