We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e70402a commit 870669bCopy full SHA for 870669b
modules/post/windows/escalate/getsystem.rb
@@ -39,7 +39,7 @@ def unsupported
39
40
def run
41
42
- tech = datastore['TECHNIQUE'].to_i
+ technique = datastore['TECHNIQUE'].to_i
43
44
unsupported if client.platform !~ /win32|win64/i
45
@@ -48,11 +48,11 @@ def run
48
return
49
end
50
51
- result = client.priv.getsystem( tech )
52
- if result and result[0]
53
- print_good( "Obtained SYSTEM via technique #{result[1]}" )
54
- else
55
- print_error( "Failed to obtain SYSTEM access" )
+ begin
+ result = client.priv.getsystem(technique)
+ print_good("Obtained SYSTEM via technique #{result[1]}")
+ rescue Rex::Post::Meterpreter::RequestError => e
+ print_error("Failed to obtain SYSTEM access")
56
57
58
0 commit comments