Skip to content

Commit e39b7fd

Browse files
committed
Land rapid7#9011, revert changes that hung getsystem/getprivs
2 parents 579342c + 3068fb6 commit e39b7fd

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

lib/rex/post/meterpreter/extensions/stdapi/sys/config.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@ def getprivs
170170
ret = []
171171
res = client.send_request(req)
172172
res.each(TLV_TYPE_PRIVILEGE) do |p|
173-
ret << {
174-
priv: p.get_tlv_value(TLV_TYPE_PRIVILEGE_NAME),
175-
enabled: p.get_tlv_value(TLV_TYPE_PRIVILEGE_ENABLED),
176-
}
173+
ret << p.value
177174
end
178175
ret
179176
end

lib/rex/post/meterpreter/extensions/stdapi/tlv.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ module Stdapi
1616
TLV_TYPE_INHERIT = TLV_META_TYPE_BOOL | 601
1717
TLV_TYPE_PROCESS_HANDLE = TLV_META_TYPE_QWORD | 630
1818
TLV_TYPE_THREAD_HANDLE = TLV_META_TYPE_QWORD | 631
19-
TLV_TYPE_PRIVILEGE = TLV_META_TYPE_GROUP | 632
20-
TLV_TYPE_PRIVILEGE_NAME = TLV_META_TYPE_STRING | 633
21-
TLV_TYPE_PRIVILEGE_ENABLED = TLV_META_TYPE_BOOL | 634
19+
TLV_TYPE_PRIVILEGE = TLV_META_TYPE_STRING | 632
2220

2321
##
2422
#

lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,12 +899,12 @@ def cmd_getprivs(*args)
899899
'Header' => 'Enabled Process Privileges',
900900
'Indent' => 0,
901901
'SortIndex' => 1,
902-
'Columns' => ['Priv Name', 'Enabled']
902+
'Columns' => ['Name']
903903
)
904904

905905
privs = client.sys.config.getprivs
906906
client.sys.config.getprivs.each do |priv|
907-
table << [priv[:priv], priv[:enabled].to_s]
907+
table << [priv]
908908
end
909909

910910
print_line

0 commit comments

Comments
 (0)