rex-socket 0.1.44 → 0.1.45

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: d3a7b1d87ee3cdaab06f938e188c8754be58acc8a3d4657809903c1506b5abb5
4
- data.tar.gz: 0a920c904aaceac647f5aeadededa5403015b30688860b1a5abc9d449a6272aa
3
+ metadata.gz: faf5e107e5cabee49fbd28a5007c63151719d74671e2ec97588f23a8bfeebb49
4
+ data.tar.gz: '04811e5e61dce894070fd82b9210052e24b6bc1c766a0c5497752d5b7ff0b6c2'
5
5
  SHA512:
6
- metadata.gz: 0df61fea9d1c6f6cfbc93652cd5dbdaf847bcbf190225c8e31d48b0efbb434f638527da433362e35fb449063e4fd80943deaf822500c11fec3195dca7c0cbeb6
7
- data.tar.gz: a3f579f19c40e9e8ff0c744b7a58c1aea4e3361846f6e31c891a53239a1b408bfb768d19c86adeac623392cc80621a0a0bdf45a016d303f530b87a66d479c29e
6
+ metadata.gz: 6aafffe07f0d89669c785c35b30fb6651c86ff46bf4bbad1f9612e08588b27c6842b74feb13c7816bc383553342fa9e951f52d10e20141e534dbb8e31ea7b8cb
7
+ data.tar.gz: b8a1683cbb979abb898c3264030b3e20d0590190da1970cb717230060c9c4c1ac99d6a29052c17a07fd229edacdc192caa7a4e2209aa8018799084491360c7fd
checksums.yaml.gz.sig CHANGED
Binary file
@@ -433,7 +433,8 @@ class Rex::Socket::Comm::Local
433
433
  raise Rex::ConnectionProxyError.new(host, port, type, "The proxy returned a non-OK response"), caller
434
434
  end
435
435
  when 'socks4'
436
- setup = [4,1,port.to_i].pack('CCn') + Socket.gethostbyname(host)[3] + Rex::Text.rand_text_alpha(rand(8)+1) + "\x00"
436
+ supports_ipv6 = false
437
+ setup = [4,1,port.to_i].pack('CCn') + Socket.resolv_nbo(host, supports_ipv6) + Rex::Text.rand_text_alpha(rand(8)+1) + "\x00"
437
438
  size = sock.put(setup)
438
439
  if size != setup.length
439
440
  raise Rex::ConnectionProxyError.new(host, port, type, "Failed to send the entire request to the proxy"), caller
@@ -463,11 +464,13 @@ class Rex::Socket::Comm::Local
463
464
  end
464
465
 
465
466
  if Rex::Socket.is_ipv4?(host)
466
- addr = Rex::Socket.gethostbyname(host)[3]
467
+ accepts_ipv6 = false
468
+ addr = Rex::Socket.resolv_nbo(host)
467
469
  setup = [5,1,0,1].pack('C4') + addr + [port.to_i].pack('n')
468
470
  elsif Rex::Socket.support_ipv6? && Rex::Socket.is_ipv6?(host)
469
471
  # IPv6 stuff all untested
470
- addr = Rex::Socket.gethostbyname(host)[3]
472
+ accepts_ipv6 = true
473
+ addr = Rex::Socket.resolv_nbo(host, accepts_ipv6)
471
474
  setup = [5,1,0,4].pack('C4') + addr + [port.to_i].pack('n')
472
475
  else
473
476
  # Then it must be a domain name.
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Socket
3
- VERSION = "0.1.44"
3
+ VERSION = "0.1.45"
4
4
  end
5
5
  end
data/lib/rex/socket.rb CHANGED
@@ -211,7 +211,7 @@ module Socket
211
211
  #
212
212
  # @deprecated Please use {#getaddress}, {#resolv_nbo}, or similar instead.
213
213
  def self.gethostbyname(host)
214
- warn "NOTE: #{self}.#{__method__} is deprecated, use getaddress, resolve_nbo, or similar instead. It will be removed in the next Major version"
214
+ warn "NOTE: #{self}.#{__method__} is deprecated, use getaddress, resolv_nbo, or similar instead. It will be removed in the next Major version"
215
215
  if is_ipv4?(host)
216
216
  return [ host, [], 2, host.split('.').map{ |c| c.to_i }.pack("C4") ]
217
217
  end
data.tar.gz.sig CHANGED
Binary file
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.44
4
+ version: 0.1.45
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-01-10 00:00:00.000000000 Z
96
+ date: 2023-01-13 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file