Skip to content

Commit f22d719

Browse files
committed
Test fix for rapid7#4305
1 parent d8b1401 commit f22d719

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/msf/core/exploit/capture.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,11 @@ def probe_gateway(addr)
309309
secret = "#{preamble}#{Rex::Text.rand_text(rand(0xff)+1)}"
310310

311311
begin
312-
UDPSocket.open.send(secret, 0, dst_host, dst_port)
312+
UDPSocket.open do |sock|
313+
sock.setsockopt(::Socket::IPPROTO_IP, ::Socket::IP_TTL, 1)
314+
sock.send(secret, 0, dst_host, dst_port)
315+
end
316+
#UDPSocket.open.send(secret, 0, dst_host, dst_port)
313317
rescue Errno::ENETUNREACH
314318
# This happens on networks with no gatway. We'll need to use a
315319
# fake source hardware address.

0 commit comments

Comments
 (0)