Skip to content

Commit 16a9450

Browse files
peregrinoperegrino
authored andcommitted
session.tunnel_peer changed by session.session_host. Other minor changes
1 parent 78733fc commit 16a9450

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/post/windows/recon/outbound_ports.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ def icmp_setup
5050
return nil
5151
end
5252
vprint_status("ICMP raw socket created successfully")
53-
sockaddr = Rex::Socket.to_sockaddr(session.tunnel_peer.partition(':')[0], 0)
53+
54+
sockaddr = Rex::Socket.to_sockaddr(session.session_host, 0)
5455
r = client.railgun.ws2_32.bind(handler['return'],sockaddr,16)
5556
if r['GetLastError'] != 0
56-
print_error("There was an error binding the ICMP socket; GetLastError: #{r['GetLastError']}")
57+
print_error("There was an error binding the ICMP socket to #{session.session_host}; GetLastError: #{r['GetLastError']}")
5758
return nil
5859
end
60+
vprint_status("ICMP socket successfully bound to #{session.session_host}")
5961

6062
# int WSAIoctl(
6163
# _In_ SOCKET s,
@@ -86,6 +88,9 @@ def tcp_setup(ttl)
8688
end
8789
vprint_status("TCP socket created successfully")
8890

91+
# 0x8004667E = FIONBIO
92+
# Enable non-blocking mode when *argp (third parameter in ioctlsocket) is set to a nonzero value
93+
8994
cmd = 0x8004667E
9095
r = client.railgun.ws2_32.ioctlsocket(handler['return'], cmd, 1)
9196
if r['GetLastError'] != 0

0 commit comments

Comments
 (0)