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
@@ -131,16 +131,16 @@ get "/header" do
|
|
131
131
|
end
|
132
132
|
|
133
133
|
get "/header/straight" do
|
134
|
-
default = '
|
134
|
+
default = 'arachni_user'
|
135
135
|
return if !env['HTTP_USER_AGENT'] || env['HTTP_USER_AGENT'].start_with?( default ) ||
|
136
136
|
!env['HTTP_USER_AGENT'].include?( '_arachni_trainer_' )
|
137
137
|
|
138
|
-
redirect "/header/straight/trained"
|
138
|
+
redirect "/header/straight/trained-redir"
|
139
139
|
end
|
140
140
|
|
141
|
-
get
|
141
|
+
get '/header/straight/trained-redir' do
|
142
142
|
<<-EOHTML
|
143
|
-
<a href="
|
143
|
+
<a href="trained">Stuff</a>
|
144
144
|
EOHTML
|
145
145
|
end
|
146
146
|
|
@@ -149,11 +149,11 @@ get "/header/append" do
|
|
149
149
|
return if !env['HTTP_USER_AGENT'] || !env['HTTP_USER_AGENT'].start_with?( default ) ||
|
150
150
|
!env['HTTP_USER_AGENT'].include?( '_arachni_trainer_' )
|
151
151
|
|
152
|
-
redirect "/header/append/trained"
|
152
|
+
redirect "/header/append/trained-redir"
|
153
153
|
end
|
154
154
|
|
155
|
-
get "/header/append/trained" do
|
155
|
+
get "/header/append/trained-redir" do
|
156
156
|
<<-EOHTML
|
157
|
-
<a href="
|
157
|
+
<a href="trained">Stuff</a>
|
158
158
|
EOHTML
|
159
159
|
end
|
@@ -5,6 +5,7 @@ get '/' do
|
|
5
5
|
<<-EOHTML
|
6
6
|
<a href="/link">Link</a>
|
7
7
|
<a href="/form">Form</a>
|
8
|
+
<a href="/ui_form">UI Form</a>
|
8
9
|
<a href="/cookie">Cookie</a>
|
9
10
|
EOHTML
|
10
11
|
end
|
@@ -45,12 +46,6 @@ get '/link/straight' do
|
|
45
46
|
EOHTML
|
46
47
|
end
|
47
48
|
|
48
|
-
get '/link-template' do
|
49
|
-
<<-EOHTML
|
50
|
-
<a href="/link-template/straight#|input|default">Link</a>
|
51
|
-
EOHTML
|
52
|
-
end
|
53
|
-
|
54
49
|
get '/form' do
|
55
50
|
<<-EOHTML
|
56
51
|
<a href="/form/straight">Form</a>
|
@@ -76,6 +71,27 @@ get '/form/straight' do
|
|
76
71
|
EOHTML
|
77
72
|
end
|
78
73
|
|
74
|
+
get '/ui_form' do
|
75
|
+
<<-EOHTML
|
76
|
+
<a href="/ui_form/straight">Form</a>
|
77
|
+
EOHTML
|
78
|
+
end
|
79
|
+
|
80
|
+
get '/ui_form/straight' do
|
81
|
+
<<-EOHTML
|
82
|
+
<script>
|
83
|
+
function handleSubmit() {
|
84
|
+
url = document.getElementById("my-input").value;
|
85
|
+
if( url.indexOf( 'http' ) != 0 ) url = 'http://' + url;
|
86
|
+
window.location = url;
|
87
|
+
}
|
88
|
+
</script>
|
89
|
+
|
90
|
+
<input id='my-input' value='default' />
|
91
|
+
<button onclick="handleSubmit()">Submit</button>
|
92
|
+
EOHTML
|
93
|
+
end
|
94
|
+
|
79
95
|
get '/cookie' do
|
80
96
|
headers 'Set-Cookie' => 'input=default'
|
81
97
|
|
@@ -7,6 +7,8 @@ get '/' do
|
|
7
7
|
<a href="/form">Form</a>
|
8
8
|
<a href="/cookie">Cookie</a>
|
9
9
|
<a href="/link-template">Link template</a>
|
10
|
+
<a href="/input">Input</a>
|
11
|
+
<a href="/ui_form">UI Form</a>
|
10
12
|
EOHTML
|
11
13
|
end
|
12
14
|
|
@@ -131,3 +133,51 @@ get '/cookie/straight' do
|
|
131
133
|
</body>
|
132
134
|
EOHTML
|
133
135
|
end
|
136
|
+
|
137
|
+
get '/input' do
|
138
|
+
<<-EOHTML
|
139
|
+
<a href="/input/straight">Form</a>
|
140
|
+
EOHTML
|
141
|
+
end
|
142
|
+
|
143
|
+
get '/input/straight' do
|
144
|
+
<<-EOHTML
|
145
|
+
<script>
|
146
|
+
function handleOnInput() {
|
147
|
+
document.getElementById("container").innerHTML =
|
148
|
+
document.getElementById("my-input").value;
|
149
|
+
}
|
150
|
+
</script>
|
151
|
+
|
152
|
+
<div id="container"></div>
|
153
|
+
|
154
|
+
<input oninput="handleOnInput()" id='my-input' value='default' />
|
155
|
+
EOHTML
|
156
|
+
end
|
157
|
+
|
158
|
+
get '/ui_form' do
|
159
|
+
<<-EOHTML
|
160
|
+
<a href="/ui_form/straight">Form</a>
|
161
|
+
EOHTML
|
162
|
+
end
|
163
|
+
|
164
|
+
get '/ui_form/straight' do
|
165
|
+
<<-EOHTML
|
166
|
+
<html>
|
167
|
+
<body>
|
168
|
+
<input id="my-input" type="text">
|
169
|
+
<button id="insert">Insert into DOM</button>
|
170
|
+
|
171
|
+
<div id="container">
|
172
|
+
</div>
|
173
|
+
|
174
|
+
<script>
|
175
|
+
document.getElementById('insert').addEventListener('click', function() {
|
176
|
+
document.getElementById("container").innerHTML =
|
177
|
+
document.getElementById("my-input").value;
|
178
|
+
});
|
179
|
+
</script>
|
180
|
+
</body>
|
181
|
+
</html>
|
182
|
+
EOHTML
|
183
|
+
end
|
@@ -7,6 +7,8 @@ get '/' do
|
|
7
7
|
<a href="/form">Form</a>
|
8
8
|
<a href="/cookie">Cookie</a>
|
9
9
|
<a href="/link-template">Link template</a>
|
10
|
+
<a href="/input">Input</a>
|
11
|
+
<a href="/ui_form">UI Form</a>
|
10
12
|
EOHTML
|
11
13
|
end
|
12
14
|
|
@@ -137,3 +139,54 @@ get '/cookie/straight' do
|
|
137
139
|
</body>
|
138
140
|
EOHTML
|
139
141
|
end
|
142
|
+
|
143
|
+
get '/input' do
|
144
|
+
<<-EOHTML
|
145
|
+
<a href="/input/straight">Form</a>
|
146
|
+
EOHTML
|
147
|
+
end
|
148
|
+
|
149
|
+
get '/input/straight' do
|
150
|
+
<<-EOHTML
|
151
|
+
<script>
|
152
|
+
function handleOnInput() {
|
153
|
+
pre_eval( document.getElementById('my-input').value );
|
154
|
+
}
|
155
|
+
|
156
|
+
function pre_eval( code ) {
|
157
|
+
eval( code );
|
158
|
+
}
|
159
|
+
</script>
|
160
|
+
|
161
|
+
<div id="container"></div>
|
162
|
+
|
163
|
+
<input oninput="handleOnInput()" id='my-input' value='default' />
|
164
|
+
EOHTML
|
165
|
+
end
|
166
|
+
|
167
|
+
get '/ui_form' do
|
168
|
+
<<-EOHTML
|
169
|
+
<a href="/ui_form/straight">Form</a>
|
170
|
+
EOHTML
|
171
|
+
end
|
172
|
+
|
173
|
+
get '/ui_form/straight' do
|
174
|
+
<<-EOHTML
|
175
|
+
<html>
|
176
|
+
<body>
|
177
|
+
<script>
|
178
|
+
function handleOnClick() {
|
179
|
+
pre_eval( document.getElementById('my-input').value );
|
180
|
+
}
|
181
|
+
|
182
|
+
function pre_eval( code ) {
|
183
|
+
eval( code );
|
184
|
+
}
|
185
|
+
</script>
|
186
|
+
|
187
|
+
<input id="my-input" type="text">
|
188
|
+
<button onclick="handleOnClick()" id="insert">Insert into DOM</button>
|
189
|
+
</body>
|
190
|
+
</html>
|
191
|
+
EOHTML
|
192
|
+
end
|
@@ -1,18 +1,18 @@
|
|
1
1
|
shared_examples_for 'sink' do
|
2
2
|
%w(trace).each do |m|
|
3
|
-
it {
|
4
|
-
it {
|
3
|
+
it { is_expected.to respond_to m }
|
4
|
+
it { is_expected.to respond_to "#{m}=" }
|
5
5
|
end
|
6
6
|
|
7
7
|
it "supports #{Arachni::RPC::Serializer}" do
|
8
|
-
subject.
|
8
|
+
expect(subject).to eq(Arachni::RPC::Serializer.deep_clone( subject ))
|
9
9
|
end
|
10
10
|
|
11
11
|
describe '#to_rpc_data' do
|
12
12
|
let(:data) { subject.to_rpc_data }
|
13
13
|
|
14
14
|
it "includes 'trace'" do
|
15
|
-
data[:trace].
|
15
|
+
expect(data[:trace]).to eq(subject.trace.map(&:to_rpc_data))
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -22,14 +22,14 @@ shared_examples_for 'sink' do
|
|
22
22
|
|
23
23
|
%w(trace).each do |attribute|
|
24
24
|
it "restores '#{attribute}'" do
|
25
|
-
restored.send( attribute ).
|
25
|
+
expect(restored.send( attribute )).to eq(subject.send( attribute ))
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
describe '#to_h' do
|
31
31
|
it 'converts #trace data to hashes' do
|
32
|
-
subject.to_h[:trace].
|
32
|
+
expect(subject.to_h[:trace]).to eq([Factory[:frame_data]])
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -23,6 +23,8 @@ shared_examples_for 'check' do
|
|
23
23
|
reset_framework
|
24
24
|
options.url = @url
|
25
25
|
|
26
|
+
framework.http.headers['User-Agent'] = 'arachni_user'
|
27
|
+
|
26
28
|
options.audit.parameter_names = true
|
27
29
|
options.audit.with_extra_parameter = true
|
28
30
|
|
@@ -53,12 +55,11 @@ shared_examples_for 'check' do
|
|
53
55
|
|
54
56
|
describe '.info' do
|
55
57
|
it 'holds the right platforms' do
|
56
|
-
current_check.platforms.sort.
|
58
|
+
expect(current_check.platforms.sort).to eq self.class.platforms.sort
|
57
59
|
end
|
58
60
|
|
59
61
|
it 'holds the right elements' do
|
60
|
-
current_check.info[:elements].map(&:to_s).sort.
|
61
|
-
self.class.elements.map(&:to_s).sort
|
62
|
+
expect(current_check.info[:elements].map(&:to_s).sort).to eq(self.class.elements.map(&:to_s).sort)
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
@@ -102,21 +103,19 @@ shared_examples_for 'check' do
|
|
102
103
|
audit element, run_checks
|
103
104
|
|
104
105
|
if issue_count
|
105
|
-
issues.size.
|
106
|
+
expect(issues.size).to eq issue_count
|
106
107
|
end
|
107
108
|
|
108
109
|
if issue_count_per_platform
|
109
|
-
issues.size.
|
110
|
-
issue_count_per_platform[platform]
|
110
|
+
expect(issues.size).to eq issue_count_per_platform[platform]
|
111
111
|
end
|
112
112
|
|
113
113
|
if issue_count_per_element
|
114
|
-
issues.size.
|
114
|
+
expect(issues.size).to eq issue_count_per_element[element]
|
115
115
|
end
|
116
116
|
|
117
117
|
if issue_count_per_element_per_platform
|
118
|
-
issues.size.
|
119
|
-
issue_count_per_element_per_platform[platform][element]
|
118
|
+
expect(issues.size).to eq issue_count_per_element_per_platform[platform][element]
|
120
119
|
end
|
121
120
|
|
122
121
|
instance_eval &block if block_given?
|
@@ -173,11 +172,10 @@ shared_examples_for 'check' do
|
|
173
172
|
|
174
173
|
if logs_issues && issues.any?
|
175
174
|
# make sure we ONLY got results for the requested element type
|
176
|
-
issues.map { |i| i.vector.class.type }.uniq.
|
175
|
+
expect(issues.map { |i| i.vector.class.type }.uniq).to eq [e.to_sym]
|
177
176
|
|
178
177
|
if current_check.info[:issue]
|
179
|
-
issues.map { |i| i.severity }.uniq.
|
180
|
-
[current_check.info[:issue][:severity]]
|
178
|
+
expect(issues.map { |i| i.severity }.uniq).to eq [current_check.info[:issue][:severity]]
|
181
179
|
end
|
182
180
|
end
|
183
181
|
end
|
@@ -10,7 +10,7 @@ shared_examples_for 'component_option' do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it "supports #{Arachni::RPC::Serializer}" do
|
13
|
-
subject.
|
13
|
+
expect(subject).to eq(Arachni::RPC::Serializer.deep_clone( subject ))
|
14
14
|
end
|
15
15
|
|
16
16
|
describe '#to_rpc_data' do
|
@@ -18,16 +18,16 @@ shared_examples_for 'component_option' do
|
|
18
18
|
|
19
19
|
%w(name description default value type).each do |attribute|
|
20
20
|
it "includes '#{attribute}'" do
|
21
|
-
data[attribute].
|
21
|
+
expect(data[attribute]).to eq(subject.send( attribute ))
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
it "includes 'class'" do
|
26
|
-
data['class'].
|
26
|
+
expect(data['class']).to eq(subject.class.to_s)
|
27
27
|
end
|
28
28
|
|
29
29
|
it "includes 'required'" do
|
30
|
-
data['required'].
|
30
|
+
expect(data['required']).to eq(subject.required?)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -37,12 +37,12 @@ shared_examples_for 'component_option' do
|
|
37
37
|
|
38
38
|
%w(name description default value type class).each do |attribute|
|
39
39
|
it "restores '#{attribute}'" do
|
40
|
-
restored.send( attribute ).
|
40
|
+
expect(restored.send( attribute )).to eq(subject.send( attribute ))
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
it "restores 'required'" do
|
45
|
-
restored.required
|
45
|
+
expect(restored.required?).to eq(subject.required?)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -57,40 +57,40 @@ shared_examples_for 'component_option' do
|
|
57
57
|
describe '#name' do
|
58
58
|
it 'returns the name of the option' do
|
59
59
|
name = 'myname'
|
60
|
-
described_class.new( name ).name.
|
60
|
+
expect(described_class.new( name ).name).to eq(name.to_sym)
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
64
|
describe '#description' do
|
65
65
|
it 'returns the description' do
|
66
66
|
description = 'a description'
|
67
|
-
described_class.new( '', description: description ).description.
|
67
|
+
expect(described_class.new( '', description: description ).description).to eq(description)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
71
|
describe '#default' do
|
72
72
|
it 'returns the default value' do
|
73
73
|
default = 'default value'
|
74
|
-
described_class.new( '', default: default ).default.
|
74
|
+
expect(described_class.new( '', default: default ).default).to eq(default)
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
78
|
describe '#required?' do
|
79
79
|
context 'when the option is mandatory' do
|
80
80
|
it 'returns true' do
|
81
|
-
described_class.new( '', required: true ).required
|
81
|
+
expect(described_class.new( '', required: true ).required?).to be_truthy
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
85
|
context 'when the option is not mandatory' do
|
86
86
|
it 'returns false' do
|
87
|
-
described_class.new( '', required: false ).required
|
87
|
+
expect(described_class.new( '', required: false ).required?).to be_falsey
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
91
91
|
context 'by default' do
|
92
92
|
it 'returns false' do
|
93
|
-
described_class.new( '' ).required
|
93
|
+
expect(described_class.new( '' ).required?).to be_falsey
|
94
94
|
end
|
95
95
|
end
|
96
96
|
end
|
@@ -99,13 +99,13 @@ shared_examples_for 'component_option' do
|
|
99
99
|
context 'when the option is required' do
|
100
100
|
context 'and the value is not empty' do
|
101
101
|
it 'returns false' do
|
102
|
-
described_class.new( '', required: true, value: 'stuff' ).missing_value
|
102
|
+
expect(described_class.new( '', required: true, value: 'stuff' ).missing_value?).to be_falsey
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
106
106
|
context 'and the value is nil' do
|
107
107
|
it 'returns true' do
|
108
|
-
described_class.new( '', required: true ).missing_value
|
108
|
+
expect(described_class.new( '', required: true ).missing_value?).to be_truthy
|
109
109
|
end
|
110
110
|
end
|
111
111
|
end
|
@@ -113,13 +113,13 @@ shared_examples_for 'component_option' do
|
|
113
113
|
context 'when the option is not required' do
|
114
114
|
context 'and the value is not empty' do
|
115
115
|
it 'returns false' do
|
116
|
-
described_class.new( '', value: 'true' ).missing_value
|
116
|
+
expect(described_class.new( '', value: 'true' ).missing_value?).to be_falsey
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
120
|
context 'and the value is empty' do
|
121
121
|
it 'returns false' do
|
122
|
-
described_class.new( '' ).missing_value
|
122
|
+
expect(described_class.new( '' ).missing_value?).to be_falsey
|
123
123
|
end
|
124
124
|
end
|
125
125
|
end
|
@@ -129,7 +129,7 @@ shared_examples_for 'component_option' do
|
|
129
129
|
it 'sets #value' do
|
130
130
|
option = described_class.new( '' )
|
131
131
|
option.value = 1
|
132
|
-
option.value.
|
132
|
+
expect(option.value).to eq(1)
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
@@ -137,7 +137,7 @@ shared_examples_for 'component_option' do
|
|
137
137
|
it 'returns the set value' do
|
138
138
|
option = described_class.new( '' )
|
139
139
|
option.value = 1
|
140
|
-
option.value.
|
140
|
+
expect(option.value).to eq(1)
|
141
141
|
end
|
142
142
|
end
|
143
143
|
|
@@ -145,18 +145,18 @@ shared_examples_for 'component_option' do
|
|
145
145
|
it 'returns the set value' do
|
146
146
|
option = described_class.new( '' )
|
147
147
|
option.value = 1
|
148
|
-
option.value.
|
148
|
+
expect(option.value).to eq(1)
|
149
149
|
end
|
150
150
|
end
|
151
151
|
|
152
152
|
describe '#effective_value' do
|
153
153
|
it 'returns the value as is' do
|
154
|
-
described_class.new( '', value: 'blah' ).effective_value.
|
154
|
+
expect(described_class.new( '', value: 'blah' ).effective_value).to eq('blah')
|
155
155
|
end
|
156
156
|
|
157
157
|
context 'when no #value is set' do
|
158
158
|
it 'returns #default' do
|
159
|
-
described_class.new( '', default: 'test' ).effective_value.
|
159
|
+
expect(described_class.new( '', default: 'test' ).effective_value).to eq('test')
|
160
160
|
end
|
161
161
|
end
|
162
162
|
end
|
@@ -172,16 +172,16 @@ shared_examples_for 'component_option' do
|
|
172
172
|
|
173
173
|
%w(name description value default type).each do |m|
|
174
174
|
it "includes :#{m}" do
|
175
|
-
option.to_h[m.to_sym].
|
175
|
+
expect(option.to_h[m.to_sym]).to eq(option.send(m))
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
179
|
it 'includes :required' do
|
180
|
-
option.to_h[:required].
|
180
|
+
expect(option.to_h[:required]).to eq(option.required?)
|
181
181
|
end
|
182
182
|
|
183
183
|
it 'is aliased to #to_hash' do
|
184
|
-
option.to_hash.
|
184
|
+
expect(option.to_hash).to eq(option.to_h)
|
185
185
|
end
|
186
186
|
end
|
187
187
|
end
|