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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de5e151c011ad64beefd0ed9a2ac3211bf9fe9718657781af03b4ea4d7df661c
4
- data.tar.gz: 7ddaeb1f593e891ece932ebcb024b4d124eb388b50624927cb995f77045ea1ed
3
+ metadata.gz: 69a97cac39e77ee44665aa30e9b9d5d30fa490c1cbb0909cfeda49bce7ca1414
4
+ data.tar.gz: 3e76c09d2320265208f8a91c8bd93730d4d4698d1940b8a654d7ec553c008b6d
5
5
  SHA512:
6
- metadata.gz: 81f854e60466971c4f6c81d6a171bb0e7b9584513b7c0ff2edcf9820c82c809effef7a5e4e42958981408f56a559e8e736b2d8ec6df0fa3be75dca2816bce22c
7
- data.tar.gz: 74711958fdbbf6708e04a0a72660d7e32a8200fd2229e7a9be91c3394875510469210a104bfbd7b51d37ea8f0381ec049f8c53cf5a82fa381fff28794da95ca9
6
+ metadata.gz: 475846de509a2f145142566a729b7fa4bf1d67d0d993c2cff20edb2bf7418c64930136d5e34f8a05a717da610c3dc734d4b631cb66611d3725a173f53a6d3001
7
+ data.tar.gz: 355abe15808629534099238aad2fee65e4588573108aa4307aa6bc45b1addca4bc6422d48bb77b288945d8b33956be4503a842f74f8e14c0ecc283fcaa45ca9b
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1 @@
1
- NrpגQ[�����>�#����i�ʁ�'�@��e]��Z��f
2
- l�5�d��Gx��ˆ�Z)�Q�����I~e��g�W�e�B�I� ��ί3���r��&�tự
1
+ mV1�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
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Socket
3
- VERSION = "0.1.50"
3
+ VERSION = "0.1.52"
4
4
  end
5
5
  end
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
- ��v��<�+C��)I�y}x����'(��O;�,��X��:Aül��yI�טO�<��C���<�-�U���V���;�Tw O��Ƹo��ǒ��������2��s�Т��?$ҒR�byk�U|�9i�-���x�q�
2
- ֪��0�2Y��>��_����v貛P5�O�߹G�N9�F̝s���[<q{�� �E@α��Dw;`��s#���Y���F��|�$��4J�+����`ü- ٤]<���J\1m^e;��
1
+ +�Sl��N���ϱ`. e�� ,SmtmB��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�������ӓ(!-���WE��'�-�
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.50
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-05-02 00:00:00.000000000 Z
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