arachni 1.1 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +159 -0
- data/LICENSE.md +126 -196
- data/README.md +32 -24
- data/arachni.gemspec +7 -7
- data/components/checks/active/code_injection_timing.rb +3 -3
- data/components/checks/active/csrf.rb +2 -2
- data/components/checks/active/file_inclusion.rb +6 -7
- data/components/checks/active/os_cmd_injection.rb +3 -3
- data/components/checks/active/path_traversal.rb +7 -7
- data/components/checks/active/response_splitting.rb +9 -4
- data/components/checks/active/session_fixation.rb +7 -3
- data/components/checks/active/source_code_disclosure.rb +5 -5
- data/components/checks/active/unvalidated_redirect.rb +12 -3
- data/components/checks/active/unvalidated_redirect_dom.rb +3 -3
- data/components/checks/active/xss.rb +23 -10
- data/components/checks/active/xss_dom_inputs.rb +113 -11
- data/components/checks/active/xxe.rb +3 -3
- data/components/checks/passive/backdoors.rb +6 -5
- data/components/checks/passive/backup_directories.rb +6 -6
- data/components/checks/passive/backup_files.rb +6 -6
- data/components/checks/passive/common_admin_interfaces.rb +58 -0
- data/components/checks/passive/common_admin_interfaces/admin-panels.txt +49 -0
- data/components/checks/passive/common_directories/directories.txt +0 -16
- data/components/checks/passive/common_files.rb +6 -5
- data/components/checks/passive/common_files/filenames.txt +0 -2
- data/components/checks/passive/directory_listing.rb +6 -6
- data/components/checks/passive/grep/cookie_set_for_parent_domain.rb +3 -3
- data/components/checks/passive/grep/hsts.rb +6 -3
- data/components/checks/passive/grep/http_only_cookies.rb +3 -3
- data/components/checks/passive/grep/insecure_cookies.rb +2 -2
- data/components/checks/passive/grep/insecure_cors_policy.rb +6 -4
- data/components/checks/passive/grep/x_frame_options.rb +6 -4
- data/components/checks/passive/htaccess_limit.rb +6 -2
- data/components/checks/passive/http_put.rb +8 -4
- data/components/checks/passive/interesting_responses.rb +3 -2
- data/components/checks/passive/localstart_asp.rb +6 -2
- data/components/checks/passive/origin_spoof_access_restriction_bypass.rb +5 -1
- data/components/checks/passive/xst.rb +6 -2
- data/components/fingerprinters/frameworks/aspx_mvc.rb +43 -0
- data/components/fingerprinters/frameworks/cakephp.rb +28 -0
- data/components/fingerprinters/frameworks/cherrypy.rb +31 -0
- data/components/fingerprinters/frameworks/django.rb +33 -0
- data/components/fingerprinters/frameworks/jsf.rb +30 -0
- data/components/fingerprinters/frameworks/rack.rb +5 -7
- data/components/fingerprinters/frameworks/rails.rb +43 -0
- data/components/fingerprinters/languages/aspx.rb +11 -11
- data/components/fingerprinters/languages/{jsp.rb → java.rb} +11 -7
- data/components/fingerprinters/languages/php.rb +6 -6
- data/components/fingerprinters/languages/python.rb +14 -6
- data/components/fingerprinters/languages/ruby.rb +3 -5
- data/components/fingerprinters/servers/apache.rb +5 -4
- data/components/fingerprinters/servers/gunicorn.rb +33 -0
- data/components/fingerprinters/servers/jetty.rb +1 -1
- data/components/fingerprinters/servers/tomcat.rb +11 -4
- data/components/path_extractors/anchors.rb +5 -12
- data/components/path_extractors/areas.rb +5 -13
- data/components/path_extractors/comments.rb +5 -3
- data/components/path_extractors/data_url.rb +21 -0
- data/components/path_extractors/forms.rb +5 -13
- data/components/path_extractors/frames.rb +6 -13
- data/components/path_extractors/generic.rb +3 -12
- data/components/path_extractors/links.rb +5 -13
- data/components/path_extractors/meta_refresh.rb +5 -13
- data/components/path_extractors/scripts.rb +8 -14
- data/components/plugins/autologin.rb +17 -5
- data/components/plugins/defaults/meta/remedies/discovery.rb +11 -29
- data/components/plugins/login_script.rb +40 -10
- data/components/plugins/metrics.rb +235 -0
- data/components/plugins/proxy.rb +21 -4
- data/components/plugins/proxy/panel/page_accordion.html.erb +34 -2
- data/components/plugins/restrict_to_dom_state.rb +70 -0
- data/components/plugins/vector_feed.rb +38 -9
- data/components/reporters/plugin_formatters/html/metrics.rb +290 -0
- data/components/reporters/plugin_formatters/stdout/metrics.rb +80 -0
- data/components/reporters/plugin_formatters/xml/metrics.rb +29 -0
- data/components/reporters/stdout.rb +4 -2
- data/components/reporters/xml.rb +4 -4
- data/components/reporters/xml/schema.xsd +95 -0
- data/lib/arachni.rb +2 -0
- data/lib/arachni/browser.rb +132 -77
- data/lib/arachni/browser/javascript.rb +173 -45
- data/lib/arachni/browser/javascript/scripts/dom_monitor.js +81 -6
- data/lib/arachni/browser/javascript/scripts/taint_tracer.js +31 -3
- data/lib/arachni/browser_cluster.rb +41 -15
- data/lib/arachni/browser_cluster/job.rb +4 -0
- data/lib/arachni/browser_cluster/jobs/resource_exploration.rb +0 -9
- data/lib/arachni/browser_cluster/worker.rb +8 -5
- data/lib/arachni/check/auditor.rb +20 -8
- data/lib/arachni/check/base.rb +38 -6
- data/lib/arachni/element/base.rb +18 -1
- data/lib/arachni/element/capabilities/analyzable/differential.rb +0 -1
- data/lib/arachni/element/capabilities/analyzable/taint.rb +40 -10
- data/lib/arachni/element/capabilities/analyzable/timeout.rb +27 -23
- data/lib/arachni/element/capabilities/auditable/dom.rb +22 -0
- data/lib/arachni/element/capabilities/inputtable.rb +6 -2
- data/lib/arachni/element/capabilities/submittable.rb +1 -1
- data/lib/arachni/element/cookie.rb +37 -23
- data/lib/arachni/element/cookie/capabilities/mutable.rb +6 -6
- data/lib/arachni/element/cookie/dom.rb +0 -8
- data/lib/arachni/element/form.rb +28 -14
- data/lib/arachni/element/form/capabilities/auditable.rb +2 -2
- data/lib/arachni/element/form/capabilities/mutable.rb +5 -5
- data/lib/arachni/element/form/dom.rb +0 -8
- data/lib/arachni/element/generic_dom.rb +1 -1
- data/lib/arachni/element/json.rb +2 -1
- data/lib/arachni/element/json/capabilities/inputtable.rb +6 -6
- data/lib/arachni/element/json/capabilities/mutable.rb +1 -1
- data/lib/arachni/element/link.rb +13 -16
- data/lib/arachni/element/link/dom.rb +1 -14
- data/lib/arachni/element/link_template.rb +3 -2
- data/lib/arachni/element/link_template/dom.rb +0 -16
- data/lib/arachni/element/server.rb +51 -9
- data/lib/arachni/element/xml.rb +1 -0
- data/lib/arachni/ethon/easy.rb +4 -1
- data/lib/arachni/framework/parts/audit.rb +26 -77
- data/lib/arachni/framework/parts/browser.rb +50 -55
- data/lib/arachni/framework/parts/check.rb +4 -3
- data/lib/arachni/framework/parts/data.rb +41 -6
- data/lib/arachni/framework/parts/state.rb +16 -7
- data/lib/arachni/http/client.rb +66 -38
- data/lib/arachni/http/client/dynamic_404_handler.rb +46 -14
- data/lib/arachni/http/headers.rb +22 -10
- data/lib/arachni/http/proxy_server.rb +67 -22
- data/lib/arachni/http/proxy_server/ssl-interceptor-cacert.pem +34 -0
- data/lib/arachni/http/proxy_server/ssl-interceptor-cakey.pem +51 -0
- data/lib/arachni/http/request.rb +71 -18
- data/lib/arachni/issue.rb +17 -3
- data/lib/arachni/option_groups/browser_cluster.rb +34 -1
- data/lib/arachni/option_groups/http.rb +1 -1
- data/lib/arachni/page.rb +26 -13
- data/lib/arachni/page/dom/transition.rb +2 -2
- data/lib/arachni/parser.rb +28 -11
- data/lib/arachni/platform/fingerprinter.rb +5 -0
- data/lib/arachni/platform/manager.rb +65 -32
- data/lib/arachni/plugin/base.rb +8 -0
- data/lib/arachni/processes/instances.rb +25 -11
- data/lib/arachni/reporter/manager.rb +2 -2
- data/lib/arachni/rpc/client/instance.rb +4 -0
- data/lib/arachni/rpc/server/framework/master.rb +3 -3
- data/lib/arachni/rpc/server/framework/multi_instance.rb +0 -8
- data/lib/arachni/rpc/server/instance.rb +2 -1
- data/lib/arachni/ruby/array.rb +5 -0
- data/lib/arachni/ruby/hash.rb +5 -0
- data/lib/arachni/ruby/string.rb +2 -3
- data/lib/arachni/session.rb +32 -6
- data/lib/arachni/state/framework.rb +6 -2
- data/lib/arachni/support/cache.rb +1 -0
- data/lib/arachni/support/cache/base.rb +12 -8
- data/lib/arachni/support/cache/least_recently_pushed.rb +29 -0
- data/lib/arachni/support/cache/least_recently_used.rb +5 -8
- data/lib/arachni/support/cache/preference.rb +1 -1
- data/lib/arachni/support/cache/random_replacement.rb +1 -25
- data/lib/arachni/support/database/queue.rb +21 -8
- data/lib/arachni/support/lookup/base.rb +7 -1
- data/lib/arachni/support/mixins/observable.rb +3 -1
- data/lib/arachni/support/profiler.rb +51 -10
- data/lib/arachni/support/signature.rb +11 -2
- data/lib/arachni/trainer.rb +8 -2
- data/lib/arachni/uri.rb +28 -25
- data/lib/arachni/uri/scope.rb +1 -1
- data/lib/arachni/utilities.rb +8 -0
- data/lib/arachni/watir/element.rb +1 -1
- data/lib/version +1 -1
- data/spec/arachni/browser/javascript/dom_monitor_spec.rb +388 -53
- data/spec/arachni/browser/javascript/taint_tracer_spec.rb +41 -0
- data/spec/arachni/browser/javascript_spec.rb +235 -61
- data/spec/arachni/browser_cluster/jobs/resource_exploration_spec.rb +0 -9
- data/spec/arachni/browser_cluster_spec.rb +58 -10
- data/spec/arachni/browser_spec.rb +170 -26
- data/spec/arachni/check/auditor_spec.rb +22 -3
- data/spec/arachni/check/base_spec.rb +84 -0
- data/spec/arachni/element/body_spec.rb +1 -1
- data/spec/arachni/element/capabilities/analyzable/taint_spec.rb +3 -3
- data/spec/arachni/element/capabilities/analyzable/timeout_spec.rb +1 -1
- data/spec/arachni/element/cookie/dom_spec.rb +0 -9
- data/spec/arachni/element/cookie_spec.rb +85 -0
- data/spec/arachni/element/form/dom_spec.rb +0 -9
- data/spec/arachni/element/form_spec.rb +46 -3
- data/spec/arachni/element/json_spec.rb +20 -0
- data/spec/arachni/element/link/dom_spec.rb +0 -9
- data/spec/arachni/element/link_spec.rb +40 -15
- data/spec/arachni/element/link_template/dom_spec.rb +0 -8
- data/spec/arachni/element/link_template_spec.rb +2 -6
- data/spec/arachni/element/server_spec.rb +94 -8
- data/spec/arachni/element/xml_spec.rb +20 -0
- data/spec/arachni/framework/parts/audit_spec.rb +12 -14
- data/spec/arachni/framework/parts/browser_spec.rb +0 -171
- data/spec/arachni/framework/parts/platform_spec.rb +14 -8
- data/spec/arachni/framework/parts/report_spec.rb +1 -1
- data/spec/arachni/framework/parts/state_spec.rb +0 -9
- data/spec/arachni/http/client/dynamic_404_handlers_spec.rb +19 -0
- data/spec/arachni/http/client_spec.rb +169 -42
- data/spec/arachni/http/headers_spec.rb +18 -0
- data/spec/arachni/http/request_spec.rb +23 -0
- data/spec/arachni/issue_spec.rb +17 -6
- data/spec/arachni/page_spec.rb +22 -2
- data/spec/arachni/parser_spec.rb +5 -0
- data/spec/arachni/platform/manager_spec.rb +57 -25
- data/spec/arachni/reporter/manager_spec.rb +26 -0
- data/spec/arachni/rpc/server/active_options_spec.rb +9 -4
- data/spec/arachni/state/framework_spec.rb +2 -8
- data/spec/arachni/support/cache/least_recently_pushed_spec.rb +90 -0
- data/spec/arachni/support/cache/least_recently_used_spec.rb +5 -13
- data/spec/arachni/support/database/queue_spec.rb +7 -0
- data/spec/arachni/support/mixins/observable_spec.rb +15 -1
- data/spec/arachni/trainer_spec.rb +2 -2
- data/spec/components/checks/active/code_injection_timing_spec.rb +1 -1
- data/spec/components/checks/active/file_inclusion_spec.rb +6 -6
- data/spec/components/checks/active/path_traversal_spec.rb +2 -2
- data/spec/components/checks/active/source_code_disclosure_spec.rb +2 -2
- data/spec/components/checks/active/unvalidated_redirect_spec.rb +6 -6
- data/spec/components/checks/active/xss_dom_inputs_spec.rb +3 -5
- data/spec/components/checks/active/xss_dom_script_context_spec.rb +1 -1
- data/spec/components/checks/active/xss_spec.rb +5 -5
- data/spec/components/checks/passive/common_admin_interfaces_spec.rb +15 -0
- data/spec/components/checks/passive/interesting_responses_spec.rb +14 -1
- data/spec/components/fingerprinters/frameworks/aspx_mvc_spec.rb +31 -0
- data/spec/components/fingerprinters/frameworks/cakephp_spec.rb +22 -0
- data/spec/components/fingerprinters/frameworks/cherrypy_spec.rb +28 -0
- data/spec/components/fingerprinters/frameworks/django_spec.rb +37 -0
- data/spec/components/fingerprinters/frameworks/jsf_spec.rb +27 -0
- data/spec/components/fingerprinters/frameworks/rack_spec.rb +11 -14
- data/spec/components/fingerprinters/frameworks/rails_spec.rb +53 -0
- data/spec/components/fingerprinters/languages/asp_spec.rb +7 -9
- data/spec/components/fingerprinters/languages/aspx_spec.rb +10 -24
- data/spec/components/fingerprinters/languages/java_spec.rb +88 -0
- data/spec/components/fingerprinters/languages/php_spec.rb +19 -12
- data/spec/components/fingerprinters/languages/python_spec.rb +22 -9
- data/spec/components/fingerprinters/languages/ruby.rb +6 -4
- data/spec/components/fingerprinters/os/bsd_spec.rb +6 -4
- data/spec/components/fingerprinters/os/linux_spec.rb +6 -4
- data/spec/components/fingerprinters/os/solaris_spec.rb +6 -4
- data/spec/components/fingerprinters/os/unix_spec.rb +6 -4
- data/spec/components/fingerprinters/os/windows_spec.rb +6 -4
- data/spec/components/fingerprinters/servers/apache_spec.rb +15 -4
- data/spec/components/fingerprinters/servers/gunicorn_spec.rb +28 -0
- data/spec/components/fingerprinters/servers/iis_spec.rb +6 -6
- data/spec/components/fingerprinters/servers/jetty_spec.rb +6 -6
- data/spec/components/fingerprinters/servers/nginx_spec.rb +6 -4
- data/spec/components/fingerprinters/servers/tomcat_spec.rb +15 -6
- data/spec/components/path_extractors/data_url_spec.rb +19 -0
- data/spec/components/plugins/autologin_spec.rb +23 -0
- data/spec/components/plugins/login_script_spec.rb +112 -24
- data/spec/components/plugins/restrict_to_dom_state_spec.rb +16 -0
- data/spec/components/plugins/vector_feed_spec.rb +39 -1
- data/spec/support/factories/page/dom.rb +9 -4
- data/spec/support/factories/page/dom/transition.rb +31 -9
- data/spec/support/factories/scan_report.rb +8 -6
- data/spec/support/fixtures/empty/placeholder +0 -0
- data/spec/support/fixtures/report.afr +0 -0
- data/spec/support/fixtures/reporters/manager_spec/error.rb +18 -0
- data/spec/support/servers/arachni/browser.rb +117 -11
- data/spec/support/servers/arachni/browser/javascript/dom_monitor.rb +148 -4
- data/spec/support/servers/arachni/check/auditor.rb +4 -0
- data/spec/support/servers/arachni/element/cookie/cookie_dom.rb +1 -1
- data/spec/support/servers/arachni/http/client.rb +5 -0
- data/spec/support/servers/arachni/http/client/dynamic_404_handler.rb +13 -0
- data/spec/support/servers/checks/active/code_injection_timing.rb +1 -1
- data/spec/support/servers/checks/active/file_inclusion.rb +2 -2
- data/spec/support/servers/checks/active/path_traversal.rb +2 -2
- data/spec/support/servers/checks/active/source_code_disclosure.rb +40 -33
- data/spec/support/servers/checks/active/trainer_check.rb +9 -10
- data/spec/support/servers/checks/active/unvalidated_redirect_dom.rb +7 -4
- data/spec/support/servers/checks/active/xss.rb +35 -0
- data/spec/support/servers/checks/active/xss_dom.rb +1 -1
- data/spec/support/servers/checks/active/xss_dom_inputs.rb +24 -0
- data/spec/support/servers/checks/active/xss_dom_script_context.rb +1 -1
- data/spec/support/servers/checks/passive/common_admin_interfaces.rb +6 -0
- data/spec/support/servers/plugins/autologin.rb +9 -0
- data/spec/support/servers/plugins/restrict_to_dom_state.rb +4 -0
- data/spec/support/shared/element/base.rb +42 -0
- data/spec/support/shared/element/capabilities/auditable.rb +4 -4
- data/spec/support/shared/element/capabilities/auditable/dom.rb +26 -0
- data/spec/support/shared/element/capabilities/inputtable.rb +16 -11
- data/spec/support/shared/element/capabilities/submitable.rb +7 -2
- data/spec/support/shared/fingerprinter.rb +8 -0
- data/spec/support/shared/path_extractor.rb +1 -1
- data/ui/cli/framework.rb +3 -3
- data/ui/cli/framework/option_parser.rb +9 -0
- data/ui/cli/output.rb +9 -0
- data/ui/cli/reporter.rb +5 -2
- data/ui/cli/utilities.rb +4 -2
- metadata +76 -17
- data/lib/arachni/http/proxy_server/ssl-interceptor-cert.pem +0 -34
- data/lib/arachni/http/proxy_server/ssl-interceptor-pkey.pem +0 -51
- data/spec/components/fingerprinters/languages/jsp_spec.rb +0 -56
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Arachni::Platform::Fingerprinters::Rails do
|
4
|
+
include_examples 'fingerprinter'
|
5
|
+
|
6
|
+
def platforms
|
7
|
+
[:ruby, :rack, :rails]
|
8
|
+
end
|
9
|
+
|
10
|
+
context 'when there is an Server header' do
|
11
|
+
context 'and it contains Rails' do
|
12
|
+
it 'identifies it as Ruby' do
|
13
|
+
check_platforms Arachni::Page.from_data(
|
14
|
+
url: 'http://stuff.com/blah',
|
15
|
+
response: { headers: { 'Server' => 'Rails' } }
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'when there is a X-Powered-By header' do
|
22
|
+
context 'and it contains X-Powered-By' do
|
23
|
+
it 'identifies it as Rails' do
|
24
|
+
check_platforms Arachni::Page.from_data(
|
25
|
+
url: 'http://stuff.com/blah',
|
26
|
+
response: { headers: { 'X-Powered-By' => 'Rails' } }
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'when there are X-Rails headers' do
|
33
|
+
it 'identifies it as Rails' do
|
34
|
+
check_platforms Arachni::Page.from_data(
|
35
|
+
url: 'http://stuff.com/blah',
|
36
|
+
response: { headers: { 'X-Rails-Stuff' => 'Blah' } }
|
37
|
+
)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'when there is a _rails_admin_session cookie' do
|
42
|
+
it 'identifies it as Rails' do
|
43
|
+
check_platforms Arachni::Page.from_data(
|
44
|
+
url: 'http://stuff.com/blah',
|
45
|
+
cookies: [Arachni::Cookie.new(
|
46
|
+
url: 'http://stuff.com/blah',
|
47
|
+
inputs: { '_rails_admin_session' => 'stuff' } )]
|
48
|
+
|
49
|
+
)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
@@ -3,35 +3,33 @@ require 'spec_helper'
|
|
3
3
|
describe Arachni::Platform::Fingerprinters::ASP do
|
4
4
|
include_examples 'fingerprinter'
|
5
5
|
|
6
|
+
def platforms
|
7
|
+
[:asp, :windows]
|
8
|
+
end
|
9
|
+
|
6
10
|
context 'when the page has a .asp extension' do
|
7
11
|
it 'identifies it as ASP' do
|
8
|
-
|
9
|
-
platforms_for( page ).should include :asp
|
10
|
-
platforms_for( page ).should include :windows
|
12
|
+
check_platforms Arachni::Page.from_data( url: 'http://stuff.com/blah.asp' )
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
14
16
|
context 'when there is a ASPSESSIONID query parameter' do
|
15
17
|
it 'identifies it as ASP' do
|
16
|
-
|
18
|
+
check_platforms Arachni::Page.from_data(
|
17
19
|
url: 'http://stuff.com/blah?ASPSESSIONID=stuff'
|
18
20
|
)
|
19
|
-
platforms_for( page ).should include :asp
|
20
|
-
platforms_for( page ).should include :windows
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
context 'when there is a ASPSESSIONID cookie' do
|
25
25
|
it 'identifies it as ASP' do
|
26
|
-
|
26
|
+
check_platforms Arachni::Page.from_data(
|
27
27
|
url: 'http://stuff.com/blah',
|
28
28
|
cookies: [Arachni::Cookie.new(
|
29
29
|
url: 'http://stuff.com/blah',
|
30
30
|
inputs: { 'ASPSESSIONID' => 'stuff' } )]
|
31
31
|
|
32
32
|
)
|
33
|
-
platforms_for( page ).should include :asp
|
34
|
-
platforms_for( page ).should include :windows
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|
@@ -3,76 +3,62 @@ require 'spec_helper'
|
|
3
3
|
describe Arachni::Platform::Fingerprinters::ASPX do
|
4
4
|
include_examples 'fingerprinter'
|
5
5
|
|
6
|
+
def platforms
|
7
|
+
[:asp, :aspx, :windows]
|
8
|
+
end
|
9
|
+
|
6
10
|
context 'when the page has a .aspx extension' do
|
7
11
|
it 'identifies it as ASPX' do
|
8
|
-
|
9
|
-
platforms_for( page ).should include :asp
|
10
|
-
platforms_for( page ).should include :aspx
|
11
|
-
platforms_for( page ).should include :windows
|
12
|
+
check_platforms Arachni::Page.from_data( url: 'http://stuff.com/blah.aspx' )
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
15
16
|
context 'when there is a session ID in the path' do
|
16
17
|
it 'identifies it as ASPX' do
|
17
|
-
|
18
|
+
check_platforms Arachni::Page.from_data(
|
18
19
|
url: 'http://blah.com/(S(yn5cby55lgzstcen0ng2b4iq))/stuff'
|
19
20
|
)
|
20
|
-
platforms_for( page ).should include :asp
|
21
|
-
platforms_for( page ).should include :aspx
|
22
|
-
platforms_for( page ).should include :windows
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
26
24
|
context 'when there is a ASP.NET_SessionId cookie' do
|
27
25
|
it 'identifies it as ASPX' do
|
28
|
-
|
26
|
+
check_platforms Arachni::Page.from_data(
|
29
27
|
url: 'http://stuff.com/blah',
|
30
28
|
cookies: [Arachni::Cookie.new(
|
31
29
|
url: 'http://stuff.com/blah',
|
32
30
|
inputs: { 'ASP.NET_SessionId' => 'stuff' } )]
|
33
31
|
|
34
32
|
)
|
35
|
-
platforms_for( page ).should include :asp
|
36
|
-
platforms_for( page ).should include :aspx
|
37
|
-
platforms_for( page ).should include :windows
|
38
33
|
end
|
39
34
|
end
|
40
35
|
|
41
36
|
context 'when there is an X-Powered-By header' do
|
42
37
|
it 'identifies it as ASPX' do
|
43
|
-
|
38
|
+
check_platforms Arachni::Page.from_data(
|
44
39
|
url: 'http://stuff.com/blah',
|
45
40
|
response: { headers: { 'X-Powered-By' => 'ASP.NET' } }
|
46
41
|
)
|
47
|
-
platforms_for( page ).should include :asp
|
48
|
-
platforms_for( page ).should include :aspx
|
49
|
-
platforms_for( page ).should include :windows
|
50
42
|
end
|
51
43
|
end
|
52
44
|
|
53
45
|
context 'when there is an X-AspNet-Version header' do
|
54
46
|
it 'identifies it as ASPX' do
|
55
|
-
|
47
|
+
check_platforms Arachni::Page.from_data(
|
56
48
|
url: 'http://stuff.com/blah',
|
57
49
|
response: { headers: { 'X-AspNet-Version' => '4.0.30319' } }
|
58
50
|
|
59
51
|
)
|
60
|
-
platforms_for( page ).should include :asp
|
61
|
-
platforms_for( page ).should include :aspx
|
62
|
-
platforms_for( page ).should include :windows
|
63
52
|
end
|
64
53
|
end
|
65
54
|
|
66
55
|
context 'when there is an X-AspNetMvc-Version header' do
|
67
56
|
it 'identifies it as ASPX' do
|
68
|
-
|
57
|
+
check_platforms Arachni::Page.from_data(
|
69
58
|
url: 'http://stuff.com/blah',
|
70
59
|
response: { headers: { 'X-AspNetMvc-Version' => '2.0' } }
|
71
60
|
|
72
61
|
)
|
73
|
-
platforms_for( page ).should include :asp
|
74
|
-
platforms_for( page ).should include :aspx
|
75
|
-
platforms_for( page ).should include :windows
|
76
62
|
end
|
77
63
|
end
|
78
64
|
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Arachni::Platform::Fingerprinters::Java do
|
4
|
+
include_examples 'fingerprinter'
|
5
|
+
|
6
|
+
def platforms
|
7
|
+
[:java]
|
8
|
+
end
|
9
|
+
|
10
|
+
context 'when the page has a .jsp extension' do
|
11
|
+
it 'identifies it as JSP' do
|
12
|
+
check_platforms Arachni::Page.from_data( url: 'http://stuff.com/blah.jsp' )
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'when there is a JSESSIONID query parameter' do
|
17
|
+
it 'identifies it as Java' do
|
18
|
+
check_platforms Arachni::Page.from_data(
|
19
|
+
url: 'http://stuff.com/blah?JSESSIONID=stuff'
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'when there is a JSESSIONID cookie' do
|
25
|
+
it 'identifies it as Java' do
|
26
|
+
check_platforms Arachni::Page.from_data(
|
27
|
+
url: 'http://stuff.com/blah',
|
28
|
+
cookies: [Arachni::Cookie.new(
|
29
|
+
url: 'http://stuff.com/blah',
|
30
|
+
inputs: { 'JSESSIONID' => 'stuff' } )]
|
31
|
+
)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when there is an X-Powered-By header with Servlet' do
|
36
|
+
it 'identifies it as Java' do
|
37
|
+
check_platforms Arachni::Page.from_data(
|
38
|
+
url: 'http://stuff.com/blah',
|
39
|
+
response: { headers: { 'X-Powered-By' => 'Servlet/2.4' } }
|
40
|
+
)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'when there is an X-Powered-By header with JSP' do
|
45
|
+
it 'identifies it as Java' do
|
46
|
+
check_platforms Arachni::Page.from_data(
|
47
|
+
url: 'http://stuff.com/blah',
|
48
|
+
response: { headers: { 'X-Powered-By' => 'JSP/2.1' } }
|
49
|
+
)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context 'when there is an X-Powered-By header with JBoss' do
|
54
|
+
it 'identifies it as Java' do
|
55
|
+
check_platforms Arachni::Page.from_data(
|
56
|
+
url: 'http://stuff.com/blah',
|
57
|
+
response: { headers: { 'X-Powered-By' => 'JBossWeb-2.1' } }
|
58
|
+
)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
context 'when there is an X-Powered-By header with GlassFish' do
|
63
|
+
it 'identifies it as Java' do
|
64
|
+
check_platforms Arachni::Page.from_data(
|
65
|
+
url: 'http://stuff.com/blah',
|
66
|
+
response: { headers: { 'X-Powered-By' => 'GlassFish Server' } }
|
67
|
+
)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
context 'when there is an X-Powered-By header with Java' do
|
72
|
+
it 'identifies it as Java' do
|
73
|
+
check_platforms Arachni::Page.from_data(
|
74
|
+
url: 'http://stuff.com/blah',
|
75
|
+
response: { headers: { 'X-Powered-By' => 'Java' } }
|
76
|
+
)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
context 'when there is an X-Powered-By header with Oracle' do
|
81
|
+
it 'identifies it as Java' do
|
82
|
+
check_platforms Arachni::Page.from_data(
|
83
|
+
url: 'http://stuff.com/blah',
|
84
|
+
response: { headers: { 'X-Powered-By' => 'Oracle-Application-Server-10g/10.1.3.5.0 Oracle-HTTP-Server' } }
|
85
|
+
)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -3,56 +3,63 @@ require 'spec_helper'
|
|
3
3
|
describe Arachni::Platform::Fingerprinters::PHP do
|
4
4
|
include_examples 'fingerprinter'
|
5
5
|
|
6
|
+
def platforms
|
7
|
+
[:php]
|
8
|
+
end
|
9
|
+
|
6
10
|
context 'when the page has a .php extension' do
|
7
11
|
it 'identifies it as PHP' do
|
8
|
-
|
9
|
-
platforms_for( page ).should include :php
|
12
|
+
check_platforms Arachni::Page.from_data( url: 'http://stuff.com/blah.php' )
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
13
16
|
context 'when the page has a .php/ rewrite' do
|
14
17
|
it 'identifies it as PHP' do
|
15
|
-
|
16
|
-
platforms_for( page ).should include :php
|
18
|
+
check_platforms Arachni::Page.from_data( url: 'http://stuff.com/blah.php/Stuff/1' )
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
20
22
|
context 'when the page has a .php5 (or similarly numbered) extension' do
|
21
23
|
it 'identifies it as PHP' do
|
22
|
-
|
23
|
-
platforms_for( page ).should include :php
|
24
|
+
check_platforms Arachni::Page.from_data( url: 'http://stuff.com/blah.php5' )
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
27
28
|
context 'when there is a PHPSESSID query parameter' do
|
28
29
|
it 'identifies it as PHP' do
|
29
|
-
|
30
|
+
check_platforms Arachni::Page.from_data(
|
30
31
|
url: 'http://stuff.com/blah?PHPSESSID=stuff'
|
31
32
|
)
|
32
|
-
platforms_for( page ).should include :php
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
context 'when there is a PHPSESSID cookie' do
|
37
37
|
it 'identifies it as PHP' do
|
38
|
-
|
38
|
+
check_platforms Arachni::Page.from_data(
|
39
39
|
url: 'http://stuff.com/blah',
|
40
40
|
cookies: [Arachni::Cookie.new(
|
41
41
|
url: 'http://stuff.com/blah',
|
42
42
|
inputs: { 'PHPSESSID' => 'stuff' } )]
|
43
43
|
|
44
44
|
)
|
45
|
-
platforms_for( page ).should include :php
|
46
45
|
end
|
47
46
|
end
|
48
47
|
|
49
48
|
context 'when there is an X-Powered-By header' do
|
50
49
|
it 'identifies it as PHP' do
|
51
|
-
|
50
|
+
check_platforms Arachni::Page.from_data(
|
52
51
|
url: 'http://stuff.com/blah',
|
53
52
|
response: { headers: { 'X-Powered-By' => 'PHP/5.1.2' } }
|
54
53
|
)
|
55
|
-
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
context 'when there is an X-PHP-PID header' do
|
58
|
+
it 'identifies it as PHP' do
|
59
|
+
check_platforms Arachni::Page.from_data(
|
60
|
+
url: 'http://stuff.com/blah',
|
61
|
+
response: { headers: { 'X-PHP-PID' => '2212' } }
|
62
|
+
)
|
56
63
|
end
|
57
64
|
end
|
58
65
|
|
@@ -3,20 +3,33 @@ require 'spec_helper'
|
|
3
3
|
describe Arachni::Platform::Fingerprinters::Python do
|
4
4
|
include_examples 'fingerprinter'
|
5
5
|
|
6
|
+
def platforms
|
7
|
+
[:python]
|
8
|
+
end
|
9
|
+
|
6
10
|
context 'when the page has a .py extension' do
|
7
11
|
it 'identifies it as Python' do
|
8
|
-
|
9
|
-
platforms_for( page ).should include :python
|
12
|
+
check_platforms Arachni::Page.from_data( url: 'http://stuff.com/blah.py' )
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
described_class::IDS.each do |id|
|
17
|
+
context "when there is an X-Powered-By header with #{id}" do
|
18
|
+
it 'identifies it as Python' do
|
19
|
+
check_platforms Arachni::Page.from_data(
|
20
|
+
url: 'http://stuff.com/blah',
|
21
|
+
response: { headers: { 'X-Powered-By' => "#{id}/stuff" } }
|
22
|
+
)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "when there is a Server header with #{id}" do
|
27
|
+
it 'identifies it as Python' do
|
28
|
+
check_platforms Arachni::Page.from_data(
|
29
|
+
url: 'http://stuff.com/blah',
|
30
|
+
response: { headers: { 'Server' => "#{id}/stuff" } }
|
31
|
+
)
|
32
|
+
end
|
20
33
|
end
|
21
34
|
end
|
22
35
|
|
@@ -3,15 +3,18 @@ require 'spec_helper'
|
|
3
3
|
describe Arachni::Platform::Fingerprinters::Ruby do
|
4
4
|
include_examples 'fingerprinter'
|
5
5
|
|
6
|
+
def platforms
|
7
|
+
[:ruby]
|
8
|
+
end
|
9
|
+
|
6
10
|
context 'when there is an Server header' do
|
7
11
|
described_class::IDs.each do |id|
|
8
12
|
context "and it contains #{id}" do
|
9
13
|
it 'identifies it as Ruby' do
|
10
|
-
|
14
|
+
check_platforms Arachni::Page.from_data(
|
11
15
|
url: 'http://stuff.com/blah',
|
12
16
|
response: { headers: { 'Server' => "Apache/2.2.21 (#{id})" } }
|
13
17
|
)
|
14
|
-
platforms_for( page ).should include :ruby
|
15
18
|
end
|
16
19
|
end
|
17
20
|
end
|
@@ -21,11 +24,10 @@ describe Arachni::Platform::Fingerprinters::Ruby do
|
|
21
24
|
described_class::IDs.each do |id|
|
22
25
|
context "and it contains #{id}" do
|
23
26
|
it 'identifies it as Ruby' do
|
24
|
-
|
27
|
+
check_platforms Arachni::Page.from_data(
|
25
28
|
url: 'http://stuff.com/blah',
|
26
29
|
response: { headers: { 'X-Powered-By' => "Apache/2.2.21 (#{id})" } }
|
27
30
|
)
|
28
|
-
platforms_for( page ).should include :ruby
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
@@ -3,23 +3,25 @@ require 'spec_helper'
|
|
3
3
|
describe Arachni::Platform::Fingerprinters::BSD do
|
4
4
|
include_examples 'fingerprinter'
|
5
5
|
|
6
|
+
def platforms
|
7
|
+
[:bsd]
|
8
|
+
end
|
9
|
+
|
6
10
|
context 'when there is an Server header' do
|
7
11
|
it 'identifies it as BSD' do
|
8
|
-
|
12
|
+
check_platforms Arachni::Page.from_data(
|
9
13
|
url: 'http://stuff.com/blah',
|
10
14
|
response: { headers: { 'Server' => 'Apache/2.2.21 (FreeBSD)' } }
|
11
15
|
)
|
12
|
-
platforms_for( page ).should include :bsd
|
13
16
|
end
|
14
17
|
end
|
15
18
|
|
16
19
|
context 'when there is a X-Powered-By header' do
|
17
20
|
it 'identifies it as BSD' do
|
18
|
-
|
21
|
+
check_platforms Arachni::Page.from_data(
|
19
22
|
url: 'http://stuff.com/blah',
|
20
23
|
response: { headers: { 'X-Powered-By' => 'Stuf/0.4 (FreeBSD)' } }
|
21
24
|
)
|
22
|
-
platforms_for( page ).should include :bsd
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|