rex-socket 0.1.66 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rex/socket/comm/local.rb +16 -2
- data/lib/rex/socket/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d08e421781956b8e7f7cae6c731fb1589401f375774dbe51fde3dba15170ae3c
|
|
4
|
+
data.tar.gz: 646375e1d851896604d9b4b342bc1158fb0628b42a659fe58622551a66bb097d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 850daee218c584254d1eaf047ad3843b4fcaa648a83add08ae29c71c9142be59613239e6bf46c7c1996b3710bfb02b271320f62ff8d55b3f93c1a2073bd286a2
|
|
7
|
+
data.tar.gz: 3fc4e74930e01ff0a54a22b7f135e83e49693a053b397619b00b2e7ede551cfd4875946c00d46fa537508266c2c79ca68af5d87e0ce970a9e23b1d0e880e7a6d
|
|
@@ -264,7 +264,15 @@ class Rex::Socket::Comm::Local
|
|
|
264
264
|
sock.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_REUSEADDR, true)
|
|
265
265
|
end
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
if Rex::Socket.is_ip_addr?(param.localhost)
|
|
268
|
+
ip = param.localhost
|
|
269
|
+
elsif param.v6
|
|
270
|
+
ip = Rex::Socket.getaddresses(param.localhost, true).select { |address| Rex::Socket.is_ipv6?(address) }.sample
|
|
271
|
+
else
|
|
272
|
+
ip = Rex::Socket.getaddresses(param.localhost, false).select { |address| Rex::Socket.is_ipv4?(address) }.sample
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
sock.bind(Rex::Socket.to_sockaddr(ip, param.localport))
|
|
268
276
|
|
|
269
277
|
rescue ::Errno::EADDRNOTAVAIL,::Errno::EADDRINUSE
|
|
270
278
|
sock.close
|
|
@@ -343,7 +351,13 @@ class Rex::Socket::Comm::Local
|
|
|
343
351
|
ip = param.proxies.first.host
|
|
344
352
|
port = param.proxies.first.port
|
|
345
353
|
else
|
|
346
|
-
|
|
354
|
+
if Rex::Socket.is_ip_addr?(param.peerhost)
|
|
355
|
+
ip = param.peerhost
|
|
356
|
+
elsif param.v6
|
|
357
|
+
ip = Rex::Socket.getaddresses(param.peerhost, true).select { |address| Rex::Socket.is_ipv6?(address) }.sample
|
|
358
|
+
else
|
|
359
|
+
ip = Rex::Socket.getaddresses(param.peerhost, false).select { |address| Rex::Socket.is_ipv4?(address) }.sample
|
|
360
|
+
end
|
|
347
361
|
port = param.peerport
|
|
348
362
|
end
|
|
349
363
|
|
data/lib/rex/socket/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rex-socket
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.67
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Metasploit Hackers
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|