cms_scanner 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/finders/interesting_files/xml_rpc.rb +1 -3
- data/app/models.rb +1 -0
- data/app/models/interesting_file.rb +0 -4
- data/app/models/version.rb +17 -0
- data/app/views/cli/core/finished.erb +0 -1
- data/app/views/cli/interesting_files/findings.erb +1 -1
- data/cms_scanner.gemspec +2 -2
- data/lib/cms_scanner.rb +1 -0
- data/lib/cms_scanner/finders.rb +2 -0
- data/lib/cms_scanner/finders/finding.rb +4 -0
- data/lib/cms_scanner/finders/independent_finders.rb +1 -1
- data/lib/cms_scanner/finders/unique_finder.rb +17 -0
- data/lib/cms_scanner/finders/unique_finders.rb +39 -0
- data/lib/cms_scanner/target.rb +1 -0
- data/lib/cms_scanner/target/platform/wordpress.rb +2 -4
- data/lib/cms_scanner/target/platform/wordpress/custom_directories.rb +1 -2
- data/lib/cms_scanner/target/server/apache.rb +3 -2
- data/lib/cms_scanner/target/server/iis.rb +1 -2
- data/lib/cms_scanner/typhoeus/response.rb +9 -0
- data/lib/cms_scanner/version.rb +1 -1
- data/spec/app/controllers/core_spec.rb +0 -2
- data/spec/app/controllers/interesting_files_spec.rb +0 -2
- data/spec/app/finders/interesting_files/fantastico_fileslist_spec.rb +0 -2
- data/spec/app/finders/interesting_files/headers_spec.rb +0 -2
- data/spec/app/finders/interesting_files/robots_txt_spec.rb +0 -2
- data/spec/app/finders/interesting_files/search_replace_db_2_spec.rb +0 -2
- data/spec/app/finders/interesting_files/xml_rpc_spec.rb +0 -2
- data/spec/app/finders/interesting_files_spec.rb +1 -2
- data/spec/app/formatters/cli_no_colour_spec.rb +0 -2
- data/spec/app/formatters/cli_spec.rb +0 -2
- data/spec/app/formatters/json_spec.rb +0 -2
- data/spec/app/models/fantastico_fileslist_spec.rb +0 -1
- data/spec/app/models/headers_spec.rb +0 -1
- data/spec/app/models/interesting_file_spec.rb +0 -2
- data/spec/app/models/robots_txt_spec.rb +0 -1
- data/spec/app/models/version_spec.rb +23 -0
- data/spec/app/models/xml_rpc_spec.rb +0 -1
- data/spec/app/views_spec.rb +0 -2
- data/spec/dummy_finding.rb +21 -0
- data/spec/dummy_independent_finders.rb +25 -0
- data/spec/dummy_unique_finders.rb +32 -0
- data/spec/lib/browser_spec.rb +0 -1
- data/spec/lib/cache/file_store_spec.rb +0 -1
- data/spec/lib/cache/typhoeus_spec.rb +0 -2
- data/spec/lib/cms_scanner_spec.rb +0 -1
- data/spec/lib/controller_spec.rb +0 -2
- data/spec/lib/controllers_spec.rb +0 -2
- data/spec/lib/finders/findings_spec.rb +1 -3
- data/spec/lib/finders/independent_finders_spec.rb +4 -6
- data/spec/lib/finders/unique_finder_spec.rb +24 -0
- data/spec/lib/finders/unique_finders_spec.rb +133 -0
- data/spec/lib/formatter_spec.rb +0 -3
- data/spec/lib/target_spec.rb +0 -2
- data/spec/lib/web_site_spec.rb +0 -3
- data/spec/output/core/finished.cli_no_colour +0 -1
- data/spec/output/interesting_files/empty.cli_no_colour +1 -0
- data/spec/output/interesting_files/findings.cli_no_colour +1 -0
- data/spec/shared_examples/browser_actions.rb +0 -2
- data/spec/shared_examples/finding.rb +21 -1
- data/spec/shared_examples/formatter_buffer.rb +0 -2
- data/spec/shared_examples/independent_finder.rb +1 -3
- data/spec/shared_examples/target/platform/php.rb +0 -1
- data/spec/shared_examples/target/platform/wordpress.rb +0 -2
- data/spec/shared_examples/target/server/apache.rb +0 -1
- data/spec/shared_examples/target/server/generic.rb +0 -1
- data/spec/shared_examples/target/server/iis.rb +0 -1
- data/spec/shared_examples/views/core.rb +0 -1
- data/spec/shared_examples/views/interesting_files.rb +0 -1
- metadata +21 -7
- data/spec/dummy_finders.rb +0 -41
data/spec/lib/formatter_spec.rb
CHANGED
@@ -27,7 +27,6 @@ module CMSScanner
|
|
27
27
|
end
|
28
28
|
|
29
29
|
describe CMSScanner::Formatter::Base do
|
30
|
-
|
31
30
|
subject(:formatter) { described_class.new }
|
32
31
|
|
33
32
|
describe '#format' do
|
@@ -114,7 +113,6 @@ describe CMSScanner::Formatter::Base do
|
|
114
113
|
@tpl = 'local'
|
115
114
|
end
|
116
115
|
end
|
117
|
-
|
118
116
|
end
|
119
117
|
|
120
118
|
describe '#views_directories' do
|
@@ -132,5 +130,4 @@ describe CMSScanner::Formatter::Base do
|
|
132
130
|
end
|
133
131
|
end
|
134
132
|
end
|
135
|
-
|
136
133
|
end
|
data/spec/lib/target_spec.rb
CHANGED
data/spec/lib/web_site_spec.rb
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe CMSScanner::WebSite do
|
4
|
-
|
5
4
|
subject(:web_site) { described_class.new(url) }
|
6
5
|
let(:url) { 'http://ex.lo' }
|
7
6
|
|
8
7
|
describe '#url=' do
|
9
8
|
context 'when the url is incorrect' do
|
10
|
-
|
11
9
|
after do
|
12
10
|
expect { web_site.url = @url }.to raise_error Addressable::URI::InvalidURIError
|
13
11
|
end
|
@@ -120,5 +118,4 @@ describe CMSScanner::WebSite do
|
|
120
118
|
end
|
121
119
|
end
|
122
120
|
end
|
123
|
-
|
124
121
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
|
2
2
|
shared_examples CMSScanner::Browser::Actions do
|
3
|
-
|
4
3
|
let(:url) { 'http://example.com/file.txt' }
|
5
4
|
let(:browser) { CMSScanner::Browser }
|
6
5
|
|
@@ -28,5 +27,4 @@ shared_examples CMSScanner::Browser::Actions do
|
|
28
27
|
# expect(response.body).to eq 'Got me'
|
29
28
|
end
|
30
29
|
end
|
31
|
-
|
32
30
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
|
2
2
|
shared_examples CMSScanner::Finders::Finding do
|
3
|
-
|
4
3
|
[:references, :confirmed_by, :interesting_entries].each do |opt|
|
5
4
|
describe "##{opt}" do
|
6
5
|
its(opt) { should eq [] }
|
@@ -27,4 +26,25 @@ shared_examples CMSScanner::Finders::Finding do
|
|
27
26
|
xit
|
28
27
|
end
|
29
28
|
|
29
|
+
describe '#eql?' do
|
30
|
+
before do
|
31
|
+
subject.confidence = 10
|
32
|
+
subject.found_by = 'test'
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when eql' do
|
36
|
+
it 'returns true' do
|
37
|
+
expect(subject).to eql subject
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'when not eql' do
|
42
|
+
it 'returns false' do
|
43
|
+
other = subject.dup
|
44
|
+
other.confidence = 20
|
45
|
+
|
46
|
+
expect(subject).to_not eql other
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
30
50
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
|
2
2
|
shared_examples CMSScanner::Finders::IndependentFinder do
|
3
|
-
|
4
3
|
describe '::find' do
|
5
4
|
it 'creates a new object and call finders#find' do
|
6
5
|
created = described_class.new(target)
|
@@ -20,7 +19,7 @@ shared_examples CMSScanner::Finders::IndependentFinder do
|
|
20
19
|
end
|
21
20
|
|
22
21
|
describe '#finders' do
|
23
|
-
its(:finders) { should be_a
|
22
|
+
its(:finders) { should be_a expected_finders_class }
|
24
23
|
|
25
24
|
it 'returns the correct finders' do
|
26
25
|
finders = subject.finders
|
@@ -29,5 +28,4 @@ shared_examples CMSScanner::Finders::IndependentFinder do
|
|
29
28
|
expect(finders.map { |f| f.class.to_s.demodulize }).to eq expected_finders
|
30
29
|
end
|
31
30
|
end
|
32
|
-
|
33
31
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require_relative 'wordpress/custom_directories'
|
2
2
|
|
3
3
|
shared_examples CMSScanner::Target::Platform::WordPress do
|
4
|
-
|
5
4
|
it_behaves_like 'WordPress::CustomDirectories'
|
6
5
|
|
7
6
|
describe '#wordpress?' do
|
@@ -37,5 +36,4 @@ shared_examples CMSScanner::Target::Platform::WordPress do
|
|
37
36
|
its(:wordpress_hosted?) { should be true }
|
38
37
|
end
|
39
38
|
end
|
40
|
-
|
41
39
|
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.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- WPScanTeam - Erwan
|
7
|
+
- WPScanTeam - Erwan Le Rousseau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opt_parse_validator
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0.
|
145
|
+
version: '0.28'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: '0.
|
152
|
+
version: '0.28'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: webmock
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- app/models/headers.rb
|
215
215
|
- app/models/interesting_file.rb
|
216
216
|
- app/models/robots_txt.rb
|
217
|
+
- app/models/version.rb
|
217
218
|
- app/models/xml_rpc.rb
|
218
219
|
- app/views/cli/core/finished.erb
|
219
220
|
- app/views/cli/core/started.erb
|
@@ -243,6 +244,8 @@ files:
|
|
243
244
|
- lib/cms_scanner/finders/findings.rb
|
244
245
|
- lib/cms_scanner/finders/independent_finder.rb
|
245
246
|
- lib/cms_scanner/finders/independent_finders.rb
|
247
|
+
- lib/cms_scanner/finders/unique_finder.rb
|
248
|
+
- lib/cms_scanner/finders/unique_finders.rb
|
246
249
|
- lib/cms_scanner/formatter.rb
|
247
250
|
- lib/cms_scanner/formatter/buffer.rb
|
248
251
|
- lib/cms_scanner/target.rb
|
@@ -254,6 +257,7 @@ files:
|
|
254
257
|
- lib/cms_scanner/target/server/apache.rb
|
255
258
|
- lib/cms_scanner/target/server/generic.rb
|
256
259
|
- lib/cms_scanner/target/server/iis.rb
|
260
|
+
- lib/cms_scanner/typhoeus/response.rb
|
257
261
|
- lib/cms_scanner/version.rb
|
258
262
|
- lib/cms_scanner/web_site.rb
|
259
263
|
- lib/helper.rb
|
@@ -272,10 +276,13 @@ files:
|
|
272
276
|
- spec/app/models/headers_spec.rb
|
273
277
|
- spec/app/models/interesting_file_spec.rb
|
274
278
|
- spec/app/models/robots_txt_spec.rb
|
279
|
+
- spec/app/models/version_spec.rb
|
275
280
|
- spec/app/models/xml_rpc_spec.rb
|
276
281
|
- spec/app/views_spec.rb
|
277
282
|
- spec/cache/.gitignore
|
278
|
-
- spec/
|
283
|
+
- spec/dummy_finding.rb
|
284
|
+
- spec/dummy_independent_finders.rb
|
285
|
+
- spec/dummy_unique_finders.rb
|
279
286
|
- spec/fixtures/interesting_files/fantastico_fileslist/fantastico_fileslist.txt
|
280
287
|
- spec/fixtures/interesting_files/file.txt
|
281
288
|
- spec/fixtures/interesting_files/headers/interesting.txt
|
@@ -314,6 +321,8 @@ files:
|
|
314
321
|
- spec/lib/controllers_spec.rb
|
315
322
|
- spec/lib/finders/findings_spec.rb
|
316
323
|
- spec/lib/finders/independent_finders_spec.rb
|
324
|
+
- spec/lib/finders/unique_finder_spec.rb
|
325
|
+
- spec/lib/finders/unique_finders_spec.rb
|
317
326
|
- spec/lib/formatter_spec.rb
|
318
327
|
- spec/lib/sub_scanner_spec.rb
|
319
328
|
- spec/lib/target/platforms_spec.rb
|
@@ -383,10 +392,13 @@ test_files:
|
|
383
392
|
- spec/app/models/headers_spec.rb
|
384
393
|
- spec/app/models/interesting_file_spec.rb
|
385
394
|
- spec/app/models/robots_txt_spec.rb
|
395
|
+
- spec/app/models/version_spec.rb
|
386
396
|
- spec/app/models/xml_rpc_spec.rb
|
387
397
|
- spec/app/views_spec.rb
|
388
398
|
- spec/cache/.gitignore
|
389
|
-
- spec/
|
399
|
+
- spec/dummy_finding.rb
|
400
|
+
- spec/dummy_independent_finders.rb
|
401
|
+
- spec/dummy_unique_finders.rb
|
390
402
|
- spec/fixtures/interesting_files/fantastico_fileslist/fantastico_fileslist.txt
|
391
403
|
- spec/fixtures/interesting_files/file.txt
|
392
404
|
- spec/fixtures/interesting_files/headers/interesting.txt
|
@@ -425,6 +437,8 @@ test_files:
|
|
425
437
|
- spec/lib/controllers_spec.rb
|
426
438
|
- spec/lib/finders/findings_spec.rb
|
427
439
|
- spec/lib/finders/independent_finders_spec.rb
|
440
|
+
- spec/lib/finders/unique_finder_spec.rb
|
441
|
+
- spec/lib/finders/unique_finders_spec.rb
|
428
442
|
- spec/lib/formatter_spec.rb
|
429
443
|
- spec/lib/sub_scanner_spec.rb
|
430
444
|
- spec/lib/target/platforms_spec.rb
|
data/spec/dummy_finders.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
module CMSScanner
|
2
|
-
# Dummy Finding
|
3
|
-
class DummyFinding
|
4
|
-
include Finders::Finding
|
5
|
-
|
6
|
-
attr_reader :r
|
7
|
-
|
8
|
-
def initialize(r, opts = {})
|
9
|
-
@r = r
|
10
|
-
parse_finding_options(opts)
|
11
|
-
end
|
12
|
-
|
13
|
-
def ==(other)
|
14
|
-
r == other.r
|
15
|
-
end
|
16
|
-
|
17
|
-
def eql?(other)
|
18
|
-
r == other.r && confidence == other.confidence && found_by == other.found_by
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
module Finders
|
23
|
-
# Dummy Test Finder
|
24
|
-
class DummyFinder < Finder
|
25
|
-
def passive(_opts = {})
|
26
|
-
DummyFinding.new('test', found_by: found_by)
|
27
|
-
end
|
28
|
-
|
29
|
-
def aggressive(_opts = {})
|
30
|
-
DummyFinding.new('test', confidence: 100, found_by: 'override')
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
# No aggressive result finder
|
35
|
-
class NoAggressiveResult < Finder
|
36
|
-
def passive(_opts = {})
|
37
|
-
DummyFinding.new('spotted', confidence: 10, found_by: found_by)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|