arachni 1.2.1 → 1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -12,11 +12,11 @@ describe Arachni::Framework::Parts::Scope do
|
|
12
12
|
f.options.audit.elements :links
|
13
13
|
f.options.scope.page_limit = 10
|
14
14
|
|
15
|
-
f.page_limit_reached
|
15
|
+
expect(f.page_limit_reached?).to be_falsey
|
16
16
|
f.run
|
17
|
-
f.page_limit_reached
|
17
|
+
expect(f.page_limit_reached?).to be_truthy
|
18
18
|
|
19
|
-
f.sitemap.size.
|
19
|
+
expect(f.sitemap.size).to eq(10)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -28,11 +28,11 @@ describe Arachni::Framework::Parts::Scope do
|
|
28
28
|
f.options.audit.elements :links
|
29
29
|
f.options.scope.page_limit = 100
|
30
30
|
|
31
|
-
f.checks.load :
|
31
|
+
f.checks.load :signature
|
32
32
|
|
33
|
-
f.page_limit_reached
|
33
|
+
expect(f.page_limit_reached?).to be_falsey
|
34
34
|
f.run
|
35
|
-
f.page_limit_reached
|
35
|
+
expect(f.page_limit_reached?).to be_falsey
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -43,11 +43,11 @@ describe Arachni::Framework::Parts::Scope do
|
|
43
43
|
f.options.url = web_server_url_for :framework
|
44
44
|
f.options.audit.elements :links
|
45
45
|
|
46
|
-
f.checks.load :
|
46
|
+
f.checks.load :signature
|
47
47
|
|
48
|
-
f.page_limit_reached
|
48
|
+
expect(f.page_limit_reached?).to be_falsey
|
49
49
|
f.run
|
50
|
-
f.page_limit_reached
|
50
|
+
expect(f.page_limit_reached?).to be_falsey
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -57,18 +57,18 @@ describe Arachni::Framework::Parts::Scope do
|
|
57
57
|
describe '#accepts_more_pages?' do
|
58
58
|
context 'when #page_limit_reached? and #crawl?' do
|
59
59
|
it 'return true' do
|
60
|
-
subject.
|
61
|
-
subject.
|
60
|
+
allow(subject).to receive(:page_limit_reached?) { false }
|
61
|
+
allow(subject).to receive(:crawl?) { true }
|
62
62
|
|
63
|
-
subject.accepts_more_pages
|
63
|
+
expect(subject.accepts_more_pages?).to be_truthy
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
67
|
context 'when #page_limit_reached?' do
|
68
68
|
context true do
|
69
69
|
it 'returns false' do
|
70
|
-
subject.
|
71
|
-
subject.accepts_more_pages
|
70
|
+
allow(subject).to receive(:page_limit_reached?) { true }
|
71
|
+
expect(subject.accepts_more_pages?).to be_falsey
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -76,8 +76,8 @@ describe Arachni::Framework::Parts::Scope do
|
|
76
76
|
context 'when #crawl?' do
|
77
77
|
context false do
|
78
78
|
it 'returns false' do
|
79
|
-
subject.
|
80
|
-
subject.accepts_more_pages
|
79
|
+
allow(subject).to receive(:crawl?) { false }
|
80
|
+
expect(subject.accepts_more_pages?).to be_falsey
|
81
81
|
end
|
82
82
|
end
|
83
83
|
end
|
@@ -5,41 +5,41 @@ describe Arachni::Framework::Parts::State do
|
|
5
5
|
|
6
6
|
describe '#scanning?' do
|
7
7
|
it "delegates to #{Arachni::State::Framework}#scanning?" do
|
8
|
-
subject.state.
|
9
|
-
subject.scanning
|
8
|
+
allow(subject.state).to receive(:scanning?) { :stuff }
|
9
|
+
expect(subject.scanning?).to eq(:stuff)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
describe '#done?' do
|
14
14
|
it "delegates to #{Arachni::State::Framework}#done?" do
|
15
|
-
subject.state.
|
16
|
-
subject.done
|
15
|
+
allow(subject.state).to receive(:done?) { :stuff }
|
16
|
+
expect(subject.done?).to eq(:stuff)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '#paused?' do
|
21
21
|
it "delegates to #{Arachni::State::Framework}#paused?" do
|
22
|
-
subject.state.
|
23
|
-
subject.paused
|
22
|
+
allow(subject.state).to receive(:paused?) { :stuff }
|
23
|
+
expect(subject.paused?).to eq(:stuff)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
describe '#state' do
|
28
28
|
it "returns #{Arachni::State::Framework}" do
|
29
|
-
subject.state.
|
29
|
+
expect(subject.state).to be_kind_of Arachni::State::Framework
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
describe '#abort' do
|
34
34
|
it 'aborts the system' do
|
35
|
-
@options.paths.checks = fixtures_path + '/
|
35
|
+
@options.paths.checks = fixtures_path + '/signature_check/'
|
36
36
|
|
37
37
|
Arachni::Framework.new do |f|
|
38
38
|
f.options.url = web_server_url_for :framework_multi
|
39
39
|
f.options.audit.elements :links
|
40
40
|
|
41
41
|
f.plugins.load :wait
|
42
|
-
f.checks.load :
|
42
|
+
f.checks.load :signature
|
43
43
|
|
44
44
|
t = Thread.new do
|
45
45
|
f.run
|
@@ -50,7 +50,7 @@ describe Arachni::Framework::Parts::State do
|
|
50
50
|
f.abort
|
51
51
|
t.join
|
52
52
|
|
53
|
-
Arachni::Data.issues.size.
|
53
|
+
expect(Arachni::Data.issues.size).to be < 500
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -58,7 +58,7 @@ describe Arachni::Framework::Parts::State do
|
|
58
58
|
Arachni::Framework.new do |f|
|
59
59
|
f.options.url = web_server_url_for :framework_multi
|
60
60
|
f.options.audit.elements :links
|
61
|
-
f.checks.load :
|
61
|
+
f.checks.load :signature
|
62
62
|
|
63
63
|
t = Thread.new do
|
64
64
|
f.run
|
@@ -66,24 +66,24 @@ describe Arachni::Framework::Parts::State do
|
|
66
66
|
sleep 0.1 while f.status != :scanning
|
67
67
|
|
68
68
|
f.abort
|
69
|
-
f.status.
|
69
|
+
expect(f.status).to eq(:aborted)
|
70
70
|
|
71
71
|
t.join
|
72
|
-
f.status.
|
72
|
+
expect(f.status).to eq(:aborted)
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
77
|
describe '#suspend' do
|
78
78
|
it 'suspends the system' do
|
79
|
-
@options.paths.checks = fixtures_path + '/
|
79
|
+
@options.paths.checks = fixtures_path + '/signature_check/'
|
80
80
|
|
81
81
|
Arachni::Framework.new do |f|
|
82
82
|
f.options.url = web_server_url_for :framework_multi
|
83
83
|
f.options.audit.elements :links
|
84
84
|
|
85
85
|
f.plugins.load :wait
|
86
|
-
f.checks.load :
|
86
|
+
f.checks.load :signature
|
87
87
|
|
88
88
|
t = Thread.new do
|
89
89
|
f.run
|
@@ -94,17 +94,17 @@ describe Arachni::Framework::Parts::State do
|
|
94
94
|
@snapshot = f.suspend
|
95
95
|
t.join
|
96
96
|
|
97
|
-
Arachni::Data.issues.size.
|
97
|
+
expect(Arachni::Data.issues.size).to be < 500
|
98
98
|
end
|
99
99
|
|
100
|
-
Arachni::Snapshot.load( @snapshot ).
|
100
|
+
expect(Arachni::Snapshot.load( @snapshot )).to be_truthy
|
101
101
|
end
|
102
102
|
|
103
103
|
it 'sets #status to :suspended' do
|
104
104
|
Arachni::Framework.new do |f|
|
105
105
|
f.options.url = web_server_url_for :framework_multi
|
106
106
|
f.options.audit.elements :links
|
107
|
-
f.checks.load :
|
107
|
+
f.checks.load :signature
|
108
108
|
|
109
109
|
t = Thread.new do
|
110
110
|
f.run
|
@@ -112,10 +112,10 @@ describe Arachni::Framework::Parts::State do
|
|
112
112
|
sleep 0.1 while f.status != :scanning
|
113
113
|
|
114
114
|
@snapshot = f.suspend
|
115
|
-
f.status.
|
115
|
+
expect(f.status).to eq(:suspended)
|
116
116
|
|
117
117
|
t.join
|
118
|
-
f.status.
|
118
|
+
expect(f.status).to eq(:suspended)
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
@@ -128,7 +128,7 @@ describe Arachni::Framework::Parts::State do
|
|
128
128
|
f.options.url = web_server_url_for :framework_multi
|
129
129
|
f.options.audit.elements :links
|
130
130
|
|
131
|
-
f.checks.load
|
131
|
+
f.checks.load :signature
|
132
132
|
f.plugins.load :suspendable
|
133
133
|
|
134
134
|
t = Thread.new do
|
@@ -140,7 +140,7 @@ describe Arachni::Framework::Parts::State do
|
|
140
140
|
f.suspend
|
141
141
|
t.join
|
142
142
|
|
143
|
-
Arachni::State.plugins.runtime[:suspendable][:data].
|
143
|
+
expect(Arachni::State.plugins.runtime[:suspendable][:data]).to eq(1)
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
@@ -149,7 +149,7 @@ describe Arachni::Framework::Parts::State do
|
|
149
149
|
context "when #{Arachni::OptionGroups::Snapshot}#save_path" do
|
150
150
|
context 'is a directory' do
|
151
151
|
it 'stores the snapshot under it' do
|
152
|
-
@options.paths.checks = fixtures_path + '/
|
152
|
+
@options.paths.checks = fixtures_path + '/signature_check/'
|
153
153
|
@options.snapshot.save_path = Dir.tmpdir
|
154
154
|
|
155
155
|
Arachni::Framework.new do |f|
|
@@ -157,7 +157,7 @@ describe Arachni::Framework::Parts::State do
|
|
157
157
|
f.options.audit.elements :links
|
158
158
|
|
159
159
|
f.plugins.load :wait
|
160
|
-
f.checks.load :
|
160
|
+
f.checks.load :signature
|
161
161
|
|
162
162
|
t = Thread.new do
|
163
163
|
f.run
|
@@ -168,17 +168,17 @@ describe Arachni::Framework::Parts::State do
|
|
168
168
|
@snapshot = f.suspend
|
169
169
|
t.join
|
170
170
|
|
171
|
-
Arachni::Data.issues.size.
|
171
|
+
expect(Arachni::Data.issues.size).to be < 500
|
172
172
|
end
|
173
173
|
|
174
|
-
File.dirname( @snapshot ).
|
175
|
-
Arachni::Snapshot.load( @snapshot ).
|
174
|
+
expect(File.dirname( @snapshot )).to eq(Dir.tmpdir)
|
175
|
+
expect(Arachni::Snapshot.load( @snapshot )).to be_truthy
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
179
179
|
context 'is a file path' do
|
180
180
|
it 'stores the snapshot there' do
|
181
|
-
@options.paths.checks = fixtures_path + '/
|
181
|
+
@options.paths.checks = fixtures_path + '/signature_check/'
|
182
182
|
@options.snapshot.save_path = "#{Dir.tmpdir}/snapshot"
|
183
183
|
|
184
184
|
Arachni::Framework.new do |f|
|
@@ -186,7 +186,7 @@ describe Arachni::Framework::Parts::State do
|
|
186
186
|
f.options.audit.elements :links
|
187
187
|
|
188
188
|
f.plugins.load :wait
|
189
|
-
f.checks.load :
|
189
|
+
f.checks.load :signature
|
190
190
|
|
191
191
|
t = Thread.new do
|
192
192
|
f.run
|
@@ -197,11 +197,11 @@ describe Arachni::Framework::Parts::State do
|
|
197
197
|
@snapshot = f.suspend
|
198
198
|
t.join
|
199
199
|
|
200
|
-
Arachni::Data.issues.size.
|
200
|
+
expect(Arachni::Data.issues.size).to be < 500
|
201
201
|
end
|
202
202
|
|
203
|
-
@snapshot.
|
204
|
-
Arachni::Snapshot.load( @snapshot ).
|
203
|
+
expect(@snapshot).to eq("#{Dir.tmpdir}/snapshot")
|
204
|
+
expect(Arachni::Snapshot.load( @snapshot )).to be_truthy
|
205
205
|
end
|
206
206
|
end
|
207
207
|
end
|
@@ -209,7 +209,7 @@ describe Arachni::Framework::Parts::State do
|
|
209
209
|
|
210
210
|
describe '#restore' do
|
211
211
|
it 'restores a suspended scan' do
|
212
|
-
@options.paths.checks = fixtures_path + '/
|
212
|
+
@options.paths.checks = fixtures_path + '/signature_check/'
|
213
213
|
|
214
214
|
logged_issues = 0
|
215
215
|
Arachni::Framework.new do |f|
|
@@ -217,7 +217,7 @@ describe Arachni::Framework::Parts::State do
|
|
217
217
|
f.options.audit.elements :links
|
218
218
|
|
219
219
|
f.plugins.load :wait
|
220
|
-
f.checks.load :
|
220
|
+
f.checks.load :signature
|
221
221
|
|
222
222
|
Arachni::Data.issues.on_new do
|
223
223
|
logged_issues += 1
|
@@ -232,11 +232,11 @@ describe Arachni::Framework::Parts::State do
|
|
232
232
|
@snapshot = f.suspend
|
233
233
|
t.join
|
234
234
|
|
235
|
-
logged_issues.
|
235
|
+
expect(logged_issues).to be < 500
|
236
236
|
end
|
237
237
|
|
238
238
|
reset_options
|
239
|
-
@options.paths.checks = fixtures_path + '/
|
239
|
+
@options.paths.checks = fixtures_path + '/signature_check/'
|
240
240
|
|
241
241
|
Arachni::Framework.new do |f|
|
242
242
|
f.restore @snapshot
|
@@ -246,10 +246,9 @@ describe Arachni::Framework::Parts::State do
|
|
246
246
|
end
|
247
247
|
f.run
|
248
248
|
|
249
|
-
|
250
|
-
Arachni::Data.issues.size.should == 500
|
249
|
+
expect(Arachni::Data.issues.size).to eq(500)
|
251
250
|
|
252
|
-
f.report.plugins[:wait][:results].
|
251
|
+
expect(f.report.plugins[:wait][:results]).to eq({ 'stuff' => true })
|
253
252
|
end
|
254
253
|
end
|
255
254
|
|
@@ -262,7 +261,7 @@ describe Arachni::Framework::Parts::State do
|
|
262
261
|
f.options.datastore.my_custom_option = 'my custom value'
|
263
262
|
options_hash = f.options.update( f.options.to_rpc_data ).to_h.deep_clone
|
264
263
|
|
265
|
-
f.checks.load :
|
264
|
+
f.checks.load :signature
|
266
265
|
|
267
266
|
t = Thread.new { f.run }
|
268
267
|
|
@@ -273,8 +272,8 @@ describe Arachni::Framework::Parts::State do
|
|
273
272
|
end
|
274
273
|
|
275
274
|
Arachni::Framework.restore( @snapshot ) do |f|
|
276
|
-
f.options.to_h.
|
277
|
-
f.browser_cluster_job_skip_states.
|
275
|
+
expect(f.options.to_h).to eq(options_hash.merge( checks: ['signature'] ))
|
276
|
+
expect(f.browser_cluster_job_skip_states).to be_any
|
278
277
|
end
|
279
278
|
end
|
280
279
|
|
@@ -283,7 +282,7 @@ describe Arachni::Framework::Parts::State do
|
|
283
282
|
f.options.url = @url + '/with_ajax'
|
284
283
|
f.options.audit.elements :links, :forms, :cookies
|
285
284
|
|
286
|
-
f.checks.load :
|
285
|
+
f.checks.load :signature
|
287
286
|
|
288
287
|
t = Thread.new { f.run }
|
289
288
|
|
@@ -294,14 +293,14 @@ describe Arachni::Framework::Parts::State do
|
|
294
293
|
end
|
295
294
|
|
296
295
|
Arachni::Framework.restore( @snapshot ) do |f|
|
297
|
-
f.browser_cluster_job_skip_states.
|
296
|
+
expect(f.browser_cluster_job_skip_states).to be_any
|
298
297
|
end
|
299
298
|
end
|
300
299
|
|
301
300
|
it 'restores loaded checks' do
|
302
301
|
Arachni::Framework.new do |f|
|
303
302
|
f.options.url = @url
|
304
|
-
f.checks.load :
|
303
|
+
f.checks.load :signature
|
305
304
|
|
306
305
|
t = Thread.new { f.run }
|
307
306
|
sleep 0.1 while f.status != :scanning
|
@@ -312,7 +311,7 @@ describe Arachni::Framework::Parts::State do
|
|
312
311
|
end
|
313
312
|
|
314
313
|
Arachni::Framework.restore( @snapshot ) do |f|
|
315
|
-
f.checks.loaded.
|
314
|
+
expect(f.checks.loaded).to eq(['signature'])
|
316
315
|
end
|
317
316
|
end
|
318
317
|
|
@@ -329,7 +328,7 @@ describe Arachni::Framework::Parts::State do
|
|
329
328
|
end
|
330
329
|
|
331
330
|
Arachni::Framework.restore( @snapshot ) do |f|
|
332
|
-
f.plugins.loaded.
|
331
|
+
expect(f.plugins.loaded).to eq(['wait'])
|
333
332
|
end
|
334
333
|
end
|
335
334
|
|
@@ -342,7 +341,7 @@ describe Arachni::Framework::Parts::State do
|
|
342
341
|
f.options.url = web_server_url_for :framework_multi
|
343
342
|
f.options.audit.elements :links
|
344
343
|
|
345
|
-
f.checks.load
|
344
|
+
f.checks.load :signature
|
346
345
|
f.plugins.load :suspendable
|
347
346
|
|
348
347
|
t = Thread.new do
|
@@ -354,7 +353,7 @@ describe Arachni::Framework::Parts::State do
|
|
354
353
|
@snapshot = f.suspend
|
355
354
|
t.join
|
356
355
|
|
357
|
-
Arachni::State.plugins.runtime[:suspendable][:data].
|
356
|
+
expect(Arachni::State.plugins.runtime[:suspendable][:data]).to eq(1)
|
358
357
|
end
|
359
358
|
|
360
359
|
Arachni::Framework.restore( @snapshot ) do |f|
|
@@ -364,7 +363,7 @@ describe Arachni::Framework::Parts::State do
|
|
364
363
|
|
365
364
|
sleep 0.1 while f.status != :scanning
|
366
365
|
|
367
|
-
f.plugins.jobs[:suspendable][:instance].counter.
|
366
|
+
expect(f.plugins.jobs[:suspendable][:instance].counter).to eq(2)
|
368
367
|
|
369
368
|
f.abort
|
370
369
|
t.join
|
@@ -377,7 +376,7 @@ describe Arachni::Framework::Parts::State do
|
|
377
376
|
Arachni::Framework.new do |f|
|
378
377
|
f.options.url = @url + '/elem_combo'
|
379
378
|
f.options.audit.elements :links, :forms, :cookies
|
380
|
-
f.checks.load :
|
379
|
+
f.checks.load :signature
|
381
380
|
|
382
381
|
t = Thread.new do
|
383
382
|
f.run
|
@@ -387,7 +386,7 @@ describe Arachni::Framework::Parts::State do
|
|
387
386
|
|
388
387
|
sleep 10
|
389
388
|
|
390
|
-
f.running
|
389
|
+
expect(f.running?).to be_truthy
|
391
390
|
t.kill
|
392
391
|
end
|
393
392
|
end
|
@@ -396,17 +395,17 @@ describe Arachni::Framework::Parts::State do
|
|
396
395
|
Arachni::Framework.new do |f|
|
397
396
|
f.options.url = @url + '/elem_combo'
|
398
397
|
f.options.audit.elements :links, :forms, :cookies
|
399
|
-
f.checks.load :
|
398
|
+
f.checks.load :signature
|
400
399
|
|
401
400
|
t = Thread.new do
|
402
401
|
f.run
|
403
402
|
end
|
404
403
|
|
405
|
-
f.pause.
|
404
|
+
expect(f.pause).to be_kind_of Integer
|
406
405
|
|
407
406
|
sleep 10
|
408
407
|
|
409
|
-
f.running
|
408
|
+
expect(f.running?).to be_truthy
|
410
409
|
t.kill
|
411
410
|
end
|
412
411
|
end
|
@@ -415,7 +414,7 @@ describe Arachni::Framework::Parts::State do
|
|
415
414
|
Arachni::Framework.new do |f|
|
416
415
|
f.options.url = @url + '/elem_combo'
|
417
416
|
f.options.audit.elements :links, :forms, :cookies
|
418
|
-
f.checks.load :
|
417
|
+
f.checks.load :signature
|
419
418
|
|
420
419
|
t = Thread.new do
|
421
420
|
f.run
|
@@ -423,7 +422,7 @@ describe Arachni::Framework::Parts::State do
|
|
423
422
|
sleep 0.1 while f.status != :scanning
|
424
423
|
|
425
424
|
f.pause
|
426
|
-
f.status.
|
425
|
+
expect(f.status).to eq(:paused)
|
427
426
|
|
428
427
|
t.kill
|
429
428
|
end
|
@@ -435,7 +434,7 @@ describe Arachni::Framework::Parts::State do
|
|
435
434
|
Arachni::Framework.new do |f|
|
436
435
|
f.options.url = @url + '/elem_combo'
|
437
436
|
f.options.audit.elements :links, :forms, :cookies
|
438
|
-
f.checks.load :
|
437
|
+
f.checks.load :signature
|
439
438
|
|
440
439
|
t = Thread.new do
|
441
440
|
f.run
|
@@ -445,7 +444,7 @@ describe Arachni::Framework::Parts::State do
|
|
445
444
|
|
446
445
|
sleep 10
|
447
446
|
|
448
|
-
f.running
|
447
|
+
expect(f.running?).to be_truthy
|
449
448
|
f.resume id
|
450
449
|
t.join
|
451
450
|
end
|
@@ -455,14 +454,14 @@ describe Arachni::Framework::Parts::State do
|
|
455
454
|
Arachni::Framework.new do |f|
|
456
455
|
f.options.url = @url + '/elem_combo'
|
457
456
|
f.options.audit.elements :links, :forms, :cookies
|
458
|
-
f.checks.load :
|
457
|
+
f.checks.load :signature
|
459
458
|
|
460
459
|
t = Thread.new do
|
461
460
|
f.run
|
462
461
|
end
|
463
462
|
|
464
463
|
id = f.pause
|
465
|
-
f.status.
|
464
|
+
expect(f.status).to eq(:paused)
|
466
465
|
|
467
466
|
f.resume id
|
468
467
|
Timeout.timeout( 5 ) do
|
@@ -478,7 +477,7 @@ describe Arachni::Framework::Parts::State do
|
|
478
477
|
Arachni::Framework.new do |f|
|
479
478
|
f.options.url = @url + '/elem_combo'
|
480
479
|
|
481
|
-
f.browser_cluster.
|
480
|
+
expect(f.browser_cluster).to receive(:shutdown)
|
482
481
|
f.clean_up
|
483
482
|
end
|
484
483
|
end
|
@@ -490,7 +489,7 @@ describe Arachni::Framework::Parts::State do
|
|
490
489
|
|
491
490
|
f.plugins.run
|
492
491
|
f.clean_up
|
493
|
-
f.plugins.jobs.
|
492
|
+
expect(f.plugins.jobs).to be_empty
|
494
493
|
end
|
495
494
|
end
|
496
495
|
|
@@ -499,7 +498,7 @@ describe Arachni::Framework::Parts::State do
|
|
499
498
|
f.options.url = @url + '/elem_combo'
|
500
499
|
|
501
500
|
f.clean_up
|
502
|
-
f.status.
|
501
|
+
expect(f.status).to eq(:cleanup)
|
503
502
|
end
|
504
503
|
end
|
505
504
|
|
@@ -508,9 +507,9 @@ describe Arachni::Framework::Parts::State do
|
|
508
507
|
f.options.url = @url + '/elem_combo'
|
509
508
|
f.push_to_page_queue Arachni::Page.from_url( f.options.url )
|
510
509
|
|
511
|
-
f.data.page_queue.
|
510
|
+
expect(f.data.page_queue).not_to be_empty
|
512
511
|
f.clean_up
|
513
|
-
f.data.page_queue.
|
512
|
+
expect(f.data.page_queue).to be_empty
|
514
513
|
end
|
515
514
|
end
|
516
515
|
|
@@ -519,9 +518,9 @@ describe Arachni::Framework::Parts::State do
|
|
519
518
|
f.options.url = @url + '/elem_combo'
|
520
519
|
f.push_to_url_queue f.options.url
|
521
520
|
|
522
|
-
f.data.url_queue.
|
521
|
+
expect(f.data.url_queue).not_to be_empty
|
523
522
|
f.clean_up
|
524
|
-
f.data.url_queue.
|
523
|
+
expect(f.data.url_queue).to be_empty
|
525
524
|
end
|
526
525
|
end
|
527
526
|
|
@@ -529,7 +528,7 @@ describe Arachni::Framework::Parts::State do
|
|
529
528
|
Arachni::Framework.new do |f|
|
530
529
|
f.options.url = @url + '/elem_combo'
|
531
530
|
f.clean_up
|
532
|
-
f.
|
531
|
+
expect(f).not_to be_running
|
533
532
|
end
|
534
533
|
end
|
535
534
|
end
|