cms_scanner 0.13.7 → 0.13.9

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: 4e844a7c12e7e4767678eee8958f7b6c863789f4478553b9260e86dea258c974
4
- data.tar.gz: e203a131365c6b7637842c6296918135e3dc97bb6bd8a922214c3629779e622e
3
+ metadata.gz: c2c550411f4adb250a8bcee7bc1eb5eccfe086faa8227d236f6fe1c580e104b1
4
+ data.tar.gz: 07e23ead3de4ef053be824e0f59161b15ad01ceca7cbb5eb7f02fd95f3964d0f
5
5
  SHA512:
6
- metadata.gz: 4d1f9c65037c59a457dd2fb4370151b0cdc0639d5dcf01d84cfc2fba1b5956ab4761434ee0b85daff31aacf0fd1db0e61c74c34688678a23d72bee7108636ede
7
- data.tar.gz: bb9e70348937efab985f82b5baca41e74fdbcfa7620b7fff1ef9f935f8562e8b0d3531bf0a0a2d73aaa1393305999d6bf3b8656f570b2c012d286784c44b40a3
6
+ metadata.gz: d3463f490304df1c4c57ace9d46b3adc15b9fe0d4fce6c48b2dbb19279a774782116c06b2ca7de0818622c13a0f7a666a00cb03ab0b0339d7b6024d53afb25aa
7
+ data.tar.gz: 3f4411c6ac58bbc76adfc8d62f75f40ffcdf5eefca1d54fb68a60dd4c2561419d29e6b07cdc68090e74fae452da792b8d2e5439f007c931e251eefdb49235c6b
@@ -48,14 +48,28 @@ module CMSScanner
48
48
  raise Error::ProxyAuthRequired
49
49
  end
50
50
 
51
- # Checks for redirects
52
- # An out of scope redirect will raise an Error::HTTPRedirect
53
- effective_url = target.homepage_res.effective_url
51
+ handle_redirection(res)
52
+ end
53
+
54
+ # Checks for redirects, an out of scope redirect will raise an Error::HTTPRedirect
55
+ #
56
+ # @param [ Typhoeus::Response ] res
57
+ def handle_redirection(res)
58
+ effective_url = target.homepage_res.effective_url # Basically get and follow location of target.url
59
+ effective_uri = Addressable::URI.parse(effective_url)
60
+
61
+ # Case of http://a.com => https://a.com (or the opposite)
62
+ if !NS::ParsedCli.ignore_main_redirect && target.uri.domain == effective_uri.domain &&
63
+ target.uri.path == effective_uri.path && target.uri.scheme != effective_uri.scheme
64
+
65
+ target.url = effective_url
66
+ end
54
67
 
55
68
  return if target.in_scope?(effective_url)
56
69
 
57
70
  raise Error::HTTPRedirect, effective_url unless NS::ParsedCli.ignore_main_redirect
58
71
 
72
+ # Sets back homepage_res to unfollowed location in case of ignore_main_redirect used
59
73
  target.homepage_res = res
60
74
  end
61
75
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version
4
4
  module CMSScanner
5
- VERSION = '0.13.7'
5
+ VERSION = '0.13.9'
6
6
  end
@@ -115,7 +115,7 @@ module CMSScanner
115
115
 
116
116
  # @return [ Hash ] The Typhoeus params to use to perform head requests
117
117
  def head_or_get_params
118
- @head_or_get_params ||= if NS::Browser.head(homepage_url).code == 405
118
+ @head_or_get_params ||= if [0, 405, 501].include?(NS::Browser.head(homepage_url).code)
119
119
  { method: :get, maxfilesize: 1 }
120
120
  else
121
121
  { method: :head }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cms_scanner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.7
4
+ version: 0.13.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-22 00:00:00.000000000 Z
11
+ date: 2023-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ethon
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.14'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '0.16'
22
+ version: '0.17'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.14'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.16'
32
+ version: '0.17'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: get_process_mem
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +53,7 @@ dependencies:
53
53
  version: 1.11.4
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: 1.14.0
56
+ version: 1.16.0
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
@@ -63,7 +63,7 @@ dependencies:
63
63
  version: 1.11.4
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
- version: 1.14.0
66
+ version: 1.16.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: opt_parse_validator
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -82,16 +82,22 @@ dependencies:
82
82
  name: public_suffix
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - "~>"
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: 4.0.3
88
+ - - "<"
89
+ - !ruby/object:Gem::Version
90
+ version: 5.1.0
88
91
  type: :runtime
89
92
  prerelease: false
90
93
  version_requirements: !ruby/object:Gem::Requirement
91
94
  requirements:
92
- - - "~>"
95
+ - - ">="
93
96
  - !ruby/object:Gem::Version
94
97
  version: 4.0.3
98
+ - - "<"
99
+ - !ruby/object:Gem::Version
100
+ version: 5.1.0
95
101
  - !ruby/object:Gem::Dependency
96
102
  name: ruby-progressbar
97
103
  requirement: !ruby/object:Gem::Requirement
@@ -101,7 +107,7 @@ dependencies:
101
107
  version: '1.10'
102
108
  - - "<"
103
109
  - !ruby/object:Gem::Version
104
- version: '1.12'
110
+ version: '1.14'
105
111
  type: :runtime
106
112
  prerelease: false
107
113
  version_requirements: !ruby/object:Gem::Requirement
@@ -111,7 +117,7 @@ dependencies:
111
117
  version: '1.10'
112
118
  - - "<"
113
119
  - !ruby/object:Gem::Version
114
- version: '1.12'
120
+ version: '1.14'
115
121
  - !ruby/object:Gem::Dependency
116
122
  name: typhoeus
117
123
  requirement: !ruby/object:Gem::Requirement
@@ -164,16 +170,22 @@ dependencies:
164
170
  name: sys-proctable
165
171
  requirement: !ruby/object:Gem::Requirement
166
172
  requirements:
167
- - - "~>"
173
+ - - ">="
168
174
  - !ruby/object:Gem::Version
169
175
  version: 1.2.2
176
+ - - "<"
177
+ - !ruby/object:Gem::Version
178
+ version: 1.4.0
170
179
  type: :runtime
171
180
  prerelease: false
172
181
  version_requirements: !ruby/object:Gem::Requirement
173
182
  requirements:
174
- - - "~>"
183
+ - - ">="
175
184
  - !ruby/object:Gem::Version
176
185
  version: 1.2.2
186
+ - - "<"
187
+ - !ruby/object:Gem::Version
188
+ version: 1.4.0
177
189
  - !ruby/object:Gem::Dependency
178
190
  name: bundler
179
191
  requirement: !ruby/object:Gem::Requirement
@@ -208,14 +220,14 @@ dependencies:
208
220
  requirements:
209
221
  - - "~>"
210
222
  - !ruby/object:Gem::Version
211
- version: 3.11.0
223
+ version: 3.12.0
212
224
  type: :development
213
225
  prerelease: false
214
226
  version_requirements: !ruby/object:Gem::Requirement
215
227
  requirements:
216
228
  - - "~>"
217
229
  - !ruby/object:Gem::Version
218
- version: 3.11.0
230
+ version: 3.12.0
219
231
  - !ruby/object:Gem::Dependency
220
232
  name: rspec-its
221
233
  requirement: !ruby/object:Gem::Requirement
@@ -236,42 +248,42 @@ dependencies:
236
248
  requirements:
237
249
  - - "~>"
238
250
  - !ruby/object:Gem::Version
239
- version: 1.25.0
251
+ version: 1.26.0
240
252
  type: :development
241
253
  prerelease: false
242
254
  version_requirements: !ruby/object:Gem::Requirement
243
255
  requirements:
244
256
  - - "~>"
245
257
  - !ruby/object:Gem::Version
246
- version: 1.25.0
258
+ version: 1.26.0
247
259
  - !ruby/object:Gem::Dependency
248
260
  name: rubocop-performance
249
261
  requirement: !ruby/object:Gem::Requirement
250
262
  requirements:
251
263
  - - "~>"
252
264
  - !ruby/object:Gem::Version
253
- version: 1.13.0
265
+ version: 1.18.0
254
266
  type: :development
255
267
  prerelease: false
256
268
  version_requirements: !ruby/object:Gem::Requirement
257
269
  requirements:
258
270
  - - "~>"
259
271
  - !ruby/object:Gem::Version
260
- version: 1.13.0
272
+ version: 1.18.0
261
273
  - !ruby/object:Gem::Dependency
262
274
  name: simplecov
263
275
  requirement: !ruby/object:Gem::Requirement
264
276
  requirements:
265
277
  - - "~>"
266
278
  - !ruby/object:Gem::Version
267
- version: 0.21.0
279
+ version: 0.22.0
268
280
  type: :development
269
281
  prerelease: false
270
282
  version_requirements: !ruby/object:Gem::Requirement
271
283
  requirements:
272
284
  - - "~>"
273
285
  - !ruby/object:Gem::Version
274
- version: 0.21.0
286
+ version: 0.22.0
275
287
  - !ruby/object:Gem::Dependency
276
288
  name: simplecov-lcov
277
289
  requirement: !ruby/object:Gem::Requirement
@@ -292,14 +304,14 @@ dependencies:
292
304
  requirements:
293
305
  - - "~>"
294
306
  - !ruby/object:Gem::Version
295
- version: 3.14.0
307
+ version: 3.18.1
296
308
  type: :development
297
309
  prerelease: false
298
310
  version_requirements: !ruby/object:Gem::Requirement
299
311
  requirements:
300
312
  - - "~>"
301
313
  - !ruby/object:Gem::Version
302
- version: 3.14.0
314
+ version: 3.18.1
303
315
  description: Framework to provide an easy way to implement CMS Scanners
304
316
  email:
305
317
  - contact@wpscan.com
@@ -412,14 +424,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
412
424
  requirements:
413
425
  - - ">="
414
426
  - !ruby/object:Gem::Version
415
- version: '2.5'
427
+ version: '2.7'
416
428
  required_rubygems_version: !ruby/object:Gem::Requirement
417
429
  requirements:
418
430
  - - ">="
419
431
  - !ruby/object:Gem::Version
420
432
  version: '0'
421
433
  requirements: []
422
- rubygems_version: 3.0.3.1
434
+ rubygems_version: 3.1.6
423
435
  signing_key:
424
436
  specification_version: 4
425
437
  summary: CMS Scanner Framework (experimental)