arachni 1.2.1 → 1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +66 -0
- data/Gemfile +1 -1
- data/README.md +16 -5
- data/components/checks/active/ldap_injection/errors.txt +1 -0
- data/components/checks/active/source_code_disclosure.rb +1 -1
- data/components/checks/active/unvalidated_redirect.rb +6 -6
- data/components/checks/active/unvalidated_redirect_dom.rb +10 -7
- data/components/checks/passive/grep/captcha.rb +14 -5
- data/components/checks/passive/grep/form_upload.rb +7 -3
- data/components/checks/passive/grep/hsts.rb +3 -3
- data/components/checks/passive/grep/html_objects.rb +2 -3
- data/components/checks/passive/grep/http_only_cookies.rb +2 -3
- data/components/checks/passive/grep/insecure_cookies.rb +1 -1
- data/components/checks/passive/grep/password_autocomplete.rb +2 -2
- data/components/checks/passive/grep/unencrypted_password_forms.rb +7 -7
- data/components/checks/passive/grep/x_frame_options.rb +2 -2
- data/components/checks/passive/http_put.rb +2 -3
- data/components/path_extractors/comments.rb +3 -3
- data/components/path_extractors/scripts.rb +10 -1
- data/components/plugins/defaults/autothrottle.rb +27 -18
- data/components/plugins/defaults/meta/remedies/discovery.rb +30 -33
- data/components/plugins/defaults/meta/remedies/timing_attacks.rb +7 -11
- data/components/plugins/login_script.rb +9 -3
- data/components/plugins/proxy.rb +4 -3
- data/components/reporters/html.rb +11 -14
- data/components/reporters/html/default/issue.erb +13 -38
- data/components/reporters/html/default/issue/info.erb +1 -1
- data/components/reporters/html/default/summary/issues/by_name.erb +3 -3
- data/components/reporters/stdout.rb +62 -71
- data/components/reporters/xml.rb +26 -40
- data/components/reporters/xml/schema.xsd +43 -89
- data/lib/arachni/browser.rb +52 -3
- data/lib/arachni/browser/javascript.rb +3 -3
- data/lib/arachni/browser/javascript/scripts/taint_tracer.js +46 -25
- data/lib/arachni/browser_cluster.rb +61 -0
- data/lib/arachni/browser_cluster/job.rb +21 -1
- data/lib/arachni/browser_cluster/jobs/browser_provider.rb +3 -1
- data/lib/arachni/browser_cluster/jobs/resource_exploration.rb +2 -1
- data/lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb +2 -1
- data/lib/arachni/browser_cluster/jobs/taint_trace.rb +3 -2
- data/lib/arachni/browser_cluster/jobs/taint_trace/event_trigger.rb +1 -1
- data/lib/arachni/browser_cluster/worker.rb +5 -0
- data/lib/arachni/check/auditor.rb +22 -12
- data/lib/arachni/data/framework.rb +13 -1
- data/lib/arachni/data/issues.rb +9 -25
- data/lib/arachni/element/base.rb +9 -3
- data/lib/arachni/element/capabilities/analyzable.rb +2 -6
- data/lib/arachni/element/capabilities/analyzable/differential.rb +24 -7
- data/lib/arachni/element/capabilities/analyzable/{taint.rb → signature.rb} +23 -23
- data/lib/arachni/element/capabilities/auditable.rb +0 -6
- data/lib/arachni/element/capabilities/dom_only.rb +61 -0
- data/lib/arachni/element/capabilities/with_dom.rb +3 -1
- data/lib/arachni/element/cookie.rb +35 -5
- data/lib/arachni/element/cookie/dom.rb +13 -4
- data/lib/arachni/element/{capabilities/auditable/dom.rb → dom.rb} +20 -68
- data/lib/arachni/element/dom/capabilities/auditable.rb +29 -0
- data/lib/arachni/element/dom/capabilities/inputtable.rb +27 -0
- data/lib/arachni/element/dom/capabilities/mutable.rb +21 -0
- data/lib/arachni/element/dom/capabilities/submittable.rb +52 -0
- data/lib/arachni/element/form.rb +12 -1
- data/lib/arachni/element/form/capabilities/mutable.rb +2 -1
- data/lib/arachni/element/form/capabilities/with_dom.rb +0 -1
- data/lib/arachni/element/form/dom.rb +9 -3
- data/lib/arachni/element/header.rb +14 -33
- data/lib/arachni/element/header/capabilities/inputtable.rb +29 -0
- data/lib/arachni/element/header/capabilities/mutable.rb +51 -0
- data/lib/arachni/element/input/dom.rb +71 -0
- data/lib/arachni/element/json.rb +2 -0
- data/lib/arachni/element/link.rb +3 -0
- data/lib/arachni/element/link/capabilities/with_dom.rb +0 -1
- data/lib/arachni/element/link/dom.rb +16 -3
- data/lib/arachni/element/link/dom/capabilities/submittable.rb +29 -0
- data/lib/arachni/element/link_template.rb +3 -5
- data/lib/arachni/element/link_template/capabilities/inputtable.rb +5 -0
- data/lib/arachni/element/link_template/capabilities/with_dom.rb +0 -1
- data/lib/arachni/element/link_template/dom.rb +16 -3
- data/lib/arachni/element/link_template/dom/capabilities/submittable.rb +29 -0
- data/lib/arachni/element/server.rb +3 -5
- data/lib/arachni/element/ui_form.rb +106 -0
- data/lib/arachni/element/ui_form/dom.rb +107 -0
- data/lib/arachni/element/ui_input.rb +62 -0
- data/lib/arachni/element/xml.rb +2 -1
- data/lib/arachni/framework.rb +7 -5
- data/lib/arachni/framework/parts/audit.rb +0 -1
- data/lib/arachni/framework/parts/check.rb +1 -0
- data/lib/arachni/framework/parts/data.rb +4 -0
- data/lib/arachni/framework/parts/state.rb +0 -2
- data/lib/arachni/http/client.rb +17 -6
- data/lib/arachni/http/proxy_server.rb +52 -5
- data/lib/arachni/http/request.rb +1 -1
- data/lib/arachni/issue.rb +34 -179
- data/lib/arachni/issue/severity.rb +2 -0
- data/lib/arachni/option_groups/audit.rb +22 -2
- data/lib/arachni/option_groups/browser_cluster.rb +15 -0
- data/lib/arachni/page.rb +3 -2
- data/lib/arachni/parser.rb +24 -5
- data/lib/arachni/platform/manager.rb +1 -2
- data/lib/arachni/rpc/server/framework.rb +3 -4
- data/lib/arachni/rpc/server/framework/multi_instance.rb +2 -1
- data/lib/arachni/session.rb +1 -1
- data/lib/arachni/trainer.rb +4 -7
- data/lib/arachni/watir/element.rb +12 -1
- data/lib/version +1 -1
- data/spec/arachni/browser/element_locator_spec.rb +43 -43
- data/spec/arachni/browser/javascript/dom_monitor_spec.rb +44 -44
- data/spec/arachni/browser/javascript/proxy/stub_spec.rb +17 -14
- data/spec/arachni/browser/javascript/proxy_spec.rb +24 -24
- data/spec/arachni/browser/javascript/taint_tracer/frame/called_function_spec.rb +11 -11
- data/spec/arachni/browser/javascript/taint_tracer/frame_spec.rb +7 -7
- data/spec/arachni/browser/javascript/taint_tracer/sink/data_flow_spec.rb +13 -13
- data/spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb +7 -7
- data/spec/arachni/browser/javascript/taint_tracer_spec.rb +568 -558
- data/spec/arachni/browser/javascript_spec.rb +73 -63
- data/spec/arachni/browser_cluster/job/result_spec.rb +3 -3
- data/spec/arachni/browser_cluster/job_spec.rb +68 -48
- data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger/result_spec.rb +2 -2
- data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger_spec.rb +5 -4
- data/spec/arachni/browser_cluster/jobs/resource_exploration/result_spec.rb +2 -2
- data/spec/arachni/browser_cluster/jobs/resource_exploration_spec.rb +5 -5
- data/spec/arachni/browser_cluster/worker_spec.rb +87 -70
- data/spec/arachni/browser_cluster_spec.rb +64 -39
- data/spec/arachni/browser_spec.rb +692 -527
- data/spec/arachni/check/auditor_spec.rb +177 -147
- data/spec/arachni/check/base_spec.rb +33 -33
- data/spec/arachni/check/manager_spec.rb +15 -15
- data/spec/arachni/component/base_spec.rb +8 -8
- data/spec/arachni/component/manager_spec.rb +100 -99
- data/spec/arachni/component/options/address_spec.rb +3 -3
- data/spec/arachni/component/options/base_spec.rb +7 -7
- data/spec/arachni/component/options/bool_spec.rb +9 -9
- data/spec/arachni/component/options/float_spec.rb +6 -6
- data/spec/arachni/component/options/int_spec.rb +5 -5
- data/spec/arachni/component/options/multiple_choice_spec.rb +12 -12
- data/spec/arachni/component/options/object_spec.rb +2 -2
- data/spec/arachni/component/options/path_spec.rb +3 -3
- data/spec/arachni/component/options/port_spec.rb +5 -5
- data/spec/arachni/component/options/string_spec.rb +3 -3
- data/spec/arachni/component/options/url_spec.rb +4 -4
- data/spec/arachni/component/utilities_spec.rb +2 -2
- data/spec/arachni/data/framework/rpc_spec.rb +10 -9
- data/spec/arachni/data/framework_spec.rb +65 -46
- data/spec/arachni/data/issues_spec.rb +39 -77
- data/spec/arachni/data/plugins_spec.rb +11 -11
- data/spec/arachni/data/session_spec.rb +6 -6
- data/spec/arachni/data_spec.rb +8 -8
- data/spec/arachni/element/body_spec.rb +10 -10
- data/spec/arachni/element/capabilities/analyzable/differential_spec.rb +39 -21
- data/spec/arachni/element/capabilities/analyzable/{taint_spec.rb → signature_spec.rb} +63 -63
- data/spec/arachni/element/capabilities/analyzable/timeout_spec.rb +51 -51
- data/spec/arachni/element/capabilities/with_scope/scope_spec.rb +5 -5
- data/spec/arachni/element/cookie/dom_spec.rb +37 -18
- data/spec/arachni/element/cookie_spec.rb +206 -139
- data/spec/arachni/element/form/dom_spec.rb +36 -19
- data/spec/arachni/element/form_spec.rb +210 -187
- data/spec/arachni/element/generic_dom_spec.rb +14 -14
- data/spec/arachni/element/header_spec.rb +35 -17
- data/spec/arachni/element/json_spec.rb +53 -31
- data/spec/arachni/element/link/dom_spec.rb +46 -28
- data/spec/arachni/element/link_spec.rb +58 -40
- data/spec/arachni/element/link_template/dom_spec.rb +47 -29
- data/spec/arachni/element/link_template_spec.rb +79 -61
- data/spec/arachni/element/path_spec.rb +1 -1
- data/spec/arachni/element/server_spec.rb +33 -32
- data/spec/arachni/element/ui_form/ui_form_dom_spec.rb +164 -0
- data/spec/arachni/element/ui_form_spec.rb +242 -0
- data/spec/arachni/element/ui_input/dom_spec.rb +157 -0
- data/spec/arachni/element/ui_input_spec.rb +136 -0
- data/spec/arachni/element/xml_spec.rb +42 -24
- data/spec/arachni/element_filter_spec.rb +49 -48
- data/spec/arachni/error_spec.rb +3 -3
- data/spec/arachni/framework/parts/audit_spec.rb +64 -63
- data/spec/arachni/framework/parts/browser_spec.rb +16 -16
- data/spec/arachni/framework/parts/check_spec.rb +3 -3
- data/spec/arachni/framework/parts/data_spec.rb +48 -48
- data/spec/arachni/framework/parts/platform_spec.rb +3 -3
- data/spec/arachni/framework/parts/plugin_spec.rb +7 -6
- data/spec/arachni/framework/parts/report_spec.rb +7 -7
- data/spec/arachni/framework/parts/scope_spec.rb +16 -16
- data/spec/arachni/framework/parts/state_spec.rb +68 -69
- data/spec/arachni/framework_spec.rb +39 -31
- data/spec/arachni/http/client/dynamic_404_handlers_spec.rb +32 -32
- data/spec/arachni/http/client_spec.rb +219 -208
- data/spec/arachni/http/cookie_jar_spec.rb +72 -72
- data/spec/arachni/http/headers_spec.rb +14 -14
- data/spec/arachni/http/proxy_server_spec.rb +43 -42
- data/spec/arachni/http/request_spec.rb +105 -103
- data/spec/arachni/http/response/scope_spec.rb +24 -24
- data/spec/arachni/http/response_spec.rb +50 -49
- data/spec/arachni/issue/severity_spec.rb +10 -9
- data/spec/arachni/issue_spec.rb +71 -369
- data/spec/arachni/option_groups/audit_spec.rb +114 -114
- data/spec/arachni/option_groups/browser_cluster_spec.rb +20 -3
- data/spec/arachni/option_groups/datastore_spec.rb +6 -6
- data/spec/arachni/option_groups/dispatcher_spec.rb +19 -19
- data/spec/arachni/option_groups/http_spec.rb +11 -11
- data/spec/arachni/option_groups/input_spec.rb +31 -27
- data/spec/arachni/option_groups/output_spec.rb +2 -2
- data/spec/arachni/option_groups/paths_spec.rb +17 -17
- data/spec/arachni/option_groups/rpc_spec.rb +2 -2
- data/spec/arachni/option_groups/scope_spec.rb +40 -40
- data/spec/arachni/option_groups/session_spec.rb +6 -5
- data/spec/arachni/option_groups/snapshot_spec.rb +4 -4
- data/spec/arachni/options_spec.rb +46 -45
- data/spec/arachni/page/dom/transition_spec.rb +74 -72
- data/spec/arachni/page/dom_spec.rb +35 -35
- data/spec/arachni/page/scope_spec.rb +15 -15
- data/spec/arachni/page_spec.rb +217 -217
- data/spec/arachni/parser_spec.rb +106 -104
- data/spec/arachni/platform/fingerprinter_spec.rb +17 -14
- data/spec/arachni/platform/list_spec.rb +33 -33
- data/spec/arachni/platform/manager_spec.rb +67 -64
- data/spec/arachni/plugin/base_spec.rb +10 -10
- data/spec/arachni/plugin/manager_spec.rb +38 -37
- data/spec/arachni/report_spec.rb +43 -40
- data/spec/arachni/reporter/base_spec.rb +15 -15
- data/spec/arachni/reporter/manager_spec.rb +4 -4
- data/spec/arachni/reporter/options_spec.rb +6 -6
- data/spec/arachni/rpc/client/base_spec.rb +6 -6
- data/spec/arachni/rpc/client/dispatcher_spec.rb +2 -2
- data/spec/arachni/rpc/client/instance_spec.rb +6 -6
- data/spec/arachni/rpc/server/active_options_spec.rb +11 -8
- data/spec/arachni/rpc/server/base_spec.rb +5 -5
- data/spec/arachni/rpc/server/checks/manager_spec.rb +8 -8
- data/spec/arachni/rpc/server/dispatcher/node_spec.rb +37 -37
- data/spec/arachni/rpc/server/dispatcher/service_spec.rb +15 -14
- data/spec/arachni/rpc/server/dispatcher_spec.rb +36 -35
- data/spec/arachni/rpc/server/framework/distributor_spec.rb +36 -36
- data/spec/arachni/rpc/server/framework_multi_spec.rb +340 -336
- data/spec/arachni/rpc/server/framework_spec.rb +90 -85
- data/spec/arachni/rpc/server/instance_spec.rb +126 -107
- data/spec/arachni/rpc/server/output_spec.rb +1 -1
- data/spec/arachni/rpc/server/plugin/manager_spec.rb +6 -6
- data/spec/arachni/ruby/array_spec.rb +42 -42
- data/spec/arachni/ruby/hash_spec.rb +20 -18
- data/spec/arachni/ruby/io_spec.rb +2 -2
- data/spec/arachni/ruby/object_spec.rb +1 -1
- data/spec/arachni/ruby/set_spec.rb +3 -3
- data/spec/arachni/ruby/string_spec.rb +30 -30
- data/spec/arachni/ruby/webrick_spec.rb +2 -2
- data/spec/arachni/scope_spec.rb +1 -1
- data/spec/arachni/session_spec.rb +67 -64
- data/spec/arachni/snapshot_spec.rb +15 -15
- data/spec/arachni/state/audit_spec.rb +11 -11
- data/spec/arachni/state/element_filter_spec.rb +6 -6
- data/spec/arachni/state/framework/rpc_spec.rb +12 -12
- data/spec/arachni/state/framework_spec.rb +125 -121
- data/spec/arachni/state/http_spec.rb +7 -7
- data/spec/arachni/state/options_spec.rb +7 -7
- data/spec/arachni/state/plugins_spec.rb +8 -8
- data/spec/arachni/state_spec.rb +10 -10
- data/spec/arachni/support/buffer/autoflush_spec.rb +16 -16
- data/spec/arachni/support/buffer/base_spec.rb +39 -39
- data/spec/arachni/support/cache/least_cost_replacement_spec.rb +18 -18
- data/spec/arachni/support/cache/least_recently_pushed_spec.rb +24 -24
- data/spec/arachni/support/cache/least_recently_used_spec.rb +20 -20
- data/spec/arachni/support/cache/preference_spec.rb +4 -4
- data/spec/arachni/support/cache/random_replacement_spec.rb +8 -8
- data/spec/arachni/support/crypto/rsa_aes_cbc_spec.rb +1 -1
- data/spec/arachni/support/database/hash_spec.rb +44 -43
- data/spec/arachni/support/database/queue_spec.rb +27 -27
- data/spec/arachni/support/lookup/hash_set_spec.rb +8 -8
- data/spec/arachni/support/lookup/moolb_spec.rb +3 -3
- data/spec/arachni/support/mixins/observable_spec.rb +6 -6
- data/spec/arachni/support/signature_spec.rb +19 -19
- data/spec/arachni/trainer_spec.rb +39 -39
- data/spec/arachni/typhoeus/hydra_spec.rb +2 -2
- data/spec/arachni/uri/scope_spec.rb +66 -66
- data/spec/arachni/uri_spec.rb +107 -105
- data/spec/arachni/utilities_spec.rb +40 -40
- data/spec/components/checks/active/csrf_spec.rb +8 -8
- data/spec/components/checks/active/no_sql_injection_spec.rb +1 -1
- data/spec/components/checks/active/sql_injection_spec.rb +16 -16
- data/spec/components/checks/active/trainer_spec.rb +4 -4
- data/spec/components/checks/active/unvalidated_redirect_dom_spec.rb +4 -2
- data/spec/components/checks/active/xpath_injection_spec.rb +1 -1
- data/spec/components/checks/active/xss_dom_script_context_spec.rb +51 -21
- data/spec/components/checks/active/xss_dom_spec.rb +46 -24
- data/spec/components/checks/passive/allowed_methods_spec.rb +1 -1
- data/spec/components/checks/passive/grep/cookie_set_for_parent_domain_spec.rb +1 -1
- data/spec/components/checks/passive/grep/hsts_spec.rb +2 -2
- data/spec/components/checks/passive/grep/http_only_cookies_spec.rb +1 -1
- data/spec/components/checks/passive/grep/insecure_cookies_spec.rb +1 -1
- data/spec/components/checks/passive/grep/insecure_cors_policy_spec.rb +2 -2
- data/spec/components/checks/passive/grep/password_autocomplete_spec.rb +1 -1
- data/spec/components/checks/passive/grep/private_ip_spec.rb +3 -3
- data/spec/components/checks/passive/grep/unencrypted_password_forms_spec.rb +1 -1
- data/spec/components/checks/passive/grep/x_frame_options_spec.rb +2 -2
- data/spec/components/checks/passive/interesting_responses_spec.rb +2 -2
- data/spec/components/checks/passive/webdav_spec.rb +1 -1
- data/spec/components/checks/passive/xst_spec.rb +1 -1
- data/spec/components/fingerprinters/servers/apache_spec.rb +2 -2
- data/spec/components/path_extractors/comments_spec.rb +5 -1
- data/spec/components/path_extractors/scripts_spec.rb +5 -2
- data/spec/components/plugins/autologin_spec.rb +22 -22
- data/spec/components/plugins/autothrottle_spec.rb +6 -5
- data/spec/components/plugins/content_types_spec.rb +4 -4
- data/spec/components/plugins/cookie_collector_spec.rb +5 -5
- data/spec/components/plugins/exec_spec.rb +12 -12
- data/spec/components/plugins/form_dicattack_spec.rb +3 -3
- data/spec/components/plugins/headers_collector_spec.rb +8 -8
- data/spec/components/plugins/healthmap_spec.rb +3 -3
- data/spec/components/plugins/http_dicattack_spec.rb +3 -3
- data/spec/components/plugins/login_script_spec.rb +79 -22
- data/spec/components/plugins/meta/remedies/discovery_spec.rb +3 -2
- data/spec/components/plugins/meta/remedies/timing_attacks_spec.rb +3 -3
- data/spec/components/plugins/meta/uniformity_spec.rb +2 -2
- data/spec/components/plugins/restrict_to_dom_state_spec.rb +1 -1
- data/spec/components/plugins/script_spec.rb +1 -1
- data/spec/components/plugins/uncommon_headers_spec.rb +2 -2
- data/spec/components/plugins/vector_collector_spec.rb +2 -2
- data/spec/components/plugins/vector_feed_spec.rb +40 -40
- data/spec/components/plugins/waf_detector_spec.rb +6 -6
- data/spec/components/reporters/json_spec.rb +4 -4
- data/spec/components/reporters/marshal_spec.rb +2 -2
- data/spec/components/reporters/yaml_spec.rb +3 -2
- data/spec/external/wavsep/active/sqli_spec.rb +1 -3
- data/spec/spec_helper.rb +4 -0
- data/spec/support/factories/element/ui_form.rb +14 -0
- data/spec/support/factories/element/ui_input.rb +13 -0
- data/spec/support/factories/issue.rb +0 -13
- data/spec/support/fixtures/report.afr +0 -0
- data/spec/support/fixtures/{taint_check/taint.rb → signature_check/signature.rb} +2 -2
- data/spec/support/helpers/browser_cluster/jobs/taint_tracer.rb +11 -11
- data/spec/support/helpers/framework.rb +1 -1
- data/spec/support/helpers/pages.rb +2 -2
- data/spec/support/servers/arachni/browser.rb +139 -0
- data/spec/support/servers/arachni/browser/javascript/taint_tracer.rb +40 -0
- data/spec/support/servers/arachni/element/capabilities/analyzable/{taint.rb → signature.rb} +0 -0
- data/spec/support/servers/arachni/element/input/input_dom.rb +102 -0
- data/spec/support/servers/arachni/element/ui_form/ui_form_dom.rb +238 -0
- data/spec/support/servers/checks/active/trainer_check.rb +7 -7
- data/spec/support/servers/checks/active/unvalidated_redirect_dom.rb +22 -6
- data/spec/support/servers/checks/active/xss_dom.rb +50 -0
- data/spec/support/servers/checks/active/xss_dom_script_context.rb +53 -0
- data/spec/support/shared/browser/javascript/taint_tracer/sink/base.rb +6 -6
- data/spec/support/shared/check.rb +10 -12
- data/spec/support/shared/component/options/base.rb +24 -24
- data/spec/support/shared/element/base.rb +25 -25
- data/spec/support/shared/element/capabilities/auditable.rb +116 -140
- data/spec/support/shared/element/capabilities/dom_only.rb +65 -0
- data/spec/support/shared/element/capabilities/inputtable.rb +71 -86
- data/spec/support/shared/element/capabilities/mutable.rb +122 -111
- data/spec/support/shared/element/capabilities/refreshable.rb +10 -10
- data/spec/support/shared/element/capabilities/{submitable.rb → submittable.rb} +26 -26
- data/spec/support/shared/element/capabilities/with_auditor.rb +10 -10
- data/spec/support/shared/element/capabilities/with_dom.rb +8 -8
- data/spec/support/shared/element/capabilities/with_node.rb +4 -6
- data/spec/support/shared/element/capabilities/with_scope.rb +2 -2
- data/spec/support/shared/element/capabilities/with_source.rb +6 -8
- data/spec/support/shared/element/dom.rb +144 -0
- data/spec/support/shared/element/dom/auditable.rb +42 -0
- data/spec/support/shared/element/dom/inputtable.rb +5 -0
- data/spec/support/shared/element/dom/mutable.rb +3 -0
- data/spec/support/shared/element/dom/submittable.rb +119 -0
- data/spec/support/shared/external/wavsep.rb +3 -3
- data/spec/support/shared/fingerprinter.rb +2 -2
- data/spec/support/shared/framework.rb +1 -1
- data/spec/support/shared/http/message.rb +9 -9
- data/spec/support/shared/option_group.rb +17 -17
- data/spec/support/shared/path_extractor.rb +1 -1
- data/spec/support/shared/plugin.rb +2 -2
- data/spec/support/shared/support/cache.rb +57 -57
- data/spec/support/shared/support/lookup.rb +25 -25
- data/ui/cli/framework.rb +22 -11
- data/ui/cli/framework/option_parser.rb +15 -0
- data/ui/cli/option_parser.rb +8 -1
- data/ui/cli/output.rb +2 -1
- metadata +54 -20
- data/components/checks/active/xss_dom_inputs.rb +0 -236
- data/spec/components/checks/active/xss_dom_inputs_spec.rb +0 -30
- data/spec/support/servers/checks/active/xss_dom_inputs.rb +0 -59
- data/spec/support/shared/element/capabilities/auditable/dom.rb +0 -322
@@ -1,336 +1,340 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'Arachni::RPC::Server::Framework' do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
1
|
+
# require 'spec_helper'
|
2
|
+
#
|
3
|
+
# describe 'Arachni::RPC::Server::Framework' do
|
4
|
+
# before( :all ) do
|
5
|
+
# @opts = Arachni::Options.instance
|
6
|
+
# @opts.paths.checks = fixtures_path + '/signature_check/'
|
7
|
+
# @opts.audit.elements :links, :forms, :cookies
|
8
|
+
#
|
9
|
+
# @instance = instance_light_grid_spawn
|
10
|
+
# @framework = @instance.framework
|
11
|
+
# @checks = @instance.checks
|
12
|
+
# @plugins = @instance.plugins
|
13
|
+
#
|
14
|
+
# @instance_clean = instance_light_grid_spawn
|
15
|
+
# @framework_clean = @instance_clean.framework
|
16
|
+
#
|
17
|
+
# @statistics_keys = [:http, :found_pages, :audited_pages, :runtime]
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# describe '#errors' do
|
21
|
+
# context 'when no argument has been provided' do
|
22
|
+
# it 'returns all logged errors' do
|
23
|
+
# test = 'Test'
|
24
|
+
# @framework.error_test test
|
25
|
+
# expect(@framework.errors.last).to end_with test
|
26
|
+
# end
|
27
|
+
# end
|
28
|
+
# context 'when a start line-range has been provided' do
|
29
|
+
# it 'returns all logged errors after that line' do
|
30
|
+
# initial_errors = @framework.errors
|
31
|
+
# errors = @framework.errors( 10 )
|
32
|
+
#
|
33
|
+
# expect(initial_errors[10..-1]).to eq(errors)
|
34
|
+
# end
|
35
|
+
# end
|
36
|
+
# end
|
37
|
+
#
|
38
|
+
# describe '#busy?' do
|
39
|
+
# context 'when the scan is not running' do
|
40
|
+
# it 'returns false' do
|
41
|
+
# expect(@framework_clean.busy?).to be_falsey
|
42
|
+
# end
|
43
|
+
# end
|
44
|
+
# context 'when the scan is running' do
|
45
|
+
# it 'returns true' do
|
46
|
+
# @instance.options.url = web_server_url_for( :auditor )
|
47
|
+
# @checks.load( 'taint' )
|
48
|
+
# expect(@framework.run).to be_truthy
|
49
|
+
# expect(@framework.busy?).to be_truthy
|
50
|
+
# end
|
51
|
+
# end
|
52
|
+
# end
|
53
|
+
# describe '#version' do
|
54
|
+
# it 'returns the system version' do
|
55
|
+
# expect(@framework_clean.version).to eq(Arachni::VERSION)
|
56
|
+
# end
|
57
|
+
# end
|
58
|
+
# describe '#master?' do
|
59
|
+
# it 'returns false' do
|
60
|
+
# expect(@framework_clean.master?).to be_truthy
|
61
|
+
# end
|
62
|
+
# end
|
63
|
+
# describe '#slave?' do
|
64
|
+
# it 'returns false' do
|
65
|
+
# expect(@framework_clean.slave?).to be_falsey
|
66
|
+
# end
|
67
|
+
# end
|
68
|
+
# describe '#solo?' do
|
69
|
+
# it 'returns true' do
|
70
|
+
# expect(@framework_clean.solo?).to be_falsey
|
71
|
+
# end
|
72
|
+
# end
|
73
|
+
# describe '#set_as_master' do
|
74
|
+
# it 'sets the instance as the master' do
|
75
|
+
# instance = instance_spawn
|
76
|
+
# expect(instance.framework.master?).to be_falsey
|
77
|
+
# instance.framework.set_as_master
|
78
|
+
# expect(instance.framework.master?).to be_truthy
|
79
|
+
#
|
80
|
+
# instance_kill instance.url
|
81
|
+
# end
|
82
|
+
# end
|
83
|
+
# describe '#enslave' do
|
84
|
+
# it 'enslaves another instance and set itself as its master' do
|
85
|
+
# master = instance_spawn
|
86
|
+
# slave = instance_spawn
|
87
|
+
#
|
88
|
+
# expect(master.framework.master?).to be_falsey
|
89
|
+
# master.framework.enslave(
|
90
|
+
# 'url' => slave.url,
|
91
|
+
# 'token' => instance_token_for( slave )
|
92
|
+
# )
|
93
|
+
# expect(master.framework.master?).to be_truthy
|
94
|
+
#
|
95
|
+
# instance_kill master.url
|
96
|
+
# end
|
97
|
+
# end
|
98
|
+
# describe '#run' do
|
99
|
+
# it 'performs a scan' do
|
100
|
+
# instance = @instance_clean
|
101
|
+
# instance.options.url = web_server_url_for( :framework_multi )
|
102
|
+
# instance.checks.load( 'taint' )
|
103
|
+
# expect(instance.framework.run).to be_truthy
|
104
|
+
# sleep( 1 ) while instance.framework.busy?
|
105
|
+
# expect(instance.framework.issues.size).to eq(500)
|
106
|
+
# end
|
107
|
+
#
|
108
|
+
# it 'handles pages with JavaScript code' do
|
109
|
+
# instance = instance_light_grid_spawn
|
110
|
+
# instance.options.url = web_server_url_for( :auditor ) + '/with_javascript'
|
111
|
+
# instance.checks.load :signature
|
112
|
+
#
|
113
|
+
# expect(instance.framework.run).to be_truthy
|
114
|
+
# sleep 0.1 while instance.framework.busy?
|
115
|
+
#
|
116
|
+
# expect(instance.framework.issues.
|
117
|
+
# map { |i| i.vector.affected_input_name }.uniq).to be
|
118
|
+
# %w(link_input form_input cookie_input)
|
119
|
+
#
|
120
|
+
# # dispatcher_kill_by_instance instance
|
121
|
+
# end
|
122
|
+
#
|
123
|
+
# it 'handles AJAX' do
|
124
|
+
# instance = instance_light_grid_spawn
|
125
|
+
# instance.options.url = web_server_url_for( :auditor ) + '/with_ajax'
|
126
|
+
# instance.checks.load :signature
|
127
|
+
#
|
128
|
+
# expect(instance.framework.run).to be_truthy
|
129
|
+
# sleep 0.1 while instance.framework.busy?
|
130
|
+
#
|
131
|
+
# expect(instance.framework.issues.
|
132
|
+
# map { |i| i.vector.affected_input_name }.uniq).to be
|
133
|
+
# %w(link_input form_input cookie_taint).sort
|
134
|
+
#
|
135
|
+
# # dispatcher_kill_by_instance instance
|
136
|
+
# end
|
137
|
+
# end
|
138
|
+
# describe '#report' do
|
139
|
+
# it 'returns an report object' do
|
140
|
+
# report = @instance_clean.framework.report
|
141
|
+
# expect(report.is_a?( Arachni::Report )).to be_truthy
|
142
|
+
# expect(report.issues).to be_any
|
143
|
+
# end
|
144
|
+
# end
|
145
|
+
# describe '#statistics' do
|
146
|
+
# it 'returns a hash containing general runtime statistics' do
|
147
|
+
# statistics = @instance_clean.framework.statistics
|
148
|
+
#
|
149
|
+
# keys = @statistics_keys | [:current_page]
|
150
|
+
#
|
151
|
+
# expect(statistics.keys.sort).to eq(keys.sort)
|
152
|
+
# keys.each { |k| expect(statistics[k]).to be_truthy }
|
153
|
+
# end
|
154
|
+
# end
|
155
|
+
# describe '#clean_up' do
|
156
|
+
# it 'sets the framework state to finished, waits for plugins to finish and merges their results' do
|
157
|
+
# @instance = instance = instance_light_grid_spawn
|
158
|
+
# instance.options.url = web_server_url_for( :framework_multi )
|
159
|
+
# instance.checks.load( 'taint' )
|
160
|
+
# instance.plugins.load( { 'wait' => {}, 'distributable' => {} } )
|
161
|
+
# expect(instance.framework.run).to be_truthy
|
162
|
+
# expect(instance.framework.report.plugins).to be_empty
|
163
|
+
#
|
164
|
+
# # Wait till the slaves join the scan.
|
165
|
+
# sleep 0.1 while instance.framework.progress[:instances].size != 3
|
166
|
+
#
|
167
|
+
# expect(instance.framework.clean_up).to be_truthy
|
168
|
+
#
|
169
|
+
# instance_count = instance.framework.progress[:instances].size
|
170
|
+
# report = instance.framework.report
|
171
|
+
#
|
172
|
+
# results = report.plugins
|
173
|
+
# expect(results).to be_any
|
174
|
+
# expect(results[:wait]).to be_any
|
175
|
+
# expect(results[:wait][:results]).to eq({ 'stuff' => true })
|
176
|
+
# expect(results[:distributable][:results]).to eq({ 'stuff' => instance_count })
|
177
|
+
#
|
178
|
+
# # dispatcher_kill_by_instance instance
|
179
|
+
# end
|
180
|
+
# end
|
181
|
+
# describe '#progress' do
|
182
|
+
# before { @progress_keys = %W(statistics status busy issues instances).map(&:to_sym).sort }
|
183
|
+
#
|
184
|
+
# context 'when called without options' do
|
185
|
+
# it 'returns all progress data' do
|
186
|
+
# instance = @instance_clean
|
187
|
+
#
|
188
|
+
# data = instance.framework.progress
|
189
|
+
#
|
190
|
+
# expect(data.keys.sort).to eq((@progress_keys | [:master]).flatten.sort)
|
191
|
+
#
|
192
|
+
# expect(data[:statistics].keys.sort).to eq(
|
193
|
+
# (@statistics_keys | [:current_pages]).flatten.sort
|
194
|
+
# )
|
195
|
+
#
|
196
|
+
# expect(data[:status]).to be_kind_of Symbol
|
197
|
+
# expect(data[:master]).to eq(instance.url)
|
198
|
+
# expect(data[:busy]).not_to be_nil
|
199
|
+
# expect(data[:issues]).to be_any
|
200
|
+
# expect(data[:instances].size).to eq(3)
|
201
|
+
#
|
202
|
+
# expect(data).not_to include :errors
|
203
|
+
#
|
204
|
+
# keys = (@statistics_keys | [:current_page]).flatten.sort
|
205
|
+
#
|
206
|
+
# data[:instances].each do |i|
|
207
|
+
# expect(i[:statistics].keys.sort).to eq(keys)
|
208
|
+
# expect(i.keys.sort).to eq([:url, :statistics, :status, :busy, :messages].sort)
|
209
|
+
# end
|
210
|
+
#
|
211
|
+
# data.delete :issues
|
212
|
+
# end
|
213
|
+
# end
|
214
|
+
#
|
215
|
+
# context 'when called with option' do
|
216
|
+
# describe :errors do
|
217
|
+
# context 'when set to true' do
|
218
|
+
# it 'includes all error messages' do
|
219
|
+
# instance = instance_light_grid_spawn
|
220
|
+
# expect(instance.framework.progress( errors: true )[:errors]).to be_empty
|
221
|
+
#
|
222
|
+
# test = 'Test'
|
223
|
+
# instance.framework.error_test test
|
224
|
+
#
|
225
|
+
# expect(instance.framework.progress( errors: true )[:errors].last).to end_with test
|
226
|
+
#
|
227
|
+
# # dispatcher_kill_by_instance instance
|
228
|
+
# end
|
229
|
+
# end
|
230
|
+
# context 'when set to an Integer' do
|
231
|
+
# it 'returns all logged errors after that line per Instance' do
|
232
|
+
# instance = instance_light_grid_spawn
|
233
|
+
#
|
234
|
+
# 100.times { instance.framework.error_test 'test' }
|
235
|
+
#
|
236
|
+
# expect(instance.framework.progress( errors: true )[:errors].size -
|
237
|
+
# instance.framework.progress( errors: 10 )[:errors].size).to eq(10)
|
238
|
+
#
|
239
|
+
# # dispatcher_kill_by_instance instance
|
240
|
+
# end
|
241
|
+
# end
|
242
|
+
# end
|
243
|
+
#
|
244
|
+
# describe :sitemap do
|
245
|
+
# context 'when set to true' do
|
246
|
+
# it 'returns entire sitemap' do
|
247
|
+
# expect(@instance_clean.framework.
|
248
|
+
# progress( sitemap: true )[:sitemap]).to eq(
|
249
|
+
# @instance_clean.framework.sitemap
|
250
|
+
# )
|
251
|
+
# end
|
252
|
+
# end
|
253
|
+
#
|
254
|
+
# context 'when an index has been provided' do
|
255
|
+
# it 'returns all entries after that line' do
|
256
|
+
# expect(@instance_clean.framework.progress( sitemap: 10 )[:sitemap]).to eq(
|
257
|
+
# @instance_clean.framework.sitemap_entries( 10 )
|
258
|
+
# )
|
259
|
+
# end
|
260
|
+
# end
|
261
|
+
# end
|
262
|
+
#
|
263
|
+
# describe :statistics do
|
264
|
+
# context 'when set to false' do
|
265
|
+
# it 'excludes statistics' do
|
266
|
+
# expect(@instance_clean.framework.progress(
|
267
|
+
# statistics: false
|
268
|
+
# )).not_to include :statistics
|
269
|
+
# end
|
270
|
+
# end
|
271
|
+
# end
|
272
|
+
# describe :issues do
|
273
|
+
# context 'when set to false' do
|
274
|
+
# it 'excludes issues' do
|
275
|
+
# expect(@instance_clean.framework.progress(
|
276
|
+
# issues: false
|
277
|
+
# )).not_to include :issues
|
278
|
+
# end
|
279
|
+
# end
|
280
|
+
# end
|
281
|
+
# describe :slaves do
|
282
|
+
# context 'when set to false' do
|
283
|
+
# it 'excludes slave data' do
|
284
|
+
# expect(@instance_clean.framework.progress(
|
285
|
+
# slaves: false
|
286
|
+
# )).not_to include :instances
|
287
|
+
# end
|
288
|
+
# end
|
289
|
+
# end
|
290
|
+
# describe :as_hash do
|
291
|
+
# context 'when set to true' do
|
292
|
+
# it 'includes issues as a hash' do
|
293
|
+
# expect(@instance_clean.framework.
|
294
|
+
# progress( as_hash: true )[:issues].
|
295
|
+
# first.is_a?( Hash )).to be_truthy
|
296
|
+
# end
|
297
|
+
# end
|
298
|
+
# end
|
299
|
+
# end
|
300
|
+
# end
|
301
|
+
#
|
302
|
+
# describe '#sitemap_entries' do
|
303
|
+
# context 'when no argument has been provided' do
|
304
|
+
# it 'returns entire sitemap' do
|
305
|
+
# expect(@instance_clean.framework.sitemap_entries).to eq(
|
306
|
+
# @instance_clean.framework.sitemap
|
307
|
+
# )
|
308
|
+
# end
|
309
|
+
# end
|
310
|
+
#
|
311
|
+
# context 'when an index has been provided' do
|
312
|
+
# it 'returns all entries after that line' do
|
313
|
+
# sitemap = @instance_clean.framework.sitemap
|
314
|
+
# expect(@instance_clean.framework.sitemap_entries( 10 )).to eq(
|
315
|
+
# Hash[sitemap.to_a[10..-1]]
|
316
|
+
# )
|
317
|
+
# end
|
318
|
+
# end
|
319
|
+
# end
|
320
|
+
#
|
321
|
+
# describe '#issues' do
|
322
|
+
# it 'returns an array of issues' do
|
323
|
+
# issues = @instance_clean.framework.issues
|
324
|
+
# expect(issues).to be_any
|
325
|
+
#
|
326
|
+
# issue = issues.first
|
327
|
+
# expect(issue.is_a?( Arachni::Issue )).to be_truthy
|
328
|
+
# end
|
329
|
+
# end
|
330
|
+
#
|
331
|
+
# describe '#issues_as_hash' do
|
332
|
+
# it 'returns an array of issues as hash' do
|
333
|
+
# issues = @instance_clean.framework.issues_as_hash
|
334
|
+
# expect(issues).to be_any
|
335
|
+
#
|
336
|
+
# issue = issues.first
|
337
|
+
# expect(issue.is_a?( Hash )).to be_truthy
|
338
|
+
# end
|
339
|
+
# end
|
340
|
+
# end
|