arachni 1.4 → 1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +136 -0
- data/Gemfile +3 -1
- data/LICENSE.md +1 -1
- data/README.md +5 -2
- data/Rakefile +1 -1
- data/arachni.gemspec +35 -30
- data/bin/arachni +1 -1
- data/bin/arachni_console +1 -1
- data/bin/arachni_multi +6 -1
- data/bin/arachni_reporter +1 -1
- data/bin/arachni_reproduce +12 -0
- data/bin/arachni_rest_server +1 -1
- data/bin/arachni_restore +1 -1
- data/bin/arachni_rpc +6 -1
- data/bin/arachni_rpcd +1 -1
- data/bin/arachni_rpcd_monitor +6 -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 +15 -75
- 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 +1 -1
- 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 +3 -3
- 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/regexps/hsqldb.yaml +1 -0
- data/components/checks/active/sql_injection/substrings/hsqldb +1 -0
- data/components/checks/active/sql_injection/substrings/java +4 -0
- data/components/checks/active/sql_injection/substrings/oracle +0 -1
- data/components/checks/active/sql_injection/substrings/sqlite +1 -0
- data/components/checks/active/sql_injection_differential.rb +1 -1
- 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 +34 -11
- data/components/checks/active/unvalidated_redirect_dom.rb +4 -4
- data/components/checks/active/xpath_injection.rb +1 -1
- data/components/checks/active/xss.rb +52 -27
- data/components/checks/active/xss_dom.rb +15 -11
- data/components/checks/active/xss_dom_script_context.rb +4 -6
- data/components/checks/active/xss_event.rb +45 -33
- data/components/checks/active/xss_path.rb +9 -6
- data/components/checks/active/xss_script_context.rb +99 -46
- data/components/checks/active/xss_tag.rb +39 -14
- 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 +15 -3
- data/components/checks/passive/backup_files.rb +39 -6
- data/components/checks/passive/common_admin_interfaces.rb +1 -1
- data/components/checks/passive/common_admin_interfaces/admin-panels.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 +8 -9
- 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 +3 -5
- 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 +5 -5
- data/components/checks/passive/grep/insecure_cors_policy.rb +1 -1
- data/components/checks/passive/grep/mixed_resource.rb +4 -4
- 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 +3 -3
- data/components/checks/passive/grep/x_frame_options.rb +1 -1
- 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 +2 -2
- data/components/checks/passive/insecure_cross_domain_policy_access.rb +2 -2
- data/components/checks/passive/insecure_cross_domain_policy_headers.rb +2 -2
- 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 +10 -12
- 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 +3 -5
- data/components/path_extractors/areas.rb +3 -4
- data/components/path_extractors/comments.rb +4 -5
- data/components/path_extractors/data_url.rb +4 -5
- data/components/path_extractors/forms.rb +3 -4
- data/components/path_extractors/frames.rb +3 -5
- data/components/path_extractors/generic.rb +3 -1
- data/components/path_extractors/links.rb +3 -4
- data/components/path_extractors/meta_refresh.rb +11 -17
- data/components/path_extractors/scripts.rb +18 -15
- data/components/plugins/autologin.rb +3 -2
- 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 +60 -0
- data/components/plugins/defaults/autothrottle.rb +1 -1
- data/components/plugins/defaults/healthmap.rb +3 -1
- 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 +26 -9
- data/components/plugins/exec.rb +1 -1
- data/components/plugins/form_dicattack.rb +3 -4
- data/components/plugins/headers_collector.rb +1 -1
- data/components/plugins/http_dicattack.rb +4 -5
- data/components/plugins/login_script.rb +2 -2
- data/components/plugins/metrics.rb +41 -15
- data/components/plugins/page_dump.rb +60 -0
- data/components/plugins/proxy.rb +42 -30
- data/components/plugins/proxy/template_scope.rb +6 -1
- data/components/plugins/rate_limiter.rb +80 -0
- 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 +3 -3
- data/components/plugins/webhook_notify.rb +99 -0
- data/components/reporters/ap.rb +1 -1
- data/components/reporters/html.rb +2 -3
- data/components/reporters/html/default.erb +1 -2
- data/components/reporters/html/default/configuration.erb +2 -0
- 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 +46 -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 +11 -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 +10 -7
- data/components/reporters/plugin_formatters/xml/cookie_collector.rb +6 -3
- 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 +5 -2
- data/components/reporters/plugin_formatters/xml/uniformity.rb +1 -1
- data/components/reporters/plugin_formatters/xml/vector_collector.rb +8 -5
- data/components/reporters/plugin_formatters/xml/waf_detector.rb +1 -1
- data/components/reporters/stdout.rb +3 -2
- data/components/reporters/txt.rb +1 -1
- data/components/reporters/xml.rb +39 -22
- data/components/reporters/xml/schema.xsd +28 -13
- data/components/reporters/yaml.rb +1 -1
- data/lib/arachni.rb +1 -1
- data/lib/arachni/banner.rb +1 -1
- data/lib/arachni/browser.rb +242 -231
- data/lib/arachni/browser/element_locator.rb +9 -5
- data/lib/arachni/browser/javascript.rb +103 -168
- data/lib/arachni/browser/javascript/dom_monitor.rb +1 -1
- data/lib/arachni/browser/javascript/proxy.rb +1 -1
- data/lib/arachni/browser/javascript/proxy/stub.rb +1 -1
- data/lib/arachni/browser/javascript/scripts/dom_monitor.js +295 -51
- data/lib/arachni/browser/javascript/scripts/polyfills.js +0 -28
- data/lib/arachni/browser/javascript/scripts/taint_tracer.js +46 -8
- data/lib/arachni/browser/javascript/taint_tracer.rb +1 -1
- data/lib/arachni/browser/javascript/taint_tracer/frame.rb +1 -1
- data/lib/arachni/browser/javascript/taint_tracer/frame/called_function.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_cluster.rb +78 -60
- data/lib/arachni/browser_cluster/job.rb +9 -2
- data/lib/arachni/browser_cluster/job/result.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/browser_provider.rb +8 -2
- data/lib/arachni/browser_cluster/jobs/dom_exploration.rb +13 -1
- data/lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger.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/result.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/taint_trace.rb +1 -1
- data/lib/arachni/browser_cluster/jobs/taint_trace/event_trigger.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/result.rb +1 -1
- data/lib/arachni/browser_cluster/worker.rb +109 -84
- data/lib/arachni/check.rb +1 -1
- data/lib/arachni/check/auditor.rb +137 -93
- data/lib/arachni/check/base.rb +1 -1
- data/lib/arachni/check/manager.rb +1 -1
- data/lib/arachni/component.rb +1 -1
- data/lib/arachni/component/base.rb +3 -1
- data/lib/arachni/component/manager.rb +1 -1
- data/lib/arachni/component/options.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/output.rb +8 -2
- data/lib/arachni/component/utilities.rb +1 -1
- data/lib/arachni/data.rb +1 -1
- data/lib/arachni/data/framework.rb +2 -1
- data/lib/arachni/data/framework/rpc.rb +1 -1
- 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/element/base.rb +1 -1
- data/lib/arachni/element/body.rb +1 -1
- data/lib/arachni/element/capabilities/analyzable.rb +1 -1
- data/lib/arachni/element/capabilities/analyzable/differential.rb +142 -175
- data/lib/arachni/element/capabilities/analyzable/signature.rb +39 -17
- data/lib/arachni/element/capabilities/analyzable/timeout.rb +1 -1
- data/lib/arachni/element/capabilities/auditable.rb +2 -8
- data/lib/arachni/element/capabilities/auditable/buffered.rb +92 -0
- data/lib/arachni/element/capabilities/auditable/line_buffered.rb +103 -0
- data/lib/arachni/element/capabilities/dom_only.rb +1 -1
- data/lib/arachni/element/capabilities/inputtable.rb +6 -2
- 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.rb +1 -1
- data/lib/arachni/element/capabilities/with_auditor/output.rb +4 -3
- data/lib/arachni/element/capabilities/with_dom.rb +1 -1
- data/lib/arachni/element/capabilities/with_node.rb +3 -3
- data/lib/arachni/element/capabilities/with_scope.rb +1 -1
- data/lib/arachni/element/capabilities/with_scope/scope.rb +1 -1
- data/lib/arachni/element/capabilities/with_source.rb +2 -2
- data/lib/arachni/element/cookie.rb +49 -24
- 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/dom.rb +1 -1
- data/lib/arachni/element/dom/capabilities/auditable.rb +44 -3
- 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 +7 -3
- data/lib/arachni/element/dom/capabilities/submittable.rb +51 -22
- data/lib/arachni/element/form.rb +21 -32
- data/lib/arachni/element/form/capabilities/auditable.rb +1 -1
- data/lib/arachni/element/form/capabilities/mutable.rb +16 -11
- 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/generic_dom.rb +1 -1
- data/lib/arachni/element/header.rb +3 -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/json.rb +4 -8
- data/lib/arachni/element/json/capabilities/inputtable.rb +1 -1
- data/lib/arachni/element/json/capabilities/mutable.rb +1 -1
- data/lib/arachni/element/link.rb +11 -30
- 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.rb +1 -1
- data/lib/arachni/element/link/dom/capabilities/submittable.rb +1 -1
- data/lib/arachni/element/link_template.rb +10 -19
- 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.rb +2 -2
- data/lib/arachni/element/link_template/dom/capabilities/submittable.rb +1 -1
- data/lib/arachni/element/path.rb +1 -1
- data/lib/arachni/element/server.rb +11 -11
- data/lib/arachni/element/ui_form.rb +5 -6
- data/lib/arachni/element/ui_form/dom.rb +1 -1
- data/lib/arachni/element/ui_input.rb +4 -6
- data/lib/arachni/element/ui_input/dom.rb +1 -1
- data/lib/arachni/element/xml.rb +3 -7
- data/lib/arachni/element/xml/capabilities/inputtable.rb +1 -1
- data/lib/arachni/element/xml/capabilities/mutable.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.rb +1 -1
- data/lib/arachni/framework/parts/audit.rb +6 -1
- data/lib/arachni/framework/parts/browser.rb +14 -14
- 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 +2 -2
- data/lib/arachni/framework/parts/scope.rb +1 -1
- data/lib/arachni/framework/parts/state.rb +1 -1
- data/lib/arachni/http.rb +1 -1
- data/lib/arachni/http/client.rb +32 -7
- data/lib/arachni/http/client/dynamic_404_handler.rb +74 -16
- data/lib/arachni/http/cookie_jar.rb +13 -8
- data/lib/arachni/http/headers.rb +11 -5
- data/lib/arachni/http/message.rb +9 -8
- data/lib/arachni/http/message/scope.rb +1 -1
- data/lib/arachni/http/proxy_server.rb +44 -11
- data/lib/arachni/http/proxy_server/connection.rb +113 -80
- data/lib/arachni/http/proxy_server/ssl_interceptor.rb +2 -1
- data/lib/arachni/http/proxy_server/tunnel.rb +4 -4
- data/lib/arachni/http/request.rb +236 -44
- data/lib/arachni/http/request/scope.rb +1 -1
- data/lib/arachni/http/response.rb +71 -8
- data/lib/arachni/http/response/scope.rb +1 -1
- data/lib/arachni/issue.rb +42 -14
- data/lib/arachni/issue/severity.rb +1 -1
- data/lib/arachni/issue/severity/base.rb +1 -1
- data/lib/arachni/option_group.rb +1 -1
- data/lib/arachni/option_groups.rb +1 -1
- data/lib/arachni/option_groups/audit.rb +1 -1
- data/lib/arachni/option_groups/browser_cluster.rb +6 -2
- 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 +35 -6
- 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 +13 -1
- data/lib/arachni/option_groups/session.rb +1 -1
- data/lib/arachni/option_groups/snapshot.rb +1 -1
- data/lib/arachni/options.rb +23 -4
- data/lib/arachni/page.rb +8 -6
- data/lib/arachni/page/dom.rb +46 -54
- data/lib/arachni/page/dom/transition.rb +5 -2
- data/lib/arachni/page/scope.rb +1 -1
- data/lib/arachni/parser.rb +157 -77
- data/lib/arachni/parser/document.rb +34 -0
- data/lib/arachni/parser/extractors/base.rb +48 -0
- data/lib/arachni/parser/nodes/base.rb +22 -0
- data/lib/arachni/parser/nodes/comment.rb +32 -0
- data/lib/arachni/parser/nodes/element.rb +48 -0
- data/lib/arachni/parser/nodes/element/with_attributes.rb +35 -0
- data/lib/arachni/parser/nodes/element/with_attributes/attributes.rb +31 -0
- data/lib/arachni/parser/nodes/text.rb +32 -0
- data/lib/arachni/parser/nodes/with_value.rb +29 -0
- data/lib/arachni/parser/sax.rb +75 -0
- data/lib/arachni/parser/with_children.rb +35 -0
- data/lib/arachni/parser/with_children/search.rb +92 -0
- data/lib/arachni/platform.rb +1 -1
- data/lib/arachni/platform/fingerprinter.rb +1 -1
- data/lib/arachni/platform/list.rb +1 -1
- data/lib/arachni/platform/manager.rb +2 -2
- data/lib/arachni/plugin.rb +1 -1
- data/lib/arachni/plugin/base.rb +2 -2
- data/lib/arachni/plugin/formatter.rb +1 -1
- data/lib/arachni/plugin/manager.rb +8 -5
- data/lib/arachni/processes.rb +1 -1
- data/lib/arachni/processes/dispatchers.rb +1 -1
- data/lib/arachni/processes/executables/browser.rb +0 -2
- data/lib/arachni/processes/helpers.rb +1 -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/instances.rb +1 -1
- data/lib/arachni/processes/manager.rb +10 -5
- data/lib/arachni/report.rb +8 -1
- data/lib/arachni/reporter.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 -1
- data/lib/arachni/rest/server.rb +7 -1
- data/lib/arachni/rest/server/instance_helpers.rb +1 -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.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/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.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/framework.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/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.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 +9 -5
- data/lib/arachni/ruby/webrick.rb +1 -1
- data/lib/arachni/ruby/webrick/cookie.rb +1 -1
- data/lib/arachni/ruby/webrick/httprequest.rb +1 -1
- data/lib/arachni/scope.rb +1 -1
- data/lib/arachni/selenium/webdriver/element.rb +4 -4
- data/lib/arachni/selenium/webdriver/remote/typhoeus.rb +69 -0
- data/lib/arachni/session.rb +32 -13
- data/lib/arachni/snapshot.rb +1 -1
- data/lib/arachni/state.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.rb +1 -1
- data/lib/arachni/state/framework/rpc.rb +1 -1
- data/lib/arachni/state/http.rb +2 -2
- data/lib/arachni/state/options.rb +1 -1
- data/lib/arachni/state/plugins.rb +1 -1
- data/lib/arachni/support.rb +1 -1
- data/lib/arachni/support/buffer.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/cache.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/crypto.rb +1 -1
- data/lib/arachni/support/crypto/rsa_aes_cbc.rb +1 -1
- data/lib/arachni/support/database.rb +1 -1
- data/lib/arachni/support/database/base.rb +1 -1
- data/lib/arachni/support/database/hash.rb +1 -1
- data/lib/arachni/support/database/queue.rb +1 -1
- data/lib/arachni/support/glob.rb +1 -1
- data/lib/arachni/support/lookup.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/mixins.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/profiler.rb +52 -13
- data/lib/arachni/support/signature.rb +18 -6
- data/lib/arachni/trainer.rb +55 -39
- data/lib/arachni/ui/foo/output.rb +1 -1
- data/lib/arachni/uri.rb +132 -103
- data/lib/arachni/uri/scope.rb +15 -13
- data/lib/arachni/utilities.rb +10 -10
- data/lib/arachni/version.rb +1 -1
- data/lib/version +1 -1
- data/logs/error-11897.log +2006 -0
- data/logs/error-3855.log +382 -0
- data/spec/arachni/browser/element_locator_spec.rb +42 -18
- data/spec/arachni/browser/javascript/dom_monitor_spec.rb +214 -63
- data/spec/arachni/browser/javascript/polyfills_spec.rb +0 -15
- data/spec/arachni/browser/javascript/taint_tracer_spec.rb +68 -121
- data/spec/arachni/browser/javascript_spec.rb +92 -51
- data/spec/arachni/browser_cluster/job_spec.rb +23 -8
- data/spec/arachni/browser_cluster/jobs/dom_exploration_spec.rb +6 -1
- data/spec/arachni/browser_cluster/worker_spec.rb +31 -57
- data/spec/arachni/browser_cluster_spec.rb +124 -43
- data/spec/arachni/browser_spec.rb +352 -312
- data/spec/arachni/check/auditor_spec.rb +118 -33
- data/spec/arachni/element/capabilities/analyzable/signature_spec.rb +46 -3
- data/spec/arachni/element/cookie/dom_spec.rb +1 -1
- data/spec/arachni/element/cookie_spec.rb +158 -63
- data/spec/arachni/element/form/dom_spec.rb +1 -1
- data/spec/arachni/element/form_spec.rb +101 -54
- data/spec/arachni/element/header_spec.rb +3 -1
- data/spec/arachni/element/json_spec.rb +2 -0
- data/spec/arachni/element/link/dom_spec.rb +2 -2
- data/spec/arachni/element/link_spec.rb +46 -15
- data/spec/arachni/element/link_template/dom_spec.rb +1 -1
- data/spec/arachni/element/link_template_spec.rb +36 -12
- data/spec/arachni/element/server_spec.rb +22 -5
- data/spec/arachni/element/ui_form/dom_spec.rb +1 -1
- data/spec/arachni/element/ui_input/dom_spec.rb +1 -1
- data/spec/arachni/element/xml_spec.rb +5 -3
- data/spec/arachni/framework/parts/audit_spec.rb +2 -14
- data/spec/arachni/framework/parts/data_spec.rb +0 -6
- data/spec/arachni/http/client/dynamic_404_handlers_spec.rb +126 -0
- data/spec/arachni/http/client_spec.rb +82 -10
- data/spec/arachni/http/headers_spec.rb +59 -12
- data/spec/arachni/http/proxy_server_spec.rb +56 -25
- data/spec/arachni/http/request_spec.rb +379 -33
- data/spec/arachni/http/response_spec.rb +135 -7
- data/spec/arachni/issue_spec.rb +20 -1
- data/spec/arachni/option_groups/http_spec.rb +15 -0
- data/spec/arachni/option_groups/scope_spec.rb +26 -1
- data/spec/arachni/options_spec.rb +8 -1
- data/spec/arachni/page/dom_spec.rb +20 -6
- data/spec/arachni/page_spec.rb +5 -5
- data/spec/arachni/parser/document_spec.rb +49 -0
- data/spec/arachni/parser/nodes/comment_spec.rb +24 -0
- data/spec/arachni/parser/nodes/element/with_attributes/attributes_spec.rb +40 -0
- data/spec/arachni/parser/nodes/element/with_attributes_spec.rb +50 -0
- data/spec/arachni/parser/nodes/element_spec.rb +18 -0
- data/spec/arachni/parser/nodes/text_spec.rb +24 -0
- data/spec/arachni/parser/sax_spec.rb +88 -0
- data/spec/arachni/parser/with_children/search_spec.rb +146 -0
- data/spec/arachni/parser/with_children_spec.rb +37 -0
- data/spec/arachni/parser_spec.rb +166 -26
- data/spec/arachni/report_spec.rb +9 -2
- data/spec/arachni/rest/server_spec.rb +52 -6
- data/spec/arachni/rpc/server/active_options_spec.rb +1 -1
- data/spec/arachni/rpc/server/framework/distributor_spec.rb +6 -6
- data/spec/arachni/ruby/string_spec.rb +6 -0
- data/spec/arachni/session_spec.rb +69 -8
- data/spec/arachni/support/signature_spec.rb +58 -0
- data/spec/arachni/trainer_spec.rb +102 -21
- data/spec/arachni/uri_spec.rb +11 -8
- data/spec/arachni/utilities_spec.rb +3 -3
- data/spec/components/checks/active/csrf_spec.rb +1 -21
- data/spec/components/checks/active/path_traversal_spec.rb +12 -12
- data/spec/components/checks/active/sql_injection_spec.rb +10 -1
- data/spec/components/checks/active/unvalidated_redirect_spec.rb +6 -6
- data/spec/components/checks/active/xss_dom_script_context_spec.rb +1 -5
- data/spec/components/checks/active/xss_dom_spec.rb +2 -2
- data/spec/components/checks/active/xss_event_spec.rb +8 -2
- data/spec/components/checks/active/xss_script_context_spec.rb +5 -5
- data/spec/components/checks/active/xss_spec.rb +3 -3
- data/spec/components/checks/passive/backup_directories_spec.rb +3 -1
- data/spec/components/checks/passive/backup_files_spec.rb +8 -1
- data/spec/components/checks/passive/grep/insecure_cookies_spec.rb +2 -2
- data/spec/components/path_extractors/comments_spec.rb +3 -1
- data/spec/components/path_extractors/data_url_spec.rb +6 -2
- data/spec/components/path_extractors/links_spec.rb +1 -1
- data/spec/components/plugins/autologin_spec.rb +2 -2
- data/spec/components/plugins/webhook_notify_spec.rb +69 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/support/factories/page/dom.rb +6 -0
- data/spec/support/factories/scan_report.rb +1 -0
- data/spec/support/factories/vector.rb +7 -3
- data/spec/support/fixtures/check_with_invalid_platforms/with_invalid_platforms.rb +1 -1
- data/spec/support/fixtures/checks/test.rb +1 -1
- data/spec/support/fixtures/checks/test2.rb +1 -1
- data/spec/support/fixtures/checks/test3.rb +1 -1
- data/spec/support/fixtures/cookies.txt +2 -2
- data/spec/support/fixtures/fingerprinters/test.rb +1 -1
- 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/browser_cluster/jobs/taint_tracer.rb +0 -3
- 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 +4 -2
- data/spec/support/logs/Dispatcher - 1024-31864.log +10 -0
- data/spec/support/logs/Dispatcher - 1047-41465.log +10 -0
- data/spec/support/logs/Dispatcher - 1274-60799.log +64 -0
- data/spec/support/logs/Dispatcher - 1295-1058.log +44 -0
- data/spec/support/logs/Dispatcher - 1313-27076.log +40 -0
- data/spec/support/logs/Dispatcher - 1332-17127.log +35 -0
- data/spec/support/logs/Dispatcher - 1350-7351.log +29 -0
- data/spec/support/logs/Dispatcher - 1368-38528.log +22 -0
- data/spec/support/logs/Dispatcher - 1386-17419.log +14 -0
- data/spec/support/logs/Dispatcher - 31030-26156.log +10 -0
- data/spec/support/logs/Dispatcher - 321-27189.log +12 -0
- data/spec/support/logs/Dispatcher - 32353-50061.log +20 -0
- data/spec/support/logs/Dispatcher - 32450-61574.log +10 -0
- data/spec/support/logs/Dispatcher - 32470-53874.log +20 -0
- data/spec/support/logs/Dispatcher - 32491-10523.log +18 -0
- data/spec/support/logs/Dispatcher - 32509-8583.log +14 -0
- data/spec/support/logs/Dispatcher - 32536-21209.log +10 -0
- data/spec/support/logs/Dispatcher - 32556-53881.log +10 -0
- data/spec/support/logs/Dispatcher - 32579-49083.log +50 -0
- data/spec/support/logs/Dispatcher - 32761-20025.log +12 -0
- data/spec/support/logs/Dispatcher - 347-17512.log +12 -0
- data/spec/support/logs/Dispatcher - 3489-43230.log +24 -0
- data/spec/support/logs/Dispatcher - 3524-57459.log +26 -0
- data/spec/support/logs/Dispatcher - 3559-21544.log +20 -0
- data/spec/support/logs/Dispatcher - 3764-33844.log +25 -0
- data/spec/support/logs/Dispatcher - 3798-45350.log +26 -0
- data/spec/support/logs/Dispatcher - 382-15725.log +12 -0
- data/spec/support/logs/Dispatcher - 3836-6205.log +21 -0
- data/spec/support/logs/Dispatcher - 4112-45433.log +22 -0
- data/spec/support/logs/Dispatcher - 4148-53510.log +26 -0
- data/spec/support/logs/Dispatcher - 415-29873.log +14 -0
- data/spec/support/logs/Dispatcher - 4185-29736.log +18 -0
- data/spec/support/logs/Dispatcher - 4268-60912.log +25 -0
- data/spec/support/logs/Dispatcher - 4303-39372.log +26 -0
- data/spec/support/logs/Dispatcher - 4342-42190.log +21 -0
- data/spec/support/logs/Dispatcher - 463-55220.log +26 -0
- data/spec/support/logs/Dispatcher - 4649-12104.log +22 -0
- data/spec/support/logs/Dispatcher - 4683-32355.log +26 -0
- data/spec/support/logs/Dispatcher - 4724-41636.log +18 -0
- data/spec/support/logs/Dispatcher - 4881-57692.log +22 -0
- data/spec/support/logs/Dispatcher - 4961-64665.log +26 -0
- data/spec/support/logs/Dispatcher - 502-8742.log +25 -0
- data/spec/support/logs/Dispatcher - 5052-61726.log +18 -0
- data/spec/support/logs/Dispatcher - 536-15972.log +22 -0
- data/spec/support/logs/Dispatcher - 620-2220.log +20 -0
- data/spec/support/logs/Dispatcher - 638-17826.log +18 -0
- data/spec/support/logs/Dispatcher - 656-23967.log +16 -0
- data/spec/support/logs/Dispatcher - 700-15701.log +12 -0
- data/spec/support/logs/Dispatcher - 726-6080.log +10 -0
- data/spec/support/logs/Dispatcher - 749-56590.log +18 -0
- data/spec/support/logs/Dispatcher - 807-19073.log +18 -0
- data/spec/support/logs/Dispatcher - 871-8764.log +10 -0
- data/spec/support/logs/Dispatcher - 898-21496.log +12 -0
- data/spec/support/logs/Dispatcher - 933-64070.log +12 -0
- data/spec/support/logs/Instance - 1577-32284.error.log +151 -0
- data/spec/support/logs/Instance - 1625-58174.error.log +154 -0
- data/spec/support/logs/Instance - 2727-57968.error.log +151 -0
- data/spec/support/logs/Instance - 2898-20648.error.log +303 -0
- data/spec/support/logs/Instance - 2901-30845.error.log +429 -0
- data/spec/support/logs/Instance - 31185-37600.error.log +174 -0
- data/spec/support/logs/Instance - 3319-20111.error.log +175 -0
- data/spec/support/logs/error-3855.log +5132 -0
- data/spec/support/servers/arachni/browser.rb +275 -4
- data/spec/support/servers/arachni/browser/javascript/dom_monitor.rb +48 -0
- data/spec/support/servers/arachni/browser/javascript/taint_tracer.rb +15 -3
- data/spec/support/servers/arachni/check/auditor.rb +8 -0
- data/spec/support/servers/arachni/element/cookie.rb +34 -0
- data/spec/support/servers/arachni/element/form.rb +34 -0
- data/spec/support/servers/arachni/element/header.rb +36 -1
- data/spec/support/servers/arachni/element/json.rb +33 -0
- data/spec/support/servers/arachni/element/link.rb +33 -1
- data/spec/support/servers/arachni/element/link_template.rb +37 -5
- data/spec/support/servers/arachni/element/xml.rb +33 -0
- data/spec/support/servers/arachni/http/client.rb +43 -4
- data/spec/support/servers/arachni/http/client/dynamic_404_handler.rb +36 -0
- data/spec/support/servers/arachni/http/client/dynamic_404_handler_redirect_1.rb +18 -0
- data/spec/support/servers/arachni/http/client/dynamic_404_handler_redirect_2.rb +11 -0
- data/spec/support/servers/arachni/http/proxy_server.rb +12 -0
- data/spec/support/servers/arachni/session.rb +24 -1
- data/spec/support/servers/checks/active/csrf.rb +0 -76
- data/spec/support/servers/checks/active/sql_injection/java +2 -0
- data/spec/support/servers/checks/active/unvalidated_redirect.rb +81 -0
- data/spec/support/servers/checks/active/xss_event.rb +1 -1
- data/spec/support/servers/checks/passive/backup_files.rb +20 -1
- data/spec/support/servers/checks/passive/grep/cookie_set_for_parent_domain.rb +3 -5
- data/spec/support/servers/checks/passive/grep/insecure_cookies_https.rb +9 -0
- data/spec/support/servers/plugins/autologin.rb +17 -1
- data/spec/support/servers/plugins/webhook_notify.rb +9 -0
- data/spec/support/shared/element/capabilities/auditable.rb +26 -32
- data/spec/support/shared/element/capabilities/auditable/buffered.rb +791 -0
- data/spec/support/shared/element/capabilities/auditable/line_buffered.rb +797 -0
- data/spec/support/shared/element/capabilities/inputtable.rb +26 -0
- data/spec/support/shared/element/capabilities/with_node.rb +2 -2
- data/spec/support/shared/element/dom/submittable.rb +10 -10
- data/spec/support/shared/path_extractor.rb +17 -5
- data/ui/cli/framework.rb +24 -4
- data/ui/cli/framework/option_parser.rb +35 -6
- data/ui/cli/option_parser.rb +1 -1
- data/ui/cli/output.rb +10 -3
- data/ui/cli/reporter.rb +1 -1
- data/ui/cli/reporter/option_parser.rb +1 -1
- data/ui/cli/reproduce.rb +228 -0
- data/ui/cli/reproduce/option_parser.rb +90 -0
- data/ui/cli/rest/server.rb +1 -1
- data/ui/cli/rest/server/option_parser.rb +1 -1
- data/ui/cli/restored_framework.rb +1 -1
- data/ui/cli/restored_framework/option_parser.rb +1 -1
- data/ui/cli/rpc/client/dispatcher_monitor.rb +9 -11
- data/ui/cli/rpc/client/dispatcher_monitor/option_parser.rb +1 -1
- data/ui/cli/rpc/client/instance.rb +1 -1
- data/ui/cli/rpc/client/local.rb +1 -1
- data/ui/cli/rpc/client/local/option_parser.rb +1 -1
- data/ui/cli/rpc/client/remote.rb +1 -1
- data/ui/cli/rpc/client/remote/option_parser.rb +1 -1
- data/ui/cli/rpc/server/dispatcher.rb +1 -1
- data/ui/cli/rpc/server/dispatcher/option_parser.rb +1 -1
- data/ui/cli/utilities.rb +1 -1
- metadata +253 -49
- data/ACKNOWLEDGMENTS.md +0 -21
- data/AUTHORS.md +0 -3
- data/CONTRIBUTORS.md +0 -22
@@ -68,30 +68,36 @@ describe Arachni::Browser::Javascript::DOMMonitor do
|
|
68
68
|
describe '#digest' do
|
69
69
|
it 'returns a string digest of the current DOM tree' do
|
70
70
|
load '/digest'
|
71
|
-
expect(subject.digest).to eq(
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
expect(subject.digest).to eq(1754753071)
|
72
|
+
|
73
|
+
# expect(subject.digest).to eq('<HTML><HEAD><SCRIPT src=http://' <<
|
74
|
+
# 'javascript.browser.arachni/polyfills.js><SCRIPT src=http://javascri' <<
|
75
|
+
# 'pt.browser.arachni/' <<'taint_tracer.js><SCRIPT src' <<
|
76
|
+
# '=http://javascript.browser.arachni/dom_monitor.js><SCRIPT>' <<
|
77
|
+
# '<BODY onload=void();><DIV id=my-id-div><DIV class=my-class' <<
|
78
|
+
# '-div><STRONG><EM><I><B><STRONG><SCRIPT><SCRIPT type=text/' <<
|
79
|
+
# 'javascript><A href=#stuff>')
|
78
80
|
end
|
79
81
|
|
80
82
|
it 'does not include <p> elements' do
|
81
83
|
load '/digest/p'
|
82
|
-
expect(subject.digest).to eq(
|
83
|
-
|
84
|
-
|
85
|
-
|
84
|
+
expect(subject.digest).to eq(422148765)
|
85
|
+
|
86
|
+
# expect(subject.digest).to eq('<HTML><HEAD><SCRIPT src=http://' <<
|
87
|
+
# 'javascript.browser.arachni/polyfills.js><SCRIPT src=http://javascript' <<
|
88
|
+
# '.browser.arachni/taint_tracer.js><SCRIPT src=http://' <<
|
89
|
+
# 'javascript.browser.arachni/dom_monitor.js><SCRIPT><BODY><STRONG>')
|
86
90
|
end
|
87
91
|
|
88
92
|
it "does not include 'data-arachni-id' attributes" do
|
89
93
|
load '/digest/data-arachni-id'
|
90
|
-
expect(subject.digest).to eq(
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
94
|
+
expect(subject.digest).to eq(822535290)
|
95
|
+
|
96
|
+
# expect(subject.digest).to eq('<HTML><HEAD><SCRIPT src=http://' <<
|
97
|
+
# 'javascript.browser.arachni/polyfills.js><SCRIPT src=http://javascript' <<
|
98
|
+
# '.browser.arachni/taint_tracer.js><SCRIPT src=http://' <<
|
99
|
+
# 'javascript.browser.arachni/dom_monitor.js><SCRIPT><BODY><DIV ' <<
|
100
|
+
# 'id=my-id-div><DIV class=my-class-div>')
|
95
101
|
end
|
96
102
|
end
|
97
103
|
|
@@ -152,12 +158,12 @@ describe Arachni::Browser::Javascript::DOMMonitor do
|
|
152
158
|
expect(subject.elements_with_events).to eq([
|
153
159
|
{
|
154
160
|
'tag_name' => 'button',
|
155
|
-
'events' =>
|
156
|
-
[
|
157
|
-
'
|
158
|
-
'
|
161
|
+
'events' => {
|
162
|
+
'click' => [
|
163
|
+
'function (my_button_click) {}',
|
164
|
+
'handler_1()'
|
159
165
|
]
|
160
|
-
|
166
|
+
},
|
161
167
|
'attributes' => {
|
162
168
|
'onclick' => 'handler_1()',
|
163
169
|
'id' => 'my-button'
|
@@ -166,6 +172,28 @@ describe Arachni::Browser::Javascript::DOMMonitor do
|
|
166
172
|
])
|
167
173
|
end
|
168
174
|
|
175
|
+
context 'when given a whitelist of tag names' do
|
176
|
+
it 'only returns those types of elements' do
|
177
|
+
load '/elements_with_events/whitelist'
|
178
|
+
|
179
|
+
expect(subject.elements_with_events( 0, 100, ['span'] )).to eq([
|
180
|
+
{
|
181
|
+
'tag_name' => 'span',
|
182
|
+
'events' =>
|
183
|
+
{
|
184
|
+
'click' => [
|
185
|
+
'function (parent_click) {}',
|
186
|
+
'function (child_click) {}',
|
187
|
+
'function (window_click) {}',
|
188
|
+
'function (document_click) {}'
|
189
|
+
]
|
190
|
+
},
|
191
|
+
'attributes' => { 'id' => 'child-span' }
|
192
|
+
}
|
193
|
+
])
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
169
197
|
context 'when it has a dot delimited custom event' do
|
170
198
|
it 'retains the first part' do
|
171
199
|
load '/elements_with_events/custom-dot-delimited'
|
@@ -173,17 +201,11 @@ describe Arachni::Browser::Javascript::DOMMonitor do
|
|
173
201
|
expect(subject.elements_with_events).to eq([
|
174
202
|
{
|
175
203
|
"tag_name" => "button",
|
176
|
-
"events" =>
|
177
|
-
[
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
],
|
182
|
-
[
|
183
|
-
"load",
|
184
|
-
"function () {\n\t\tdocument.removeEventListener( \"DOMContentLoaded\", completed, false );\n\t\twindow.removeEventListener( \"load\", completed, false );\n\t\tjQuery.ready();\n\t}"
|
185
|
-
]
|
186
|
-
],
|
204
|
+
"events" => {
|
205
|
+
"click"=> [
|
206
|
+
"function (e) {\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?\n\t\t\t\t\tjQuery.event.dispatch.apply( eventHandle.elem, arguments ) :\n\t\t\t\t\tundefined;\n\t\t\t}"
|
207
|
+
]
|
208
|
+
},
|
187
209
|
"attributes" => {
|
188
210
|
"id" => "my-button"
|
189
211
|
}
|
@@ -200,17 +222,23 @@ describe Arachni::Browser::Javascript::DOMMonitor do
|
|
200
222
|
expect(subject.elements_with_events).to eq([
|
201
223
|
{
|
202
224
|
'tag_name' => 'button',
|
203
|
-
'events' =>
|
225
|
+
'events' => {
|
226
|
+
'click' => ['handler_1()']
|
227
|
+
},
|
204
228
|
'attributes' => { 'onclick' => 'handler_1()', 'id' => 'my-button' }
|
205
229
|
},
|
206
230
|
{
|
207
231
|
'tag_name' => 'button',
|
208
|
-
'events' =>
|
232
|
+
'events' => {
|
233
|
+
'click' => ['handler_2()']
|
234
|
+
},
|
209
235
|
'attributes' => { 'onclick' => 'handler_2()', 'id' => 'my-button2' }
|
210
236
|
},
|
211
237
|
{
|
212
238
|
'tag_name' => 'button',
|
213
|
-
'events'
|
239
|
+
'events' => {
|
240
|
+
'click' => ['handler_3()']
|
241
|
+
},
|
214
242
|
'attributes' => { 'onclick' => 'handler_3()', 'id' => 'my-button3' }
|
215
243
|
}
|
216
244
|
])
|
@@ -224,18 +252,20 @@ describe Arachni::Browser::Javascript::DOMMonitor do
|
|
224
252
|
expect(subject.elements_with_events).to eq([
|
225
253
|
{
|
226
254
|
'tag_name' => 'button',
|
227
|
-
'events' =>
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
255
|
+
'events' => {
|
256
|
+
'click' => [
|
257
|
+
'function (my_button_click) {}',
|
258
|
+
'function (my_button_click2) {}'
|
259
|
+
],
|
260
|
+
'mouseover' => ['function (my_button_onmouseover) {}']
|
261
|
+
},
|
232
262
|
'attributes' => { 'id' => 'my-button' }
|
233
263
|
},
|
234
264
|
{
|
235
265
|
'tag_name' => 'button',
|
236
|
-
'events' =>
|
237
|
-
|
238
|
-
|
266
|
+
'events' => {
|
267
|
+
'click' => ['function (my_button2_click) {}']
|
268
|
+
},
|
239
269
|
'attributes' => { 'id' => 'my-button2' }
|
240
270
|
}
|
241
271
|
])
|
@@ -247,29 +277,150 @@ describe Arachni::Browser::Javascript::DOMMonitor do
|
|
247
277
|
load 'elements_with_events/inherited'
|
248
278
|
|
249
279
|
expect(subject.elements_with_events).to eq([
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
280
|
+
{
|
281
|
+
"tag_name" => "div",
|
282
|
+
"events" => {
|
283
|
+
"click" => [
|
284
|
+
"function (parent_click) {}"
|
285
|
+
]
|
286
|
+
},
|
287
|
+
"attributes" => { "id" => "parent" } },
|
288
|
+
{
|
289
|
+
"tag_name" => "button",
|
290
|
+
"events" => {
|
291
|
+
"click" => [
|
292
|
+
"function (parent_click) {}",
|
293
|
+
"function (window_click) {}",
|
294
|
+
"function (document_click) {}"
|
295
|
+
]
|
296
|
+
},
|
297
|
+
"attributes" => { "id" => "parent-button" }
|
298
|
+
},
|
299
|
+
{
|
300
|
+
"tag_name" => "div",
|
301
|
+
"events" => {
|
302
|
+
"click" => ["function (child_click) {}"]
|
303
|
+
},
|
304
|
+
"attributes" => { "id" => "child" }
|
305
|
+
},
|
306
|
+
{
|
307
|
+
"tag_name" => "button",
|
308
|
+
"events" => {
|
309
|
+
"click" => [
|
310
|
+
"function (parent_click) {}",
|
311
|
+
"function (child_click) {}",
|
312
|
+
"function (window_click) {}",
|
313
|
+
"function (document_click) {}"
|
314
|
+
]
|
315
|
+
},
|
316
|
+
"attributes" => { "id" => "child-button" }
|
317
|
+
}
|
318
|
+
])
|
270
319
|
end
|
271
320
|
end
|
272
321
|
end
|
273
322
|
end
|
274
323
|
|
324
|
+
describe '#event_digest' do
|
325
|
+
before(:each) do
|
326
|
+
@url = Arachni::Utilities.normalize_url( web_server_url_for( :browser ) )
|
327
|
+
|
328
|
+
@empty_event_digest ||= begin
|
329
|
+
@browser.load( empty_event_digest_url )
|
330
|
+
subject.event_digest
|
331
|
+
end
|
332
|
+
|
333
|
+
@browser.load( url )
|
334
|
+
@event_digest = subject.event_digest
|
335
|
+
end
|
336
|
+
|
337
|
+
let(:empty_event_digest_url) { @url + '/event_digest/default' }
|
338
|
+
let(:empty_event_digest) do
|
339
|
+
@empty_event_digest
|
340
|
+
end
|
341
|
+
let(:event_digest) do
|
342
|
+
@event_digest
|
343
|
+
end
|
344
|
+
|
345
|
+
let(:url) { @url + '/trigger_events' }
|
346
|
+
|
347
|
+
it 'returns a DOM digest' do
|
348
|
+
expect(event_digest).to eq(subject.event_digest)
|
349
|
+
end
|
350
|
+
|
351
|
+
context 'when there are new cookies' do
|
352
|
+
let(:url) { @url + '/each_element_with_events/set-cookie' }
|
353
|
+
|
354
|
+
it 'takes them into account' do
|
355
|
+
@browser.fire_event Arachni::Browser::ElementLocator.new(
|
356
|
+
tag_name: :button,
|
357
|
+
attributes: {
|
358
|
+
onclick: 'setCookie()'
|
359
|
+
}
|
360
|
+
), :click
|
361
|
+
|
362
|
+
expect(subject.event_digest).not_to eq(event_digest)
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
366
|
+
context ':a' do
|
367
|
+
context 'and the href is not empty' do
|
368
|
+
context 'and it starts with javascript:' do
|
369
|
+
let(:url) { @url + '/each_element_with_events/a/href/javascript' }
|
370
|
+
|
371
|
+
it 'takes it into account' do
|
372
|
+
expect(event_digest).not_to eq(empty_event_digest)
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
context 'and it does not start with javascript:' do
|
377
|
+
let(:url) { @url + '/each_element_with_events/a/href/regular' }
|
378
|
+
|
379
|
+
it 'takes it into account' do
|
380
|
+
expect(event_digest).not_to eq(empty_event_digest)
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
context 'and the href is empty' do
|
386
|
+
let(:url) { @url + '/each_element_with_events/a/href/empty' }
|
387
|
+
|
388
|
+
it 'takes it into account' do
|
389
|
+
expect(event_digest).not_to eq(empty_event_digest)
|
390
|
+
end
|
391
|
+
end
|
392
|
+
end
|
393
|
+
|
394
|
+
context ':form' do
|
395
|
+
let(:empty_event_digest_url) { @url + '/event_digest/form/default' }
|
396
|
+
|
397
|
+
context ':input' do
|
398
|
+
context 'of type "image"' do
|
399
|
+
let(:url) { @url + '/each_element_with_events/form/input/image' }
|
400
|
+
|
401
|
+
it 'takes it into account' do
|
402
|
+
expect(event_digest).not_to eq(empty_event_digest)
|
403
|
+
end
|
404
|
+
end
|
405
|
+
end
|
406
|
+
|
407
|
+
context 'and the action is not empty' do
|
408
|
+
context 'and it starts with javascript:' do
|
409
|
+
let(:url) { @url + '/each_element_with_events/form/action/javascript' }
|
410
|
+
|
411
|
+
it 'takes it into account' do
|
412
|
+
expect(event_digest).not_to eq(empty_event_digest)
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
context 'and it does not start with javascript:' do
|
417
|
+
let(:url) { @url + '/each_element_with_events/form/action/regular' }
|
418
|
+
|
419
|
+
it 'takes it into account' do
|
420
|
+
expect(event_digest).not_to eq(empty_event_digest)
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
424
|
+
end
|
425
|
+
end
|
275
426
|
end
|
@@ -17,19 +17,4 @@ describe 'Arachni::Browser::Javascript::Polyfiils' do
|
|
17
17
|
|
18
18
|
subject { @browser.javascript }
|
19
19
|
|
20
|
-
describe 'Function.prototype.bind' do
|
21
|
-
it 'is implemented' do
|
22
|
-
expect(subject.run(
|
23
|
-
<<EOJS
|
24
|
-
this.x = 9;
|
25
|
-
var module = {
|
26
|
-
x: 81,
|
27
|
-
getX: function() { return this.x; }
|
28
|
-
};
|
29
|
-
return module.getX.bind( module )()
|
30
|
-
EOJS
|
31
|
-
)).to eq 81
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
20
|
end
|
@@ -28,18 +28,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
28
28
|
@browser.shutdown
|
29
29
|
end
|
30
30
|
|
31
|
-
describe '#initialized' do
|
32
|
-
it 'returns true' do
|
33
|
-
expect(subject.initialized).to be_truthy
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe '#class' do
|
38
|
-
it "returns #{described_class}" do
|
39
|
-
expect(subject.class).to eq(described_class)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
31
|
it 'is aliased to _token_taint_tracer' do
|
44
32
|
load "debug?input=_#{@javascript.token}_taint_tracer.log_execution_flow_sink()"
|
45
33
|
@browser.watir.form.submit
|
@@ -52,6 +40,18 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
52
40
|
expect(subject.execution_flow_sinks).to be_any
|
53
41
|
end
|
54
42
|
|
43
|
+
describe '#initialized' do
|
44
|
+
it 'returns true' do
|
45
|
+
expect(subject.initialized).to be_truthy
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe '#class' do
|
50
|
+
it "returns #{described_class}" do
|
51
|
+
expect(subject.class).to eq(described_class)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
55
|
describe '#taints=' do
|
56
56
|
it 'sets the taints to be traced' do
|
57
57
|
subject.taints = [taint]
|
@@ -78,10 +78,9 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
78
78
|
load "/data_trace/multiple-taints?taint1=#{taint1}&taint2=#{taint2}"
|
79
79
|
|
80
80
|
sink = subject.data_flow_sinks[taint1]
|
81
|
-
expect(sink.size).to eq(2)
|
82
81
|
|
83
82
|
entry = sink[0]
|
84
|
-
expect(entry.object).to eq('
|
83
|
+
expect(entry.object).to eq('Window')
|
85
84
|
expect(entry.function.name).to eq('process')
|
86
85
|
expect(entry.function.source).to start_with 'function process'
|
87
86
|
expect(entry.function.arguments).to eq([
|
@@ -95,7 +94,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
95
94
|
expect(@browser.source.split("\n")[entry.trace[0].line-1]).to include 'process('
|
96
95
|
|
97
96
|
entry = sink[1]
|
98
|
-
expect(entry.object).to eq('
|
97
|
+
expect(entry.object).to eq('Window')
|
99
98
|
expect(entry.function.name).to eq('process')
|
100
99
|
expect(entry.function.source).to start_with 'function process'
|
101
100
|
expect(entry.function.arguments).to eq([
|
@@ -109,10 +108,9 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
109
108
|
expect(@browser.source.split("\n")[entry.trace[0].line-1]).to include 'process('
|
110
109
|
|
111
110
|
sink = subject.data_flow_sinks[taint2]
|
112
|
-
expect(sink.size).to eq(2)
|
113
111
|
|
114
112
|
entry = sink[0]
|
115
|
-
expect(entry.object).to eq('
|
113
|
+
expect(entry.object).to eq('Window')
|
116
114
|
expect(entry.function.name).to eq('process')
|
117
115
|
expect(entry.function.source).to start_with 'function process'
|
118
116
|
expect(entry.function.arguments).to eq([
|
@@ -123,10 +121,10 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
123
121
|
])
|
124
122
|
expect(entry.tainted_value).to eq(taint2)
|
125
123
|
expect(entry.taint).to eq(taint2)
|
126
|
-
expect(@browser.source.split("\n")[entry.trace[0].line]).to include 'process('
|
124
|
+
expect(@browser.source.split("\n")[entry.trace[0].line - 1]).to include 'process('
|
127
125
|
|
128
126
|
entry = sink[1]
|
129
|
-
expect(entry.object).to eq('
|
127
|
+
expect(entry.object).to eq('Window')
|
130
128
|
expect(entry.function.name).to eq('process')
|
131
129
|
expect(entry.function.source).to start_with 'function process'
|
132
130
|
expect(entry.function.arguments).to eq([
|
@@ -137,7 +135,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
137
135
|
])
|
138
136
|
expect(entry.tainted_value).to eq(taint2)
|
139
137
|
expect(entry.taint).to eq(taint2)
|
140
|
-
expect(@browser.source.split("\n")[entry.trace[0].line]).to include 'process('
|
138
|
+
expect(@browser.source.split("\n")[entry.trace[0].line - 1]).to include 'process('
|
141
139
|
end
|
142
140
|
end
|
143
141
|
|
@@ -157,10 +155,9 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
157
155
|
load_with_taint 'data_trace/user-defined-global-functions'
|
158
156
|
|
159
157
|
sink = subject.data_flow_sinks[taint]
|
160
|
-
expect(sink.size).to eq(1)
|
161
158
|
|
162
159
|
entry = sink[0]
|
163
|
-
expect(entry.object).to eq('
|
160
|
+
expect(entry.object).to eq('Window')
|
164
161
|
expect(entry.function.name).to eq('process')
|
165
162
|
expect(entry.function.source).to start_with 'function process'
|
166
163
|
expect(entry.function.arguments).to eq([
|
@@ -182,16 +179,15 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
182
179
|
load_with_taint "data_trace/window.#{function}"
|
183
180
|
|
184
181
|
sink = subject.data_flow_sinks[taint]
|
185
|
-
expect(sink.size).to eq(1)
|
186
182
|
|
187
183
|
entry = sink[0]
|
188
|
-
expect(entry.object).to eq('
|
184
|
+
expect(entry.object).to eq('Window')
|
189
185
|
expect(entry.function.name).to eq(function)
|
190
186
|
expect(entry.function.source).to start_with "function #{function}"
|
191
187
|
expect(entry.function.arguments).to eq([ taint ])
|
192
188
|
expect(entry.tainted_value).to eq(taint)
|
193
189
|
expect(entry.taint).to eq(taint)
|
194
|
-
expect(@browser.source.split("\n")[entry.trace[0].line]).to include "#{function}("
|
190
|
+
expect(@browser.source.split("\n")[entry.trace[0].line - 1]).to include "#{function}("
|
195
191
|
end
|
196
192
|
end
|
197
193
|
end
|
@@ -203,7 +199,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
203
199
|
load_with_taint 'data_trace/XMLHttpRequest.open'
|
204
200
|
|
205
201
|
sink = subject.data_flow_sinks[taint]
|
206
|
-
expect(sink.size).to eq(1)
|
207
202
|
|
208
203
|
entry = sink[0]
|
209
204
|
expect(entry.object).to eq('XMLHttpRequestPrototype')
|
@@ -215,7 +210,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
215
210
|
expect(entry.taint).to eq(taint)
|
216
211
|
|
217
212
|
trace = entry.trace[0]
|
218
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'open('
|
213
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'open('
|
219
214
|
expect(trace.url).to eq(@browser.url)
|
220
215
|
end
|
221
216
|
end
|
@@ -225,7 +220,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
225
220
|
load_with_taint 'data_trace/XMLHttpRequest.send'
|
226
221
|
|
227
222
|
sink = subject.data_flow_sinks[taint]
|
228
|
-
expect(sink.size).to eq(1)
|
229
223
|
|
230
224
|
entry = sink[0]
|
231
225
|
expect(entry.object).to eq('XMLHttpRequestPrototype')
|
@@ -235,7 +229,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
235
229
|
expect(entry.taint).to eq(taint)
|
236
230
|
|
237
231
|
trace = entry.trace[0]
|
238
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'send('
|
232
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'send('
|
239
233
|
expect(trace.url).to eq(@browser.url)
|
240
234
|
end
|
241
235
|
end
|
@@ -245,7 +239,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
245
239
|
load_with_taint 'data_trace/XMLHttpRequest.setRequestHeader'
|
246
240
|
|
247
241
|
sink = subject.data_flow_sinks[taint]
|
248
|
-
expect(sink.size).to eq(1)
|
249
242
|
|
250
243
|
entry = sink[0]
|
251
244
|
expect(entry.object).to eq('XMLHttpRequestPrototype')
|
@@ -255,7 +248,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
255
248
|
expect(entry.taint).to eq(taint)
|
256
249
|
|
257
250
|
trace = entry.trace[0]
|
258
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'setRequestHeader('
|
251
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'setRequestHeader('
|
259
252
|
expect(trace.url).to eq(@browser.url)
|
260
253
|
end
|
261
254
|
end
|
@@ -267,7 +260,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
267
260
|
load_with_taint 'data_trace/AngularJS.element'
|
268
261
|
|
269
262
|
sink = subject.data_flow_sinks[taint]
|
270
|
-
expect(sink.size).to eq(2)
|
271
263
|
|
272
264
|
entry = sink[1]
|
273
265
|
expect(entry.object).to eq('angular')
|
@@ -277,7 +269,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
277
269
|
expect(entry.taint).to eq(taint)
|
278
270
|
|
279
271
|
trace = entry.trace[0]
|
280
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'angular.element('
|
272
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'angular.element('
|
281
273
|
expect(trace.url).to eq(@browser.url)
|
282
274
|
end
|
283
275
|
end
|
@@ -288,7 +280,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
288
280
|
load_with_taint 'data_trace/AngularJS/$http.delete'
|
289
281
|
|
290
282
|
sink = subject.data_flow_sinks[taint]
|
291
|
-
expect(sink.size).to eq(4)
|
292
283
|
|
293
284
|
entry = sink[1]
|
294
285
|
expect(entry.object).to eq('angular.$http')
|
@@ -315,7 +306,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
315
306
|
load_with_taint 'data_trace/AngularJS/$http.head'
|
316
307
|
|
317
308
|
sink = subject.data_flow_sinks[taint]
|
318
|
-
expect(sink.size).to eq(4)
|
319
309
|
|
320
310
|
entry = sink[1]
|
321
311
|
expect(entry.object).to eq('angular.$http')
|
@@ -342,7 +332,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
342
332
|
load_with_taint 'data_trace/AngularJS/$http.jsonp'
|
343
333
|
|
344
334
|
sink = subject.data_flow_sinks[taint]
|
345
|
-
expect(sink.size).to eq(3)
|
346
335
|
|
347
336
|
entry = sink[1]
|
348
337
|
expect(entry.object).to eq('angular.$http')
|
@@ -369,7 +358,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
369
358
|
load_with_taint 'data_trace/AngularJS/$http.put'
|
370
359
|
|
371
360
|
sink = subject.data_flow_sinks[taint]
|
372
|
-
expect(sink.size).to eq(3)
|
373
361
|
|
374
362
|
entry = sink[1]
|
375
363
|
expect(entry.object).to eq('angular.$http')
|
@@ -396,7 +384,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
396
384
|
load_with_taint 'data_trace/AngularJS/$http.get'
|
397
385
|
|
398
386
|
sink = subject.data_flow_sinks[taint]
|
399
|
-
expect(sink.size).to eq(4)
|
400
387
|
|
401
388
|
entry = sink[1]
|
402
389
|
expect(entry.object).to eq('angular.$http')
|
@@ -423,7 +410,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
423
410
|
load_with_taint 'data_trace/AngularJS/$http.post'
|
424
411
|
|
425
412
|
sink = subject.data_flow_sinks[taint]
|
426
|
-
expect(sink.size).to eq(4)
|
427
413
|
|
428
414
|
entry = sink[1]
|
429
415
|
expect(entry.object).to eq('angular.$http')
|
@@ -462,7 +448,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
462
448
|
load_with_taint 'data_trace/AngularJS/ngRoute/'
|
463
449
|
|
464
450
|
sink = subject.data_flow_sinks[taint]
|
465
|
-
expect(sink.size).to eq(8)
|
466
451
|
|
467
452
|
# ngRoute module first schedules an HTTP request to grab
|
468
453
|
# the template from the given 'templateUrl'...
|
@@ -494,7 +479,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
494
479
|
load_with_taint 'data_trace/AngularJS/jqLite.html'
|
495
480
|
|
496
481
|
sink = subject.data_flow_sinks[taint]
|
497
|
-
expect(sink.size).to eq(2)
|
498
482
|
|
499
483
|
entry = sink[1]
|
500
484
|
expect(entry.object).to eq('angular.element')
|
@@ -504,7 +488,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
504
488
|
expect(entry.taint).to eq(taint)
|
505
489
|
|
506
490
|
trace = entry.trace[0]
|
507
|
-
expect(@browser.source.split("\n")[trace.line-
|
491
|
+
expect(@browser.source.split("\n")[trace.line - 2]).to include 'html('
|
508
492
|
expect(trace.url).to eq(@browser.url)
|
509
493
|
end
|
510
494
|
end
|
@@ -514,7 +498,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
514
498
|
load_with_taint 'data_trace/AngularJS/jqLite.text'
|
515
499
|
|
516
500
|
sink = subject.data_flow_sinks[taint]
|
517
|
-
expect(sink.size).to eq(2)
|
518
501
|
|
519
502
|
entry = sink[1]
|
520
503
|
expect(entry.object).to eq('angular.element')
|
@@ -524,7 +507,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
524
507
|
expect(entry.taint).to eq(taint)
|
525
508
|
|
526
509
|
trace = entry.trace[0]
|
527
|
-
expect(@browser.source.split("\n")[trace.line-
|
510
|
+
expect(@browser.source.split("\n")[trace.line - 2]).to include 'text('
|
528
511
|
expect(trace.url).to eq(@browser.url)
|
529
512
|
end
|
530
513
|
end
|
@@ -534,7 +517,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
534
517
|
load_with_taint 'data_trace/AngularJS/jqLite.append'
|
535
518
|
|
536
519
|
sink = subject.data_flow_sinks[taint]
|
537
|
-
expect(sink.size).to eq(2)
|
538
520
|
|
539
521
|
entry = sink[1]
|
540
522
|
expect(entry.object).to eq('angular.element')
|
@@ -544,7 +526,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
544
526
|
expect(entry.taint).to eq(taint)
|
545
527
|
|
546
528
|
trace = entry.trace[0]
|
547
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'append('
|
529
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'append('
|
548
530
|
expect(trace.url).to eq(@browser.url)
|
549
531
|
end
|
550
532
|
end
|
@@ -554,7 +536,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
554
536
|
load_with_taint 'data_trace/AngularJS/jqLite.prepend'
|
555
537
|
|
556
538
|
sink = subject.data_flow_sinks[taint]
|
557
|
-
expect(sink.size).to eq(2)
|
558
539
|
|
559
540
|
entry = sink[1]
|
560
541
|
expect(entry.object).to eq('angular.element')
|
@@ -564,7 +545,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
564
545
|
expect(entry.taint).to eq(taint)
|
565
546
|
|
566
547
|
trace = entry.trace[0]
|
567
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'prepend('
|
548
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'prepend('
|
568
549
|
expect(trace.url).to eq(@browser.url)
|
569
550
|
end
|
570
551
|
end
|
@@ -574,7 +555,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
574
555
|
load_with_taint 'data_trace/AngularJS/jqLite.prop'
|
575
556
|
|
576
557
|
sink = subject.data_flow_sinks[taint]
|
577
|
-
expect(sink.size).to eq(2)
|
578
558
|
|
579
559
|
entry = sink[1]
|
580
560
|
expect(entry.object).to eq('angular.element')
|
@@ -584,7 +564,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
584
564
|
expect(entry.taint).to eq(taint)
|
585
565
|
|
586
566
|
trace = entry.trace[0]
|
587
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'prop('
|
567
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'prop('
|
588
568
|
expect(trace.url).to eq(@browser.url)
|
589
569
|
end
|
590
570
|
end
|
@@ -594,7 +574,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
594
574
|
load_with_taint 'data_trace/AngularJS/jqLite.replaceWith'
|
595
575
|
|
596
576
|
sink = subject.data_flow_sinks[taint]
|
597
|
-
expect(sink.size).to eq(2)
|
598
577
|
|
599
578
|
entry = sink[1]
|
600
579
|
expect(entry.object).to eq('angular.element')
|
@@ -604,7 +583,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
604
583
|
expect(entry.taint).to eq(taint)
|
605
584
|
|
606
585
|
trace = entry.trace[0]
|
607
|
-
expect(@browser.source.split("\n")[trace.line-
|
586
|
+
expect(@browser.source.split("\n")[trace.line - 2]).to include 'replaceWith('
|
608
587
|
expect(trace.url).to eq(@browser.url)
|
609
588
|
end
|
610
589
|
end
|
@@ -614,7 +593,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
614
593
|
load_with_taint 'data_trace/AngularJS/jqLite.val'
|
615
594
|
|
616
595
|
sink = subject.data_flow_sinks[taint]
|
617
|
-
expect(sink.size).to eq(2)
|
618
596
|
|
619
597
|
entry = sink[1]
|
620
598
|
expect(entry.object).to eq('angular.element')
|
@@ -624,7 +602,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
624
602
|
expect(entry.taint).to eq(taint)
|
625
603
|
|
626
604
|
trace = entry.trace[0]
|
627
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'val('
|
605
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'val('
|
628
606
|
expect(trace.url).to eq(@browser.url)
|
629
607
|
end
|
630
608
|
end
|
@@ -637,7 +615,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
637
615
|
load_with_taint 'data_trace/jQuery.cookie'
|
638
616
|
|
639
617
|
sink = subject.data_flow_sinks[taint]
|
640
|
-
expect(sink.size).to eq(2)
|
641
618
|
|
642
619
|
entry = sink[0]
|
643
620
|
expect(entry.object).to eq('jQuery')
|
@@ -647,7 +624,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
647
624
|
expect(entry.taint).to eq(taint)
|
648
625
|
|
649
626
|
trace = entry.trace[0]
|
650
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'cookie('
|
627
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'cookie('
|
651
628
|
expect(trace.url).to eq(@browser.url)
|
652
629
|
end
|
653
630
|
end
|
@@ -657,7 +634,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
657
634
|
load_with_taint 'data_trace/jQuery.ajax'
|
658
635
|
|
659
636
|
sink = subject.data_flow_sinks[taint]
|
660
|
-
expect(sink.size).to eq(3)
|
661
637
|
|
662
638
|
entry = sink[0]
|
663
639
|
expect(entry.object).to eq('jQuery')
|
@@ -674,7 +650,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
674
650
|
expect(entry.taint).to eq(taint)
|
675
651
|
|
676
652
|
trace = entry.trace[0]
|
677
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'ajax('
|
653
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'ajax('
|
678
654
|
expect(trace.url).to eq(@browser.url)
|
679
655
|
end
|
680
656
|
end
|
@@ -684,7 +660,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
684
660
|
load_with_taint 'data_trace/jQuery.get'
|
685
661
|
|
686
662
|
sink = subject.data_flow_sinks[taint]
|
687
|
-
expect(sink.size).to eq(4)
|
688
663
|
|
689
664
|
entry = sink[0]
|
690
665
|
expect(entry.object).to eq('jQuery')
|
@@ -697,7 +672,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
697
672
|
expect(entry.taint).to eq(taint)
|
698
673
|
|
699
674
|
trace = entry.trace[0]
|
700
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'get('
|
675
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'get('
|
701
676
|
expect(trace.url).to eq(@browser.url)
|
702
677
|
end
|
703
678
|
end
|
@@ -707,7 +682,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
707
682
|
load_with_taint 'data_trace/jQuery.post'
|
708
683
|
|
709
684
|
sink = subject.data_flow_sinks[taint]
|
710
|
-
expect(sink.size).to eq(3)
|
711
685
|
|
712
686
|
entry = sink[0]
|
713
687
|
expect(entry.object).to eq('jQuery')
|
@@ -717,7 +691,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
717
691
|
expect(entry.taint).to eq(taint)
|
718
692
|
|
719
693
|
trace = entry.trace[0]
|
720
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'post('
|
694
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'post('
|
721
695
|
expect(trace.url).to eq(@browser.url)
|
722
696
|
end
|
723
697
|
end
|
@@ -727,7 +701,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
727
701
|
load_with_taint 'data_trace/jQuery.load'
|
728
702
|
|
729
703
|
sink = subject.data_flow_sinks[taint]
|
730
|
-
expect(sink.size).to eq(3)
|
731
704
|
|
732
705
|
entry = sink[0]
|
733
706
|
expect(entry.object).to eq('jQuery')
|
@@ -737,7 +710,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
737
710
|
expect(entry.taint).to eq(taint)
|
738
711
|
|
739
712
|
trace = entry.trace[0]
|
740
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'load('
|
713
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'load('
|
741
714
|
expect(trace.url).to eq(@browser.url)
|
742
715
|
end
|
743
716
|
end
|
@@ -747,7 +720,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
747
720
|
load_with_taint 'data_trace/jQuery.html'
|
748
721
|
|
749
722
|
sink = subject.data_flow_sinks[taint]
|
750
|
-
expect(sink.size).to eq(1)
|
751
723
|
|
752
724
|
entry = sink[0]
|
753
725
|
expect(entry.object).to eq('jQuery')
|
@@ -757,7 +729,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
757
729
|
expect(entry.taint).to eq(taint)
|
758
730
|
|
759
731
|
trace = entry.trace[0]
|
760
|
-
expect(@browser.source.split("\n")[trace.line-
|
732
|
+
expect(@browser.source.split("\n")[trace.line - 2]).to include 'html('
|
761
733
|
expect(trace.url).to eq(@browser.url)
|
762
734
|
end
|
763
735
|
end
|
@@ -767,7 +739,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
767
739
|
load_with_taint 'data_trace/jQuery.text'
|
768
740
|
|
769
741
|
sink = subject.data_flow_sinks[taint]
|
770
|
-
expect(sink.size).to eq(2)
|
771
742
|
|
772
743
|
entry = sink[0]
|
773
744
|
expect(entry.object).to eq('jQuery')
|
@@ -777,7 +748,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
777
748
|
expect(entry.taint).to eq(taint)
|
778
749
|
|
779
750
|
trace = entry.trace[0]
|
780
|
-
expect(@browser.source.split("\n")[trace.line-
|
751
|
+
expect(@browser.source.split("\n")[trace.line - 2]).to include 'text('
|
781
752
|
expect(trace.url).to eq(@browser.url)
|
782
753
|
end
|
783
754
|
end
|
@@ -787,7 +758,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
787
758
|
load_with_taint 'data_trace/jQuery.append'
|
788
759
|
|
789
760
|
sink = subject.data_flow_sinks[taint]
|
790
|
-
expect(sink.size).to eq(2)
|
791
761
|
|
792
762
|
entry = sink[0]
|
793
763
|
expect(entry.object).to eq('jQuery')
|
@@ -797,7 +767,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
797
767
|
expect(entry.taint).to eq(taint)
|
798
768
|
|
799
769
|
trace = entry.trace[0]
|
800
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'append('
|
770
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'append('
|
801
771
|
expect(trace.url).to eq(@browser.url)
|
802
772
|
end
|
803
773
|
end
|
@@ -807,7 +777,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
807
777
|
load_with_taint 'data_trace/jQuery.prepend'
|
808
778
|
|
809
779
|
sink = subject.data_flow_sinks[taint]
|
810
|
-
expect(sink.size).to eq(2)
|
811
780
|
|
812
781
|
entry = sink[0]
|
813
782
|
expect(entry.object).to eq('jQuery')
|
@@ -817,7 +786,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
817
786
|
expect(entry.taint).to eq(taint)
|
818
787
|
|
819
788
|
trace = entry.trace[0]
|
820
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'prepend('
|
789
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'prepend('
|
821
790
|
expect(trace.url).to eq(@browser.url)
|
822
791
|
end
|
823
792
|
end
|
@@ -827,7 +796,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
827
796
|
load_with_taint 'data_trace/jQuery.before'
|
828
797
|
|
829
798
|
sink = subject.data_flow_sinks[taint]
|
830
|
-
expect(sink.size).to eq(2)
|
831
799
|
|
832
800
|
entry = sink[0]
|
833
801
|
expect(entry.object).to eq('jQuery')
|
@@ -837,7 +805,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
837
805
|
expect(entry.taint).to eq(taint)
|
838
806
|
|
839
807
|
trace = entry.trace[0]
|
840
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'before('
|
808
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'before('
|
841
809
|
expect(trace.url).to eq(@browser.url)
|
842
810
|
end
|
843
811
|
end
|
@@ -847,7 +815,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
847
815
|
load_with_taint 'data_trace/jQuery.prop'
|
848
816
|
|
849
817
|
sink = subject.data_flow_sinks[taint]
|
850
|
-
expect(sink.size).to eq(1)
|
851
818
|
|
852
819
|
entry = sink[0]
|
853
820
|
expect(entry.object).to eq('jQuery')
|
@@ -857,7 +824,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
857
824
|
expect(entry.taint).to eq(taint)
|
858
825
|
|
859
826
|
trace = entry.trace[0]
|
860
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'prop('
|
827
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'prop('
|
861
828
|
expect(trace.url).to eq(@browser.url)
|
862
829
|
end
|
863
830
|
end
|
@@ -867,7 +834,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
867
834
|
load_with_taint 'data_trace/jQuery.replaceWith'
|
868
835
|
|
869
836
|
sink = subject.data_flow_sinks[taint]
|
870
|
-
expect(sink.size).to eq(2)
|
871
837
|
|
872
838
|
entry = sink[0]
|
873
839
|
expect(entry.object).to eq('jQuery')
|
@@ -877,7 +843,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
877
843
|
expect(entry.taint).to eq(taint)
|
878
844
|
|
879
845
|
trace = entry.trace[0]
|
880
|
-
expect(@browser.source.split("\n")[trace.line-
|
846
|
+
expect(@browser.source.split("\n")[trace.line - 2]).to include 'replaceWith('
|
881
847
|
expect(trace.url).to eq(@browser.url)
|
882
848
|
end
|
883
849
|
end
|
@@ -887,7 +853,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
887
853
|
load_with_taint 'data_trace/jQuery.val'
|
888
854
|
|
889
855
|
sink = subject.data_flow_sinks[taint]
|
890
|
-
expect(sink.size).to eq(1)
|
891
856
|
|
892
857
|
entry = sink[0]
|
893
858
|
expect(entry.object).to eq('jQuery')
|
@@ -897,7 +862,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
897
862
|
expect(entry.taint).to eq(taint)
|
898
863
|
|
899
864
|
trace = entry.trace[0]
|
900
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'val('
|
865
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'val('
|
901
866
|
expect(trace.url).to eq(@browser.url)
|
902
867
|
end
|
903
868
|
end
|
@@ -909,7 +874,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
909
874
|
load_with_taint 'data_trace/String.replace'
|
910
875
|
|
911
876
|
sink = subject.data_flow_sinks[taint]
|
912
|
-
expect(sink.size).to eq(1)
|
913
877
|
|
914
878
|
entry = sink[0]
|
915
879
|
expect(entry.object).to eq('String')
|
@@ -922,7 +886,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
922
886
|
expect(entry.taint).to eq(taint)
|
923
887
|
|
924
888
|
trace = entry.trace[0]
|
925
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'replace('
|
889
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'replace('
|
926
890
|
expect(trace.url).to eq(@browser.url)
|
927
891
|
end
|
928
892
|
end
|
@@ -932,7 +896,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
932
896
|
load_with_taint 'data_trace/String.concat'
|
933
897
|
|
934
898
|
sink = subject.data_flow_sinks[taint]
|
935
|
-
expect(sink.size).to eq(1)
|
936
899
|
|
937
900
|
entry = sink[0]
|
938
901
|
expect(entry.object).to eq('String')
|
@@ -943,7 +906,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
943
906
|
expect(entry.taint).to eq(taint)
|
944
907
|
|
945
908
|
trace = entry.trace[0]
|
946
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'concat('
|
909
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'concat('
|
947
910
|
expect(trace.url).to eq(@browser.url)
|
948
911
|
end
|
949
912
|
end
|
@@ -953,7 +916,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
953
916
|
load_with_taint 'data_trace/String.indexOf'
|
954
917
|
|
955
918
|
sink = subject.data_flow_sinks[taint]
|
956
|
-
expect(sink.size).to eq(1)
|
957
919
|
|
958
920
|
entry = sink[0]
|
959
921
|
expect(entry.object).to eq('String')
|
@@ -964,7 +926,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
964
926
|
expect(entry.taint).to eq(taint)
|
965
927
|
|
966
928
|
trace = entry.trace[0]
|
967
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'indexOf('
|
929
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'indexOf('
|
968
930
|
expect(trace.url).to eq(@browser.url)
|
969
931
|
end
|
970
932
|
end
|
@@ -974,7 +936,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
974
936
|
load_with_taint 'data_trace/String.lastIndexOf'
|
975
937
|
|
976
938
|
sink = subject.data_flow_sinks[taint]
|
977
|
-
expect(sink.size).to eq(1)
|
978
939
|
|
979
940
|
entry = sink[0]
|
980
941
|
expect(entry.object).to eq('String')
|
@@ -985,7 +946,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
985
946
|
expect(entry.taint).to eq(taint)
|
986
947
|
|
987
948
|
trace = entry.trace[0]
|
988
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'lastIndexOf('
|
949
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'lastIndexOf('
|
989
950
|
expect(trace.url).to eq(@browser.url)
|
990
951
|
end
|
991
952
|
end
|
@@ -997,7 +958,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
997
958
|
load_with_taint 'data_trace/HTMLElement.insertAdjacentHTML'
|
998
959
|
|
999
960
|
sink = subject.data_flow_sinks[taint]
|
1000
|
-
expect(sink.size).to eq(1)
|
1001
961
|
|
1002
962
|
entry = sink[0]
|
1003
963
|
expect(entry.object).to eq('HTMLElementPrototype')
|
@@ -1010,7 +970,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1010
970
|
expect(entry.taint).to eq(taint)
|
1011
971
|
|
1012
972
|
trace = entry.trace[0]
|
1013
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'insertAdjacentHTML('
|
973
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'insertAdjacentHTML('
|
1014
974
|
expect(trace.url).to eq(@browser.url)
|
1015
975
|
end
|
1016
976
|
end
|
@@ -1022,7 +982,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1022
982
|
load_with_taint 'data_trace/Element.setAttribute'
|
1023
983
|
|
1024
984
|
sink = subject.data_flow_sinks[taint]
|
1025
|
-
expect(sink.size).to eq(1)
|
1026
985
|
|
1027
986
|
entry = sink[0]
|
1028
987
|
expect(entry.object).to eq('ElementPrototype')
|
@@ -1035,7 +994,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1035
994
|
expect(entry.taint).to eq(taint)
|
1036
995
|
|
1037
996
|
trace = entry.trace[0]
|
1038
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'setAttribute('
|
997
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'setAttribute('
|
1039
998
|
expect(trace.url).to eq(@browser.url)
|
1040
999
|
end
|
1041
1000
|
end
|
@@ -1047,7 +1006,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1047
1006
|
load_with_taint 'data_trace/Document.createTextNode'
|
1048
1007
|
|
1049
1008
|
sink = subject.data_flow_sinks[taint]
|
1050
|
-
expect(sink.size).to eq(1)
|
1051
1009
|
|
1052
1010
|
entry = sink[0]
|
1053
1011
|
expect(entry.object).to eq('DocumentPrototype')
|
@@ -1058,7 +1016,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1058
1016
|
expect(entry.taint).to eq(taint)
|
1059
1017
|
|
1060
1018
|
trace = entry.trace[0]
|
1061
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'document.createTextNode('
|
1019
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'document.createTextNode('
|
1062
1020
|
expect(trace.url).to eq(@browser.url)
|
1063
1021
|
end
|
1064
1022
|
end
|
@@ -1070,7 +1028,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1070
1028
|
load_with_taint 'data_trace/CharacterData.insertData'
|
1071
1029
|
|
1072
1030
|
sink = subject.data_flow_sinks[taint]
|
1073
|
-
expect(sink.size).to eq(1)
|
1074
1031
|
|
1075
1032
|
entry = sink[0]
|
1076
1033
|
expect(entry.object).to eq('CharacterDataPrototype')
|
@@ -1081,7 +1038,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1081
1038
|
expect(entry.taint).to eq(taint)
|
1082
1039
|
|
1083
1040
|
trace = entry.trace[0]
|
1084
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'insertData('
|
1041
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'insertData('
|
1085
1042
|
expect(trace.url).to eq(@browser.url)
|
1086
1043
|
end
|
1087
1044
|
end
|
@@ -1091,7 +1048,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1091
1048
|
load_with_taint 'data_trace/CharacterData.appendData'
|
1092
1049
|
|
1093
1050
|
sink = subject.data_flow_sinks[taint]
|
1094
|
-
expect(sink.size).to eq(1)
|
1095
1051
|
|
1096
1052
|
entry = sink[0]
|
1097
1053
|
expect(entry.object).to eq('CharacterDataPrototype')
|
@@ -1102,7 +1058,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1102
1058
|
expect(entry.taint).to eq(taint)
|
1103
1059
|
|
1104
1060
|
trace = entry.trace[0]
|
1105
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'appendData('
|
1061
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'appendData('
|
1106
1062
|
expect(trace.url).to eq(@browser.url)
|
1107
1063
|
end
|
1108
1064
|
end
|
@@ -1112,7 +1068,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1112
1068
|
load_with_taint 'data_trace/CharacterData.replaceData'
|
1113
1069
|
|
1114
1070
|
sink = subject.data_flow_sinks[taint]
|
1115
|
-
expect(sink.size).to eq(1)
|
1116
1071
|
|
1117
1072
|
entry = sink[0]
|
1118
1073
|
expect(entry.object).to eq('CharacterDataPrototype')
|
@@ -1123,7 +1078,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1123
1078
|
expect(entry.taint).to eq(taint)
|
1124
1079
|
|
1125
1080
|
trace = entry.trace[0]
|
1126
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'replaceData('
|
1081
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'replaceData('
|
1127
1082
|
expect(trace.url).to eq(@browser.url)
|
1128
1083
|
end
|
1129
1084
|
end
|
@@ -1135,7 +1090,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1135
1090
|
load_with_taint 'data_trace/Text.replaceWholeText'
|
1136
1091
|
|
1137
1092
|
sink = subject.data_flow_sinks[taint]
|
1138
|
-
expect(sink.size).to eq(1)
|
1139
1093
|
|
1140
1094
|
entry = sink[0]
|
1141
1095
|
expect(entry.object).to eq('TextPrototype')
|
@@ -1146,7 +1100,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1146
1100
|
expect(entry.taint).to eq(taint)
|
1147
1101
|
|
1148
1102
|
trace = entry.trace[0]
|
1149
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'replaceWholeText('
|
1103
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'replaceWholeText('
|
1150
1104
|
expect(trace.url).to eq(@browser.url)
|
1151
1105
|
end
|
1152
1106
|
end
|
@@ -1158,7 +1112,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1158
1112
|
load_with_taint 'data_trace/HTMLDocument.write'
|
1159
1113
|
|
1160
1114
|
sink = subject.data_flow_sinks[taint]
|
1161
|
-
expect(sink.size).to eq(1)
|
1162
1115
|
|
1163
1116
|
entry = sink[0]
|
1164
1117
|
expect(entry.object).to eq('HTMLDocumentPrototype')
|
@@ -1173,7 +1126,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1173
1126
|
expect(entry.taint).to eq(taint)
|
1174
1127
|
|
1175
1128
|
trace = entry.trace[0]
|
1176
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'document.write('
|
1129
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'document.write('
|
1177
1130
|
expect(trace.url).to eq(@browser.url)
|
1178
1131
|
end
|
1179
1132
|
end
|
@@ -1183,7 +1136,6 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1183
1136
|
load_with_taint 'data_trace/HTMLDocument.writeln'
|
1184
1137
|
|
1185
1138
|
sink = subject.data_flow_sinks[taint]
|
1186
|
-
expect(sink.size).to eq(1)
|
1187
1139
|
|
1188
1140
|
entry = sink[0]
|
1189
1141
|
expect(entry.object).to eq('HTMLDocumentPrototype')
|
@@ -1198,7 +1150,7 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1198
1150
|
expect(entry.taint).to eq(taint)
|
1199
1151
|
|
1200
1152
|
trace = entry.trace[0]
|
1201
|
-
expect(@browser.source.split("\n")[trace.line]).to include 'document.writeln('
|
1153
|
+
expect(@browser.source.split("\n")[trace.line - 1]).to include 'document.writeln('
|
1202
1154
|
expect(trace.url).to eq(@browser.url)
|
1203
1155
|
end
|
1204
1156
|
end
|
@@ -1273,16 +1225,15 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1273
1225
|
expect(sink_data).to eq([first_entry])
|
1274
1226
|
|
1275
1227
|
expect(first_entry.function.name).to eq('blah')
|
1276
|
-
expect(first_entry.trace.size).to eq(2)
|
1277
1228
|
|
1278
1229
|
expect(first_entry.trace[0].function.name).to eq('onClick')
|
1279
1230
|
expect(first_entry.trace[0].function.source).to start_with 'function onClick'
|
1280
|
-
expect(@browser.source.split("\n")[first_entry.trace[0].line]).to include 'log_data_flow_sink'
|
1231
|
+
expect(@browser.source.split("\n")[first_entry.trace[0].line - 1]).to include 'log_data_flow_sink'
|
1281
1232
|
expect(first_entry.trace[0].function.arguments).to eq(%w(some-arg arguments-arg here-arg))
|
1282
1233
|
|
1283
1234
|
expect(first_entry.trace[1].function.name).to eq('onsubmit')
|
1284
1235
|
expect(first_entry.trace[1].function.source).to start_with 'function onsubmit'
|
1285
|
-
expect(@browser.source.split("\n")[first_entry.trace[1].line]).to include 'onsubmit'
|
1236
|
+
expect(@browser.source.split("\n")[first_entry.trace[1].line - 1]).to include 'onsubmit'
|
1286
1237
|
expect(first_entry.trace[1].function.arguments.size).to eq(1)
|
1287
1238
|
|
1288
1239
|
event = first_entry.trace[1].function.arguments.first
|
@@ -1311,16 +1262,15 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1311
1262
|
expect(sink_data).to eq([first_entry])
|
1312
1263
|
|
1313
1264
|
expect(first_entry.data).to eq([1])
|
1314
|
-
expect(first_entry.trace.size).to eq(2)
|
1315
1265
|
|
1316
1266
|
expect(first_entry.trace[0].function.name).to eq('onClick')
|
1317
1267
|
expect(first_entry.trace[0].function.source).to start_with 'function onClick'
|
1318
|
-
expect(@browser.source.split("\n")[first_entry.trace[0].line]).to include 'log_execution_flow_sink(1)'
|
1268
|
+
expect(@browser.source.split("\n")[first_entry.trace[0].line - 1]).to include 'log_execution_flow_sink(1)'
|
1319
1269
|
expect(first_entry.trace[0].function.arguments).to eq(%w(some-arg arguments-arg here-arg))
|
1320
1270
|
|
1321
1271
|
expect(first_entry.trace[1].function.name).to eq('onsubmit')
|
1322
1272
|
expect(first_entry.trace[1].function.source).to start_with 'function onsubmit'
|
1323
|
-
expect(@browser.source.split("\n")[first_entry.trace[1].line]).to include 'onsubmit'
|
1273
|
+
expect(@browser.source.split("\n")[first_entry.trace[1].line - 1]).to include 'onsubmit'
|
1324
1274
|
expect(first_entry.trace[1].function.arguments.size).to eq(1)
|
1325
1275
|
|
1326
1276
|
event = first_entry.trace[1].function.arguments.first
|
@@ -1349,16 +1299,15 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1349
1299
|
expect(sink_data).to eq([first_entry])
|
1350
1300
|
|
1351
1301
|
expect(first_entry.data).to eq([1])
|
1352
|
-
expect(first_entry.trace.size).to eq(2)
|
1353
1302
|
|
1354
1303
|
expect(first_entry.trace[0].function.name).to eq('onClick')
|
1355
1304
|
expect(first_entry.trace[0].function.source).to start_with 'function onClick'
|
1356
|
-
expect(@browser.source.split("\n")[first_entry.trace[0].line]).to include 'log_execution_flow_sink(1)'
|
1305
|
+
expect(@browser.source.split("\n")[first_entry.trace[0].line - 1]).to include 'log_execution_flow_sink(1)'
|
1357
1306
|
expect(first_entry.trace[0].function.arguments).to eq(%w(some-arg arguments-arg here-arg))
|
1358
1307
|
|
1359
1308
|
expect(first_entry.trace[1].function.name).to eq('onsubmit')
|
1360
1309
|
expect(first_entry.trace[1].function.source).to start_with 'function onsubmit'
|
1361
|
-
expect(@browser.source.split("\n")[first_entry.trace[1].line]).to include 'onsubmit'
|
1310
|
+
expect(@browser.source.split("\n")[first_entry.trace[1].line - 1]).to include 'onsubmit'
|
1362
1311
|
expect(first_entry.trace[1].function.arguments.size).to eq(1)
|
1363
1312
|
|
1364
1313
|
event = first_entry.trace[1].function.arguments.first
|
@@ -1399,16 +1348,15 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1399
1348
|
expect(sink_data).to eq([first_entry])
|
1400
1349
|
|
1401
1350
|
expect(first_entry.function.name).to eq('blah')
|
1402
|
-
expect(first_entry.trace.size).to eq(2)
|
1403
1351
|
|
1404
1352
|
expect(first_entry.trace[0].function.name).to eq('onClick')
|
1405
1353
|
expect(first_entry.trace[0].function.source).to start_with 'function onClick'
|
1406
|
-
expect(@browser.source.split("\n")[first_entry.trace[0].line]).to include 'log_data_flow_sink'
|
1354
|
+
expect(@browser.source.split("\n")[first_entry.trace[0].line - 1]).to include 'log_data_flow_sink'
|
1407
1355
|
expect(first_entry.trace[0].function.arguments).to eq(%w(some-arg arguments-arg here-arg))
|
1408
1356
|
|
1409
1357
|
expect(first_entry.trace[1].function.name).to eq('onsubmit')
|
1410
1358
|
expect(first_entry.trace[1].function.source).to start_with 'function onsubmit'
|
1411
|
-
expect(@browser.source.split("\n")[first_entry.trace[1].line]).to include 'onsubmit'
|
1359
|
+
expect(@browser.source.split("\n")[first_entry.trace[1].line - 1]).to include 'onsubmit'
|
1412
1360
|
expect(first_entry.trace[1].function.arguments.size).to eq(1)
|
1413
1361
|
|
1414
1362
|
event = first_entry.trace[1].function.arguments.first
|
@@ -1474,16 +1422,15 @@ describe Arachni::Browser::Javascript::TaintTracer do
|
|
1474
1422
|
expect(debugging_data).to eq([first_entry])
|
1475
1423
|
|
1476
1424
|
expect(first_entry.data).to eq([1])
|
1477
|
-
expect(first_entry.trace.size).to eq(2)
|
1478
1425
|
|
1479
1426
|
expect(first_entry.trace[0].function.name).to eq('onClick')
|
1480
1427
|
expect(first_entry.trace[0].function.source).to start_with 'function onClick'
|
1481
|
-
expect(@browser.source.split("\n")[first_entry.trace[0].line]).to include 'debug(1)'
|
1428
|
+
expect(@browser.source.split("\n")[first_entry.trace[0].line - 1]).to include 'debug(1)'
|
1482
1429
|
expect(first_entry.trace[0].function.arguments).to eq(%w(some-arg arguments-arg here-arg))
|
1483
1430
|
|
1484
1431
|
expect(first_entry.trace[1].function.name).to eq('onsubmit')
|
1485
1432
|
expect(first_entry.trace[1].function.source).to start_with 'function onsubmit'
|
1486
|
-
expect(@browser.source.split("\n")[first_entry.trace[1].line]).to include 'onClick('
|
1433
|
+
expect(@browser.source.split("\n")[first_entry.trace[1].line - 1]).to include 'onClick('
|
1487
1434
|
expect(first_entry.trace[1].function.arguments.size).to eq(1)
|
1488
1435
|
|
1489
1436
|
event = first_entry.trace[1].function.arguments.first
|