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
@@ -13,13 +13,13 @@ describe Arachni::State::HTTP do
|
|
13
13
|
|
14
14
|
describe '#headers' do
|
15
15
|
it 'returns a Hash' do
|
16
|
-
subject.headers.
|
16
|
+
expect(subject.headers).to be_kind_of Hash
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '#cookie_jar' do
|
21
21
|
it "returns a #{Arachni::HTTP::CookieJar}" do
|
22
|
-
subject.cookie_jar.
|
22
|
+
expect(subject.cookie_jar).to be_kind_of Arachni::HTTP::CookieJar
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -28,7 +28,7 @@ describe Arachni::State::HTTP do
|
|
28
28
|
|
29
29
|
it 'includes :cookies' do
|
30
30
|
subject.cookie_jar << cookie
|
31
|
-
statistics[:cookies].
|
31
|
+
expect(statistics[:cookies]).to eq([cookie.to_s])
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -46,15 +46,15 @@ describe Arachni::State::HTTP do
|
|
46
46
|
subject.dump( dump_directory )
|
47
47
|
|
48
48
|
http = described_class.load( dump_directory )
|
49
|
-
http.headers.
|
50
|
-
http.cookie_jar.
|
49
|
+
expect(http.headers).to eq(subject.headers)
|
50
|
+
expect(http.cookie_jar).to eq(subject.cookie_jar)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
describe '#clear' do
|
55
55
|
it 'clears the list' do
|
56
|
-
subject.headers.
|
57
|
-
subject.cookie_jar.
|
56
|
+
expect(subject.headers).to receive(:clear)
|
57
|
+
expect(subject.cookie_jar).to receive(:clear)
|
58
58
|
|
59
59
|
subject.clear
|
60
60
|
end
|
@@ -10,24 +10,24 @@ describe Arachni::State::Options do
|
|
10
10
|
@dump_directory = "#{Dir.tmpdir}/options-#{Arachni::Utilities.generate_token}"
|
11
11
|
end
|
12
12
|
|
13
|
-
it {
|
13
|
+
it { is_expected.to respond_to :clear}
|
14
14
|
|
15
15
|
describe '#statistics' do
|
16
16
|
let(:statistics) { subject.statistics }
|
17
17
|
|
18
18
|
it 'includes :url' do
|
19
19
|
Arachni::Options.url = 'http://test/'
|
20
|
-
statistics[:url].
|
20
|
+
expect(statistics[:url]).to eq(Arachni::Options.url)
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'includes :checks' do
|
24
24
|
Arachni::Options.checks = %w(xss* sql_injection)
|
25
|
-
statistics[:checks].
|
25
|
+
expect(statistics[:checks]).to eq(Arachni::Options.checks)
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'includes :plugins' do
|
29
29
|
Arachni::Options.plugins = { 'autologin' => {} }
|
30
|
-
statistics[:plugins].
|
30
|
+
expect(statistics[:plugins]).to eq(%w(autologin))
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -36,8 +36,8 @@ describe Arachni::State::Options do
|
|
36
36
|
Arachni::Options.datastore.my_custom_option = 'my value'
|
37
37
|
subject.dump( dump_directory )
|
38
38
|
|
39
|
-
Arachni::Options.load( "#{dump_directory}/options" ).
|
40
|
-
datastore.my_custom_option.
|
39
|
+
expect(Arachni::Options.load( "#{dump_directory}/options" ).
|
40
|
+
datastore.my_custom_option).to eq('my value')
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -48,7 +48,7 @@ describe Arachni::State::Options do
|
|
48
48
|
|
49
49
|
described_class.load( dump_directory )
|
50
50
|
|
51
|
-
Arachni::Options.datastore.my_custom_option.
|
51
|
+
expect(Arachni::Options.datastore.my_custom_option).to eq('my value')
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -18,7 +18,7 @@ describe Arachni::State::Plugins do
|
|
18
18
|
|
19
19
|
describe '#runtime' do
|
20
20
|
it 'returns a Hash' do
|
21
|
-
subject.runtime.
|
21
|
+
expect(subject.runtime).to be_kind_of Hash
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -29,7 +29,7 @@ describe Arachni::State::Plugins do
|
|
29
29
|
|
30
30
|
subject.store( :distributable, result )
|
31
31
|
|
32
|
-
subject.statistics[:names].
|
32
|
+
expect(subject.statistics[:names]).to eq([:distributable])
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -39,7 +39,7 @@ describe Arachni::State::Plugins do
|
|
39
39
|
result = { stuff: 1 }
|
40
40
|
|
41
41
|
subject.store( :distributable, result )
|
42
|
-
subject[:distributable].
|
42
|
+
expect(subject[:distributable]).to eq(result)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -49,10 +49,10 @@ describe Arachni::State::Plugins do
|
|
49
49
|
subject.dump( dump_directory )
|
50
50
|
|
51
51
|
results_file = "#{dump_directory}/runtime/distributable"
|
52
|
-
File.exists?( results_file ).
|
53
|
-
subject.runtime.
|
52
|
+
expect(File.exists?( results_file )).to be_truthy
|
53
|
+
expect(subject.runtime).to eq({
|
54
54
|
distributable: Marshal.load( IO.read( results_file ) )
|
55
|
-
}
|
55
|
+
})
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -61,14 +61,14 @@ describe Arachni::State::Plugins do
|
|
61
61
|
subject.runtime[:distributable] = { stuff: 1 }
|
62
62
|
subject.dump( dump_directory )
|
63
63
|
|
64
|
-
subject.runtime.
|
64
|
+
expect(subject.runtime).to eq(described_class.load( dump_directory ).runtime)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
68
|
describe '#clear' do
|
69
69
|
%w(runtime).each do |method|
|
70
70
|
it "clears ##{method}" do
|
71
|
-
subject.send(method).
|
71
|
+
expect(subject.send(method)).to receive(:clear)
|
72
72
|
subject.clear
|
73
73
|
end
|
74
74
|
end
|
data/spec/arachni/state_spec.rb
CHANGED
@@ -15,37 +15,37 @@ describe Arachni::State do
|
|
15
15
|
|
16
16
|
describe '#audit' do
|
17
17
|
it "returns an instance of #{described_class::Audit}" do
|
18
|
-
subject.audit.
|
18
|
+
expect(subject.audit).to be_kind_of described_class::Audit
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
describe '#element_filter' do
|
23
23
|
it "returns an instance of #{described_class::ElementFilter}" do
|
24
|
-
subject.element_filter.
|
24
|
+
expect(subject.element_filter).to be_kind_of described_class::ElementFilter
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
describe '#framework' do
|
29
29
|
it "returns an instance of #{described_class::Framework}" do
|
30
|
-
subject.framework.
|
30
|
+
expect(subject.framework).to be_kind_of described_class::Framework
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
34
|
describe '#options' do
|
35
35
|
it "returns an instance of #{described_class::Options}" do
|
36
|
-
subject.options.
|
36
|
+
expect(subject.options).to be_kind_of described_class::Options
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
describe '#http' do
|
41
41
|
it "returns an instance of #{described_class::HTTP}" do
|
42
|
-
subject.http.
|
42
|
+
expect(subject.http).to be_kind_of described_class::HTTP
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
46
|
describe '#plugins' do
|
47
47
|
it "returns an instance of #{described_class::Plugins}" do
|
48
|
-
subject.plugins.
|
48
|
+
expect(subject.plugins).to be_kind_of described_class::Plugins
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -56,7 +56,7 @@ describe Arachni::State do
|
|
56
56
|
describe '#statistics' do
|
57
57
|
%w(options audit element_filter framework http plugins).each do |name|
|
58
58
|
it "includes :#{name} statistics" do
|
59
|
-
subject.statistics[name.to_sym].
|
59
|
+
expect(subject.statistics[name.to_sym]).to eq(subject.send(name).statistics)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
@@ -70,8 +70,8 @@ describe Arachni::State do
|
|
70
70
|
|
71
71
|
new_instance = subject.load( dump_directory ).send(name)
|
72
72
|
|
73
|
-
new_instance.
|
74
|
-
new_instance.object_id.
|
73
|
+
expect(new_instance).to be_kind_of subject.send(name).class
|
74
|
+
expect(new_instance.object_id).not_to eq(previous_instance.object_id)
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
@@ -79,7 +79,7 @@ describe Arachni::State do
|
|
79
79
|
describe '#clear' do
|
80
80
|
%w(options audit element_filter framework http plugins).each do |method|
|
81
81
|
it "clears ##{method}" do
|
82
|
-
subject.send(method).
|
82
|
+
expect(subject.send(method)).to receive(:clear)
|
83
83
|
subject.clear
|
84
84
|
end
|
85
85
|
end
|
@@ -14,11 +14,11 @@ describe Arachni::Support::Buffer::AutoFlush do
|
|
14
14
|
|
15
15
|
20.times { |i| b << i }
|
16
16
|
|
17
|
-
buffers.size.
|
18
|
-
buffers.shift.
|
19
|
-
buffers.shift.
|
17
|
+
expect(buffers.size).to eq(2)
|
18
|
+
expect(buffers.shift).to eq((0..9).to_a)
|
19
|
+
expect(buffers.shift).to eq((10...20).to_a)
|
20
20
|
|
21
|
-
b.
|
21
|
+
expect(b).to be_empty
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -35,10 +35,10 @@ describe Arachni::Support::Buffer::AutoFlush do
|
|
35
35
|
|
36
36
|
20.times { |i| b << i }
|
37
37
|
|
38
|
-
buffers.size.
|
39
|
-
buffers.shift.
|
40
|
-
buffers.shift.
|
41
|
-
b.
|
38
|
+
expect(buffers.size).to eq(2)
|
39
|
+
expect(buffers.shift).to eq((0..9).to_a)
|
40
|
+
expect(buffers.shift).to eq((10...20).to_a)
|
41
|
+
expect(b).to be_empty
|
42
42
|
|
43
43
|
b = described_class.new( 99999, 10 )
|
44
44
|
|
@@ -49,10 +49,10 @@ describe Arachni::Support::Buffer::AutoFlush do
|
|
49
49
|
|
50
50
|
20.times { |i| b.batch_push (0..1000).to_a }
|
51
51
|
|
52
|
-
buffers.size.
|
53
|
-
buffers.shift.
|
54
|
-
buffers.shift.
|
55
|
-
b.
|
52
|
+
expect(buffers.size).to eq(2)
|
53
|
+
expect(buffers.shift).to eq((0..1000).to_a)
|
54
|
+
expect(buffers.shift).to eq((0..1000).to_a)
|
55
|
+
expect(b).to be_empty
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -62,15 +62,15 @@ describe Arachni::Support::Buffer::AutoFlush do
|
|
62
62
|
b = described_class.new( 10, 999, Set )
|
63
63
|
b << 'test'
|
64
64
|
b << 'test'
|
65
|
-
b.size.
|
66
|
-
b.flush.class.
|
65
|
+
expect(b.size).to eq(1)
|
66
|
+
expect(b.flush.class).to eq(Set)
|
67
67
|
|
68
68
|
b = described_class.new
|
69
69
|
b << 'test'
|
70
70
|
b << 'test'
|
71
|
-
b.size.
|
71
|
+
expect(b.size).to eq(2)
|
72
72
|
|
73
|
-
b.flush.class.
|
73
|
+
expect(b.flush.class).to eq(Array)
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
@@ -7,7 +7,7 @@ describe Arachni::Support::Buffer::Base do
|
|
7
7
|
it 'determines whether or not the buffer is full' do
|
8
8
|
b = described_class.new( 10 )
|
9
9
|
20.times { |i| b << i }
|
10
|
-
b.full
|
10
|
+
expect(b.full?).to be_truthy
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -16,15 +16,15 @@ describe Arachni::Support::Buffer::Base do
|
|
16
16
|
b = described_class.new( 10, Set )
|
17
17
|
b << 'test'
|
18
18
|
b << 'test'
|
19
|
-
b.size.
|
20
|
-
b.flush.class.
|
19
|
+
expect(b.size).to eq(1)
|
20
|
+
expect(b.flush.class).to eq(Set)
|
21
21
|
|
22
22
|
b = described_class.new
|
23
23
|
b << 'test'
|
24
24
|
b << 'test'
|
25
|
-
b.size.
|
25
|
+
expect(b.size).to eq(2)
|
26
26
|
|
27
|
-
b.flush.class.
|
27
|
+
expect(b.flush.class).to eq(Array)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -34,13 +34,13 @@ describe Arachni::Support::Buffer::Base do
|
|
34
34
|
b = described_class.new
|
35
35
|
b << 'test'
|
36
36
|
b << 'test'
|
37
|
-
b.size.
|
37
|
+
expect(b.size).to eq(2)
|
38
38
|
end
|
39
39
|
it 'aliased to #push' do
|
40
40
|
b = described_class.new
|
41
41
|
b.push 'test'
|
42
42
|
b.push 'test'
|
43
|
-
b.size.
|
43
|
+
expect(b.size).to eq(2)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -48,7 +48,7 @@ describe Arachni::Support::Buffer::Base do
|
|
48
48
|
it 'pushes a batch of entries' do
|
49
49
|
b = described_class.new
|
50
50
|
b.batch_push [ 'test', 'test2' ]
|
51
|
-
b.size.
|
51
|
+
expect(b.size).to eq(2)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -56,7 +56,7 @@ describe Arachni::Support::Buffer::Base do
|
|
56
56
|
it 'returns the number of entries in the buffer' do
|
57
57
|
b = described_class.new
|
58
58
|
b.batch_push [ 'test', 'test2', 'test3' ]
|
59
|
-
b.size.
|
59
|
+
expect(b.size).to eq(3)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -65,14 +65,14 @@ describe Arachni::Support::Buffer::Base do
|
|
65
65
|
context 'is empty' do
|
66
66
|
it 'returns true' do
|
67
67
|
b = described_class.new( 10 )
|
68
|
-
b.empty
|
68
|
+
expect(b.empty?).to be_truthy
|
69
69
|
end
|
70
70
|
end
|
71
71
|
context 'is not empty' do
|
72
72
|
it 'returns false' do
|
73
73
|
b = described_class.new( 10 )
|
74
74
|
b << 1
|
75
|
-
b.empty
|
75
|
+
expect(b.empty?).to be_falsey
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
@@ -84,14 +84,14 @@ describe Arachni::Support::Buffer::Base do
|
|
84
84
|
it 'returns true' do
|
85
85
|
b = described_class.new( 10 )
|
86
86
|
20.times { |i| b << i }
|
87
|
-
b.full
|
87
|
+
expect(b.full?).to be_truthy
|
88
88
|
end
|
89
89
|
end
|
90
90
|
context 'not reached its maximum size' do
|
91
91
|
it 'returns false' do
|
92
92
|
b = described_class.new( 100 )
|
93
93
|
20.times { |i| b << i }
|
94
|
-
b.full
|
94
|
+
expect(b.full?).to be_falsey
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
@@ -101,18 +101,18 @@ describe Arachni::Support::Buffer::Base do
|
|
101
101
|
it 'returns buffer contents' do
|
102
102
|
b = described_class.new
|
103
103
|
b.batch_push [ 'test', 'test2', 'test3' ]
|
104
|
-
b.size.
|
104
|
+
expect(b.size).to eq(3)
|
105
105
|
|
106
|
-
b.flush.
|
107
|
-
b.size.
|
106
|
+
expect(b.flush).to eq([ 'test', 'test2', 'test3' ])
|
107
|
+
expect(b.size).to eq(0)
|
108
108
|
end
|
109
109
|
it 'empties the buffer' do
|
110
110
|
b = described_class.new
|
111
111
|
b.batch_push [ 'test', 'test2', 'test3' ]
|
112
|
-
b.size.
|
112
|
+
expect(b.size).to eq(3)
|
113
113
|
|
114
|
-
b.flush.
|
115
|
-
b.size.
|
114
|
+
expect(b.flush).to eq([ 'test', 'test2', 'test3' ])
|
115
|
+
expect(b.size).to eq(0)
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
@@ -123,30 +123,30 @@ describe Arachni::Support::Buffer::Base do
|
|
123
123
|
b = described_class.new
|
124
124
|
|
125
125
|
call_args = []
|
126
|
-
b.on_push do |buffer|
|
126
|
+
expect(b.on_push do |buffer|
|
127
127
|
call_args << buffer
|
128
|
-
end.
|
128
|
+
end).to eq(b)
|
129
129
|
|
130
|
-
b.on_push do |buffer|
|
130
|
+
expect(b.on_push do |buffer|
|
131
131
|
call_args << buffer
|
132
|
-
end.
|
132
|
+
end).to eq(b)
|
133
133
|
|
134
134
|
b << item
|
135
|
-
call_args.
|
135
|
+
expect(call_args).to eq([ item, item])
|
136
136
|
|
137
137
|
b = described_class.new
|
138
138
|
|
139
139
|
call_args = []
|
140
|
-
b.on_push do |buffer|
|
140
|
+
expect(b.on_push do |buffer|
|
141
141
|
call_args << buffer
|
142
|
-
end.
|
142
|
+
end).to eq(b)
|
143
143
|
|
144
|
-
b.on_push do |buffer|
|
144
|
+
expect(b.on_push do |buffer|
|
145
145
|
call_args << buffer
|
146
|
-
end.
|
146
|
+
end).to eq(b)
|
147
147
|
|
148
148
|
b.push item
|
149
|
-
call_args.
|
149
|
+
expect(call_args).to eq([ item, item])
|
150
150
|
end
|
151
151
|
end
|
152
152
|
|
@@ -157,16 +157,16 @@ describe Arachni::Support::Buffer::Base do
|
|
157
157
|
b = described_class.new
|
158
158
|
|
159
159
|
call_args = []
|
160
|
-
b.on_batch_push do |buffer|
|
160
|
+
expect(b.on_batch_push do |buffer|
|
161
161
|
call_args << buffer
|
162
|
-
end.
|
162
|
+
end).to eq(b)
|
163
163
|
|
164
|
-
b.on_batch_push do |buffer|
|
164
|
+
expect(b.on_batch_push do |buffer|
|
165
165
|
call_args << buffer
|
166
|
-
end.
|
166
|
+
end).to eq(b)
|
167
167
|
|
168
168
|
b.batch_push item
|
169
|
-
call_args.
|
169
|
+
expect(call_args).to eq([ item, item])
|
170
170
|
end
|
171
171
|
end
|
172
172
|
|
@@ -178,16 +178,16 @@ describe Arachni::Support::Buffer::Base do
|
|
178
178
|
b << item
|
179
179
|
|
180
180
|
call_args = []
|
181
|
-
b.on_flush do |buffer|
|
181
|
+
expect(b.on_flush do |buffer|
|
182
182
|
call_args << buffer
|
183
|
-
end.
|
183
|
+
end).to eq(b)
|
184
184
|
|
185
|
-
b.on_flush do |buffer|
|
185
|
+
expect(b.on_flush do |buffer|
|
186
186
|
call_args << buffer
|
187
|
-
end.
|
187
|
+
end).to eq(b)
|
188
188
|
|
189
189
|
b.flush
|
190
|
-
call_args.
|
190
|
+
expect(call_args).to eq([ [item], [item]])
|
191
191
|
end
|
192
192
|
end
|
193
193
|
end
|