cms_scanner 0.0.27 → 0.0.28

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
  SHA1:
3
- metadata.gz: b06c4efce1d393996ffda3a018320e50d2ef67d4
4
- data.tar.gz: 9f28e5f4af6ec097806bfe06f5dbdbb9e7221d73
3
+ metadata.gz: ae683c66a4944bbb795dd2226eb508bb5cd4b605
4
+ data.tar.gz: 1a857e71e73e5e2b3fff2b72c9f405ca6bf840db
5
5
  SHA512:
6
- metadata.gz: a6d472bb648225acf3644f67659cbfad3c39fd9e0df51c426e595383c6139c98d07ce90588a7a23344095f5e20350b936ac699dbd488cd5c2203fedb417bdb55
7
- data.tar.gz: 8413c264f2beb0ba547cd95aff1a009149a31c8e0cb2d04e1c6eb0500c4752d516ec8bc1b903f3226ddd21432953d092c6b8bdc724a3586c3cb6d799467243d2
6
+ metadata.gz: eb2ba5e94e801de333e9e92d9fb1116999a15e19db246f7916bad6d5a28ed5e4b31d2c1d7a4610d9e06c8917ea258dbbfc017425c35af21468108e734f11ae9c
7
+ data.tar.gz: 55afc0d62d3aefdba80e1057bfc99fb57b74a291beb1270bb1005da3856baefbc5f85ea8d5f40a74bbe22ee19733b11398edf7951a9d0432d4c3685c115a7ac4
@@ -24,10 +24,8 @@ module CMSScanner
24
24
  fail HTTPAuthRequiredError if target.http_auth?
25
25
  fail ProxyAuthRequiredError if target.proxy_auth?
26
26
 
27
- # TODO: ask if the redirection should be followed
28
- # if user_interaction? is allowed (if followed, the Cache#storage_path should be updated)
29
27
  redirection = target.redirection
30
- fail "The url supplied redirects to #{redirection}" if redirection
28
+ fail HTTPRedirectError, redirection if redirection
31
29
  end
32
30
 
33
31
  def run
data/lib/cms_scanner.rb CHANGED
@@ -17,7 +17,7 @@ require 'cms_scanner/typhoeus/hydra'
17
17
  require 'cms_scanner/public_suffix/domain'
18
18
  # Custom Libs
19
19
  require 'cms_scanner/helper'
20
- require 'cms_scanner/errors/auth_errors'
20
+ require 'cms_scanner/errors/http'
21
21
  require 'cms_scanner/cache/typhoeus'
22
22
  require 'cms_scanner/target'
23
23
  require 'cms_scanner/browser'
@@ -1,23 +1,37 @@
1
1
  module CMSScanner
2
2
  # HTTP Authentication Required Error
3
3
  class HTTPAuthRequiredError < StandardError
4
- def message
4
+ def to_s
5
5
  'HTTP authentication required (or was invalid), please provide it with --http-auth'
6
6
  end
7
7
  end
8
8
 
9
9
  # Proxy Authentication Required Error
10
10
  class ProxyAuthRequiredError < StandardError
11
- def message
11
+ def to_s
12
12
  'Proxy authentication required (or was invalid), please provide it with --proxy-auth'
13
13
  end
14
14
  end
15
15
 
16
16
  # Access Forbidden Error
17
17
  class AccessForbiddenError < StandardError
18
- def message
19
- # TODO: add a --random-agent option
20
- 'The target is responding with a 403, this might be due to a WAF'
18
+ def to_s
19
+ 'The target is responding with a 403, this might be due to a WAF. ' \
20
+ 'Please re-try with --random-user-agent'
21
+ end
22
+ end
23
+
24
+ # HTTP Redirect Error
25
+ class HTTPRedirectError < StandardError
26
+ attr_reader :redirect_uri
27
+
28
+ # @param [ String ] url
29
+ def initialize(url)
30
+ @redirect_uri = Addressable::URI.parse(url).normalize
31
+ end
32
+
33
+ def to_s
34
+ "The URL supplied redirects to #{redirect_uri}"
21
35
  end
22
36
  end
23
37
  end
@@ -53,6 +53,7 @@ module CMSScanner
53
53
 
54
54
  return "#{titleize} (#{label.capitalize} Detection)"
55
55
  end
56
+ nil
56
57
  end
57
58
  end
58
59
  end
@@ -1,4 +1,4 @@
1
1
  # Version
2
2
  module CMSScanner
3
- VERSION = '0.0.27'
3
+ VERSION = '0.0.28'
4
4
  end
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.0.27
4
+ version: 0.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - WPScanTeam - Erwan Le Rousseau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-24 00:00:00.000000000 Z
11
+ date: 2015-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opt_parse_validator
@@ -259,7 +259,7 @@ files:
259
259
  - lib/cms_scanner/cache/typhoeus.rb
260
260
  - lib/cms_scanner/controller.rb
261
261
  - lib/cms_scanner/controllers.rb
262
- - lib/cms_scanner/errors/auth_errors.rb
262
+ - lib/cms_scanner/errors/http.rb
263
263
  - lib/cms_scanner/finders.rb
264
264
  - lib/cms_scanner/finders/finder.rb
265
265
  - lib/cms_scanner/finders/finder/enumerator.rb