rex-socket 0.1.50 → 0.1.52
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -2
- data/lib/rex/socket/comm/local.rb +3 -3
- data/lib/rex/socket/version.rb +1 -1
- data/lib/rex/socket.rb +27 -1
- data.tar.gz.sig +1 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69a97cac39e77ee44665aa30e9b9d5d30fa490c1cbb0909cfeda49bce7ca1414
|
4
|
+
data.tar.gz: 3e76c09d2320265208f8a91c8bd93730d4d4698d1940b8a654d7ec553c008b6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 475846de509a2f145142566a729b7fa4bf1d67d0d993c2cff20edb2bf7418c64930136d5e34f8a05a717da610c3dc734d4b631cb66611d3725a173f53a6d3001
|
7
|
+
data.tar.gz: 355abe15808629534099238aad2fee65e4588573108aa4307aa6bc45b1addca4bc6422d48bb77b288945d8b33956be4503a842f74f8e14c0ecc283fcaa45ca9b
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
l�5�d��Gx��ˆ�Z)�Q�����I~e��g�W�e�B�I� ��ί3���r��&�tự
|
1
|
+
m�V1�g����T�F��s�V��"��u�a
|
@@ -212,7 +212,7 @@ class Rex::Socket::Comm::Local
|
|
212
212
|
klass = Rex::Socket::SctpServer
|
213
213
|
else
|
214
214
|
raise Rex::BindFailed.new(param.localhost, param.localport), caller
|
215
|
-
end
|
215
|
+
end
|
216
216
|
sock.extend(klass)
|
217
217
|
|
218
218
|
sock.initsock(param)
|
@@ -447,7 +447,7 @@ class Rex::Socket::Comm::Local
|
|
447
447
|
end
|
448
448
|
when 'socks4'
|
449
449
|
supports_ipv6 = false
|
450
|
-
setup = [4,1,port.to_i].pack('CCn') + Socket.resolv_nbo(host, supports_ipv6) + Rex::Text.rand_text_alpha(rand(8)+1) + "\x00"
|
450
|
+
setup = [4,1,port.to_i].pack('CCn') + Rex::Socket.resolv_nbo(host, supports_ipv6) + Rex::Text.rand_text_alpha(rand(8)+1) + "\x00"
|
451
451
|
size = sock.put(setup)
|
452
452
|
if size != setup.length
|
453
453
|
raise Rex::ConnectionProxyError.new(host, port, type, "Failed to send the entire request to the proxy"), caller
|
@@ -478,7 +478,7 @@ class Rex::Socket::Comm::Local
|
|
478
478
|
|
479
479
|
if Rex::Socket.is_ipv4?(host)
|
480
480
|
accepts_ipv6 = false
|
481
|
-
addr = Rex::Socket.resolv_nbo(host)
|
481
|
+
addr = Rex::Socket.resolv_nbo(host, accepts_ipv6)
|
482
482
|
setup = [5,1,0,1].pack('C4') + addr + [port.to_i].pack('n')
|
483
483
|
elsif Rex::Socket.support_ipv6? && Rex::Socket.is_ipv6?(host)
|
484
484
|
# IPv6 stuff all untested
|
data/lib/rex/socket/version.rb
CHANGED
data/lib/rex/socket.rb
CHANGED
@@ -157,7 +157,33 @@ module Socket
|
|
157
157
|
(support_ipv6? && addr =~ MATCH_IPV6) || (addr =~ MATCH_IPV4)
|
158
158
|
end
|
159
159
|
|
160
|
-
#
|
160
|
+
# Checks to see if an address is an IPv6 address and if so, converts it into its
|
161
|
+
# square bracket format for addressing as noted in RFC 6874 which states that an IPv6
|
162
|
+
# address literal in a URL is always embedded between [ and ]. Please also refer to
|
163
|
+
# RFC5952, RFC3986, and RFC6874 for more info.
|
164
|
+
#
|
165
|
+
# RFC3986 section 3.2.2 specifically notes "A host identified by an Internet Protocol literal address, version 6
|
166
|
+
# [RFC3513] or later, is distinguished by enclosing the IP literal
|
167
|
+
# within square brackets ("[" and "]"). This is the only place where
|
168
|
+
# square bracket characters are allowed in the URI syntax."
|
169
|
+
#
|
170
|
+
# RFC6874 reinforces this in section 2 where it notes "In a URI, a literal IPv6 address
|
171
|
+
# is always embedded between '[' and ']'".
|
172
|
+
#
|
173
|
+
# @param host [String] IP address or hostname to convert to a URI authority.
|
174
|
+
# @param port [Integer] Port number to include within the URI authority.
|
175
|
+
# @return [String] Returns the URI authority string.
|
176
|
+
# @raise [ArgumentError] This function will raise an ArgumentError if the host parameter is not a String.
|
177
|
+
def self.to_authority(host, port=nil)
|
178
|
+
unless host.kind_of?(String)
|
179
|
+
raise ArgumentError.new("Expected a string for the host parameter!")
|
180
|
+
end
|
181
|
+
host = "[#{host}]" if is_ipv6?(host)
|
182
|
+
host += ":#{port}" if port
|
183
|
+
host
|
184
|
+
end
|
185
|
+
|
186
|
+
|
161
187
|
# Return true if +addr+ is within the ranges specified in RFC1918, or
|
162
188
|
# RFC5735/RFC3927
|
163
189
|
#
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
��
|
2
|
-
֪��0�2Y��>��_����v貛P5�O�߹G�N9�F̝s���[<q{���E@α��Dw;`��s#���Y���F��|�$��4J�+����`ü- ٤]<���J\1m^e;��
|
1
|
+
+�Sl��N���ϱ`.e�� ,Smt�mB��bvh����WQ�%�׆�����(y\�ԯ.��OW=�q���� �O刣�9�#�;���a%;(�����E!���dҨmZ��$�jI;0���G��|Z�$ID4��4|��s�|0�U�\5C�2 �����u�.���z���8��Q���Eڵ�_c1pjq�,%Z��vLI���ý�N�&�����DI�������ӓ(!-���W�E��'�-�
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.52
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Metasploit Hackers
|
@@ -93,7 +93,7 @@ cert_chain:
|
|
93
93
|
EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
|
94
94
|
9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
|
95
95
|
-----END CERTIFICATE-----
|
96
|
-
date: 2023-
|
96
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
97
97
|
dependencies:
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rake
|
metadata.gz.sig
CHANGED
Binary file
|