rex-socket 0.1.44 → 0.1.46

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: d0b0474613c0bf2b204e3ebfc5f50b29b72ea6af1f98a4bd3e125d86a97aa295
4
+ data.tar.gz: c01ea0331c2640f4283cbfa08baec9e44e216045e175a0a2ff5737a5483766ff
5
5
  SHA512:
6
- metadata.gz: 0df61fea9d1c6f6cfbc93652cd5dbdaf847bcbf190225c8e31d48b0efbb434f638527da433362e35fb449063e4fd80943deaf822500c11fec3195dca7c0cbeb6
7
- data.tar.gz: a3f579f19c40e9e8ff0c744b7a58c1aea4e3361846f6e31c891a53239a1b408bfb768d19c86adeac623392cc80621a0a0bdf45a016d303f530b87a66d479c29e
6
+ metadata.gz: 7b71fa7bbec1a4e63d95518939742d3f1f8ee8114ee772efcce477953bfa6fce3405c0f9ed6c8818aeaca296072c4034e69e236f5eb5b10f39124e8ab21482b2
7
+ data.tar.gz: b0b74b486a3416aca4c9cfdd974b670f62dfa51ca7d55a28fae7c56265129f0f9bf71a75a57f800aca4e83550b5b076e2e565c791e52a256fc2745246f6d1e85
checksums.yaml.gz.sig CHANGED
Binary file
@@ -33,15 +33,16 @@ jobs:
33
33
  fail-fast: true
34
34
  matrix:
35
35
  ruby:
36
- - 2.7
37
- - 3.0
38
- - 3.1
36
+ - '2.7'
37
+ - '3.0'
38
+ - '3.1'
39
+ - '3.2'
39
40
  os:
40
41
  - ubuntu-20.04
41
42
  - ubuntu-latest
42
43
  exclude:
43
- - { os: ubuntu-latest, ruby: 2.7 }
44
- - { os: ubuntu-latest, ruby: 3.0 }
44
+ - { os: ubuntu-latest, ruby: '2.7' }
45
+ - { os: ubuntu-latest, ruby: '3.0' }
45
46
  test_cmd:
46
47
  - bundle exec rspec
47
48
 
@@ -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.46"
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.46
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-31 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file