rex-core 0.1.16 → 0.1.17
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.tar.gz.sig +0 -0
- data/lib/rex/core/version.rb +1 -1
- data/lib/rex/exceptions.rb +31 -18
- 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: cc3a037b0e2014526adcb218da1f7519b84c59ed81457e63d3d4bfe8632b7d32
|
4
|
+
data.tar.gz: ac2a430d2978df81f3671123d1c192430098ab4f2b3833a26489bcbe2f6e7db9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0adeeff27a4a9dee8092466387624a60ff991789b419e15c667c9f0b2a94a3c8f64e836ee967182dd78834e46722c42fbb2e8cf0c1af5a2210b9bacc136da9e2
|
7
|
+
data.tar.gz: 308daa85d93b917ce3dbb7fc5445087269899c437baaa96ce0082901ee54de94e6e5b7016cd3cfaf4914716b0fd8bddc331c439d2cf5c9d6999572215bddfa1c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rex/core/version.rb
CHANGED
data/lib/rex/exceptions.rb
CHANGED
@@ -145,9 +145,10 @@ end
|
|
145
145
|
#
|
146
146
|
###
|
147
147
|
module HostCommunicationError
|
148
|
-
def initialize(addr = nil, port = nil)
|
149
|
-
|
150
|
-
|
148
|
+
def initialize(addr = nil, port = nil, reason: nil)
|
149
|
+
@host = addr
|
150
|
+
@port = port
|
151
|
+
@reason = reason
|
151
152
|
end
|
152
153
|
|
153
154
|
#
|
@@ -156,7 +157,7 @@ module HostCommunicationError
|
|
156
157
|
#
|
157
158
|
def addr_to_s
|
158
159
|
if host and port
|
159
|
-
"(#{host}:#{port})"
|
160
|
+
host.include?(':') ? "([#{host}]:#{port})" : "(#{host}:#{port})"
|
160
161
|
elsif host
|
161
162
|
"(#{host})"
|
162
163
|
else
|
@@ -164,7 +165,13 @@ module HostCommunicationError
|
|
164
165
|
end
|
165
166
|
end
|
166
167
|
|
167
|
-
|
168
|
+
def to_s
|
169
|
+
str = super
|
170
|
+
str << " #{@reason}" if @reason
|
171
|
+
str
|
172
|
+
end
|
173
|
+
|
174
|
+
attr_accessor :host, :port, :reason
|
168
175
|
end
|
169
176
|
|
170
177
|
|
@@ -186,7 +193,9 @@ end
|
|
186
193
|
###
|
187
194
|
class ConnectionRefused < ConnectionError
|
188
195
|
def to_s
|
189
|
-
"The connection was refused by the remote host #{addr_to_s}."
|
196
|
+
str = "The connection was refused by the remote host #{addr_to_s}."
|
197
|
+
str << " #{@reason}" unless @reason.nil?
|
198
|
+
str
|
190
199
|
end
|
191
200
|
end
|
192
201
|
|
@@ -198,7 +207,9 @@ end
|
|
198
207
|
###
|
199
208
|
class HostUnreachable < ConnectionError
|
200
209
|
def to_s
|
201
|
-
"The host #{addr_to_s} was unreachable."
|
210
|
+
str = "The host #{addr_to_s} was unreachable."
|
211
|
+
str << " #{@reason}" unless @reason.nil?
|
212
|
+
str
|
202
213
|
end
|
203
214
|
end
|
204
215
|
|
@@ -209,7 +220,9 @@ end
|
|
209
220
|
###
|
210
221
|
class ConnectionTimeout < ConnectionError
|
211
222
|
def to_s
|
212
|
-
"The connection
|
223
|
+
str = "The connection with #{addr_to_s} timed out."
|
224
|
+
str << " #{@reason}" unless @reason.nil?
|
225
|
+
str
|
213
226
|
end
|
214
227
|
end
|
215
228
|
|
@@ -220,18 +233,17 @@ end
|
|
220
233
|
#
|
221
234
|
###
|
222
235
|
class InvalidDestination < ConnectionError
|
223
|
-
include SocketError
|
224
|
-
include HostCommunicationError
|
225
|
-
|
226
236
|
def to_s
|
227
|
-
"The destination is invalid: #{addr_to_s}."
|
237
|
+
str = "The destination is invalid: #{addr_to_s}."
|
238
|
+
str << " #{@reason}" unless @reason.nil?
|
239
|
+
str
|
228
240
|
end
|
229
241
|
end
|
230
242
|
|
231
243
|
###
|
232
244
|
#
|
233
245
|
# This exception is raised when an attempt to use an address or port that is
|
234
|
-
# already in use or
|
246
|
+
# already in use or not available occurs. such as binding to a host on a
|
235
247
|
# given port that is already in use, or when a bind address is specified that
|
236
248
|
# is not available to the host.
|
237
249
|
#
|
@@ -241,7 +253,9 @@ class BindFailed < ::ArgumentError
|
|
241
253
|
include HostCommunicationError
|
242
254
|
|
243
255
|
def to_s
|
244
|
-
"The address is already in use or unavailable: #{addr_to_s}."
|
256
|
+
str = "The address is already in use or unavailable: #{addr_to_s}."
|
257
|
+
str << " #{@reason}" unless @reason.nil?
|
258
|
+
str
|
245
259
|
end
|
246
260
|
end
|
247
261
|
|
@@ -255,11 +269,10 @@ end
|
|
255
269
|
#
|
256
270
|
##
|
257
271
|
class AddressInUse < ConnectionError
|
258
|
-
include SocketError
|
259
|
-
include HostCommunicationError
|
260
|
-
|
261
272
|
def to_s
|
262
|
-
"The address is already in use or unavailable: #{addr_to_s}."
|
273
|
+
str = "The address is already in use or unavailable: #{addr_to_s}."
|
274
|
+
str << " #{@reason}" unless @reason.nil?
|
275
|
+
str
|
263
276
|
end
|
264
277
|
end
|
265
278
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rex-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
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-
|
96
|
+
date: 2021-07-15 00:00:00.000000000 Z
|
97
97
|
dependencies:
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rake
|
metadata.gz.sig
CHANGED
Binary file
|