rex-socket 0.1.35 → 0.1.38
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 +0 -0
- data/.gitignore +3 -1
- data/lib/rex/socket/comm/local.rb +1 -0
- data/lib/rex/socket/parameters.rb +10 -0
- data/lib/rex/socket/range_walker.rb +2 -0
- data/lib/rex/socket/ssl_tcp.rb +6 -2
- data/lib/rex/socket/version.rb +1 -1
- data/lib/rex/socket.rb +6 -1
- data.tar.gz.sig +0 -0
- 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: 519832366ed76568c895e37e610c482576910f7b26dabf2bec2dbbe8c423f6b2
|
4
|
+
data.tar.gz: 0715e1a90fdb015fbcaa93787c5e29a4d764a81eeabe8f7aafa0995064e6e776
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed02cf31575b674a5615fbf88d612fe633a060c23d6edd86e38abecdb1aa940f25889001fe258cbaa50f373cf47fc48f8894de20d38fe0cb85284236d73d8009
|
7
|
+
data.tar.gz: b7231990271831b6151f8ca0abd4b735ebca9b37fdad9578a194d2c4376c1c6d498420b7f9aa91e298f7f932c1a4f946db5fdf70bc53f6b0f927cb3bd5afa27d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.gitignore
CHANGED
@@ -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
|
@@ -81,6 +81,8 @@ class RangeWalker
|
|
81
81
|
|
82
82
|
ranges = []
|
83
83
|
parseme.split(', ').map{ |a| a.split(' ') }.flatten.each do |arg|
|
84
|
+
# Remove trailing commas that may be unneeded, i.e. '1.1.1.1,'
|
85
|
+
arg = arg.sub(/,+$/, '')
|
84
86
|
|
85
87
|
# Handle IPv6 CIDR first
|
86
88
|
if arg.include?(':') && arg.include?('/')
|
data/lib/rex/socket/ssl_tcp.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
data/lib/rex/socket/version.rb
CHANGED
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
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.
|
4
|
+
version: 0.1.38
|
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: 2022-
|
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
|