File tree Expand file tree Collapse file tree 2 files changed +10
-28
lines changed
lib/msf/core/payload/windows Expand file tree Collapse file tree 2 files changed +10
-28
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ module Msf
13
13
14
14
module Payload ::Windows ::MigrateNamedPipe
15
15
16
- include Msf ::Payload ::Windows
17
- include Msf ::Payload ::Windows ::BlockApi
16
+ include Msf ::Payload ::Windows ::MigrateCommon
18
17
19
18
def initialize ( info = { } )
20
19
super ( update_info ( info ,
@@ -30,23 +29,15 @@ def initialize(info={})
30
29
#
31
30
# Constructs the payload
32
31
#
33
- def generate
32
+ def generate_migrate ( opts = { } )
34
33
%Q^
35
- migrate:
36
- cld
37
- pop esi
38
- pop esi ; esi now contains a pointer to the migrate context
39
- sub esp, 0x2000
40
- call start
41
- #{ asm_block_api }
42
- start:
43
- pop ebp
34
+ start_migrate_pipe:
44
35
mov edi, [esi+16] ; The duplicated pipe handle is in the migrate context.
45
- signal_event :
36
+ signal_pipe_event :
46
37
push dword [esi] ; Event handle is pointed at by esi
47
38
push #{ Rex ::Text . block_api_hash ( 'kernel32.dll' , 'SetEvent' ) }
48
39
call ebp ; SetEvent(handle)
49
- call_payload :
40
+ call_pipe_payload :
50
41
call dword [esi+8] ; call the associated payload
51
42
^
52
43
end
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ module Msf
13
13
14
14
module Payload ::Windows ::MigrateNamedPipe_x64
15
15
16
- include Msf ::Payload ::Windows
17
- include Msf ::Payload ::Windows ::BlockApi_x64
16
+ include Msf ::Payload ::Windows ::MigrateCommon_x64
18
17
19
18
def initialize ( info = { } )
20
19
super ( update_info ( info ,
@@ -30,23 +29,15 @@ def initialize(info={})
30
29
#
31
30
# Constructs the payload
32
31
#
33
- def generate
32
+ def generate_migrate ( opts = { } )
34
33
%Q^
35
- migrate:
36
- cld
37
- mov rsi, rcx
38
- sub rsp, 0x2000
39
- and rsp, ~0xF
40
- call start
41
- #{ asm_block_api }
42
- start:
43
- pop rbp
34
+ start_migrate_pipe:
44
35
mov rdi, qword [rsi+16] ; The duplicated pipe handle is in the migrate context.
45
- signal_event :
36
+ signal_pipe_event :
46
37
mov rcx, qword [rsi] ; Event handle is pointed at by rsi
47
38
mov r10d, #{ Rex ::Text . block_api_hash ( 'kernel32.dll' , 'SetEvent' ) }
48
39
call rbp ; SetEvent(handle)
49
- call_payload :
40
+ call_pipe_payload :
50
41
call qword [rsi+8] ; call the associated payload
51
42
^
52
43
end
You can’t perform that action at this time.
0 commit comments