Skip to content

Commit 35e5354

Browse files
getsytem module: use ACTION instead of TECHNIQUE datastore option
1 parent f804a58 commit 35e5354

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

modules/post/windows/escalate/getsystem.rb

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
##
55

66
require 'metasm'
7+
require 'rex/post/meterpreter/ui/console/command_dispatcher/priv'
78

89
class MetasploitModule < Msf::Post
910
include Msf::Post::Windows::Priv
1011

1112
def initialize(info = {})
13+
techniques = Rex::Post::Meterpreter::Ui::Console::CommandDispatcher::Priv::Elevate::ELEVATE_TECHNIQUE_DESCRIPTION
1214
super(
1315
update_info(
1416
info,
@@ -28,13 +30,21 @@ def initialize(info = {})
2830
priv_elevate_getsystem
2931
]
3032
}
33+
},
34+
'Actions' => techniques.map.with_index {|t,i| [i.to_s, { 'Description' => t }]},
35+
'DefaultAction' => '0',
36+
'Notes' => {
37+
'AKA' => [
38+
'Named Pipe Impersonation',
39+
'Token Duplication',
40+
'RPCSS',
41+
'PrintSpooler',
42+
'EFSRPC',
43+
'EfsPotato'
44+
]
3145
}
3246
)
3347
)
34-
35-
register_options([
36-
OptInt.new('TECHNIQUE', [false, "Specify a particular technique to use (1-6), otherwise try them all", 0])
37-
])
3848
end
3949

4050
def unsupported
@@ -43,7 +53,7 @@ def unsupported
4353
end
4454

4555
def run
46-
technique = datastore['TECHNIQUE'].to_i
56+
technique = action.name.to_i
4757

4858
unsupported if client.platform != 'windows' || (client.arch != ARCH_X64 && client.arch != ARCH_X86)
4959

0 commit comments

Comments
 (0)