arachni 1.5.1 → 1.6.1.1
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 +5 -5
- data/CHANGELOG.md +56 -0
- data/Gemfile +2 -4
- data/LICENSE.md +1 -1
- data/README.md +116 -110
- data/Rakefile +1 -1
- data/arachni.gemspec +26 -26
- data/bin/arachni +1 -1
- data/bin/arachni_console +1 -1
- data/bin/arachni_multi +1 -1
- data/bin/arachni_reporter +1 -1
- data/bin/arachni_reproduce +1 -1
- data/bin/arachni_rest_server +1 -1
- data/bin/arachni_restore +1 -1
- data/bin/arachni_rpc +1 -1
- data/bin/arachni_rpcd +1 -1
- data/bin/arachni_rpcd_monitor +1 -1
- data/bin/arachni_script +1 -1
- data/components/checks/active/code_injection.rb +1 -1
- data/components/checks/active/code_injection_php_input_wrapper.rb +1 -1
- data/components/checks/active/code_injection_timing.rb +1 -1
- data/components/checks/active/csrf.rb +7 -2
- data/components/checks/active/file_inclusion.rb +1 -1
- data/components/checks/active/ldap_injection.rb +1 -1
- data/components/checks/active/no_sql_injection.rb +1 -1
- data/components/checks/active/no_sql_injection_differential.rb +3 -3
- data/components/checks/active/os_cmd_injection.rb +1 -1
- data/components/checks/active/os_cmd_injection_timing.rb +1 -1
- data/components/checks/active/path_traversal.rb +1 -1
- data/components/checks/active/response_splitting.rb +1 -1
- data/components/checks/active/rfi.rb +1 -1
- data/components/checks/active/session_fixation.rb +1 -1
- data/components/checks/active/source_code_disclosure.rb +1 -1
- data/components/checks/active/sql_injection.rb +1 -1
- data/components/checks/active/sql_injection_differential.rb +3 -3
- data/components/checks/active/sql_injection_timing.rb +1 -1
- data/components/checks/active/trainer.rb +1 -1
- data/components/checks/active/unvalidated_redirect.rb +1 -1
- data/components/checks/active/unvalidated_redirect_dom.rb +1 -1
- data/components/checks/active/xpath_injection.rb +1 -1
- data/components/checks/active/xss.rb +4 -4
- data/components/checks/active/xss_dom.rb +1 -1
- data/components/checks/active/xss_dom_script_context.rb +1 -1
- data/components/checks/active/xss_event.rb +3 -3
- data/components/checks/active/xss_path.rb +1 -1
- data/components/checks/active/xss_script_context.rb +3 -3
- data/components/checks/active/xss_tag.rb +4 -3
- data/components/checks/active/xxe.rb +1 -1
- data/components/checks/passive/allowed_methods.rb +1 -1
- data/components/checks/passive/backdoors.rb +1 -1
- data/components/checks/passive/backup_directories.rb +1 -1
- data/components/checks/passive/backup_files.rb +2 -2
- data/components/checks/passive/common_admin_interfaces.rb +1 -1
- data/components/checks/passive/common_directories/directories.txt +1 -0
- data/components/checks/passive/common_directories.rb +1 -1
- data/components/checks/passive/common_files.rb +1 -1
- data/components/checks/passive/directory_listing.rb +1 -1
- data/components/checks/passive/grep/captcha.rb +1 -1
- data/components/checks/passive/grep/cookie_set_for_parent_domain.rb +1 -1
- data/components/checks/passive/grep/credit_card.rb +1 -1
- data/components/checks/passive/grep/cvs_svn_users.rb +1 -1
- data/components/checks/passive/grep/emails.rb +1 -1
- data/components/checks/passive/grep/form_upload.rb +1 -1
- data/components/checks/passive/grep/hsts.rb +1 -1
- data/components/checks/passive/grep/html_objects.rb +1 -1
- data/components/checks/passive/grep/http_only_cookies.rb +1 -1
- data/components/checks/passive/grep/insecure_cookies.rb +1 -1
- data/components/checks/passive/grep/insecure_cors_policy.rb +1 -1
- data/components/checks/passive/grep/mixed_resource.rb +1 -1
- data/components/checks/passive/grep/password_autocomplete.rb +1 -1
- data/components/checks/passive/grep/private_ip.rb +1 -1
- data/components/checks/passive/grep/ssn.rb +1 -1
- data/components/checks/passive/grep/unencrypted_password_forms.rb +1 -1
- data/components/checks/passive/grep/x_frame_options.rb +4 -4
- data/components/checks/passive/htaccess_limit.rb +1 -1
- data/components/checks/passive/http_put.rb +1 -1
- data/components/checks/passive/insecure_client_access_policy.rb +1 -1
- data/components/checks/passive/insecure_cross_domain_policy_access.rb +1 -1
- data/components/checks/passive/insecure_cross_domain_policy_headers.rb +1 -1
- data/components/checks/passive/interesting_responses.rb +1 -1
- data/components/checks/passive/localstart_asp.rb +1 -1
- data/components/checks/passive/origin_spoof_access_restriction_bypass.rb +1 -1
- data/components/checks/passive/webdav.rb +1 -1
- data/components/checks/passive/xst.rb +1 -1
- data/components/fingerprinters/frameworks/aspx_mvc.rb +1 -1
- data/components/fingerprinters/frameworks/cakephp.rb +1 -1
- data/components/fingerprinters/frameworks/cherrypy.rb +1 -1
- data/components/fingerprinters/frameworks/django.rb +1 -1
- data/components/fingerprinters/frameworks/jsf.rb +1 -1
- data/components/fingerprinters/frameworks/nette.rb +1 -1
- data/components/fingerprinters/frameworks/rack.rb +1 -1
- data/components/fingerprinters/frameworks/rails.rb +1 -1
- data/components/fingerprinters/frameworks/symfony.rb +1 -1
- data/components/fingerprinters/languages/asp.rb +1 -1
- data/components/fingerprinters/languages/aspx.rb +1 -1
- data/components/fingerprinters/languages/java.rb +1 -1
- data/components/fingerprinters/languages/php.rb +1 -1
- data/components/fingerprinters/languages/python.rb +1 -1
- data/components/fingerprinters/languages/ruby.rb +1 -1
- data/components/fingerprinters/os/bsd.rb +1 -1
- data/components/fingerprinters/os/linux.rb +1 -1
- data/components/fingerprinters/os/solaris.rb +1 -1
- data/components/fingerprinters/os/unix.rb +1 -1
- data/components/fingerprinters/os/windows.rb +1 -1
- data/components/fingerprinters/servers/apache.rb +1 -1
- data/components/fingerprinters/servers/gunicorn.rb +1 -1
- data/components/fingerprinters/servers/iis.rb +1 -1
- data/components/fingerprinters/servers/jetty.rb +1 -1
- data/components/fingerprinters/servers/nginx.rb +1 -1
- data/components/fingerprinters/servers/tomcat.rb +1 -1
- data/components/path_extractors/anchors.rb +1 -1
- data/components/path_extractors/areas.rb +1 -1
- data/components/path_extractors/comments.rb +1 -1
- data/components/path_extractors/data_url.rb +1 -1
- data/components/path_extractors/forms.rb +1 -1
- data/components/path_extractors/frames.rb +1 -1
- data/components/path_extractors/generic.rb +1 -1
- data/components/path_extractors/links.rb +1 -1
- data/components/path_extractors/meta_refresh.rb +1 -1
- data/components/path_extractors/scripts.rb +1 -1
- data/components/plugins/autologin.rb +1 -1
- data/components/plugins/beep_notify.rb +1 -1
- data/components/plugins/content_types.rb +1 -1
- data/components/plugins/cookie_collector.rb +1 -1
- data/components/plugins/debug/browser_cluster_job_monitor.rb +1 -1
- data/components/plugins/defaults/autothrottle.rb +1 -1
- data/components/plugins/defaults/healthmap.rb +2 -2
- data/components/plugins/defaults/meta/remedies/discovery.rb +1 -1
- data/components/plugins/defaults/meta/remedies/timing_attacks.rb +1 -1
- data/components/plugins/defaults/meta/uniformity.rb +1 -1
- data/components/plugins/email_notify.rb +1 -1
- data/components/plugins/exec.rb +3 -3
- data/components/plugins/form_dicattack.rb +1 -1
- data/components/plugins/headers_collector.rb +1 -1
- data/components/plugins/http_dicattack.rb +1 -1
- data/components/plugins/login_script.rb +1 -1
- data/components/plugins/metrics.rb +1 -1
- data/components/plugins/page_dump.rb +1 -1
- data/components/plugins/proxy/panel/verify_login_sequence.html.erb +1 -1
- data/components/plugins/proxy/template_scope.rb +1 -1
- data/components/plugins/proxy.rb +3 -2
- data/components/plugins/rate_limiter.rb +1 -1
- data/components/plugins/restrict_to_dom_state.rb +1 -1
- data/components/plugins/script.rb +1 -1
- data/components/plugins/uncommon_headers.rb +1 -1
- data/components/plugins/vector_collector.rb +1 -1
- data/components/plugins/vector_feed.rb +1 -1
- data/components/plugins/waf_detector.rb +1 -1
- data/components/plugins/webhook_notify.rb +1 -1
- data/components/reporters/ap.rb +1 -1
- data/components/reporters/html/default/css/main.css +4 -0
- data/components/reporters/html/default.erb +9 -1
- data/components/reporters/html.rb +4 -6
- data/components/reporters/json.rb +1 -1
- data/components/reporters/marshal.rb +1 -1
- data/components/reporters/plugin_formatters/html/autologin.rb +1 -1
- data/components/reporters/plugin_formatters/html/content_types.rb +1 -1
- data/components/reporters/plugin_formatters/html/cookie_collector.rb +1 -1
- data/components/reporters/plugin_formatters/html/exec.rb +1 -1
- data/components/reporters/plugin_formatters/html/form_dicattack.rb +1 -1
- data/components/reporters/plugin_formatters/html/healthmap.rb +1 -1
- data/components/reporters/plugin_formatters/html/http_dicattack.rb +1 -1
- data/components/reporters/plugin_formatters/html/login_script.rb +1 -1
- data/components/reporters/plugin_formatters/html/metrics.rb +1 -1
- data/components/reporters/plugin_formatters/html/uncommon_headers.rb +1 -1
- data/components/reporters/plugin_formatters/html/uniformity.rb +1 -1
- data/components/reporters/plugin_formatters/html/vector_collector.rb +1 -1
- data/components/reporters/plugin_formatters/html/waf_detector.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/autologin.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/content_types.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/cookie_collector.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/exec.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/form_dicattack.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/healthmap.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/http_dicattack.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/login_script.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/metrics.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/uncommon_headers.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/uniformity.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/vector_collector.rb +1 -1
- data/components/reporters/plugin_formatters/stdout/waf_detector.rb +1 -1
- data/components/reporters/plugin_formatters/xml/autologin.rb +1 -1
- data/components/reporters/plugin_formatters/xml/content_types.rb +1 -1
- data/components/reporters/plugin_formatters/xml/cookie_collector.rb +1 -1
- data/components/reporters/plugin_formatters/xml/exec.rb +1 -1
- data/components/reporters/plugin_formatters/xml/form_dicattack.rb +1 -1
- data/components/reporters/plugin_formatters/xml/healthmap.rb +1 -1
- data/components/reporters/plugin_formatters/xml/http_dicattack.rb +1 -1
- data/components/reporters/plugin_formatters/xml/login_script.rb +1 -1
- data/components/reporters/plugin_formatters/xml/metrics.rb +1 -1
- data/components/reporters/plugin_formatters/xml/uncommon_headers.rb +1 -1
- data/components/reporters/plugin_formatters/xml/uniformity.rb +1 -1
- data/components/reporters/plugin_formatters/xml/vector_collector.rb +1 -1
- data/components/reporters/plugin_formatters/xml/waf_detector.rb +1 -1
- data/components/reporters/stdout.rb +6 -1
- data/components/reporters/txt.rb +1 -1
- data/components/reporters/xml/schema.xsd +1 -0
- data/components/reporters/xml.rb +3 -3
- data/components/reporters/yaml.rb +1 -1
- data/lib/arachni/banner.rb +1 -1
- data/lib/arachni/browser/element_locator.rb +1 -1
- data/lib/arachni/browser/javascript/dom_monitor.rb +1 -1
- data/lib/arachni/browser/javascript/proxy/stub.rb +1 -1
- data/lib/arachni/browser/javascript/proxy.rb +1 -1
- data/lib/arachni/browser/javascript/scripts/dom_monitor.js +39 -11
- data/lib/arachni/browser/javascript/scripts/taint_tracer.js +41 -30
- data/lib/arachni/browser/javascript/taint_tracer/frame/called_function.rb +1 -1
- data/lib/arachni/browser/javascript/taint_tracer/frame.rb +1 -1
- data/lib/arachni/browser/javascript/taint_tracer/sink/base.rb +1 -1
- data/lib/arachni/browser/javascript/taint_tracer/sink/data_flow.rb +1 -1
- data/lib/arachni/browser/javascript/taint_tracer/sink/execution_flow.rb +1 -1
- data/lib/arachni/browser/javascript/taint_tracer.rb +1 -1
- data/lib/arachni/browser/javascript.rb +14 -29
- data/lib/arachni/browser.rb +133 -216
- data/lib/arachni/browser_cluster/job/result.rb +1 -1
- data/lib/arachni/browser_cluster/job.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/browser_provider.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger/result.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/dom_exploration/result.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/dom_exploration.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/taint_trace/event_trigger/result.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/taint_trace/event_trigger.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/taint_trace/result.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/taint_trace.rb +1 -1
- data/lib/arachni/browser_cluster/worker.rb +11 -26
- data/lib/arachni/browser_cluster.rb +2 -3
- data/lib/arachni/check/auditor.rb +10 -5
- data/lib/arachni/check/base.rb +1 -1
- data/lib/arachni/check/manager.rb +1 -1
- data/lib/arachni/check.rb +1 -1
- data/lib/arachni/component/base.rb +1 -1
- data/lib/arachni/component/manager.rb +1 -1
- data/lib/arachni/component/options/address.rb +1 -1
- data/lib/arachni/component/options/base.rb +1 -1
- data/lib/arachni/component/options/bool.rb +1 -1
- data/lib/arachni/component/options/float.rb +1 -1
- data/lib/arachni/component/options/int.rb +1 -1
- data/lib/arachni/component/options/multiple_choice.rb +1 -1
- data/lib/arachni/component/options/object.rb +1 -1
- data/lib/arachni/component/options/path.rb +1 -1
- data/lib/arachni/component/options/port.rb +1 -1
- data/lib/arachni/component/options/string.rb +1 -1
- data/lib/arachni/component/options/url.rb +1 -1
- data/lib/arachni/component/options.rb +1 -1
- data/lib/arachni/component/output.rb +1 -1
- data/lib/arachni/component/utilities.rb +1 -1
- data/lib/arachni/component.rb +1 -1
- data/lib/arachni/data/framework/rpc.rb +2 -2
- data/lib/arachni/data/framework.rb +2 -2
- data/lib/arachni/data/issues.rb +1 -1
- data/lib/arachni/data/plugins.rb +1 -1
- data/lib/arachni/data/session.rb +1 -1
- data/lib/arachni/data.rb +1 -1
- data/lib/arachni/element/base.rb +1 -1
- data/lib/arachni/element/body.rb +1 -1
- data/lib/arachni/element/capabilities/analyzable/differential.rb +1 -1
- data/lib/arachni/element/capabilities/analyzable/signature.rb +1 -1
- data/lib/arachni/element/capabilities/analyzable/timeout.rb +1 -1
- data/lib/arachni/element/capabilities/analyzable.rb +1 -1
- data/lib/arachni/element/capabilities/auditable/buffered.rb +1 -1
- data/lib/arachni/element/capabilities/auditable/line_buffered.rb +1 -1
- data/lib/arachni/element/capabilities/auditable.rb +1 -1
- data/lib/arachni/element/capabilities/dom_only.rb +1 -1
- data/lib/arachni/element/capabilities/inputtable.rb +1 -1
- data/lib/arachni/element/capabilities/mutable.rb +1 -1
- data/lib/arachni/element/capabilities/refreshable.rb +1 -1
- data/lib/arachni/element/capabilities/submittable.rb +1 -1
- data/lib/arachni/element/capabilities/with_auditor/output.rb +1 -1
- data/lib/arachni/element/capabilities/with_auditor.rb +1 -1
- data/lib/arachni/element/capabilities/with_dom.rb +1 -1
- data/lib/arachni/element/capabilities/with_node.rb +1 -1
- data/lib/arachni/element/capabilities/with_scope/scope.rb +1 -1
- data/lib/arachni/element/capabilities/with_scope.rb +1 -1
- data/lib/arachni/element/capabilities/with_source.rb +1 -1
- data/lib/arachni/element/cookie/capabilities/inputtable.rb +1 -1
- data/lib/arachni/element/cookie/capabilities/mutable.rb +1 -1
- data/lib/arachni/element/cookie/capabilities/with_dom.rb +1 -1
- data/lib/arachni/element/cookie/dom.rb +1 -1
- data/lib/arachni/element/cookie.rb +1 -1
- data/lib/arachni/element/dom/capabilities/auditable.rb +1 -1
- data/lib/arachni/element/dom/capabilities/inputtable.rb +1 -1
- data/lib/arachni/element/dom/capabilities/locatable.rb +1 -1
- data/lib/arachni/element/dom/capabilities/mutable.rb +1 -1
- data/lib/arachni/element/dom/capabilities/submittable.rb +1 -1
- data/lib/arachni/element/dom.rb +1 -1
- data/lib/arachni/element/form/capabilities/auditable.rb +1 -1
- data/lib/arachni/element/form/capabilities/mutable.rb +1 -1
- data/lib/arachni/element/form/capabilities/submittable.rb +1 -1
- data/lib/arachni/element/form/capabilities/with_dom.rb +1 -1
- data/lib/arachni/element/form/dom.rb +1 -1
- data/lib/arachni/element/form.rb +1 -1
- data/lib/arachni/element/generic_dom.rb +1 -1
- data/lib/arachni/element/header/capabilities/inputtable.rb +1 -1
- data/lib/arachni/element/header/capabilities/mutable.rb +1 -1
- data/lib/arachni/element/header.rb +1 -1
- data/lib/arachni/element/json/capabilities/inputtable.rb +1 -1
- data/lib/arachni/element/json/capabilities/mutable.rb +1 -1
- data/lib/arachni/element/json.rb +1 -1
- data/lib/arachni/element/link/capabilities/auditable.rb +1 -1
- data/lib/arachni/element/link/capabilities/submittable.rb +1 -1
- data/lib/arachni/element/link/capabilities/with_dom.rb +1 -1
- data/lib/arachni/element/link/dom/capabilities/submittable.rb +1 -1
- data/lib/arachni/element/link/dom.rb +1 -1
- data/lib/arachni/element/link.rb +1 -1
- data/lib/arachni/element/link_template/capabilities/auditable.rb +1 -1
- data/lib/arachni/element/link_template/capabilities/inputtable.rb +1 -1
- data/lib/arachni/element/link_template/capabilities/with_dom.rb +1 -1
- data/lib/arachni/element/link_template/dom/capabilities/submittable.rb +1 -1
- data/lib/arachni/element/link_template/dom.rb +1 -1
- data/lib/arachni/element/link_template.rb +1 -1
- data/lib/arachni/element/nested_cookie/capabilities/submittable.rb +35 -0
- data/lib/arachni/element/nested_cookie.rb +370 -0
- data/lib/arachni/element/path.rb +1 -1
- data/lib/arachni/element/server.rb +1 -1
- data/lib/arachni/element/ui_form/dom.rb +1 -1
- data/lib/arachni/element/ui_form.rb +1 -1
- data/lib/arachni/element/ui_input/dom.rb +1 -1
- data/lib/arachni/element/ui_input.rb +1 -1
- data/lib/arachni/element/xml/capabilities/inputtable.rb +1 -1
- data/lib/arachni/element/xml/capabilities/mutable.rb +1 -1
- data/lib/arachni/element/xml.rb +1 -1
- data/lib/arachni/element_filter.rb +1 -1
- data/lib/arachni/error.rb +1 -1
- data/lib/arachni/ethon/easy.rb +1 -1
- data/lib/arachni/framework/parts/audit.rb +1 -1
- data/lib/arachni/framework/parts/browser.rb +1 -1
- data/lib/arachni/framework/parts/check.rb +1 -1
- data/lib/arachni/framework/parts/data.rb +1 -1
- data/lib/arachni/framework/parts/platform.rb +1 -1
- data/lib/arachni/framework/parts/plugin.rb +1 -1
- data/lib/arachni/framework/parts/report.rb +1 -1
- data/lib/arachni/framework/parts/scope.rb +1 -1
- data/lib/arachni/framework/parts/state.rb +1 -1
- data/lib/arachni/framework.rb +1 -1
- data/lib/arachni/http/client/dynamic_404_handler.rb +1 -1
- data/lib/arachni/http/client.rb +7 -5
- data/lib/arachni/http/cookie_jar.rb +1 -1
- data/lib/arachni/http/headers.rb +1 -1
- data/lib/arachni/http/message/scope.rb +1 -1
- data/lib/arachni/http/message.rb +1 -1
- data/lib/arachni/http/proxy_server/connection.rb +3 -8
- data/lib/arachni/http/proxy_server/ssl-interceptor-cacert.pem +18 -32
- data/lib/arachni/http/proxy_server/ssl-interceptor-cakey.pem +28 -49
- data/lib/arachni/http/proxy_server/ssl_interceptor.rb +7 -6
- data/lib/arachni/http/proxy_server/tunnel.rb +1 -1
- data/lib/arachni/http/proxy_server.rb +1 -1
- data/lib/arachni/http/request/scope.rb +1 -1
- data/lib/arachni/http/request.rb +8 -2
- data/lib/arachni/http/response/scope.rb +1 -1
- data/lib/arachni/http/response.rb +1 -1
- data/lib/arachni/http.rb +1 -1
- data/lib/arachni/issue/severity/base.rb +1 -1
- data/lib/arachni/issue/severity.rb +1 -1
- data/lib/arachni/issue.rb +1 -1
- data/lib/arachni/option_group.rb +1 -1
- data/lib/arachni/option_groups/audit.rb +11 -2
- data/lib/arachni/option_groups/browser_cluster.rb +28 -4
- data/lib/arachni/option_groups/datastore.rb +1 -1
- data/lib/arachni/option_groups/dispatcher.rb +1 -1
- data/lib/arachni/option_groups/http.rb +5 -5
- data/lib/arachni/option_groups/input.rb +1 -1
- data/lib/arachni/option_groups/output.rb +1 -1
- data/lib/arachni/option_groups/paths.rb +1 -1
- data/lib/arachni/option_groups/rpc.rb +1 -1
- data/lib/arachni/option_groups/scope.rb +46 -4
- data/lib/arachni/option_groups/session.rb +1 -1
- data/lib/arachni/option_groups/snapshot.rb +1 -1
- data/lib/arachni/option_groups.rb +1 -1
- data/lib/arachni/options.rb +1 -1
- data/lib/arachni/page/dom/transition.rb +1 -1
- data/lib/arachni/page/dom.rb +1 -1
- data/lib/arachni/page/scope.rb +1 -1
- data/lib/arachni/page.rb +3 -3
- data/lib/arachni/parser/document.rb +1 -1
- data/lib/arachni/parser/extractors/base.rb +1 -1
- data/lib/arachni/parser/nodes/base.rb +1 -1
- data/lib/arachni/parser/nodes/comment.rb +1 -1
- data/lib/arachni/parser/nodes/element/with_attributes/attributes.rb +2 -2
- data/lib/arachni/parser/nodes/element/with_attributes.rb +1 -1
- data/lib/arachni/parser/nodes/element.rb +1 -1
- data/lib/arachni/parser/nodes/text.rb +1 -1
- data/lib/arachni/parser/nodes/with_value.rb +2 -2
- data/lib/arachni/parser/sax.rb +2 -1
- data/lib/arachni/parser/with_children/search.rb +1 -1
- data/lib/arachni/parser/with_children.rb +1 -1
- data/lib/arachni/parser.rb +31 -2
- data/lib/arachni/platform/fingerprinter.rb +1 -1
- data/lib/arachni/platform/list.rb +1 -1
- data/lib/arachni/platform/manager.rb +1 -1
- data/lib/arachni/platform.rb +1 -1
- data/lib/arachni/plugin/base.rb +1 -1
- data/lib/arachni/plugin/formatter.rb +1 -1
- data/lib/arachni/plugin/manager.rb +1 -1
- data/lib/arachni/plugin.rb +1 -1
- data/lib/arachni/processes/dispatchers.rb +1 -1
- data/lib/arachni/processes/executables/base.rb +2 -1
- data/lib/arachni/processes/helpers/dispatchers.rb +1 -1
- data/lib/arachni/processes/helpers/instances.rb +1 -1
- data/lib/arachni/processes/helpers/processes.rb +1 -1
- data/lib/arachni/processes/helpers.rb +1 -1
- data/lib/arachni/processes/instances.rb +1 -1
- data/lib/arachni/processes/manager.rb +9 -5
- data/lib/arachni/processes.rb +1 -1
- data/lib/arachni/report.rb +1 -1
- data/lib/arachni/reporter/base.rb +1 -1
- data/lib/arachni/reporter/formatter_manager.rb +1 -1
- data/lib/arachni/reporter/manager.rb +1 -1
- data/lib/arachni/reporter/options.rb +1 -10
- data/lib/arachni/reporter.rb +1 -1
- data/lib/arachni/rest/server/instance_helpers.rb +10 -1
- data/lib/arachni/rest/server.rb +7 -1
- data/lib/arachni/rpc/client/base.rb +1 -1
- data/lib/arachni/rpc/client/dispatcher.rb +1 -1
- data/lib/arachni/rpc/client/instance/framework.rb +1 -1
- data/lib/arachni/rpc/client/instance/service.rb +1 -1
- data/lib/arachni/rpc/client/instance.rb +1 -1
- data/lib/arachni/rpc/serializer.rb +1 -1
- data/lib/arachni/rpc/server/active_options.rb +1 -1
- data/lib/arachni/rpc/server/base.rb +1 -1
- data/lib/arachni/rpc/server/check/manager.rb +1 -1
- data/lib/arachni/rpc/server/dispatcher/node.rb +1 -1
- data/lib/arachni/rpc/server/dispatcher/service.rb +1 -1
- data/lib/arachni/rpc/server/dispatcher.rb +1 -1
- data/lib/arachni/rpc/server/framework/distributor.rb +1 -1
- data/lib/arachni/rpc/server/framework/master.rb +1 -1
- data/lib/arachni/rpc/server/framework/multi_instance.rb +1 -1
- data/lib/arachni/rpc/server/framework/slave.rb +1 -1
- data/lib/arachni/rpc/server/framework.rb +1 -1
- data/lib/arachni/rpc/server/instance.rb +1 -1
- data/lib/arachni/rpc/server/output.rb +1 -1
- data/lib/arachni/rpc/server/plugin/manager.rb +1 -1
- data/lib/arachni/ruby/array.rb +1 -1
- data/lib/arachni/ruby/hash.rb +1 -1
- data/lib/arachni/ruby/object.rb +1 -1
- data/lib/arachni/ruby/set.rb +1 -1
- data/lib/arachni/ruby/string.rb +1 -1
- data/lib/arachni/ruby/webrick/cookie.rb +1 -1
- data/lib/arachni/ruby/webrick/httprequest.rb +1 -1
- data/lib/arachni/ruby/webrick.rb +1 -1
- data/lib/arachni/ruby.rb +1 -1
- data/lib/arachni/scope.rb +1 -1
- data/lib/arachni/selenium/webdriver/remote/typhoeus.rb +6 -16
- data/lib/arachni/session.rb +1 -1
- data/lib/arachni/snapshot.rb +1 -1
- data/lib/arachni/state/audit.rb +1 -1
- data/lib/arachni/state/element_filter.rb +1 -1
- data/lib/arachni/state/framework/rpc.rb +1 -1
- data/lib/arachni/state/framework.rb +1 -1
- data/lib/arachni/state/http.rb +1 -1
- data/lib/arachni/state/options.rb +1 -1
- data/lib/arachni/state/plugins.rb +1 -1
- data/lib/arachni/state.rb +1 -1
- data/lib/arachni/support/buffer/autoflush.rb +1 -1
- data/lib/arachni/support/buffer/base.rb +1 -1
- data/lib/arachni/support/buffer.rb +1 -1
- data/lib/arachni/support/cache/base.rb +1 -1
- data/lib/arachni/support/cache/least_cost_replacement.rb +1 -1
- data/lib/arachni/support/cache/least_recently_pushed.rb +1 -1
- data/lib/arachni/support/cache/least_recently_used.rb +1 -1
- data/lib/arachni/support/cache/preference.rb +1 -1
- data/lib/arachni/support/cache/random_replacement.rb +1 -1
- data/lib/arachni/support/cache.rb +1 -1
- data/lib/arachni/support/crypto/rsa_aes_cbc.rb +1 -1
- data/lib/arachni/support/crypto.rb +1 -1
- data/lib/arachni/support/database/base.rb +15 -7
- data/lib/arachni/support/database/hash.rb +1 -1
- data/lib/arachni/support/database/queue.rb +1 -1
- data/lib/arachni/support/database.rb +1 -1
- data/lib/arachni/support/glob.rb +1 -1
- data/lib/arachni/support/lookup/base.rb +1 -1
- data/lib/arachni/support/lookup/hash_set.rb +1 -1
- data/lib/arachni/support/lookup/moolb.rb +1 -1
- data/lib/arachni/support/lookup.rb +1 -1
- data/lib/arachni/support/mixins/observable.rb +1 -1
- data/lib/arachni/support/mixins/terminal.rb +1 -1
- data/lib/arachni/support/mixins.rb +1 -1
- data/lib/arachni/support/profiler.rb +1 -1
- data/lib/arachni/support/signature.rb +1 -1
- data/lib/arachni/support.rb +1 -1
- data/lib/arachni/trainer.rb +1 -1
- data/lib/arachni/ui/foo/output.rb +1 -1
- data/lib/arachni/uri/scope.rb +1 -1
- data/lib/arachni/uri.rb +6 -9
- data/lib/arachni/utilities.rb +1 -1
- data/lib/arachni/version.rb +1 -1
- data/lib/arachni.rb +1 -1
- data/lib/version +1 -1
- data/logs/error-1821117.log +243 -0
- data/spec/arachni/browser/javascript/dom_monitor_spec.rb +84 -60
- data/spec/arachni/browser/javascript/proxy_spec.rb +0 -10
- data/spec/arachni/browser/javascript/taint_tracer_spec.rb +68 -90
- data/spec/arachni/browser/javascript_spec.rb +10 -9
- data/spec/arachni/browser_cluster/worker_spec.rb +23 -55
- data/spec/arachni/browser_spec.rb +160 -158
- data/spec/arachni/data/framework/rpc_spec.rb +1 -1
- data/spec/arachni/data/framework_spec.rb +1 -1
- data/spec/arachni/element/cookie_spec.rb +1 -1
- data/spec/arachni/element/nested_cookie_spec.rb +687 -0
- data/spec/arachni/element/ui_form_spec.rb +2 -2
- data/spec/arachni/element/ui_input_spec.rb +1 -1
- data/spec/arachni/http/client_spec.rb +14 -26
- data/spec/arachni/http/cookie_jar_spec.rb +2 -2
- data/spec/arachni/http/proxy_server_spec.rb +2 -0
- data/spec/arachni/http/request_spec.rb +3 -2
- data/spec/arachni/option_groups/browser_cluster_spec.rb +17 -0
- data/spec/arachni/option_groups/http_spec.rb +6 -6
- data/spec/arachni/option_groups/scope_spec.rb +1 -6
- data/spec/arachni/page_spec.rb +3 -2
- data/spec/arachni/parser_spec.rb +45 -1
- data/spec/arachni/reporter/options_spec.rb +0 -14
- data/spec/arachni/rest/server_spec.rb +39 -2
- data/spec/arachni/uri_spec.rb +1 -1
- data/spec/components/checks/active/code_injection_spec.rb +12 -7
- data/spec/components/checks/active/code_injection_timing_spec.rb +4 -3
- data/spec/components/checks/active/file_inclusion_spec.rb +15 -10
- data/spec/components/checks/active/ldap_injection_spec.rb +5 -4
- data/spec/components/checks/active/no_sql_injection_differential_spec.rb +1 -1
- data/spec/components/checks/active/no_sql_injection_spec.rb +5 -4
- data/spec/components/checks/active/os_cmd_injection_spec.rb +6 -4
- data/spec/components/checks/active/os_cmd_injection_timing_spec.rb +4 -3
- data/spec/components/checks/active/path_traversal_spec.rb +10 -7
- data/spec/components/checks/active/response_splitting_spec.rb +5 -4
- data/spec/components/checks/active/rfi_spec.rb +9 -8
- data/spec/components/checks/active/source_code_disclosure_spec.rb +33 -10
- data/spec/components/checks/active/sql_injection_differential_spec.rb +1 -1
- data/spec/components/checks/active/sql_injection_spec.rb +53 -36
- data/spec/components/checks/active/sql_injection_timing_spec.rb +11 -8
- data/spec/components/checks/active/unvalidated_redirect_spec.rb +9 -8
- data/spec/components/checks/active/xpath_injection_spec.rb +5 -4
- data/spec/components/checks/active/xss_dom_script_context_spec.rb +5 -5
- data/spec/components/checks/active/xss_event_spec.rb +5 -3
- data/spec/components/checks/active/xss_script_context_spec.rb +4 -3
- data/spec/components/checks/active/xss_spec.rb +5 -4
- data/spec/components/checks/active/xss_tag_spec.rb +11 -3
- data/spec/components/checks/passive/backup_files_spec.rb +0 -4
- data/spec/components/checks/passive/grep/x_frame_options_spec.rb +6 -0
- data/spec/spec_helper.rb +2 -1
- data/spec/support/factories/http/response.rb +1 -1
- data/spec/support/fixtures/check_with_invalid_platforms/with_invalid_platforms.rb +1 -1
- data/spec/support/fixtures/checks/test.rb +4 -4
- data/spec/support/fixtures/checks/test2.rb +1 -1
- data/spec/support/fixtures/checks/test3.rb +1 -1
- data/spec/support/fixtures/cookies.txt +1 -1
- data/spec/support/fixtures/executables/node.rb +2 -3
- data/spec/support/fixtures/fingerprinters/test.rb +1 -1
- data/spec/support/fixtures/nested_cookies.txt +11 -0
- data/spec/support/fixtures/plugins/bad.rb +1 -1
- data/spec/support/fixtures/plugins/defaults/default.rb +1 -1
- data/spec/support/fixtures/plugins/distributable.rb +1 -1
- data/spec/support/fixtures/plugins/loop.rb +1 -1
- data/spec/support/fixtures/plugins/suspendable.rb +1 -1
- data/spec/support/fixtures/plugins/wait.rb +1 -1
- data/spec/support/fixtures/plugins/with_options.rb +1 -1
- data/spec/support/fixtures/plugins_with_priorities/p0.rb +1 -1
- data/spec/support/fixtures/plugins_with_priorities/p00.rb +1 -1
- data/spec/support/fixtures/plugins_with_priorities/p1.rb +1 -1
- data/spec/support/fixtures/plugins_with_priorities/p2.rb +1 -1
- data/spec/support/fixtures/plugins_with_priorities/p22.rb +1 -1
- data/spec/support/fixtures/plugins_with_priorities/p222.rb +1 -1
- data/spec/support/fixtures/plugins_with_priorities/p_nil.rb +1 -1
- data/spec/support/fixtures/plugins_with_priorities/p_nil2.rb +1 -1
- data/spec/support/fixtures/report.afr +0 -0
- data/spec/support/fixtures/reporters/base_spec/plugin_formatters/with_formatters/foobar.rb +1 -1
- data/spec/support/fixtures/reporters/base_spec/with_formatters.rb +1 -1
- data/spec/support/fixtures/reporters/base_spec/with_outfile.rb +1 -1
- data/spec/support/fixtures/reporters/base_spec/without_outfile.rb +1 -1
- data/spec/support/fixtures/reporters/manager_spec/afr.rb +1 -1
- data/spec/support/fixtures/reporters/manager_spec/error.rb +1 -1
- data/spec/support/fixtures/reporters/manager_spec/foo.rb +1 -1
- data/spec/support/fixtures/run_check/body.rb +1 -1
- data/spec/support/fixtures/run_check/cookies.rb +1 -1
- data/spec/support/fixtures/run_check/empty.rb +1 -1
- data/spec/support/fixtures/run_check/flch.rb +1 -1
- data/spec/support/fixtures/run_check/forms.rb +1 -1
- data/spec/support/fixtures/run_check/headers.rb +1 -1
- data/spec/support/fixtures/run_check/links.rb +1 -1
- data/spec/support/fixtures/run_check/nil.rb +1 -1
- data/spec/support/fixtures/run_check/path.rb +1 -1
- data/spec/support/fixtures/run_check/server.rb +1 -1
- data/spec/support/fixtures/signature_check/signature.rb +1 -1
- data/spec/support/fixtures/wait_check/wait.rb +1 -1
- data/spec/support/helpers/framework.rb +1 -1
- data/spec/support/helpers/misc.rb +1 -1
- data/spec/support/helpers/paths.rb +1 -1
- data/spec/support/helpers/requires.rb +1 -1
- data/spec/support/helpers/resets.rb +1 -1
- data/spec/support/helpers/web_server.rb +1 -1
- data/spec/support/lib/factory.rb +1 -1
- data/spec/support/lib/web_server_client.rb +1 -1
- data/spec/support/lib/web_server_dispatcher.rb +1 -1
- data/spec/support/lib/web_server_manager.rb +1 -1
- data/spec/support/servers/arachni/check/auditor.rb +1 -0
- data/spec/support/servers/arachni/element/form/form_dom.rb +1 -0
- data/spec/support/servers/arachni/element/form.rb +4 -4
- data/spec/support/servers/arachni/element/header.rb +1 -1
- data/spec/support/servers/arachni/element/nested_cookie.rb +84 -0
- data/spec/support/servers/arachni/parser.rb +6 -0
- data/spec/support/servers/checks/active/code_injection.rb +18 -0
- data/spec/support/servers/checks/active/code_injection_timing.rb +18 -0
- data/spec/support/servers/checks/active/file_inclusion.rb +19 -1
- data/spec/support/servers/checks/active/ldap_injection.rb +18 -0
- data/spec/support/servers/checks/active/no_sql_injection.rb +27 -0
- data/spec/support/servers/checks/active/no_sql_injection_differential.rb +19 -0
- data/spec/support/servers/checks/active/os_cmd_injection.rb +29 -0
- data/spec/support/servers/checks/active/os_cmd_injection_timing.rb +18 -1
- data/spec/support/servers/checks/active/path_traversal.rb +30 -3
- data/spec/support/servers/checks/active/response_splitting.rb +30 -1
- data/spec/support/servers/checks/active/rfi.rb +30 -2
- data/spec/support/servers/checks/active/session_fixation.rb +1 -3
- data/spec/support/servers/checks/active/source_code_disclosure.rb +16 -0
- data/spec/support/servers/checks/active/sql_injection.rb +27 -0
- data/spec/support/servers/checks/active/sql_injection_differential.rb +19 -0
- data/spec/support/servers/checks/active/sql_injection_timing.rb +19 -1
- data/spec/support/servers/checks/active/unvalidated_redirect.rb +40 -1
- data/spec/support/servers/checks/active/xpath_injection.rb +27 -0
- data/spec/support/servers/checks/active/xss.rb +40 -0
- data/spec/support/servers/checks/active/xss_event.rb +22 -1
- data/spec/support/servers/checks/active/xss_script_context.rb +18 -0
- data/spec/support/servers/checks/active/xss_tag.rb +40 -0
- data/spec/support/servers/checks/passive/grep/x_frame_options.rb +5 -0
- data/spec/support/shared/check.rb +1 -0
- data/spec/support/shared/element/capabilities/auditable/buffered.rb +2 -2
- data/spec/support/shared/element/capabilities/auditable/line_buffered.rb +2 -2
- data/spec/support/shared/element/capabilities/auditable.rb +2 -2
- data/ui/cli/framework/option_parser.rb +44 -8
- data/ui/cli/framework.rb +6 -5
- data/ui/cli/option_parser.rb +1 -1
- data/ui/cli/output.rb +1 -1
- data/ui/cli/reporter/option_parser.rb +1 -1
- data/ui/cli/reporter.rb +1 -1
- data/ui/cli/reproduce/option_parser.rb +1 -1
- data/ui/cli/reproduce.rb +1 -1
- data/ui/cli/rest/server/option_parser.rb +1 -1
- data/ui/cli/rest/server.rb +1 -1
- data/ui/cli/restored_framework/option_parser.rb +1 -1
- data/ui/cli/restored_framework.rb +1 -1
- data/ui/cli/rpc/client/dispatcher_monitor/option_parser.rb +1 -1
- data/ui/cli/rpc/client/dispatcher_monitor.rb +1 -1
- data/ui/cli/rpc/client/instance.rb +7 -4
- data/ui/cli/rpc/client/local/option_parser.rb +1 -1
- data/ui/cli/rpc/client/local.rb +1 -1
- data/ui/cli/rpc/client/remote/option_parser.rb +1 -1
- data/ui/cli/rpc/client/remote.rb +1 -1
- data/ui/cli/rpc/server/dispatcher/option_parser.rb +1 -1
- data/ui/cli/rpc/server/dispatcher.rb +1 -1
- data/ui/cli/utilities.rb +1 -1
- metadata +603 -581
data/lib/arachni/browser.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -7,8 +7,9 @@
|
|
7
7
|
=end
|
8
8
|
|
9
9
|
require 'childprocess'
|
10
|
-
require 'watir
|
10
|
+
require 'watir'
|
11
11
|
require_relative 'selenium/webdriver/element'
|
12
|
+
require_relative 'selenium/webdriver/remote/typhoeus'
|
12
13
|
require_relative 'processes/manager'
|
13
14
|
require_relative 'browser/element_locator'
|
14
15
|
require_relative 'browser/javascript'
|
@@ -57,6 +58,11 @@ class Browser
|
|
57
58
|
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
|
58
59
|
class Load < Error
|
59
60
|
end
|
61
|
+
|
62
|
+
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
|
63
|
+
class MissingExecutable < Error
|
64
|
+
end
|
65
|
+
|
60
66
|
end
|
61
67
|
|
62
68
|
# How much time to wait for the PhantomJS process to spawn before respawning.
|
@@ -80,12 +86,6 @@ class Browser
|
|
80
86
|
/src\s*=\s*['"]?(.*?)?['"]?[\s>]/i,
|
81
87
|
]
|
82
88
|
|
83
|
-
# Unfortunately, we can't expose the HTTP user-agent for client-side
|
84
|
-
# stuff, because Selenium needs to know that we're using a Webkit-based
|
85
|
-
# browser in order to use the right JS code to trigger events etc.
|
86
|
-
USER_AGENT = 'Mozilla/5.0 AppleWebKit/538.1 (KHTML, like Gecko) ' <<
|
87
|
-
"Arachni/#{Arachni::VERSION} Safari/538.1"
|
88
|
-
|
89
89
|
# @return [Array<Page::DOM::Transition>]
|
90
90
|
attr_reader :transitions
|
91
91
|
|
@@ -124,14 +124,6 @@ class Browser
|
|
124
124
|
# @see #skip_state?
|
125
125
|
attr_reader :skip_states
|
126
126
|
|
127
|
-
# @return [Integer]
|
128
|
-
# PID of the lifeline process managing the browser process.
|
129
|
-
attr_reader :lifeline_pid
|
130
|
-
|
131
|
-
# @return [Integer]
|
132
|
-
# PID of the browser process.
|
133
|
-
attr_reader :browser_pid
|
134
|
-
|
135
127
|
attr_reader :last_url
|
136
128
|
|
137
129
|
class <<self
|
@@ -139,13 +131,26 @@ class Browser
|
|
139
131
|
# @return [Bool]
|
140
132
|
# `true` if a supported browser is in the OS PATH, `false` otherwise.
|
141
133
|
def has_executable?
|
142
|
-
|
134
|
+
executable
|
135
|
+
true
|
136
|
+
rescue Error::MissingExecutable
|
137
|
+
false
|
143
138
|
end
|
144
139
|
|
145
140
|
# @return [String]
|
146
141
|
# Path to the PhantomJS executable.
|
147
142
|
def executable
|
148
|
-
|
143
|
+
@path ||= begin
|
144
|
+
path = Selenium::WebDriver::Platform.find_binary('chromedriver')
|
145
|
+
raise Error::MissingExecutable, 'chromedriver could not be found in PATH.' unless path
|
146
|
+
Selenium::WebDriver::Platform.assert_executable path
|
147
|
+
path
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# @ private
|
152
|
+
def reset
|
153
|
+
@path = nil
|
149
154
|
end
|
150
155
|
|
151
156
|
def asset_domains
|
@@ -345,7 +350,7 @@ class Browser
|
|
345
350
|
).until { @selenium.find_element( :css, css ) }
|
346
351
|
|
347
352
|
print_info "#{css.inspect} appeared for: #{url}"
|
348
|
-
rescue Selenium::WebDriver::Error::
|
353
|
+
rescue Selenium::WebDriver::Error::TimeoutError
|
349
354
|
print_bad "#{css.inspect} did not appear for: #{url}"
|
350
355
|
end
|
351
356
|
|
@@ -370,35 +375,12 @@ class Browser
|
|
370
375
|
|
371
376
|
def wait_till_ready
|
372
377
|
@javascript.wait_till_ready
|
373
|
-
wait_for_timers
|
374
|
-
wait_for_pending_requests
|
375
|
-
end
|
376
378
|
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
print_debug_level_2 'Killing process.'
|
381
|
-
if @kill_process
|
382
|
-
begin
|
383
|
-
@kill_process.close
|
384
|
-
rescue => e
|
385
|
-
print_debug_exception e
|
386
|
-
end
|
379
|
+
if Options.browser_cluster.wait_for_timers?
|
380
|
+
wait_for_timers
|
387
381
|
end
|
388
382
|
|
389
|
-
|
390
|
-
@proxy.shutdown rescue Reactor::Error::NotRunning
|
391
|
-
print_debug_level_2 '...done.'
|
392
|
-
|
393
|
-
@proxy = nil
|
394
|
-
@kill_process = nil
|
395
|
-
@watir = nil
|
396
|
-
@selenium = nil
|
397
|
-
@lifeline_pid = nil
|
398
|
-
@browser_pid = nil
|
399
|
-
@browser_url = nil
|
400
|
-
|
401
|
-
print_debug '...shutdown complete.'
|
383
|
+
wait_for_pending_requests
|
402
384
|
end
|
403
385
|
|
404
386
|
# @return [String]
|
@@ -612,7 +594,9 @@ class Browser
|
|
612
594
|
|
613
595
|
notify_on_fire_event( element, event )
|
614
596
|
|
615
|
-
|
597
|
+
if Options.browser_cluster.wait_for_timers?
|
598
|
+
pre_timeouts = javascript.timeouts
|
599
|
+
end
|
616
600
|
|
617
601
|
begin
|
618
602
|
transition = Page::DOM::Transition.new( locator, event, options ) do
|
@@ -679,13 +663,15 @@ class Browser
|
|
679
663
|
|
680
664
|
print_debug_level_2 "[done in #{transition.time}s]: #{event} (#{options}) #{locator}"
|
681
665
|
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
666
|
+
if Options.browser_cluster.wait_for_timers?
|
667
|
+
delay = (javascript.timeouts - pre_timeouts).compact.map { |t| t[1].to_i }.max
|
668
|
+
if delay
|
669
|
+
print_debug_level_2 "Found new timers with max #{delay}ms."
|
670
|
+
delay = [Options.http.request_timeout, delay].min / 1000.0
|
686
671
|
|
687
|
-
|
688
|
-
|
672
|
+
print_debug_level_2 "Will wait for #{delay}s."
|
673
|
+
sleep delay
|
674
|
+
end
|
689
675
|
end
|
690
676
|
|
691
677
|
transition
|
@@ -1040,7 +1026,6 @@ class Browser
|
|
1040
1026
|
end
|
1041
1027
|
|
1042
1028
|
def load_delay
|
1043
|
-
#(intervals + timeouts).map { |t| t[1] }.max
|
1044
1029
|
@javascript.timeouts.compact.map { |t| t[1].to_i }.max
|
1045
1030
|
end
|
1046
1031
|
|
@@ -1101,30 +1086,83 @@ class Browser
|
|
1101
1086
|
def selenium
|
1102
1087
|
return @selenium if @selenium
|
1103
1088
|
|
1104
|
-
|
1105
|
-
# PhantomJS 2.1.1 and causes a boatload of time-outs.
|
1106
|
-
client = Selenium::WebDriver::Remote::Http::Default.new
|
1107
|
-
client.timeout = Options.browser_cluster.job_timeout
|
1089
|
+
start_proxy
|
1108
1090
|
|
1109
|
-
|
1110
|
-
|
1091
|
+
proxy_uri = URI( @proxy.url )
|
1092
|
+
|
1093
|
+
dir = "#{Options.paths.tmpdir}/Arachni_Chrome_#{self.object_id}/"
|
1094
|
+
FileUtils.rm_rf dir
|
1095
|
+
FileUtils.mkdir dir
|
1096
|
+
at_exit do
|
1097
|
+
FileUtils.rm_rf dir
|
1098
|
+
end
|
1111
1099
|
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1100
|
+
@selenium = Selenium::WebDriver.for(
|
1101
|
+
:chrome,
|
1102
|
+
capabilities: Selenium::WebDriver::Chrome::Options.new(
|
1103
|
+
emulation: {
|
1104
|
+
userAgent: Arachni::Options.http.user_agent
|
1105
|
+
},
|
1106
|
+
args: [
|
1107
|
+
'--allow-running-insecure-content',
|
1108
|
+
'--disable-web-security',
|
1109
|
+
'--reduce-security-for-testing',
|
1110
|
+
'--ignore-certificate-errors',
|
1111
|
+
'--no-sandbox',
|
1112
|
+
'--disable-plugins',
|
1113
|
+
"--user-data-dir=#{dir}",
|
1114
|
+
"--proxy-server=#{proxy_uri.host}:#{proxy_uri.port}",
|
1115
|
+
"--buid=46464646",
|
1116
|
+
"--headless"
|
1117
|
+
]
|
1118
|
+
),
|
1119
|
+
http_client: Selenium::WebDriver::Remote::Http::Typhoeus.new
|
1117
1120
|
)
|
1121
|
+
|
1122
|
+
rescue Selenium::WebDriver::Error::WebDriverError => e
|
1123
|
+
print_error "Please ensure that chromedriver and Chrome are the same" <<
|
1124
|
+
" version and in your PATH."
|
1125
|
+
raise e
|
1118
1126
|
end
|
1119
1127
|
|
1120
|
-
def
|
1121
|
-
|
1128
|
+
def shutdown
|
1129
|
+
print_debug 'Shutting down...'
|
1130
|
+
|
1131
|
+
if @selenium
|
1132
|
+
@selenium.close
|
1133
|
+
|
1134
|
+
print_debug_level_2 'Quiting Selenium...'
|
1135
|
+
# So freaking hacky but @selenium.quit freezes if we don't detach first.
|
1136
|
+
@selenium.instance_eval do
|
1137
|
+
bridge.quit
|
1138
|
+
|
1139
|
+
@service.instance_eval do
|
1140
|
+
Process.detach @process.pid
|
1141
|
+
@process.stop
|
1142
|
+
end
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
@selenium.quit rescue Errno::ECONNREFUSED
|
1146
|
+
# @selenium.quit rescue Selenium::WebDriver::Error::WebDriverError
|
1147
|
+
print_debug_level_2 '...done.'
|
1148
|
+
|
1149
|
+
end
|
1150
|
+
|
1151
|
+
if @proxy
|
1152
|
+
print_debug_level_2 'Shutting down proxy...'
|
1153
|
+
@proxy.shutdown rescue Reactor::Error::NotRunning
|
1154
|
+
print_debug_level_2 '...done.'
|
1155
|
+
end
|
1156
|
+
|
1157
|
+
@proxy = nil
|
1158
|
+
@watir = nil
|
1159
|
+
@selenium = nil
|
1160
|
+
|
1161
|
+
print_debug '...shutdown complete.'
|
1122
1162
|
end
|
1123
1163
|
|
1124
1164
|
def inspect
|
1125
1165
|
s = "#<#{self.class} "
|
1126
|
-
s << "pid=#{@lifeline_pid} "
|
1127
|
-
s << "browser_pid=#{@browser_pid} "
|
1128
1166
|
s << "last-url=#{@last_url.inspect} "
|
1129
1167
|
s << "transitions=#{@transitions.size}"
|
1130
1168
|
s << '>'
|
@@ -1213,107 +1251,6 @@ class Browser
|
|
1213
1251
|
Options.input.value_for_name( name )
|
1214
1252
|
end
|
1215
1253
|
|
1216
|
-
def spawn_browser
|
1217
|
-
if !spawn_phantomjs
|
1218
|
-
fail Error::Spawn, 'Could not start the browser process.'
|
1219
|
-
end
|
1220
|
-
|
1221
|
-
@browser_url
|
1222
|
-
end
|
1223
|
-
|
1224
|
-
def spawn_phantomjs
|
1225
|
-
return @browser_url if @browser_url
|
1226
|
-
|
1227
|
-
print_debug 'Spawning PhantomJS...'
|
1228
|
-
|
1229
|
-
ChildProcess.posix_spawn = true
|
1230
|
-
|
1231
|
-
port = nil
|
1232
|
-
output = ''
|
1233
|
-
|
1234
|
-
10.times do |i|
|
1235
|
-
# Clear output of previous attempt.
|
1236
|
-
output = ''
|
1237
|
-
done = false
|
1238
|
-
port = Utilities.available_port
|
1239
|
-
|
1240
|
-
start_proxy
|
1241
|
-
|
1242
|
-
print_debug_level_2 "Attempt ##{i}, chose port number #{port}"
|
1243
|
-
|
1244
|
-
begin
|
1245
|
-
with_timeout BROWSER_SPAWN_TIMEOUT do
|
1246
|
-
print_debug_level_2 "Spawning process: #{self.class.executable}"
|
1247
|
-
|
1248
|
-
r, w = IO.pipe
|
1249
|
-
ri, @kill_process = IO.pipe
|
1250
|
-
|
1251
|
-
@lifeline_pid = Processes::Manager.spawn(
|
1252
|
-
:browser,
|
1253
|
-
executable: self.class.executable,
|
1254
|
-
without_arachni: true,
|
1255
|
-
fork: false,
|
1256
|
-
new_pgroup: true,
|
1257
|
-
stdin: ri,
|
1258
|
-
stdout: w,
|
1259
|
-
stderr: w,
|
1260
|
-
port: port,
|
1261
|
-
proxy_url: @proxy.url
|
1262
|
-
)
|
1263
|
-
|
1264
|
-
w.close
|
1265
|
-
ri.close
|
1266
|
-
|
1267
|
-
print_debug_level_2 'Process spawned, waiting for WebDriver server...'
|
1268
|
-
|
1269
|
-
# Wait for PhantomJS to initialize.
|
1270
|
-
while !output.include?( 'running on port' )
|
1271
|
-
begin
|
1272
|
-
output << r.readpartial( 8192 )
|
1273
|
-
# EOF or something, take a breather before retrying.
|
1274
|
-
rescue
|
1275
|
-
sleep 0.05
|
1276
|
-
end
|
1277
|
-
end
|
1278
|
-
|
1279
|
-
@browser_pid = output.scan( /^PID: (\d+)/ ).flatten.first.to_i
|
1280
|
-
|
1281
|
-
print_debug_level_2 '...WebDriver server is up.'
|
1282
|
-
done = true
|
1283
|
-
end
|
1284
|
-
rescue Timeout::Error
|
1285
|
-
print_debug 'Spawn timed-out.'
|
1286
|
-
end
|
1287
|
-
|
1288
|
-
if !output.empty?
|
1289
|
-
print_debug_level_2 output
|
1290
|
-
end
|
1291
|
-
|
1292
|
-
if done
|
1293
|
-
print_debug 'PhantomJS is ready.'
|
1294
|
-
break
|
1295
|
-
end
|
1296
|
-
|
1297
|
-
print_debug_level_2 'Killing process.'
|
1298
|
-
|
1299
|
-
# Kill everything.
|
1300
|
-
shutdown
|
1301
|
-
end
|
1302
|
-
|
1303
|
-
# Something went really bad, the browser couldn't be spawned even
|
1304
|
-
# after our valiant efforts.
|
1305
|
-
#
|
1306
|
-
# Bail out for now and count on the BrowserCluster to retry to boot
|
1307
|
-
# another process ass needed.
|
1308
|
-
if !@lifeline_pid
|
1309
|
-
log_error 'Could not spawn browser process.'
|
1310
|
-
log_error output
|
1311
|
-
return
|
1312
|
-
end
|
1313
|
-
|
1314
|
-
@browser_url = "http://127.0.0.1:#{port}"
|
1315
|
-
end
|
1316
|
-
|
1317
1254
|
def start_proxy
|
1318
1255
|
print_debug 'Booting up...'
|
1319
1256
|
|
@@ -1335,7 +1272,7 @@ class Browser
|
|
1335
1272
|
def start_webdriver
|
1336
1273
|
print_debug_level_2 'Starting WebDriver...'
|
1337
1274
|
@watir = ::Watir::Browser.new( selenium )
|
1338
|
-
print_debug_level_2 "... started WebDriver
|
1275
|
+
print_debug_level_2 "... started WebDriver."
|
1339
1276
|
|
1340
1277
|
print_debug '...boot-up completed.'
|
1341
1278
|
end
|
@@ -1422,16 +1359,17 @@ class Browser
|
|
1422
1359
|
end
|
1423
1360
|
|
1424
1361
|
return if set_cookies.empty? &&
|
1425
|
-
|
1362
|
+
Options.browser_cluster.local_storage.empty? &&
|
1363
|
+
Options.browser_cluster.session_storage.empty?
|
1426
1364
|
|
1427
1365
|
set_cookie = set_cookies.values.map(&:to_set_cookie)
|
1428
1366
|
print_debug_level_2 "Setting cookies: #{set_cookie}"
|
1429
1367
|
|
1430
1368
|
body = ''
|
1431
|
-
if
|
1432
|
-
body
|
1369
|
+
if Options.browser_cluster.local_storage.any?
|
1370
|
+
body << <<EOJS
|
1433
1371
|
<script>
|
1434
|
-
var data = #{
|
1372
|
+
var data = #{Options.browser_cluster.local_storage.to_json};
|
1435
1373
|
|
1436
1374
|
for( prop in data ) {
|
1437
1375
|
localStorage.setItem( prop, data[prop] );
|
@@ -1440,6 +1378,18 @@ class Browser
|
|
1440
1378
|
EOJS
|
1441
1379
|
end
|
1442
1380
|
|
1381
|
+
if Options.browser_cluster.session_storage.any?
|
1382
|
+
body << <<EOJS
|
1383
|
+
<script>
|
1384
|
+
var data = #{Options.browser_cluster.session_storage.to_json};
|
1385
|
+
|
1386
|
+
for( prop in data ) {
|
1387
|
+
sessionStorage.setItem( prop, data[prop] );
|
1388
|
+
}
|
1389
|
+
</script>
|
1390
|
+
EOJS
|
1391
|
+
end
|
1392
|
+
|
1443
1393
|
@selenium.navigate.to preload( HTTP::Response.new(
|
1444
1394
|
code: 200,
|
1445
1395
|
url: "#{url}/set-cookies-#{request_token}",
|
@@ -1475,43 +1425,6 @@ EOJS
|
|
1475
1425
|
@selenium.manage.window.resize_to( @width, @height )
|
1476
1426
|
end
|
1477
1427
|
|
1478
|
-
# # Firefox driver, only used for debugging.
|
1479
|
-
# def firefox
|
1480
|
-
# profile = Selenium::WebDriver::Firefox::Profile.new
|
1481
|
-
# profile.proxy = Selenium::WebDriver::Proxy.new http: @proxy.address,
|
1482
|
-
# ssl: @proxy.address
|
1483
|
-
# [:firefox, profile: profile]
|
1484
|
-
# end
|
1485
|
-
#
|
1486
|
-
# # Chrome driver, only used for debugging.
|
1487
|
-
# def chrome
|
1488
|
-
# [ :chrome, switches: [ "--proxy-server=#{@proxy.address}" ] ]
|
1489
|
-
# end
|
1490
|
-
|
1491
|
-
def capabilities
|
1492
|
-
Selenium::WebDriver::Remote::Capabilities.phantomjs(
|
1493
|
-
# Selenium tries to be helpful by including screenshots for errors
|
1494
|
-
# in the JSON response. That's not gonna fly in this use case as
|
1495
|
-
# parsing lots of massive JSON responses at the same time will
|
1496
|
-
# have a significant impact on performance.
|
1497
|
-
takes_screenshot: false,
|
1498
|
-
|
1499
|
-
# Needs to include the string Webkit:
|
1500
|
-
# https://github.com/ariya/phantomjs/issues/14198
|
1501
|
-
#
|
1502
|
-
# Default is:
|
1503
|
-
# Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1
|
1504
|
-
'phantomjs.page.settings.userAgent' =>
|
1505
|
-
USER_AGENT,
|
1506
|
-
'phantomjs.page.customHeaders.X-Arachni-Browser-Auth' =>
|
1507
|
-
auth_token,
|
1508
|
-
'phantomjs.page.settings.resourceTimeout' =>
|
1509
|
-
Options.http.request_timeout,
|
1510
|
-
'phantomjs.page.settings.loadImages' =>
|
1511
|
-
!Options.browser_cluster.ignore_images
|
1512
|
-
)
|
1513
|
-
end
|
1514
|
-
|
1515
1428
|
def flush_request_transitions
|
1516
1429
|
@request_transitions.dup
|
1517
1430
|
ensure
|
@@ -1529,8 +1442,8 @@ EOJS
|
|
1529
1442
|
def request_handler( request, response )
|
1530
1443
|
request.performer = self
|
1531
1444
|
|
1532
|
-
return if request.headers['X-Arachni-Browser-Auth'] != auth_token
|
1533
|
-
request.headers.delete 'X-Arachni-Browser-Auth'
|
1445
|
+
# return if request.headers['X-Arachni-Browser-Auth'] != auth_token
|
1446
|
+
# request.headers.delete 'X-Arachni-Browser-Auth'
|
1534
1447
|
|
1535
1448
|
print_debug_level_2 "Request: #{request.url}"
|
1536
1449
|
|
@@ -1539,7 +1452,7 @@ EOJS
|
|
1539
1452
|
#
|
1540
1453
|
# Still, it's a nice feature to have when requesting assets or anything
|
1541
1454
|
# else.
|
1542
|
-
if request.url == @last_url
|
1455
|
+
if !@last_url || request.url == @last_url
|
1543
1456
|
request.headers.delete 'If-None-Match'
|
1544
1457
|
request.headers.delete 'If-Modified-Since'
|
1545
1458
|
end
|
@@ -1594,7 +1507,11 @@ EOJS
|
|
1594
1507
|
|
1595
1508
|
# Prevent PhantomJS from caching the root page, we need to have an
|
1596
1509
|
# associated response.
|
1597
|
-
|
1510
|
+
#
|
1511
|
+
# Also don't cache when we don't have a @last_url because this could
|
1512
|
+
# be driven directly from Selenium/Watir via a plugin and caching it
|
1513
|
+
# can ruin the scan.
|
1514
|
+
if !@last_url || @last_url == response.url
|
1598
1515
|
response.headers.delete 'Cache-control'
|
1599
1516
|
response.headers.delete 'Etag'
|
1600
1517
|
response.headers.delete 'Date'
|
@@ -1872,7 +1789,7 @@ EOJS
|
|
1872
1789
|
end
|
1873
1790
|
|
1874
1791
|
def normalize_watir_url( url )
|
1875
|
-
normalize_url(
|
1792
|
+
normalize_url( url.gsub( ';', '%3B' ) ).gsub( '%3B', '%253B' )
|
1876
1793
|
end
|
1877
1794
|
|
1878
1795
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright 2010-
|
2
|
+
Copyright 2010-2022 Ecsypno <http://www.ecsypno.com>
|
3
3
|
|
4
4
|
This file is part of the Arachni Framework project and is subject to
|
5
5
|
redistribution and commercial restrictions. Please see the Arachni Framework
|