rex-socket 0.1.34 → 0.1.37

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: b7c47df3f39b889182acdf10979bdf50d435d605e79d9242549ed300de2298b9
4
- data.tar.gz: 23844c82242b552bdea184aa95b5c499766ab70e9f77cc9baaa73b7edea81cab
3
+ metadata.gz: f6fc1471d9de2717bcab7b4808f6011eab4f2a0e9bf9042cec9ce83ddf976d7e
4
+ data.tar.gz: 43a4ce0def2c26f141fc9b7025f0b1d413b20d8a8aa8d48206813091a8173e2e
5
5
  SHA512:
6
- metadata.gz: 91887057ffde34e4fd7a30b4148e4da3f3442d5e99f746e2d464515bf81ad7a459932a8c69879d83267dc06939abadad17c50fad21b42e026047f879a8869cc4
7
- data.tar.gz: aed583e93601c0ac04343844aad9b4304f5a848fb9c44405ddc8bc33cdeabbc2e8470a8f4c78fded2933a154e3aaf9b53f2c652e46471180349fd83c7d3b861c
6
+ metadata.gz: c83bd69270a612453bafd90d508135db979f840f0b3c2aba435e680f5f71b60ee51efeafcb31063b5d91b48b2aad1503446c5c028cd8de666ec2bc10c0768fc1
7
+ data.tar.gz: 8f0c03d1038b03a6d32b732674622e0db1acfe47d5b031055c0ab46164908f14b23e373271007996e456d04127dd1f4b8c0ed7f68aa6ade85b633d14a53e6230
checksums.yaml.gz.sig CHANGED
Binary file
@@ -17,10 +17,10 @@ jobs:
17
17
  fail-fast: true
18
18
  matrix:
19
19
  ruby:
20
- - 2.5
21
20
  - 2.6
22
21
  - 2.7
23
22
  - 3.0
23
+ - 3.1
24
24
  test_cmd:
25
25
  - bundle exec rspec
26
26
 
data/.gitignore CHANGED
@@ -8,4 +8,6 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  /.ruby-version
11
- /.ruby-gemset
11
+ /.ruby-gemset
12
+ # Rubymine project directory
13
+ .idea
@@ -1,5 +1,6 @@
1
1
  # -*- coding: binary -*-
2
2
  require 'singleton'
3
+ require 'rex/compat'
3
4
  require 'rex/socket'
4
5
  require 'rex/socket/tcp'
5
6
  require 'rex/socket/ssl_tcp'
@@ -49,6 +49,7 @@ class Rex::Socket::Parameters
49
49
  # keys can be specified.
50
50
  #
51
51
  # @option hash [String] 'PeerHost' The remote host to connect to
52
+ # @option hash [String] 'PeerHostname' The unresolved remote hostname, used to specify Server Name Indication (SNI)
52
53
  # @option hash [String] 'PeerAddr' (alias for 'PeerHost')
53
54
  # @option hash [Fixnum] 'PeerPort' The remote port to connect to
54
55
  # @option hash [String] 'LocalHost' The local host to communicate from, if any
@@ -84,6 +85,10 @@ class Rex::Socket::Parameters
84
85
  self.peerhost = hash['PeerAddr']
85
86
  end
86
87
 
88
+ if (hash['PeerHostname'])
89
+ self.peerhostname = hash['PeerHostname']
90
+ end
91
+
87
92
  if (hash['LocalHost'])
88
93
  self.localhost = hash['LocalHost']
89
94
  elsif (hash['LocalAddr'])
@@ -291,6 +296,11 @@ class Rex::Socket::Parameters
291
296
  # @return [String]
292
297
  attr_accessor :peerhost
293
298
 
299
+ # The remote hostname information, equivalent to the PeerHostname parameter hash
300
+ # key.
301
+ # @return [String]
302
+ attr_accessor :peerhostname
303
+
294
304
  # The remote port. Equivalent to the PeerPort parameter hash key.
295
305
  # @return [Fixnum]
296
306
  attr_writer :peerport
@@ -123,10 +123,14 @@ begin
123
123
  # Tie the context to a socket
124
124
  self.sslsock = OpenSSL::SSL::SSLSocket.new(self, self.sslctx)
125
125
 
126
- # If peerhost looks like a hostname, set the undocumented 'hostname'
126
+ # If peerhostname is set, or if hostname looks like a hostname, set the undocumented 'hostname'
127
127
  # attribute on sslsock, which enables the Server Name Indication (SNI)
128
128
  # extension
129
- self.sslsock.hostname = self.peerhost if !Rex::Socket.dotted_ip?(self.peerhost)
129
+ if self.peerhostname
130
+ self.sslsock.hostname = self.peerhostname
131
+ else !Rex::Socket.dotted_ip?(self.peerhost)
132
+ self.sslsock.hostname = self.peerhost
133
+ end
130
134
 
131
135
  # Force a negotiation timeout
132
136
  begin
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Socket
3
- VERSION = "0.1.34"
3
+ VERSION = "0.1.37"
4
4
  end
5
5
  end
data/lib/rex/socket.rb CHANGED
@@ -706,6 +706,7 @@ module Socket
706
706
  def initsock(params = nil)
707
707
  if (params)
708
708
  self.peerhost = params.peerhost
709
+ self.peerhostname = params.peerhostname
709
710
  self.peerport = params.peerport
710
711
  self.localhost = params.localhost
711
712
  self.localport = params.localport
@@ -785,6 +786,10 @@ module Socket
785
786
  #
786
787
  attr_reader :peerhost
787
788
  #
789
+ # The peer hostname of the connected socket.
790
+ #
791
+ attr_reader :peerhostname
792
+ #
788
793
  # The peer port of the connected socket.
789
794
  #
790
795
  attr_reader :peerport
@@ -809,7 +814,7 @@ module Socket
809
814
 
810
815
  protected
811
816
 
812
- attr_writer :peerhost, :peerport, :localhost, :localport # :nodoc:
817
+ attr_writer :peerhost, :peerhostname, :peerport, :localhost, :localport # :nodoc:
813
818
  attr_writer :context # :nodoc:
814
819
  attr_writer :ipv # :nodoc:
815
820
 
data.tar.gz.sig CHANGED
@@ -1 +1,3 @@
1
- ����?tP��rGL �fç�wx��F�5��c������w��R����"(�ot�b�ia_� �7b����� �P�]���ه՚f��‚�'�)�z����+ݺ8����~.G��sBr�5���&����k���� �V�)=�
1
+ �ޝgZ;��n���6�(H���y�!�XSXV\��4އ%�@.�Z
2
+ I� ���'2r�:T{�D�����U�)�
3
+ ^vΌ������;�@�����/lq�Ү
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.34
4
+ version: 0.1.37
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: 2021-10-28 00:00:00.000000000 Z
96
+ date: 2022-05-03 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: rake
metadata.gz.sig CHANGED
Binary file