rex-socket 0.1.55 → 0.1.56
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/lib/rex/socket/version.rb +1 -1
- data/lib/rex/socket.rb +16 -4
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: 93a2eeaa43fcd931469e95e513127b480a2ba55dd7f8ada8986b076191c22ad9
|
4
|
+
data.tar.gz: '09dc66492bfdddd8227b015c51ba5f41b3bf263001f1564cf4ae2ef75b80b2f8'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e614ceccfda078dbdf7cf75e68c79f47b8a663752cfe84e49909b4b1c1545284a98fc22b1003181fcb773da5785bfb5fbaf79beb6c292caa0b38153399217592
|
7
|
+
data.tar.gz: 44b09208c1de7dfdfb93d1b6b44426466a229434ba7c1c9412e28847e1c00a1896b9e80da8c62ec6bff8f349f591faee37a6e2e93535c5110441989fc5c78094
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/rex/socket/version.rb
CHANGED
data/lib/rex/socket.rb
CHANGED
@@ -84,6 +84,9 @@ module Socket
|
|
84
84
|
# Common Regular Expressions
|
85
85
|
#
|
86
86
|
|
87
|
+
# see: https://debugpointer.com/regex/regex-for-dns-name
|
88
|
+
MATCH_DNS_NAME = /^(((?!-))(xn--)?([a-z0-9][a-z0-9\-]{0,59})?[a-z0-9]\.)*(xn--)?([a-z0-9\-]{1,61}|[a-z0-9-]{1,30}\.[a-z]{2,})$/i
|
89
|
+
|
87
90
|
MATCH_IPV6 = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25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[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2}))\s*$/
|
@@ -125,24 +128,33 @@ module Socket
|
|
125
128
|
# Cache our resolver
|
126
129
|
@@resolver = nil
|
127
130
|
|
131
|
+
#
|
132
|
+
# Determine whether this is a valid DNS name without trying to resolve it
|
133
|
+
#
|
134
|
+
def self.is_name?(name)
|
135
|
+
return false if name.length > 253
|
136
|
+
name =~ MATCH_DNS_NAME ? (name =~ /\s/).nil? : false
|
137
|
+
end
|
138
|
+
|
139
|
+
#
|
128
140
|
# Determine whether this is an IPv4 address
|
129
141
|
#
|
130
142
|
def self.is_ipv4?(addr)
|
131
|
-
addr =~ MATCH_IPV4 ?
|
143
|
+
addr =~ MATCH_IPV4 ? (addr =~ /\s/).nil? : false
|
132
144
|
end
|
133
145
|
|
134
146
|
#
|
135
147
|
# Determine whether this is an IPv6 address
|
136
148
|
#
|
137
149
|
def self.is_ipv6?(addr)
|
138
|
-
addr =~ MATCH_IPV6 ?
|
150
|
+
addr =~ MATCH_IPV6 ? (addr =~ /\s/).nil? : false
|
139
151
|
end
|
140
152
|
|
141
153
|
#
|
142
154
|
# Determine whether this is a MAC address
|
143
155
|
#
|
144
156
|
def self.is_mac_addr?(addr)
|
145
|
-
|
157
|
+
addr =~ MATCH_MAC_ADDR ? (addr =~ /\s/).nil? : false
|
146
158
|
end
|
147
159
|
|
148
160
|
#
|
@@ -157,7 +169,7 @@ module Socket
|
|
157
169
|
# Checks to see if the supplied address is in "dotted" form
|
158
170
|
#
|
159
171
|
def self.dotted_ip?(addr)
|
160
|
-
(support_ipv6? && addr
|
172
|
+
(support_ipv6? && self.is_ipv6?(addr)) || self.is_ipv4?(addr)
|
161
173
|
end
|
162
174
|
|
163
175
|
# Checks to see if an address is an IPv6 address and if so, converts it into its
|
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.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Metasploit Hackers
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
DgscAao7wB3xW2BWEp1KnaDWkf1x9ttgoBEYyuYwU7uatB67kBQG1PKvLt79wHvz
|
35
35
|
Dxs+KOjGbBRfMnPgVGYkORKVrZIwlaboHbDKxcVW5xv+oZc7KYXWGg==
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date:
|
37
|
+
date: 2024-02-14 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: rake
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
|
-
rubygems_version: 3.
|
140
|
+
rubygems_version: 3.4.10
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: The Ruby Exploitation (Rex) Socket Abstraction Library.
|
metadata.gz.sig
CHANGED
Binary file
|