arachni 0.4.7 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/AUTHORS.md +1 -1
- data/CHANGELOG.md +211 -0
- data/CONTRIBUTORS.md +1 -0
- data/Gemfile +23 -2
- data/LICENSE.md +34 -1
- data/README.md +211 -127
- data/Rakefile +79 -67
- data/arachni.gemspec +54 -62
- data/bin/arachni +6 -18
- data/bin/arachni_console +5 -13
- data/bin/arachni_multi +6 -16
- data/bin/arachni_reporter +12 -0
- data/bin/arachni_restore +12 -0
- data/bin/arachni_rpc +6 -16
- data/bin/arachni_rpcd +6 -17
- data/bin/arachni_rpcd_monitor +6 -18
- data/bin/arachni_script +8 -19
- data/components/checks/active/code_injection.rb +123 -0
- data/components/checks/active/code_injection_php_input_wrapper.rb +99 -0
- data/components/checks/active/code_injection_timing.rb +106 -0
- data/components/checks/active/csrf.rb +218 -0
- data/components/checks/active/file_inclusion.rb +152 -0
- data/components/checks/active/ldap_injection.rb +109 -0
- data/{modules/audit/ldapi → components/checks/active/ldap_injection}/errors.txt +0 -0
- data/components/checks/active/no_sql_injection.rb +94 -0
- data/components/checks/active/no_sql_injection/patterns/mongodb +1 -0
- data/{extras/placeholder → components/checks/active/no_sql_injection/regexp_ignore.txt} +0 -0
- data/components/checks/active/no_sql_injection_differential.rb +78 -0
- data/components/checks/active/os_cmd_injection.rb +116 -0
- data/components/checks/active/os_cmd_injection_timing.rb +92 -0
- data/components/checks/active/path_traversal.rb +174 -0
- data/components/checks/active/response_splitting.rb +94 -0
- data/components/checks/active/rfi.rb +172 -0
- data/components/checks/active/session_fixation.rb +117 -0
- data/components/checks/active/source_code_disclosure.rb +177 -0
- data/components/checks/active/sql_injection.rb +123 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/access +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/coldfusion +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/db2 +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/emc +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/firebird +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/frontbase +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/hsqldb +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/informix +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/ingres +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/interbase +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/maxdb +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/mssql +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/mysql +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/oracle +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/pgsql +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/sqlite +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/patterns/sybase +0 -0
- data/{modules/audit/sqli → components/checks/active/sql_injection}/regexp_ignore.txt +0 -0
- data/components/checks/active/sql_injection_differential.rb +114 -0
- data/{modules/audit/sqli_blind_rdiff → components/checks/active/sql_injection_differential}/payloads.txt +0 -0
- data/components/checks/active/sql_injection_timing.rb +98 -0
- data/{modules/audit/sqli_blind_timing → components/checks/active/sql_injection_timing}/mssql.txt +0 -0
- data/{modules/audit/sqli_blind_timing → components/checks/active/sql_injection_timing}/mysql.txt +0 -0
- data/{modules/audit/sqli_blind_timing → components/checks/active/sql_injection_timing}/pgsql.txt +0 -0
- data/components/checks/active/trainer.rb +40 -0
- data/components/checks/active/unvalidated_redirect.rb +108 -0
- data/components/checks/active/xpath_injection.rb +87 -0
- data/{modules/audit/xpath → components/checks/active/xpath_injection}/errors.txt +0 -0
- data/components/checks/active/xss.rb +169 -0
- data/components/checks/active/xss_dom.rb +119 -0
- data/components/checks/active/xss_dom_inputs.rb +132 -0
- data/components/checks/active/xss_dom_script_context.rb +118 -0
- data/components/checks/active/xss_event.rb +165 -0
- data/components/checks/active/xss_path.rb +146 -0
- data/components/checks/active/xss_script_context.rb +207 -0
- data/components/checks/active/xss_tag.rb +135 -0
- data/components/checks/passive/allowed_methods.rb +92 -0
- data/components/checks/passive/backdoors.rb +79 -0
- data/{modules/recon → components/checks/passive}/backdoors/filenames.txt +0 -0
- data/components/checks/passive/backup_directories.rb +86 -0
- data/components/checks/passive/backup_directories/formats.txt +56 -0
- data/components/checks/passive/backup_files.rb +99 -0
- data/components/checks/passive/backup_files/formats.txt +106 -0
- data/components/checks/passive/common_directories.rb +81 -0
- data/{modules/recon → components/checks/passive}/common_directories/directories.txt +0 -0
- data/components/checks/passive/common_files.rb +73 -0
- data/components/checks/passive/common_files/filenames.txt +24 -0
- data/components/checks/passive/directory_listing.rb +129 -0
- data/components/checks/passive/grep/captcha.rb +73 -0
- data/components/checks/passive/grep/cookie_set_for_parent_domain.rb +71 -0
- data/components/checks/passive/grep/credit_card.rb +124 -0
- data/components/checks/passive/grep/cvs_svn_users.rb +75 -0
- data/components/checks/passive/grep/emails.rb +53 -0
- data/components/checks/passive/grep/form_upload.rb +75 -0
- data/components/checks/passive/grep/hsts.rb +74 -0
- data/components/checks/passive/grep/html_objects.rb +45 -0
- data/components/checks/passive/grep/http_only_cookies.rb +72 -0
- data/components/checks/passive/grep/insecure_cookies.rb +74 -0
- data/components/checks/passive/grep/mixed_resource.rb +109 -0
- data/components/checks/passive/grep/password_autocomplete.rb +80 -0
- data/components/checks/passive/grep/private_ip.rb +73 -0
- data/components/checks/passive/grep/ssn.rb +62 -0
- data/components/checks/passive/grep/unencrypted_password_forms.rb +88 -0
- data/components/checks/passive/htaccess_limit.rb +71 -0
- data/components/checks/passive/http_put.rb +91 -0
- data/components/checks/passive/interesting_responses.rb +88 -0
- data/components/checks/passive/localstart_asp.rb +88 -0
- data/components/checks/passive/origin_spoof_access_restriction_bypass.rb +83 -0
- data/components/checks/passive/webdav.rb +101 -0
- data/components/checks/passive/xst.rb +90 -0
- data/components/fingerprinters/frameworks/rack.rb +33 -0
- data/components/fingerprinters/languages/asp.rb +34 -0
- data/components/fingerprinters/languages/aspx.rb +55 -0
- data/components/fingerprinters/languages/jsp.rb +34 -0
- data/components/fingerprinters/languages/php.rb +35 -0
- data/components/fingerprinters/languages/python.rb +32 -0
- data/components/fingerprinters/languages/ruby.rb +33 -0
- data/components/fingerprinters/os/bsd.rb +28 -0
- data/components/fingerprinters/os/linux.rb +34 -0
- data/components/fingerprinters/os/solaris.rb +33 -0
- data/components/fingerprinters/os/unix.rb +28 -0
- data/components/fingerprinters/os/windows.rb +33 -0
- data/components/fingerprinters/servers/apache.rb +28 -0
- data/components/fingerprinters/servers/iis.rb +28 -0
- data/components/fingerprinters/servers/jetty.rb +28 -0
- data/components/fingerprinters/servers/nginx.rb +28 -0
- data/components/fingerprinters/servers/tomcat.rb +28 -0
- data/components/path_extractors/anchors.rb +29 -0
- data/components/path_extractors/areas.rb +29 -0
- data/components/path_extractors/comments.rb +21 -0
- data/components/path_extractors/forms.rb +29 -0
- data/components/path_extractors/frames.rb +29 -0
- data/components/path_extractors/generic.rb +76 -0
- data/components/path_extractors/links.rb +29 -0
- data/components/path_extractors/meta_refresh.rb +50 -0
- data/components/path_extractors/scripts.rb +31 -0
- data/components/plugins/autologin.rb +120 -0
- data/components/plugins/beep_notify.rb +43 -0
- data/components/plugins/content_types.rb +110 -0
- data/components/plugins/cookie_collector.rb +94 -0
- data/components/plugins/defaults/autothrottle.rb +73 -0
- data/components/plugins/defaults/healthmap.rb +79 -0
- data/components/plugins/defaults/meta/remedies/discovery.rb +122 -0
- data/components/plugins/defaults/meta/remedies/timing_attacks.rb +98 -0
- data/components/plugins/defaults/meta/uniformity.rb +55 -0
- data/components/plugins/email_notify.rb +112 -0
- data/components/plugins/form_dicattack.rb +128 -0
- data/components/plugins/http_dicattack.rb +102 -0
- data/components/plugins/proxy.rb +492 -0
- data/{plugins → components/plugins}/proxy/panel/403_forbidden.html.erb +0 -0
- data/{plugins → components/plugins}/proxy/panel/404_not_found.html.erb +0 -0
- data/{plugins → components/plugins}/proxy/panel/css/bootstrap-responsive.css +0 -0
- data/{plugins → components/plugins}/proxy/panel/css/bootstrap.min.css +0 -0
- data/{plugins → components/plugins}/proxy/panel/css/panel.css +0 -0
- data/{plugins → components/plugins}/proxy/panel/help.html.erb +0 -0
- data/{plugins → components/plugins}/proxy/panel/img/glyphicons-halflings-white.png +0 -0
- data/{plugins → components/plugins}/proxy/panel/img/glyphicons-halflings.png +0 -0
- data/{plugins → components/plugins}/proxy/panel/img/record.png +0 -0
- data/{plugins → components/plugins}/proxy/panel/inspect.html.erb +0 -0
- data/{plugins → components/plugins}/proxy/panel/js/bootstrap.min.js +0 -0
- data/{plugins → components/plugins}/proxy/panel/js/jquery.min.js +0 -0
- data/{plugins → components/plugins}/proxy/panel/js/panel.js +0 -0
- data/{plugins → components/plugins}/proxy/panel/layout.html.erb +0 -0
- data/components/plugins/proxy/panel/page_accordion.html.erb +67 -0
- data/{plugins → components/plugins}/proxy/panel/page_twin_accordion.html.erb +0 -0
- data/components/plugins/proxy/panel/panel.html.erb +69 -0
- data/{plugins → components/plugins}/proxy/panel/shutdown_message.html.erb +0 -0
- data/{plugins → components/plugins}/proxy/panel/sign_in.html.erb +0 -0
- data/{plugins → components/plugins}/proxy/panel/vectors.yml.erb +0 -0
- data/{plugins → components/plugins}/proxy/panel/verify_login_check.html.erb +0 -0
- data/{plugins → components/plugins}/proxy/panel/verify_login_final.html.erb +0 -0
- data/components/plugins/proxy/panel/verify_login_sequence.html.erb +45 -0
- data/components/plugins/proxy/template_scope.rb +130 -0
- data/components/plugins/script.rb +48 -0
- data/components/plugins/uncommon_headers.rb +92 -0
- data/components/plugins/vector_feed.rb +225 -0
- data/components/plugins/waf_detector.rb +169 -0
- data/components/reporters/ap.rb +38 -0
- data/components/reporters/html.rb +468 -0
- data/components/reporters/html/default.erb +68 -0
- data/components/reporters/html/default/configuration.erb +78 -0
- data/components/reporters/html/default/css/lib/bootstrap-theme.min.css +7 -0
- data/components/reporters/html/default/css/lib/bootstrap.min.css +7 -0
- data/components/reporters/html/default/css/lib/c3.css +203 -0
- data/components/reporters/html/default/css/lib/font-awesome.min.css +4 -0
- data/components/reporters/html/default/css/main.css +140 -0
- data/components/reporters/html/default/fonts/FontAwesome.otf +0 -0
- data/components/reporters/html/default/fonts/fontawesome-webfont.eot +0 -0
- data/components/reporters/html/default/fonts/fontawesome-webfont.svg +504 -0
- data/components/reporters/html/default/fonts/fontawesome-webfont.ttf +0 -0
- data/components/reporters/html/default/fonts/fontawesome-webfont.woff +0 -0
- data/components/reporters/html/default/fonts/glyphicons-halflings-regular.eot +0 -0
- data/components/reporters/html/default/fonts/glyphicons-halflings-regular.svg +229 -0
- data/components/reporters/html/default/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/components/reporters/html/default/fonts/glyphicons-halflings-regular.woff +0 -0
- data/components/reporters/html/default/issue.erb +81 -0
- data/components/reporters/html/default/issue/details.erb +68 -0
- data/components/reporters/html/default/issue/info.erb +74 -0
- data/components/reporters/html/default/issue/page.erb +117 -0
- data/components/reporters/html/default/issue/page/body.erb +42 -0
- data/components/reporters/html/default/issue/page/sink/data_flow.erb +95 -0
- data/components/reporters/html/default/issue/page/sink/data_flow/arguments.erb +70 -0
- data/components/reporters/html/default/issue/page/sink/data_flow/source.erb +1 -0
- data/components/reporters/html/default/issue/page/sink/execution_flow.erb +63 -0
- data/components/reporters/html/default/issue/page/sink/frame/source.erb +32 -0
- data/components/reporters/html/default/issue/page/sink/trace/table.erb +127 -0
- data/components/reporters/html/default/issue/page/transitions.erb +86 -0
- data/components/reporters/html/default/issue/platform.erb +8 -0
- data/components/reporters/html/default/issue/remarks.erb +28 -0
- data/components/reporters/html/default/issue/vector.erb +40 -0
- data/components/reporters/html/default/issues.erb +46 -0
- data/components/reporters/html/default/issues/grouped.erb +147 -0
- data/components/reporters/html/default/js/charts.js.erb +117 -0
- data/components/reporters/html/default/js/configuration.js.erb +12 -0
- data/components/reporters/html/default/js/helpers.js +107 -0
- data/components/reporters/html/default/js/init.js.erb +23 -0
- data/components/reporters/html/default/js/lib/bootstrap.min.js +6 -0
- data/components/reporters/html/default/js/lib/c3.min.js +3 -0
- data/components/reporters/html/default/js/lib/d3.min.js +5 -0
- data/components/reporters/html/default/js/lib/jquery.min.js +4 -0
- data/components/reporters/html/default/navigation.erb +136 -0
- data/components/reporters/html/default/plugins.erb +30 -0
- data/components/reporters/html/default/shared/hash.erb +10 -0
- data/components/reporters/html/default/shared/hash_table.erb +22 -0
- data/components/reporters/html/default/sitemap.erb +29 -0
- data/components/reporters/html/default/summary.erb +34 -0
- data/components/reporters/html/default/summary/charts.erb +67 -0
- data/components/reporters/html/default/summary/issues.erb +129 -0
- data/components/reporters/json.rb +44 -0
- data/components/reporters/marshal.rb +38 -0
- data/components/reporters/plugin_formatters/html/autologin.rb +50 -0
- data/components/reporters/plugin_formatters/html/content_types.rb +59 -0
- data/components/reporters/plugin_formatters/html/cookie_collector.rb +46 -0
- data/components/reporters/plugin_formatters/html/form_dicattack.rb +36 -0
- data/components/reporters/plugin_formatters/html/healthmap.rb +88 -0
- data/components/reporters/plugin_formatters/html/http_dicattack.rb +36 -0
- data/components/reporters/plugin_formatters/html/uncommon_headers.rb +40 -0
- data/components/reporters/plugin_formatters/html/uniformity.rb +55 -0
- data/components/reporters/plugin_formatters/html/waf_detector.rb +69 -0
- data/components/reporters/plugin_formatters/stdout/autologin.rb +25 -0
- data/components/reporters/plugin_formatters/stdout/content_types.rb +39 -0
- data/components/reporters/plugin_formatters/stdout/cookie_collector.rb +31 -0
- data/components/reporters/plugin_formatters/stdout/form_dicattack.rb +24 -0
- data/components/reporters/plugin_formatters/stdout/healthmap.rb +41 -0
- data/components/reporters/plugin_formatters/stdout/http_dicattack.rb +24 -0
- data/components/reporters/plugin_formatters/stdout/uncommon_headers.rb +29 -0
- data/components/reporters/plugin_formatters/stdout/uniformity.rb +35 -0
- data/components/reporters/plugin_formatters/stdout/waf_detector.rb +21 -0
- data/components/reporters/plugin_formatters/xml/autologin.rb +28 -0
- data/components/reporters/plugin_formatters/xml/content_types.rb +36 -0
- data/components/reporters/plugin_formatters/xml/cookie_collector.rb +32 -0
- data/components/reporters/plugin_formatters/xml/form_dicattack.rb +22 -0
- data/components/reporters/plugin_formatters/xml/healthmap.rb +30 -0
- data/components/reporters/plugin_formatters/xml/http_dicattack.rb +22 -0
- data/components/reporters/plugin_formatters/xml/uncommon_headers.rb +29 -0
- data/components/reporters/plugin_formatters/xml/uniformity.rb +23 -0
- data/components/reporters/plugin_formatters/xml/waf_detector.rb +22 -0
- data/components/reporters/stdout.rb +226 -0
- data/components/reporters/txt.rb +50 -0
- data/components/reporters/xml.rb +285 -0
- data/components/reporters/xml/schema.xsd +664 -0
- data/components/reporters/yaml.rb +37 -0
- data/{rpcd_handlers → components/services}/placeholder +0 -0
- data/lib/arachni.rb +29 -18
- data/lib/arachni/banner.rb +5 -13
- data/lib/arachni/browser.rb +1292 -0
- data/lib/arachni/browser/element_locator.rb +137 -0
- data/lib/arachni/browser/javascript.rb +383 -0
- data/lib/arachni/browser/javascript/dom_monitor.rb +31 -0
- data/lib/arachni/browser/javascript/proxy.rb +92 -0
- data/lib/arachni/browser/javascript/proxy/stub.rb +90 -0
- data/lib/arachni/browser/javascript/scripts/dom_monitor.js +146 -0
- data/lib/arachni/browser/javascript/scripts/taint_tracer.js +486 -0
- data/lib/arachni/browser/javascript/taint_tracer.rb +101 -0
- data/lib/arachni/browser/javascript/taint_tracer/frame.rb +73 -0
- data/lib/arachni/browser/javascript/taint_tracer/frame/called_function.rb +78 -0
- data/lib/arachni/browser/javascript/taint_tracer/sink/base.rb +63 -0
- data/lib/arachni/browser/javascript/taint_tracer/sink/data_flow.rb +83 -0
- data/lib/arachni/browser/javascript/taint_tracer/sink/execution_flow.rb +30 -0
- data/lib/arachni/browser_cluster.rb +414 -0
- data/lib/arachni/browser_cluster/job.rb +193 -0
- data/lib/arachni/browser_cluster/job/result.rb +29 -0
- data/lib/arachni/browser_cluster/jobs/browser_provider.rb +27 -0
- data/lib/arachni/browser_cluster/jobs/resource_exploration.rb +60 -0
- data/lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb +43 -0
- data/lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger/result.rb +23 -0
- data/lib/arachni/browser_cluster/jobs/resource_exploration/result.rb +23 -0
- data/lib/arachni/browser_cluster/jobs/taint_trace.rb +48 -0
- data/lib/arachni/browser_cluster/jobs/taint_trace/event_trigger.rb +33 -0
- data/lib/arachni/browser_cluster/jobs/taint_trace/event_trigger/result.rb +23 -0
- data/lib/arachni/browser_cluster/jobs/taint_trace/result.rb +23 -0
- data/lib/arachni/browser_cluster/worker.rb +277 -0
- data/lib/arachni/check.rb +12 -0
- data/lib/arachni/check/auditor.rb +612 -0
- data/lib/arachni/check/base.rb +177 -0
- data/lib/arachni/check/manager.rb +137 -0
- data/lib/arachni/component.rb +11 -0
- data/lib/arachni/component/base.rb +62 -0
- data/lib/arachni/component/manager.rb +92 -90
- data/lib/arachni/component/options.rb +6 -28
- data/lib/arachni/component/options/address.rb +14 -30
- data/lib/arachni/component/options/base.rb +96 -81
- data/lib/arachni/component/options/bool.rb +20 -37
- data/lib/arachni/component/options/float.rb +12 -31
- data/lib/arachni/component/options/int.rb +14 -31
- data/lib/arachni/component/options/multiple_choice.rb +40 -0
- data/lib/arachni/component/options/object.rb +16 -0
- data/lib/arachni/component/options/path.rb +12 -25
- data/lib/arachni/component/options/port.rb +15 -25
- data/lib/arachni/component/options/string.rb +10 -32
- data/lib/arachni/component/options/url.rb +15 -30
- data/lib/arachni/component/output.rb +33 -0
- data/lib/arachni/component/utilities.rb +49 -0
- data/lib/arachni/data.rb +109 -0
- data/lib/arachni/data/framework.rb +160 -0
- data/lib/arachni/data/framework/rpc.rb +68 -0
- data/lib/arachni/data/issues.rb +227 -0
- data/lib/arachni/data/plugins.rb +109 -0
- data/lib/arachni/data/session.rb +48 -0
- data/lib/arachni/element/base.rb +131 -82
- data/lib/arachni/element/body.rb +43 -13
- data/lib/arachni/element/capabilities/analyzable.rb +46 -0
- data/lib/arachni/element/capabilities/analyzable/differential.rb +436 -0
- data/lib/arachni/element/capabilities/analyzable/taint.rb +218 -0
- data/lib/arachni/element/capabilities/analyzable/timeout.rb +433 -0
- data/lib/arachni/element/capabilities/auditable.rb +172 -577
- data/lib/arachni/element/capabilities/auditable/dom.rb +156 -0
- data/lib/arachni/element/capabilities/inputtable.rb +267 -0
- data/lib/arachni/element/capabilities/mutable.rb +197 -155
- data/lib/arachni/element/capabilities/refreshable.rb +31 -24
- data/lib/arachni/element/capabilities/submittable.rb +128 -0
- data/lib/arachni/element/capabilities/with_auditor.rb +60 -0
- data/lib/arachni/element/capabilities/with_auditor/output.rb +33 -0
- data/lib/arachni/element/capabilities/with_dom.rb +40 -0
- data/lib/arachni/element/capabilities/with_node.rb +52 -0
- data/lib/arachni/element/capabilities/with_scope.rb +25 -0
- data/lib/arachni/element/capabilities/with_scope/scope.rb +38 -0
- data/lib/arachni/element/cookie.rb +337 -862
- data/lib/arachni/element/cookie/dom.rb +67 -0
- data/lib/arachni/element/form.rb +326 -756
- data/lib/arachni/element/form/dom.rb +52 -0
- data/lib/arachni/element/generic_dom.rb +133 -0
- data/lib/arachni/element/header.rb +46 -46
- data/lib/arachni/element/link.rb +134 -172
- data/lib/arachni/element/link/dom.rb +128 -0
- data/lib/arachni/element/link_template.rb +268 -0
- data/lib/arachni/element/link_template/dom.rb +143 -0
- data/lib/arachni/element/path.rb +24 -13
- data/lib/arachni/element/server.rb +89 -13
- data/lib/arachni/element_filter.rb +101 -99
- data/lib/arachni/error.rb +5 -15
- data/lib/arachni/ethon/easy.rb +22 -0
- data/lib/arachni/framework.rb +841 -476
- data/lib/arachni/http.rb +6 -714
- data/lib/arachni/http/client.rb +801 -0
- data/lib/arachni/http/cookie_jar.rb +50 -51
- data/lib/arachni/http/headers.rb +122 -0
- data/lib/arachni/http/message.rb +76 -0
- data/lib/arachni/http/message/scope.rb +35 -0
- data/lib/arachni/http/proxy_server.rb +303 -0
- data/{plugins/proxy → lib/arachni/http/proxy_server}/ssl-interceptor-cert.pem +0 -0
- data/{plugins/proxy → lib/arachni/http/proxy_server}/ssl-interceptor-pkey.pem +0 -0
- data/lib/arachni/http/request.rb +471 -0
- data/lib/arachni/http/request/scope.rb +30 -0
- data/lib/arachni/http/response.rb +226 -0
- data/lib/arachni/http/response/scope.rb +67 -0
- data/lib/arachni/issue.rb +389 -223
- data/lib/arachni/issue/severity.rb +34 -0
- data/lib/arachni/issue/severity/base.rb +39 -0
- data/lib/arachni/option_group.rb +137 -0
- data/lib/arachni/option_groups.rb +13 -0
- data/lib/arachni/option_groups/audit.rb +226 -0
- data/lib/arachni/option_groups/browser_cluster.rb +50 -0
- data/lib/arachni/option_groups/datastore.rb +31 -0
- data/lib/arachni/option_groups/dispatcher.rb +132 -0
- data/lib/arachni/option_groups/http.rb +174 -0
- data/lib/arachni/option_groups/input.rb +156 -0
- data/lib/arachni/option_groups/output.rb +22 -0
- data/lib/arachni/option_groups/paths.rb +63 -0
- data/lib/arachni/option_groups/rpc.rb +87 -0
- data/lib/arachni/option_groups/scope.rb +233 -0
- data/lib/arachni/option_groups/session.rb +54 -0
- data/lib/arachni/option_groups/snapshot.rb +22 -0
- data/lib/arachni/options.rb +286 -1486
- data/lib/arachni/page.rb +504 -108
- data/lib/arachni/page/dom.rb +280 -0
- data/lib/arachni/page/dom/transition.rb +302 -0
- data/lib/arachni/page/scope.rb +53 -0
- data/lib/arachni/parser.rb +177 -210
- data/lib/arachni/platform.rb +5 -13
- data/lib/arachni/platform/fingerprinter.rb +24 -23
- data/lib/arachni/platform/list.rb +48 -27
- data/lib/arachni/platform/manager.rb +146 -83
- data/lib/arachni/plugin.rb +5 -13
- data/lib/arachni/plugin/base.rb +90 -110
- data/lib/arachni/plugin/formatter.rb +40 -0
- data/lib/arachni/plugin/manager.rb +129 -108
- data/lib/arachni/processes.rb +6 -14
- data/lib/arachni/processes/dispatchers.rb +51 -58
- data/lib/arachni/processes/executables/base.rb +9 -0
- data/lib/arachni/processes/executables/dispatcher.rb +6 -0
- data/lib/arachni/processes/executables/instance.rb +13 -0
- data/lib/arachni/processes/helpers.rb +4 -12
- data/lib/arachni/processes/helpers/dispatchers.rb +8 -12
- data/lib/arachni/processes/helpers/instances.rb +13 -13
- data/lib/arachni/processes/helpers/processes.rb +8 -28
- data/lib/arachni/processes/instances.rb +86 -63
- data/lib/arachni/processes/manager.rb +89 -52
- data/lib/arachni/report.rb +282 -15
- data/lib/arachni/reporter.rb +12 -0
- data/lib/arachni/reporter/base.rb +126 -0
- data/lib/arachni/reporter/formatter_manager.rb +20 -0
- data/lib/arachni/reporter/manager.rb +54 -0
- data/lib/arachni/reporter/options.rb +47 -0
- data/lib/arachni/rpc/client/base.rb +27 -35
- data/lib/arachni/rpc/client/dispatcher.rb +13 -21
- data/lib/arachni/rpc/client/instance.rb +45 -40
- data/lib/arachni/rpc/client/instance/framework.rb +88 -0
- data/lib/arachni/rpc/client/instance/service.rb +106 -0
- data/lib/arachni/rpc/serializer.rb +98 -0
- data/lib/arachni/rpc/server/active_options.rb +26 -42
- data/lib/arachni/rpc/server/base.rb +35 -26
- data/lib/arachni/rpc/server/check/manager.rb +38 -0
- data/lib/arachni/rpc/server/dispatcher.rb +125 -211
- data/lib/arachni/rpc/server/dispatcher/node.rb +36 -50
- data/lib/arachni/rpc/server/dispatcher/service.rb +153 -0
- data/lib/arachni/rpc/server/framework.rb +83 -176
- data/lib/arachni/rpc/server/framework/distributor.rb +292 -271
- data/lib/arachni/rpc/server/framework/master.rb +164 -296
- data/lib/arachni/rpc/server/framework/multi_instance.rb +96 -128
- data/lib/arachni/rpc/server/framework/slave.rb +79 -89
- data/lib/arachni/rpc/server/instance.rb +362 -413
- data/lib/arachni/rpc/server/output.rb +33 -147
- data/lib/arachni/rpc/server/plugin/manager.rb +18 -54
- data/lib/arachni/ruby.rb +5 -14
- data/lib/arachni/ruby/array.rb +4 -14
- data/lib/arachni/ruby/hash.rb +47 -15
- data/lib/arachni/ruby/io.rb +4 -14
- data/lib/arachni/ruby/object.rb +10 -52
- data/lib/arachni/ruby/set.rb +4 -12
- data/lib/arachni/ruby/string.rb +60 -40
- data/lib/arachni/ruby/webrick.rb +4 -12
- data/lib/arachni/ruby/webrick/cookie.rb +4 -12
- data/lib/arachni/ruby/webrick/httprequest.rb +4 -12
- data/lib/arachni/scope.rb +40 -0
- data/lib/arachni/selenium/webdriver/remote/http/typhoeus.rb +46 -0
- data/lib/arachni/session.rb +150 -173
- data/lib/arachni/snapshot.rb +181 -0
- data/lib/arachni/state.rb +122 -0
- data/lib/arachni/state/audit.rb +57 -0
- data/lib/arachni/state/element_filter.rb +67 -0
- data/lib/arachni/state/framework.rb +419 -0
- data/lib/arachni/state/framework/rpc.rb +63 -0
- data/lib/arachni/state/http.rb +60 -0
- data/lib/arachni/state/options.rb +39 -0
- data/lib/arachni/state/plugins.rb +94 -0
- data/lib/arachni/support.rb +6 -15
- data/lib/arachni/support/buffer.rb +5 -13
- data/lib/arachni/support/buffer/autoflush.rb +5 -15
- data/lib/arachni/support/buffer/base.rb +41 -70
- data/lib/arachni/support/cache.rb +5 -13
- data/lib/arachni/support/cache/base.rb +45 -50
- data/lib/arachni/support/cache/least_cost_replacement.rb +9 -19
- data/lib/arachni/support/cache/least_recently_used.rb +5 -15
- data/lib/arachni/support/cache/preference.rb +11 -20
- data/lib/arachni/support/cache/random_replacement.rb +10 -15
- data/lib/arachni/support/crypto.rb +5 -13
- data/lib/arachni/support/crypto/rsa_aes_cbc.rb +15 -27
- data/lib/arachni/support/database.rb +5 -13
- data/lib/arachni/support/database/base.rb +20 -37
- data/lib/arachni/support/database/hash.rb +265 -350
- data/lib/arachni/support/database/queue.rb +86 -27
- data/lib/arachni/support/lookup.rb +5 -13
- data/lib/arachni/support/lookup/base.rb +33 -26
- data/lib/arachni/support/lookup/hash_set.rb +11 -15
- data/lib/arachni/support/lookup/moolb.rb +9 -20
- data/lib/arachni/support/mixins.rb +14 -0
- data/lib/arachni/support/mixins/observable.rb +105 -0
- data/lib/arachni/support/mixins/terminal.rb +65 -0
- data/lib/arachni/support/profiler.rb +130 -0
- data/lib/arachni/support/signature.rb +37 -67
- data/lib/arachni/trainer.rb +57 -97
- data/lib/arachni/ui/foo/output.rb +31 -33
- data/lib/arachni/uri.rb +456 -462
- data/lib/arachni/uri/scope.rb +168 -0
- data/lib/arachni/utilities.rb +125 -147
- data/lib/arachni/version.rb +4 -12
- data/lib/arachni/watir/element.rb +17 -0
- data/lib/version +1 -1
- data/{spec/support/servers/modules/audit/sqli/jdbc → profiles/placeholder} +0 -0
- data/spec/arachni/browser/element_locator_spec.rb +228 -0
- data/spec/arachni/browser/javascript/dom_monitor_spec.rb +195 -0
- data/spec/arachni/browser/javascript/proxy/stub_spec.rb +106 -0
- data/spec/arachni/browser/javascript/proxy_spec.rb +144 -0
- data/spec/arachni/browser/javascript/taint_tracer/frame/called_function_spec.rb +72 -0
- data/spec/arachni/browser/javascript/taint_tracer/frame_spec.rb +46 -0
- data/spec/arachni/browser/javascript/taint_tracer/sink/data_flow_spec.rb +81 -0
- data/spec/arachni/browser/javascript/taint_tracer/sink/execution_flow_spec.rb +47 -0
- data/spec/arachni/browser/javascript/taint_tracer_spec.rb +1304 -0
- data/spec/arachni/browser/javascript_spec.rb +355 -0
- data/spec/arachni/browser_cluster/job/result_spec.rb +14 -0
- data/spec/arachni/browser_cluster/job_spec.rb +264 -0
- data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger/result_spec.rb +7 -0
- data/spec/arachni/browser_cluster/jobs/resource_exploration/event_trigger_spec.rb +68 -0
- data/spec/arachni/browser_cluster/jobs/resource_exploration/result_spec.rb +7 -0
- data/spec/arachni/browser_cluster/jobs/resource_exploration_spec.rb +89 -0
- data/spec/arachni/browser_cluster/jobs/taint_tracer_spec.rb +149 -0
- data/spec/arachni/browser_cluster/worker_spec.rb +314 -0
- data/spec/arachni/browser_cluster_spec.rb +543 -0
- data/spec/arachni/browser_spec.rb +2368 -0
- data/spec/arachni/check/auditor_spec.rb +1089 -0
- data/spec/arachni/check/base_spec.rb +33 -0
- data/spec/arachni/check/manager_spec.rb +100 -0
- data/spec/arachni/component/base_spec.rb +64 -0
- data/spec/arachni/component/manager_spec.rb +37 -26
- data/spec/arachni/component/options/address_spec.rb +5 -11
- data/spec/arachni/component/options/base_spec.rb +29 -81
- data/spec/arachni/component/options/bool_spec.rb +16 -19
- data/spec/arachni/component/options/float_spec.rb +17 -16
- data/spec/arachni/component/options/int_spec.rb +17 -20
- data/spec/arachni/component/options/multiple_choice_spec.rb +82 -0
- data/spec/arachni/component/options/object_spec.rb +24 -0
- data/spec/arachni/component/options/path_spec.rb +8 -11
- data/spec/arachni/component/options/port_spec.rb +16 -15
- data/spec/arachni/component/options/string_spec.rb +8 -17
- data/spec/arachni/component/options/url_spec.rb +16 -14
- data/spec/arachni/component/utilities_spec.rb +30 -0
- data/spec/arachni/{module → component}/utilities_spec/read_file.txt +0 -0
- data/spec/arachni/data/framework/rpc_spec.rb +72 -0
- data/spec/arachni/data/framework_spec.rb +266 -0
- data/spec/arachni/data/issues_spec.rb +347 -0
- data/spec/arachni/data/plugins_spec.rb +102 -0
- data/spec/arachni/data/session_spec.rb +59 -0
- data/spec/arachni/data_spec.rb +71 -0
- data/spec/arachni/element/body_spec.rb +63 -4
- data/spec/arachni/element/capabilities/analyzable/differential_spec.rb +135 -0
- data/spec/arachni/element/capabilities/analyzable/taint_spec.rb +355 -0
- data/spec/arachni/element/capabilities/analyzable/timeout_spec.rb +386 -0
- data/spec/arachni/element/capabilities/with_scope/scope_spec.rb +25 -0
- data/spec/arachni/element/cookie/dom_spec.rb +145 -0
- data/spec/arachni/element/cookie_spec.rb +147 -108
- data/spec/arachni/element/form/dom_spec.rb +146 -0
- data/spec/arachni/element/form_spec.rb +519 -271
- data/spec/arachni/element/generic_dom_spec.rb +113 -0
- data/spec/arachni/element/header_spec.rb +68 -20
- data/spec/arachni/element/link/dom_spec.rb +206 -0
- data/spec/arachni/element/link_spec.rb +218 -130
- data/spec/arachni/element/link_template/dom_spec.rb +218 -0
- data/spec/arachni/element/link_template_spec.rb +403 -0
- data/spec/arachni/element/path_spec.rb +28 -4
- data/spec/arachni/element/server_spec.rb +171 -4
- data/spec/arachni/element_filter_spec.rb +227 -96
- data/spec/arachni/framework_spec.rb +1099 -759
- data/spec/arachni/http/client_spec.rb +1470 -0
- data/spec/arachni/http/cookie_jar_spec.rb +164 -130
- data/spec/arachni/http/headers_spec.rb +111 -0
- data/spec/arachni/http/message_spec.rb +5 -0
- data/spec/arachni/http/proxy_server_spec.rb +354 -0
- data/spec/arachni/http/request_spec.rb +602 -0
- data/spec/arachni/http/response/scope_spec.rb +135 -0
- data/spec/arachni/http/response_spec.rb +350 -0
- data/spec/arachni/issue/severity/base_spec.rb +15 -0
- data/spec/arachni/issue/severity_spec.rb +43 -0
- data/spec/arachni/issue_spec.rb +547 -284
- data/spec/arachni/option_groups/audit_spec.rb +298 -0
- data/spec/arachni/option_groups/browser_cluster_spec.rb +12 -0
- data/spec/arachni/option_groups/datastore_spec.rb +54 -0
- data/spec/arachni/option_groups/dispatcher_spec.rb +123 -0
- data/spec/arachni/option_groups/http_spec.rb +42 -0
- data/spec/arachni/option_groups/input_spec.rb +202 -0
- data/spec/arachni/option_groups/output_spec.rb +11 -0
- data/spec/arachni/option_groups/paths_spec.rb +34 -0
- data/spec/arachni/option_groups/rpc_spec.rb +13 -0
- data/spec/arachni/option_groups/scope_spec.rb +237 -0
- data/spec/arachni/option_groups/session_spec.rb +51 -0
- data/spec/arachni/option_groups/snapshot_spec.rb +11 -0
- data/spec/arachni/options_spec.rb +202 -756
- data/spec/arachni/page/dom/transition_spec.rb +515 -0
- data/spec/arachni/page/dom_spec.rb +308 -0
- data/spec/arachni/page/scope_spec.rb +80 -0
- data/spec/arachni/page_spec.rb +789 -175
- data/spec/arachni/parser_spec.rb +308 -200
- data/spec/arachni/platform/fingerprinter_spec.rb +51 -52
- data/spec/arachni/platform/manager_spec.rb +146 -34
- data/spec/arachni/plugin/base_spec.rb +97 -0
- data/spec/arachni/plugin/manager_spec.rb +186 -80
- data/spec/arachni/report_spec.rb +275 -0
- data/spec/arachni/reporter/base_spec.rb +96 -0
- data/spec/arachni/reporter/manager_spec.rb +38 -0
- data/spec/arachni/reporter/options_spec.rb +48 -0
- data/spec/arachni/rpc/client/base_spec.rb +43 -45
- data/spec/arachni/rpc/client/dispatcher_spec.rb +3 -3
- data/spec/arachni/rpc/client/instance_spec.rb +18 -40
- data/spec/arachni/rpc/server/active_options_spec.rb +35 -296
- data/spec/arachni/rpc/server/base_spec.rb +12 -6
- data/spec/arachni/rpc/server/checks/manager_spec.rb +48 -0
- data/spec/arachni/rpc/server/dispatcher/node_spec.rb +47 -74
- data/spec/arachni/rpc/server/dispatcher/service_spec.rb +99 -0
- data/spec/arachni/rpc/server/dispatcher_spec.rb +77 -38
- data/spec/arachni/rpc/server/framework/distributor_spec.rb +356 -396
- data/spec/arachni/rpc/server/framework_multi_spec.rb +336 -0
- data/spec/arachni/rpc/server/framework_spec.rb +396 -0
- data/spec/arachni/rpc/server/instance_spec.rb +480 -281
- data/spec/arachni/rpc/server/output_spec.rb +9 -212
- data/spec/arachni/rpc/server/plugin/manager_spec.rb +6 -11
- data/spec/arachni/ruby/hash_spec.rb +30 -0
- data/spec/arachni/ruby/object_spec.rb +0 -16
- data/spec/arachni/ruby/string_spec.rb +98 -6
- data/spec/arachni/scope_spec.rb +13 -0
- data/spec/arachni/session_spec.rb +279 -251
- data/spec/arachni/snapshot_spec.rb +127 -0
- data/spec/arachni/state/audit_spec.rb +107 -0
- data/spec/arachni/state/element_filter_spec.rb +66 -0
- data/spec/arachni/state/framework/rpc_spec.rb +85 -0
- data/spec/arachni/state/framework_spec.rb +853 -0
- data/spec/arachni/state/http_spec.rb +63 -0
- data/spec/arachni/state/options_spec.rb +55 -0
- data/spec/arachni/state/plugins_spec.rb +76 -0
- data/spec/arachni/state_spec.rb +87 -0
- data/spec/arachni/support/cache/least_cost_replacement_spec.rb +30 -32
- data/spec/arachni/support/cache/least_recently_used_spec.rb +39 -40
- data/spec/arachni/support/cache/preference_spec.rb +17 -18
- data/spec/arachni/support/cache/random_replacement_spec.rb +19 -20
- data/spec/arachni/support/database/queue_spec.rb +200 -32
- data/spec/arachni/support/lookup/hash_set_spec.rb +74 -0
- data/spec/arachni/support/mixins/observable_spec.rb +81 -0
- data/spec/arachni/support/signature_spec.rb +9 -25
- data/spec/arachni/trainer_spec.rb +141 -124
- data/spec/arachni/uri/scope_spec.rb +416 -0
- data/spec/arachni/uri_spec.rb +187 -195
- data/spec/arachni/utilities_spec.rb +178 -525
- data/spec/components/checks/active/code_injection_spec.rb +26 -0
- data/spec/components/checks/active/code_injection_timing_spec.rb +26 -0
- data/spec/components/checks/active/csrf_spec.rb +44 -0
- data/spec/components/checks/active/file_inclusion_spec.rb +56 -0
- data/spec/components/checks/active/ldap_injection_spec.rb +16 -0
- data/spec/components/checks/active/no_sql_injection_differential_spec.rb +15 -0
- data/spec/components/checks/active/no_sql_injection_spec.rb +28 -0
- data/spec/components/checks/active/os_cmd_injection_spec.rb +26 -0
- data/spec/components/checks/active/os_cmd_injection_timing_spec.rb +26 -0
- data/spec/components/checks/active/path_traversal_spec.rb +42 -0
- data/spec/components/checks/active/response_splitting_spec.rb +22 -0
- data/spec/components/checks/active/rfi_spec.rb +20 -0
- data/spec/components/checks/active/session_fixation_spec.rb +20 -0
- data/spec/components/checks/active/source_code_disclosure_spec.rb +26 -0
- data/spec/components/checks/active/sql_injection_differential_spec.rb +15 -0
- data/spec/components/checks/active/sql_injection_spec.rb +142 -0
- data/spec/components/checks/active/sql_injection_timing_spec.rb +24 -0
- data/spec/components/checks/active/trainer_spec.rb +36 -0
- data/spec/components/checks/active/unvalidated_redirect_spec.rb +20 -0
- data/spec/components/checks/active/xpath_injection_spec.rb +16 -0
- data/spec/components/checks/active/xss_dom_inputs_spec.rb +32 -0
- data/spec/components/checks/active/xss_dom_script_context_spec.rb +63 -0
- data/spec/components/checks/active/xss_dom_spec.rb +67 -0
- data/spec/components/checks/active/xss_event_spec.rb +15 -0
- data/spec/components/checks/active/xss_path_spec.rb +15 -0
- data/spec/components/checks/active/xss_script_context_spec.rb +22 -0
- data/spec/components/checks/active/xss_spec.rb +22 -0
- data/spec/components/checks/active/xss_tag_spec.rb +15 -0
- data/spec/components/checks/passive/allowed_methods_spec.rb +15 -0
- data/spec/components/checks/passive/backdoors_spec.rb +15 -0
- data/spec/components/checks/passive/backup_directories_spec.rb +15 -0
- data/spec/components/checks/passive/backup_files_spec.rb +15 -0
- data/spec/components/checks/passive/common_directories_spec.rb +15 -0
- data/spec/components/checks/passive/common_files_spec.rb +15 -0
- data/spec/components/checks/passive/directory_listing_spec.rb +15 -0
- data/spec/components/checks/passive/grep/captcha_spec.rb +15 -0
- data/spec/components/checks/passive/grep/cookie_set_for_parent_domain_spec.rb +15 -0
- data/spec/components/checks/passive/grep/credit_card_spec.rb +15 -0
- data/spec/components/checks/passive/grep/cvs_svn_users_spec.rb +15 -0
- data/spec/components/checks/passive/grep/emails_spec.rb +15 -0
- data/spec/components/checks/passive/grep/form_upload_spec.rb +15 -0
- data/spec/components/checks/passive/grep/hsts_spec.rb +17 -0
- data/spec/components/checks/passive/grep/html_objects_spec.rb +15 -0
- data/spec/components/checks/passive/grep/http_only_cookies_spec.rb +15 -0
- data/spec/components/checks/passive/grep/insecure_cookies_spec.rb +15 -0
- data/spec/components/checks/passive/grep/mixed_resource_spec.rb +16 -0
- data/spec/components/checks/passive/grep/password_autocomplete_spec.rb +15 -0
- data/spec/components/checks/passive/grep/private_ip_spec.rb +22 -0
- data/spec/components/checks/passive/grep/ssn_spec.rb +15 -0
- data/spec/components/checks/passive/grep/unencrypted_password_forms_spec.rb +15 -0
- data/spec/components/checks/passive/htaccess_limit_spec.rb +15 -0
- data/spec/components/checks/passive/http_put_spec.rb +15 -0
- data/spec/components/checks/passive/interesting_responses_spec.rb +23 -0
- data/spec/components/checks/passive/localstart_asp_spec.rb +15 -0
- data/spec/components/checks/passive/origin_spoof_access_restriction_bypass_spec.rb +15 -0
- data/spec/components/checks/passive/webdav_spec.rb +15 -0
- data/spec/components/checks/passive/xst_spec.rb +15 -0
- data/spec/components/fingerprinters/frameworks/rack_spec.rb +42 -0
- data/spec/components/fingerprinters/languages/asp_spec.rb +38 -0
- data/spec/components/fingerprinters/languages/aspx_spec.rb +79 -0
- data/spec/components/fingerprinters/languages/jsp_spec.rb +56 -0
- data/spec/components/fingerprinters/languages/php_spec.rb +59 -0
- data/spec/components/fingerprinters/languages/python_spec.rb +23 -0
- data/spec/components/fingerprinters/languages/ruby.rb +34 -0
- data/spec/components/fingerprinters/os/bsd_spec.rb +26 -0
- data/spec/components/fingerprinters/os/linux_spec.rb +34 -0
- data/spec/components/fingerprinters/os/solaris_spec.rb +34 -0
- data/spec/components/fingerprinters/os/unix_spec.rb +26 -0
- data/spec/components/fingerprinters/os/windows_spec.rb +34 -0
- data/spec/components/fingerprinters/servers/apache_spec.rb +26 -0
- data/spec/components/fingerprinters/servers/iis_spec.rb +28 -0
- data/spec/components/fingerprinters/servers/jetty_spec.rb +28 -0
- data/spec/components/fingerprinters/servers/nginx_spec.rb +26 -0
- data/spec/components/fingerprinters/servers/tomcat_spec.rb +28 -0
- data/spec/{path_extractors → components/path_extractors}/anchors_spec.rb +0 -0
- data/spec/{path_extractors → components/path_extractors}/areas_spec.rb +0 -0
- data/spec/components/path_extractors/comments_spec.rb +23 -0
- data/spec/{path_extractors → components/path_extractors}/forms_spec.rb +0 -0
- data/spec/{path_extractors → components/path_extractors}/frames_spec.rb +0 -0
- data/spec/{path_extractors → components/path_extractors}/generic_spec.rb +0 -0
- data/spec/{path_extractors → components/path_extractors}/links_spec.rb +0 -0
- data/spec/{path_extractors → components/path_extractors}/meta_refresh_spec.rb +0 -0
- data/spec/components/path_extractors/scripts_spec.rb +30 -0
- data/spec/components/plugins/autologin_spec.rb +96 -0
- data/spec/components/plugins/autothrottle_spec.rb +56 -0
- data/spec/components/plugins/content_types_spec.rb +91 -0
- data/spec/components/plugins/cookie_collector_spec.rb +41 -0
- data/spec/components/plugins/form_dicattack_spec.rb +54 -0
- data/spec/components/plugins/healthmap_spec.rb +40 -0
- data/spec/components/plugins/http_dicattack_spec.rb +40 -0
- data/spec/components/plugins/meta/remedies/discovery_spec.rb +23 -0
- data/spec/components/plugins/meta/remedies/timing_attacks_spec.rb +31 -0
- data/spec/components/plugins/meta/uniformity_spec.rb +29 -0
- data/spec/components/plugins/script_spec.rb +13 -0
- data/spec/components/plugins/uncommon_headers_spec.rb +64 -0
- data/spec/components/plugins/vector_feed_spec.rb +169 -0
- data/spec/components/plugins/waf_detector_spec.rb +50 -0
- data/spec/components/reporters/ap_spec.rb +9 -0
- data/spec/components/reporters/html_spec.rb +9 -0
- data/spec/components/reporters/json_spec.rb +17 -0
- data/spec/components/reporters/marshal_spec.rb +13 -0
- data/spec/components/reporters/stdout_spec.rb +9 -0
- data/spec/components/reporters/txt_spec.rb +8 -0
- data/spec/components/reporters/xml_spec.rb +9 -0
- data/spec/components/reporters/yaml_spec.rb +14 -0
- data/spec/external/wavsep/active/lfi_spec.rb +1 -1
- data/spec/external/wavsep/active/obsolete_files_spec.rb +225 -0
- data/spec/external/wavsep/active/rfi_spec.rb +1 -1
- data/spec/external/wavsep/active/sqli_spec.rb +8 -6
- data/spec/external/wavsep/active/unvalidated_redirect_spec.rb +57 -0
- data/spec/external/wavsep/active/xss_dom_spec.rb +27 -0
- data/spec/external/wavsep/active/xss_spec.rb +13 -3
- data/spec/external/wavsep/false_positives/lfi_spec.rb +4 -16
- data/spec/external/wavsep/false_positives/obsolete_files_spec.rb +21 -0
- data/spec/external/wavsep/false_positives/rfi_spec.rb +2 -2
- data/spec/external/wavsep/false_positives/sqli_spec.rb +4 -15
- data/spec/external/wavsep/false_positives/unvalidated_redirect_spec.rb +21 -0
- data/spec/external/wavsep/false_positives/xss_spec.rb +2 -2
- data/spec/spec_helper.rb +17 -18
- data/spec/support/factories/browser/javascript/taint_tracer/frame.rb +10 -0
- data/spec/support/factories/browser/javascript/taint_tracer/frame/called_function.rb +11 -0
- data/spec/support/factories/browser/javascript/taint_tracer/sink/data_flow.rb +14 -0
- data/spec/support/factories/browser/javascript/taint_tracer/sink/execution_flow.rb +10 -0
- data/spec/support/factories/browser_cluster/job.rb +27 -0
- data/spec/support/factories/element/cookie.rb +7 -0
- data/spec/support/factories/element/form.rb +12 -0
- data/spec/support/factories/element/header.rb +5 -0
- data/spec/support/factories/element/link.rb +11 -0
- data/spec/support/factories/element/link_template.rb +11 -0
- data/spec/support/factories/http/request.rb +9 -0
- data/spec/support/factories/http/response.rb +42 -0
- data/spec/support/factories/issue.rb +67 -0
- data/spec/support/factories/page.rb +7 -0
- data/spec/support/factories/page/dom.rb +13 -0
- data/spec/support/factories/page/dom/transition.rb +21 -0
- data/spec/support/factories/scan_report.rb +35 -0
- data/spec/support/factories/vector.rb +32 -0
- data/spec/support/fixtures/check_with_invalid_platforms/with_invalid_platforms.rb +37 -0
- data/spec/support/fixtures/checks/test.rb +58 -0
- data/spec/support/fixtures/checks/test2.rb +41 -0
- data/spec/support/fixtures/checks/test3.rb +41 -0
- data/spec/support/fixtures/executables/node.rb +47 -0
- data/spec/support/fixtures/fingerprinters/test.rb +5 -13
- data/spec/support/fixtures/option_groups/input.yml +2 -0
- data/spec/support/fixtures/plugins/bad.rb +5 -13
- data/spec/support/fixtures/plugins/defaults/default.rb +6 -14
- data/spec/support/fixtures/plugins/distributable.rb +7 -15
- data/spec/support/fixtures/plugins/loop.rb +5 -13
- data/spec/support/fixtures/plugins/suspendable.rb +44 -0
- data/spec/support/fixtures/plugins/wait.rb +6 -14
- data/spec/support/fixtures/plugins/with_options.rb +20 -16
- data/spec/support/fixtures/plugins_with_priorities/p0.rb +17 -0
- data/spec/support/fixtures/plugins_with_priorities/p00.rb +17 -0
- data/spec/support/fixtures/plugins_with_priorities/p1.rb +17 -0
- data/spec/support/fixtures/plugins_with_priorities/p2.rb +17 -0
- data/spec/support/fixtures/plugins_with_priorities/p22.rb +17 -0
- data/spec/support/fixtures/plugins_with_priorities/p222.rb +17 -0
- data/spec/support/fixtures/plugins_with_priorities/p_nil.rb +16 -0
- data/spec/support/fixtures/plugins_with_priorities/p_nil2.rb +16 -0
- data/spec/support/fixtures/report.afr +0 -0
- data/spec/support/fixtures/reporters/base_spec/plugin_formatters/with_formatters/foobar.rb +13 -0
- data/spec/support/fixtures/reporters/base_spec/with_formatters.rb +15 -0
- data/spec/support/fixtures/reporters/base_spec/with_outfile.rb +16 -0
- data/spec/support/fixtures/reporters/base_spec/without_outfile.rb +12 -0
- data/spec/support/fixtures/reporters/manager_spec/afr.rb +13 -0
- data/spec/support/fixtures/reporters/manager_spec/foo.rb +18 -0
- data/spec/support/fixtures/rescan.afr.tpl +4 -5
- data/spec/support/fixtures/run_check/body.rb +48 -0
- data/spec/support/fixtures/run_check/cookies.rb +48 -0
- data/spec/support/fixtures/run_check/empty.rb +34 -0
- data/spec/support/fixtures/run_check/flch.rb +53 -0
- data/spec/support/fixtures/run_check/forms.rb +48 -0
- data/spec/support/fixtures/run_check/headers.rb +48 -0
- data/spec/support/fixtures/run_check/links.rb +48 -0
- data/spec/support/fixtures/run_check/nil.rb +47 -0
- data/spec/support/fixtures/run_check/path.rb +48 -0
- data/spec/support/fixtures/run_check/server.rb +48 -0
- data/spec/support/fixtures/services/echo.rb +64 -0
- data/spec/support/fixtures/taint_check/taint.rb +38 -0
- data/spec/support/fixtures/wait_check/wait.rb +38 -0
- data/spec/support/helpers/auditor.rb +18 -5
- data/spec/support/helpers/browser.rb +6 -0
- data/spec/support/helpers/browser_cluster/jobs/taint_tracer.rb +32 -0
- data/spec/support/helpers/framework.rb +5 -13
- data/spec/support/helpers/misc.rb +4 -12
- data/spec/support/helpers/pages.rb +18 -0
- data/spec/support/helpers/paths.rb +4 -12
- data/spec/support/helpers/requires.rb +5 -13
- data/spec/support/helpers/resets.rb +12 -19
- data/spec/support/helpers/web_server.rb +11 -15
- data/spec/support/lib/factory.rb +115 -0
- data/spec/support/lib/web_server_client.rb +49 -0
- data/spec/support/lib/web_server_dispatcher.rb +33 -0
- data/spec/support/lib/web_server_manager.rb +29 -32
- data/spec/support/pems/cacert.pem +35 -37
- data/spec/support/pems/client/cert.pem +35 -37
- data/spec/support/pems/client/key.pem +49 -49
- data/spec/support/pems/server/cert.pem +35 -37
- data/spec/support/pems/server/key.pem +49 -49
- data/spec/support/servers/arachni/browser.rb +836 -0
- data/spec/support/servers/arachni/browser/javascript.rb +7 -0
- data/spec/support/servers/arachni/browser/javascript/angular-1.2.8.js +20554 -0
- data/spec/support/servers/arachni/browser/javascript/angular-route.js +911 -0
- data/spec/support/servers/arachni/browser/javascript/dom_monitor.rb +90 -0
- data/spec/support/servers/arachni/browser/javascript/jquery-2.0.3.js +8829 -0
- data/spec/support/servers/arachni/browser/javascript/proxy.rb +17 -0
- data/spec/support/servers/arachni/browser/javascript/taint_tracer.rb +714 -0
- data/spec/support/servers/arachni/browser_cluster/jobs/event_trigger.rb +25 -0
- data/spec/support/servers/arachni/browser_https.rb +60 -0
- data/spec/support/servers/arachni/check/auditor.rb +247 -0
- data/spec/support/servers/arachni/element/body.rb +5 -0
- data/spec/support/servers/arachni/element/capabilities/analyzable/differential.rb +162 -0
- data/spec/support/servers/arachni/element/capabilities/{auditable → analyzable}/taint.rb +0 -0
- data/spec/support/servers/arachni/element/capabilities/analyzable/timeout.rb +37 -0
- data/spec/support/servers/arachni/element/cookie.rb +1 -1
- data/spec/support/servers/arachni/element/cookie/cookie_dom.rb +21 -0
- data/spec/support/servers/arachni/element/form.rb +6 -22
- data/spec/support/servers/arachni/element/form/form_dom.rb +50 -0
- data/spec/support/servers/arachni/element/header.rb +7 -8
- data/spec/support/servers/arachni/element/link.rb +15 -7
- data/spec/support/servers/arachni/element/link/link_dom.rb +49 -0
- data/spec/support/servers/arachni/element/link_template.rb +11 -0
- data/spec/support/servers/arachni/element/link_template/link_template_dom.rb +43 -0
- data/spec/support/servers/arachni/framework.rb +18 -0
- data/spec/support/servers/arachni/http/client.rb +176 -0
- data/spec/support/servers/arachni/http/proxy_server.rb +9 -0
- data/spec/support/servers/arachni/http/proxy_server_https.rb +25 -0
- data/spec/support/servers/arachni/page/page_dom.rb +83 -0
- data/spec/support/servers/arachni/parser.rb +4 -0
- data/spec/support/servers/arachni/rpc/server/{framework_hpg.rb → framework_multi.rb} +0 -0
- data/spec/support/servers/arachni/session.rb +43 -9
- data/spec/support/servers/arachni/trainer.rb +11 -7
- data/spec/support/servers/checks/active/code_injection.rb +163 -0
- data/spec/support/servers/checks/active/code_injection_timing.rb +134 -0
- data/spec/support/servers/{modules/audit → checks/active}/csrf.rb +0 -0
- data/spec/support/servers/checks/active/file_inclusion.rb +228 -0
- data/spec/support/servers/checks/active/ldap_injection.rb +88 -0
- data/spec/support/servers/checks/active/no_sql_injection.rb +134 -0
- data/spec/support/servers/checks/active/no_sql_injection/mongodb +1 -0
- data/spec/support/servers/checks/active/no_sql_injection_differential.rb +61 -0
- data/spec/support/servers/checks/active/os_cmd_injection.rb +172 -0
- data/spec/support/servers/checks/active/os_cmd_injection_timing.rb +118 -0
- data/spec/support/servers/checks/active/path_traversal.rb +219 -0
- data/spec/support/servers/checks/active/response_splitting.rb +138 -0
- data/spec/support/servers/{modules/audit → checks/active}/rfi.rb +0 -0
- data/spec/support/servers/checks/active/session_fixation.rb +111 -0
- data/spec/support/servers/checks/active/source_code_disclosure.rb +118 -0
- data/spec/support/servers/checks/active/sql_injection.rb +133 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/access +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/coldfusion +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/db2 +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/emc +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/firebird +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/frontbase +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/hsqldb +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/informix +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/ingres +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/interbase +0 -0
- data/spec/support/servers/checks/active/sql_injection/jdbc +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/maxdb +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/mssql +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/mysql +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/oracle +0 -0
- data/spec/support/servers/{modules/audit/sqli/postgresql → checks/active/sql_injection/pgsql} +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/sqlite +0 -0
- data/spec/support/servers/{modules/audit/sqli → checks/active/sql_injection}/sybase +0 -0
- data/spec/support/servers/{modules/audit/sqli_blind_rdiff.rb → checks/active/sql_injection_differential.rb} +0 -0
- data/spec/support/servers/checks/active/sql_injection_timing.rb +145 -0
- data/spec/support/servers/{modules/audit/trainer_module.rb → checks/active/trainer_check.rb} +0 -0
- data/spec/support/servers/checks/active/unvalidated_redirect.rb +141 -0
- data/spec/support/servers/checks/active/xpath_injection.rb +121 -0
- data/spec/support/servers/{modules/audit/xpath → checks/active/xpath_injection}/dotnet +0 -0
- data/spec/support/servers/{modules/audit/xpath → checks/active/xpath_injection}/general +0 -0
- data/spec/support/servers/{modules/audit/xpath → checks/active/xpath_injection}/java +0 -0
- data/spec/support/servers/{modules/audit/xpath → checks/active/xpath_injection}/libxml2 +0 -0
- data/spec/support/servers/{modules/audit/xpath → checks/active/xpath_injection}/php +0 -0
- data/spec/support/servers/checks/active/xss.rb +239 -0
- data/spec/support/servers/checks/active/xss_dom.rb +133 -0
- data/spec/support/servers/checks/active/xss_dom_inputs.rb +35 -0
- data/spec/support/servers/checks/active/xss_dom_script_context.rb +139 -0
- data/spec/support/servers/checks/active/xss_event.rb +80 -0
- data/spec/support/servers/{modules/audit → checks/active}/xss_path.rb +0 -0
- data/spec/support/servers/checks/active/xss_script_context.rb +90 -0
- data/spec/support/servers/{modules/audit → checks/active}/xss_tag.rb +0 -0
- data/spec/support/servers/checks/check_server.rb +14 -0
- data/spec/support/servers/{modules/recon → checks/passive}/allowed_methods.rb +0 -0
- data/spec/support/servers/checks/passive/backdoors.rb +4 -0
- data/spec/support/servers/checks/passive/backup_directories.rb +15 -0
- data/spec/support/servers/checks/passive/backup_files.rb +15 -0
- data/spec/support/servers/checks/passive/common_directories.rb +6 -0
- data/spec/support/servers/checks/passive/common_files.rb +6 -0
- data/spec/support/servers/checks/passive/directory_listing.rb +30 -0
- data/spec/support/servers/{modules/recon → checks/passive}/grep/captcha.rb +0 -0
- data/spec/support/servers/checks/passive/grep/cookie_set_for_parent_domain.rb +21 -0
- data/spec/support/servers/{modules/recon → checks/passive}/grep/credit_card.rb +0 -0
- data/spec/support/servers/{modules/recon → checks/passive}/grep/cvs_svn_users.rb +0 -0
- data/spec/support/servers/checks/passive/grep/emails.rb +23 -0
- data/spec/support/servers/{modules/recon → checks/passive}/grep/form_upload.rb +0 -0
- data/spec/support/servers/checks/passive/grep/hsts_https.rb +37 -0
- data/spec/support/servers/{modules/recon → checks/passive}/grep/html_objects.rb +0 -0
- data/spec/support/servers/{modules/recon → checks/passive}/grep/http_only_cookies.rb +0 -0
- data/spec/support/servers/checks/passive/grep/insecure_cookies_https.rb +40 -0
- data/spec/support/servers/checks/passive/grep/mixed_resource_https.rb +69 -0
- data/spec/support/servers/checks/passive/grep/password_autocomplete.rb +33 -0
- data/spec/support/servers/{modules/recon → checks/passive}/grep/private_ip.rb +0 -0
- data/spec/support/servers/{modules/recon → checks/passive}/grep/ssn.rb +0 -0
- data/spec/support/servers/checks/passive/grep/unencrypted_password_forms.rb +33 -0
- data/spec/support/servers/{modules/recon → checks/passive}/htaccess_limit.rb +0 -0
- data/spec/support/servers/checks/passive/http_put.rb +7 -0
- data/spec/support/servers/checks/passive/interesting_responses.rb +5 -0
- data/spec/support/servers/{modules/recon → checks/passive}/localstart_asp.rb +0 -0
- data/spec/support/servers/checks/passive/origin_spoof_access_restriction_bypass.rb +30 -0
- data/spec/support/servers/checks/passive/webdav.rb +25 -0
- data/spec/support/servers/{modules/recon → checks/passive}/xst.rb +0 -0
- data/spec/support/servers/plugins/meta/remedies/discovery.rb +2 -2
- data/spec/support/servers/plugins/meta/remedies/timing_attacks.rb +2 -0
- data/spec/support/shared/browser/javascript/taint_tracer/sink/base.rb +36 -0
- data/spec/support/shared/check.rb +198 -0
- data/spec/support/shared/component.rb +15 -4
- data/spec/support/shared/component/options/base.rb +187 -0
- data/spec/support/shared/element/base.rb +131 -0
- data/spec/support/shared/element/capabilities/auditable.rb +371 -604
- data/spec/support/shared/element/capabilities/auditable/dom.rb +303 -0
- data/spec/support/shared/element/capabilities/inputtable.rb +499 -0
- data/spec/support/shared/element/capabilities/mutable.rb +362 -0
- data/spec/support/shared/element/capabilities/refreshable.rb +26 -26
- data/spec/support/shared/element/capabilities/submitable.rb +155 -0
- data/spec/support/shared/element/capabilities/with_auditor.rb +75 -0
- data/spec/support/shared/element/capabilities/with_dom.rb +39 -0
- data/spec/support/shared/element/capabilities/with_node.rb +42 -0
- data/spec/support/shared/element/capabilities/with_scope.rb +22 -0
- data/spec/support/shared/external/wavsep.rb +30 -9
- data/spec/support/shared/http/message.rb +72 -0
- data/spec/support/shared/option_group.rb +98 -0
- data/spec/support/shared/path_extractor.rb +1 -1
- data/spec/support/shared/plugin.rb +33 -16
- data/spec/support/shared/reporter.rb +41 -0
- data/spec/support/shared/support/cache.rb +341 -0
- data/spec/support/shared/support/lookup.rb +93 -13
- data/ui/cli/framework.rb +466 -0
- data/ui/cli/framework/option_parser.rb +628 -0
- data/ui/cli/option_parser.rb +104 -0
- data/ui/cli/output.rb +377 -0
- data/ui/cli/reporter.rb +52 -0
- data/ui/cli/reporter/option_parser.rb +102 -0
- data/ui/cli/restored_framework.rb +127 -0
- data/ui/cli/restored_framework/option_parser.rb +115 -0
- data/ui/cli/rpc/client/dispatcher_monitor.rb +157 -0
- data/ui/cli/rpc/client/dispatcher_monitor/option_parser.rb +41 -0
- data/ui/cli/rpc/client/instance.rb +294 -0
- data/ui/cli/rpc/client/local.rb +65 -0
- data/ui/cli/rpc/client/local/option_parser.rb +35 -0
- data/ui/cli/rpc/client/remote.rb +84 -0
- data/ui/cli/rpc/client/remote/option_parser.rb +99 -0
- data/ui/cli/rpc/server/dispatcher.rb +36 -0
- data/ui/cli/rpc/server/dispatcher/option_parser.rb +165 -0
- data/ui/cli/utilities.rb +228 -0
- metadata +1260 -1266
- data/EXPLOITATION.md +0 -431
- data/HACKING.md +0 -120
- data/NOTICE +0 -12
- data/data/crypto/public.pem +0 -9
- data/external/metasploit/LICENSE +0 -24
- data/external/metasploit/plugins/arachni.rb +0 -516
- data/external/metasploit/plugins/arachni/modules/auxiliary/arachni_sqlmap.rb +0 -91
- data/external/metasploit/plugins/arachni/modules/exploits/unix/webapp/arachni_exec.rb +0 -142
- data/external/metasploit/plugins/arachni/modules/exploits/unix/webapp/arachni_path_traversal.rb +0 -113
- data/external/metasploit/plugins/arachni/modules/exploits/unix/webapp/arachni_php_eval.rb +0 -150
- data/external/metasploit/plugins/arachni/modules/exploits/unix/webapp/arachni_php_include.rb +0 -141
- data/fingerprinters/frameworks/rack.rb +0 -41
- data/fingerprinters/languages/asp.rb +0 -42
- data/fingerprinters/languages/aspx.rb +0 -63
- data/fingerprinters/languages/jsp.rb +0 -42
- data/fingerprinters/languages/php.rb +0 -43
- data/fingerprinters/languages/python.rb +0 -40
- data/fingerprinters/languages/ruby.rb +0 -41
- data/fingerprinters/os/bsd.rb +0 -36
- data/fingerprinters/os/linux.rb +0 -42
- data/fingerprinters/os/solaris.rb +0 -41
- data/fingerprinters/os/unix.rb +0 -36
- data/fingerprinters/os/windows.rb +0 -41
- data/fingerprinters/servers/apache.rb +0 -36
- data/fingerprinters/servers/iis.rb +0 -36
- data/fingerprinters/servers/jetty.rb +0 -36
- data/fingerprinters/servers/nginx.rb +0 -36
- data/fingerprinters/servers/tomcat.rb +0 -36
- data/gfx/README.md +0 -18
- data/gfx/compiled/banner.png +0 -0
- data/gfx/compiled/favicon.ico +0 -0
- data/gfx/compiled/icon.png +0 -0
- data/gfx/compiled/logo.png +0 -0
- data/gfx/compiled/spider.png +0 -0
- data/gfx/font/Beneath_the_Surface.ttf +0 -0
- data/gfx/font/bts_readme.txt +0 -14
- data/gfx/source/banner.svg +0 -999
- data/gfx/source/icon.svg +0 -627
- data/gfx/source/logo.svg +0 -672
- data/gfx/source/spider.png +0 -0
- data/gfx/source/spider.svg +0 -277
- data/lib/arachni/audit_store.rb +0 -321
- data/lib/arachni/component/options/enum.rb +0 -51
- data/lib/arachni/element/capabilities/auditable/rdiff.rb +0 -489
- data/lib/arachni/element/capabilities/auditable/taint.rb +0 -238
- data/lib/arachni/element/capabilities/auditable/timeout.rb +0 -469
- data/lib/arachni/mixins/observable.rb +0 -91
- data/lib/arachni/mixins/progress_bar.rb +0 -87
- data/lib/arachni/mixins/terminal.rb +0 -112
- data/lib/arachni/module.rb +0 -20
- data/lib/arachni/module/auditor.rb +0 -618
- data/lib/arachni/module/base.rb +0 -188
- data/lib/arachni/module/manager.rb +0 -255
- data/lib/arachni/module/output.rb +0 -68
- data/lib/arachni/module/utilities.rb +0 -64
- data/lib/arachni/report/base.rb +0 -201
- data/lib/arachni/report/manager.rb +0 -86
- data/lib/arachni/rpc/server/dispatcher/handler.rb +0 -166
- data/lib/arachni/rpc/server/module/manager.rb +0 -46
- data/lib/arachni/rpc/server/spider.rb +0 -404
- data/lib/arachni/ruby/enumerable.rb +0 -29
- data/lib/arachni/spider.rb +0 -477
- data/lib/arachni/support/key_filler.rb +0 -68
- data/lib/arachni/support/queue.rb +0 -18
- data/lib/arachni/support/queue/disk.rb +0 -171
- data/lib/arachni/typhoeus/hydra.rb +0 -56
- data/lib/arachni/typhoeus/request.rb +0 -80
- data/lib/arachni/typhoeus/response.rb +0 -103
- data/lib/arachni/typhoeus/utils.rb +0 -25
- data/lib/arachni/ui/cli/cli.rb +0 -469
- data/lib/arachni/ui/cli/output.rb +0 -391
- data/lib/arachni/ui/cli/rpc/dispatcher_monitor.rb +0 -188
- data/lib/arachni/ui/cli/rpc/instance.rb +0 -407
- data/lib/arachni/ui/cli/rpc/local.rb +0 -80
- data/lib/arachni/ui/cli/rpc/remote.rb +0 -134
- data/lib/arachni/ui/cli/utilities.rb +0 -509
- data/modules/audit/code_injection.rb +0 -137
- data/modules/audit/code_injection_php_input_wrapper.rb +0 -109
- data/modules/audit/code_injection_timing.rb +0 -122
- data/modules/audit/csrf.rb +0 -225
- data/modules/audit/file_inclusion.rb +0 -156
- data/modules/audit/ldapi.rb +0 -97
- data/modules/audit/os_cmd_injection.rb +0 -109
- data/modules/audit/os_cmd_injection_timing.rb +0 -98
- data/modules/audit/path_traversal.rb +0 -170
- data/modules/audit/response_splitting.rb +0 -99
- data/modules/audit/rfi.rb +0 -181
- data/modules/audit/session_fixation.rb +0 -117
- data/modules/audit/source_code_disclosure.rb +0 -179
- data/modules/audit/sqli.rb +0 -148
- data/modules/audit/sqli_blind_rdiff.rb +0 -138
- data/modules/audit/sqli_blind_timing.rb +0 -126
- data/modules/audit/trainer.rb +0 -49
- data/modules/audit/unvalidated_redirect.rb +0 -91
- data/modules/audit/xpath.rb +0 -97
- data/modules/audit/xss.rb +0 -154
- data/modules/audit/xss_event.rb +0 -153
- data/modules/audit/xss_path.rb +0 -152
- data/modules/audit/xss_script_tag.rb +0 -137
- data/modules/audit/xss_tag.rb +0 -137
- data/modules/recon/allowed_methods.rb +0 -99
- data/modules/recon/backdoors.rb +0 -82
- data/modules/recon/backup_files.rb +0 -100
- data/modules/recon/backup_files/extensions.txt +0 -28
- data/modules/recon/common_directories.rb +0 -87
- data/modules/recon/common_files.rb +0 -78
- data/modules/recon/common_files/filenames.txt +0 -21
- data/modules/recon/directory_listing.rb +0 -133
- data/modules/recon/grep/captcha.rb +0 -74
- data/modules/recon/grep/credit_card.rb +0 -128
- data/modules/recon/grep/cvs_svn_users.rb +0 -81
- data/modules/recon/grep/emails.rb +0 -73
- data/modules/recon/grep/form_upload.rb +0 -86
- data/modules/recon/grep/html_objects.rb +0 -56
- data/modules/recon/grep/http_only_cookies.rb +0 -82
- data/modules/recon/grep/insecure_cookies.rb +0 -82
- data/modules/recon/grep/mixed_resource.rb +0 -113
- data/modules/recon/grep/password_autocomplete.rb +0 -85
- data/modules/recon/grep/private_ip.rb +0 -70
- data/modules/recon/grep/ssn.rb +0 -66
- data/modules/recon/grep/unencrypted_password_forms.rb +0 -103
- data/modules/recon/htaccess_limit.rb +0 -76
- data/modules/recon/http_put.rb +0 -95
- data/modules/recon/interesting_responses.rb +0 -91
- data/modules/recon/localstart_asp.rb +0 -97
- data/modules/recon/webdav.rb +0 -106
- data/modules/recon/x_forwarded_for_access_restriction_bypass.rb +0 -76
- data/modules/recon/xst.rb +0 -103
- data/path_extractors/anchors.rb +0 -37
- data/path_extractors/areas.rb +0 -37
- data/path_extractors/forms.rb +0 -37
- data/path_extractors/frames.rb +0 -37
- data/path_extractors/generic.rb +0 -84
- data/path_extractors/links.rb +0 -37
- data/path_extractors/meta_refresh.rb +0 -58
- data/path_extractors/scripts.rb +0 -38
- data/plugins/autologin.rb +0 -133
- data/plugins/beep_notify.rb +0 -49
- data/plugins/content_types.rb +0 -107
- data/plugins/cookie_collector.rb +0 -85
- data/plugins/defaults/autothrottle.rb +0 -78
- data/plugins/defaults/healthmap.rb +0 -89
- data/plugins/defaults/meta/remedies/discovery.rb +0 -138
- data/plugins/defaults/meta/remedies/timing_attacks.rb +0 -117
- data/plugins/defaults/meta/uniformity.rb +0 -82
- data/plugins/defaults/resolver.rb +0 -60
- data/plugins/email_notify.rb +0 -106
- data/plugins/form_dicattack.rb +0 -123
- data/plugins/http_dicattack.rb +0 -108
- data/plugins/libnotify.rb +0 -82
- data/plugins/profiler.rb +0 -179
- data/plugins/proxy.rb +0 -502
- data/plugins/proxy/panel/page_accordion.html.erb +0 -67
- data/plugins/proxy/panel/panel.html.erb +0 -69
- data/plugins/proxy/panel/verify_login_sequence.html.erb +0 -45
- data/plugins/proxy/server.rb +0 -215
- data/plugins/proxy/template_scope.rb +0 -138
- data/plugins/rescan.rb +0 -59
- data/plugins/script.rb +0 -53
- data/plugins/uncommon_headers.rb +0 -92
- data/plugins/vector_feed.rb +0 -226
- data/plugins/waf_detector.rb +0 -167
- data/profiles/full.afp +0 -48
- data/reports/afr.rb +0 -44
- data/reports/ap.rb +0 -46
- data/reports/html.rb +0 -273
- data/reports/html/default.erb +0 -82
- data/reports/html/default/configuration.erb +0 -126
- data/reports/html/default/css/jquery-ui.css +0 -570
- data/reports/html/default/css/jquery.jqplot.min.css +0 -1
- data/reports/html/default/css/main.css +0 -391
- data/reports/html/default/headers.erb +0 -19
- data/reports/html/default/issue.erb +0 -178
- data/reports/html/default/issues.erb +0 -52
- data/reports/html/default/js/charts.js +0 -147
- data/reports/html/default/js/helpers.js +0 -53
- data/reports/html/default/js/init.js +0 -72
- data/reports/html/default/js/lib/jqplot.barRenderer.min.js +0 -57
- data/reports/html/default/js/lib/jqplot.categoryAxisRenderer.min.js +0 -57
- data/reports/html/default/js/lib/jqplot.cursor.min.js +0 -57
- data/reports/html/default/js/lib/jqplot.pieRenderer.min.js +0 -57
- data/reports/html/default/js/lib/jqplot.pointLabels.min.js +0 -57
- data/reports/html/default/js/lib/jquery-ui.min.js +0 -404
- data/reports/html/default/js/lib/jquery.jqplot.min.js +0 -57
- data/reports/html/default/js/lib/jquery.min.js +0 -167
- data/reports/html/default/plugins.erb +0 -22
- data/reports/html/default/search.erb +0 -8
- data/reports/html/default/sitemap.erb +0 -15
- data/reports/html/default/summary.erb +0 -75
- data/reports/html/default/summary_issue.erb +0 -20
- data/reports/json.rb +0 -52
- data/reports/marshal.rb +0 -46
- data/reports/metareport.rb +0 -104
- data/reports/plugin_formatters/html/autologin.rb +0 -45
- data/reports/plugin_formatters/html/content_types.rb +0 -67
- data/reports/plugin_formatters/html/cookie_collector.rb +0 -52
- data/reports/plugin_formatters/html/discovery.rb +0 -45
- data/reports/plugin_formatters/html/form_dicattack.rb +0 -40
- data/reports/plugin_formatters/html/healthmap.rb +0 -60
- data/reports/plugin_formatters/html/http_dicattack.rb +0 -40
- data/reports/plugin_formatters/html/profiler.rb +0 -36
- data/reports/plugin_formatters/html/profiler/template.erb +0 -84
- data/reports/plugin_formatters/html/resolver.rb +0 -55
- data/reports/plugin_formatters/html/timing_attacks.rb +0 -51
- data/reports/plugin_formatters/html/uncommon_headers.rb +0 -47
- data/reports/plugin_formatters/html/uniformity.rb +0 -54
- data/reports/plugin_formatters/html/waf_detector.rb +0 -38
- data/reports/plugin_formatters/stdout/autologin.rb +0 -38
- data/reports/plugin_formatters/stdout/content_types.rb +0 -51
- data/reports/plugin_formatters/stdout/cookie_collector.rb +0 -43
- data/reports/plugin_formatters/stdout/discovery.rb +0 -37
- data/reports/plugin_formatters/stdout/form_dicattack.rb +0 -34
- data/reports/plugin_formatters/stdout/healthmap.rb +0 -49
- data/reports/plugin_formatters/stdout/http_dicattack.rb +0 -34
- data/reports/plugin_formatters/stdout/profiler.rb +0 -66
- data/reports/plugin_formatters/stdout/resolver.rb +0 -29
- data/reports/plugin_formatters/stdout/timing_attacks.rb +0 -37
- data/reports/plugin_formatters/stdout/uncommon_headers.rb +0 -37
- data/reports/plugin_formatters/stdout/uniformity.rb +0 -48
- data/reports/plugin_formatters/stdout/waf_detector.rb +0 -31
- data/reports/plugin_formatters/xml/autologin.rb +0 -41
- data/reports/plugin_formatters/xml/content_types.rb +0 -61
- data/reports/plugin_formatters/xml/cookie_collector.rb +0 -45
- data/reports/plugin_formatters/xml/discovery.rb +0 -38
- data/reports/plugin_formatters/xml/form_dicattack.rb +0 -34
- data/reports/plugin_formatters/xml/healthmap.rb +0 -58
- data/reports/plugin_formatters/xml/http_dicattack.rb +0 -33
- data/reports/plugin_formatters/xml/profiler.rb +0 -80
- data/reports/plugin_formatters/xml/resolver.rb +0 -33
- data/reports/plugin_formatters/xml/timing_attacks.rb +0 -39
- data/reports/plugin_formatters/xml/uncommon_headers.rb +0 -38
- data/reports/plugin_formatters/xml/uniformity.rb +0 -54
- data/reports/plugin_formatters/xml/waf_detector.rb +0 -34
- data/reports/stdout.rb +0 -203
- data/reports/txt.rb +0 -58
- data/reports/xml.rb +0 -176
- data/reports/xml/buffer.rb +0 -97
- data/reports/yaml.rb +0 -46
- data/spec/arachni/audit_store_spec.rb +0 -239
- data/spec/arachni/component/options/enum_spec.rb +0 -51
- data/spec/arachni/element/base_spec.rb +0 -138
- data/spec/arachni/element/capabilities/auditable/rdiff_spec.rb +0 -134
- data/spec/arachni/element/capabilities/auditable/taint_spec.rb +0 -409
- data/spec/arachni/element/capabilities/auditable/timeout_spec.rb +0 -157
- data/spec/arachni/element/capabilities/mutable_spec.rb +0 -284
- data/spec/arachni/http_spec.rb +0 -962
- data/spec/arachni/mixins/observable_spec.rb +0 -75
- data/spec/arachni/mixins/progress_bar_spec.rb +0 -47
- data/spec/arachni/module/auditor_spec.rb +0 -544
- data/spec/arachni/module/manager_spec.rb +0 -150
- data/spec/arachni/module/utilities_spec.rb +0 -30
- data/spec/arachni/report/base_spec.rb +0 -61
- data/spec/arachni/report/manager_spec.rb +0 -82
- data/spec/arachni/rpc/server/dispatcher/handler_spec.rb +0 -102
- data/spec/arachni/rpc/server/framework_hpg_spec.rb +0 -376
- data/spec/arachni/rpc/server/framework_simple_spec.rb +0 -501
- data/spec/arachni/rpc/server/modules/manager_spec.rb +0 -47
- data/spec/arachni/rpc/server/spider_spec.rb +0 -68
- data/spec/arachni/ruby/enumerable_spec.rb +0 -37
- data/spec/arachni/spider_spec.rb +0 -539
- data/spec/arachni/support/cache/base_spec.rb +0 -282
- data/spec/arachni/support/key_filler.rb +0 -60
- data/spec/arachni/support/queue/disk_spec.rb +0 -116
- data/spec/arachni/typhoeus/requrest_spec.rb +0 -58
- data/spec/arachni/typhoeus/response_spec.rb +0 -171
- data/spec/fingerprinters/frameworks/rack_spec.rb +0 -41
- data/spec/fingerprinters/languages/asp_spec.rb +0 -40
- data/spec/fingerprinters/languages/aspx_spec.rb +0 -78
- data/spec/fingerprinters/languages/jsp_spec.rb +0 -58
- data/spec/fingerprinters/languages/php_spec.rb +0 -61
- data/spec/fingerprinters/languages/python_spec.rb +0 -23
- data/spec/fingerprinters/languages/ruby.rb +0 -34
- data/spec/fingerprinters/os/bsd_spec.rb +0 -26
- data/spec/fingerprinters/os/linux_spec.rb +0 -34
- data/spec/fingerprinters/os/solaris_spec.rb +0 -34
- data/spec/fingerprinters/os/unix_spec.rb +0 -26
- data/spec/fingerprinters/os/windows_spec.rb +0 -34
- data/spec/fingerprinters/servers/apache_spec.rb +0 -26
- data/spec/fingerprinters/servers/iis_spec.rb +0 -28
- data/spec/fingerprinters/servers/jetty_spec.rb +0 -28
- data/spec/fingerprinters/servers/nginx_spec.rb +0 -26
- data/spec/fingerprinters/servers/tomcat_spec.rb +0 -28
- data/spec/modules/audit/code_injection_spec.rb +0 -25
- data/spec/modules/audit/code_injection_timing_spec.rb +0 -24
- data/spec/modules/audit/csrf_spec.rb +0 -45
- data/spec/modules/audit/file_inclusion_spec.rb +0 -25
- data/spec/modules/audit/ldapi_spec.rb +0 -19
- data/spec/modules/audit/os_cmd_injection_spec.rb +0 -24
- data/spec/modules/audit/os_cmd_injection_timing_spec.rb +0 -24
- data/spec/modules/audit/path_traversal_spec.rb +0 -23
- data/spec/modules/audit/response_splitting_spec.rb +0 -19
- data/spec/modules/audit/rfi_spec.rb +0 -19
- data/spec/modules/audit/session_fixation_spec.rb +0 -23
- data/spec/modules/audit/source_code_disclosure_spec.rb +0 -24
- data/spec/modules/audit/sqli_blind_rdiff_spec.rb +0 -19
- data/spec/modules/audit/sqli_blind_timing_spec.rb +0 -23
- data/spec/modules/audit/sqli_spec.rb +0 -25
- data/spec/modules/audit/trainer_spec.rb +0 -35
- data/spec/modules/audit/unvalidated_redirect_spec.rb +0 -24
- data/spec/modules/audit/xpath_spec.rb +0 -25
- data/spec/modules/audit/xss_event_spec.rb +0 -19
- data/spec/modules/audit/xss_path_spec.rb +0 -19
- data/spec/modules/audit/xss_script_tag_spec.rb +0 -27
- data/spec/modules/audit/xss_spec.rb +0 -24
- data/spec/modules/audit/xss_tag_spec.rb +0 -19
- data/spec/modules/recon/allowed_methods_spec.rb +0 -19
- data/spec/modules/recon/backdoors_spec.rb +0 -19
- data/spec/modules/recon/backup_files_spec.rb +0 -19
- data/spec/modules/recon/common_directories_spec.rb +0 -19
- data/spec/modules/recon/common_files_spec.rb +0 -19
- data/spec/modules/recon/directory_listing_spec.rb +0 -19
- data/spec/modules/recon/grep/captcha_spec.rb +0 -19
- data/spec/modules/recon/grep/credit_card_spec.rb +0 -19
- data/spec/modules/recon/grep/cvs_svn_users_spec.rb +0 -19
- data/spec/modules/recon/grep/emails_spec.rb +0 -19
- data/spec/modules/recon/grep/form_upload_spec.rb +0 -19
- data/spec/modules/recon/grep/html_objects_spec.rb +0 -19
- data/spec/modules/recon/grep/http_only_cookies_spec.rb +0 -19
- data/spec/modules/recon/grep/insecure_cookies_spec.rb +0 -19
- data/spec/modules/recon/grep/mixed_resource_spec.rb +0 -20
- data/spec/modules/recon/grep/password_autocomplete_spec.rb +0 -19
- data/spec/modules/recon/grep/private_ip_spec.rb +0 -26
- data/spec/modules/recon/grep/ssn_spec.rb +0 -19
- data/spec/modules/recon/grep/unencrypted_password_forms_spec.rb +0 -19
- data/spec/modules/recon/htaccess_limit_spec.rb +0 -19
- data/spec/modules/recon/http_put_spec.rb +0 -19
- data/spec/modules/recon/interesting_responses_spec.rb +0 -30
- data/spec/modules/recon/localstart_asp_spec.rb +0 -19
- data/spec/modules/recon/webdav_spec.rb +0 -19
- data/spec/modules/recon/x_forwarded_for_access_restriction_bypass_spec.rb +0 -19
- data/spec/modules/recon/xst_spec.rb +0 -19
- data/spec/path_extractors/scripts_spec.rb +0 -19
- data/spec/plugins/autologin_spec.rb +0 -94
- data/spec/plugins/autothrottle_spec.rb +0 -45
- data/spec/plugins/content_types_spec.rb +0 -93
- data/spec/plugins/cookie_collector_spec.rb +0 -49
- data/spec/plugins/form_dicattack_spec.rb +0 -60
- data/spec/plugins/healthmap_spec.rb +0 -40
- data/spec/plugins/http_dicattack_spec.rb +0 -40
- data/spec/plugins/meta/remedies/discovery_spec.rb +0 -21
- data/spec/plugins/meta/remedies/timing_attacks_spec.rb +0 -34
- data/spec/plugins/meta/uniformity_spec.rb +0 -83
- data/spec/plugins/profiler_spec.rb +0 -82
- data/spec/plugins/rescan_spec.rb +0 -26
- data/spec/plugins/resolver_spec.rb +0 -16
- data/spec/plugins/script_spec.rb +0 -12
- data/spec/plugins/uncommon_headers_spec.rb +0 -64
- data/spec/plugins/vector_feed_spec.rb +0 -167
- data/spec/plugins/waf_detector_spec.rb +0 -41
- data/spec/reports/afr_spec.rb +0 -13
- data/spec/reports/ap_spec.rb +0 -9
- data/spec/reports/html_spec.rb +0 -13
- data/spec/reports/json_spec.rb +0 -17
- data/spec/reports/marshal_spec.rb +0 -13
- data/spec/reports/stdout_spec.rb +0 -9
- data/spec/reports/txt_spec.rb +0 -8
- data/spec/reports/xml_spec.rb +0 -13
- data/spec/reports/yaml_spec.rb +0 -13
- data/spec/support/fixtures/auditstore.afr +0 -76074
- data/spec/support/fixtures/modules/test.rb +0 -58
- data/spec/support/fixtures/modules/test2.rb +0 -46
- data/spec/support/fixtures/modules/test3.rb +0 -46
- data/spec/support/fixtures/plugins/spider_hook.rb +0 -50
- data/spec/support/fixtures/reports/base_spec/plugin_formatters/with_formatters/foobar.rb +0 -21
- data/spec/support/fixtures/reports/base_spec/with_formatters.rb +0 -23
- data/spec/support/fixtures/reports/base_spec/with_outfile.rb +0 -24
- data/spec/support/fixtures/reports/base_spec/without_outfile.rb +0 -20
- data/spec/support/fixtures/reports/manager_spec/afr.rb +0 -21
- data/spec/support/fixtures/reports/manager_spec/foo.rb +0 -26
- data/spec/support/fixtures/rpcd_handlers/echo.rb +0 -68
- data/spec/support/fixtures/run_mod/body.rb +0 -58
- data/spec/support/fixtures/run_mod/cookies.rb +0 -58
- data/spec/support/fixtures/run_mod/empty.rb +0 -58
- data/spec/support/fixtures/run_mod/flch.rb +0 -63
- data/spec/support/fixtures/run_mod/forms.rb +0 -58
- data/spec/support/fixtures/run_mod/headers.rb +0 -58
- data/spec/support/fixtures/run_mod/links.rb +0 -58
- data/spec/support/fixtures/run_mod/nil.rb +0 -57
- data/spec/support/fixtures/run_mod/path.rb +0 -58
- data/spec/support/fixtures/run_mod/server.rb +0 -58
- data/spec/support/fixtures/taint_module/taint.rb +0 -48
- data/spec/support/fixtures/wait_module/wait.rb +0 -48
- data/spec/support/logs/Dispatcher - 1332-56847.log +0 -9
- data/spec/support/logs/Dispatcher - 1361-63434.log +0 -21
- data/spec/support/logs/Dispatcher - 1545-55308.log +0 -9
- data/spec/support/logs/Dispatcher - 1559-18938.log +0 -19
- data/spec/support/logs/Dispatcher - 1568-25013.log +0 -17
- data/spec/support/logs/Dispatcher - 1577-55689.log +0 -13
- data/spec/support/logs/Dispatcher - 1586-18577.log +0 -9
- data/spec/support/logs/Dispatcher - 1595-49353.log +0 -9
- data/spec/support/logs/Dispatcher - 1604-27831.log +0 -11
- data/spec/support/logs/Dispatcher - 1617-57444.log +0 -11
- data/spec/support/logs/Dispatcher - 1631-28737.log +0 -11
- data/spec/support/logs/Dispatcher - 1644-21815.log +0 -33
- data/spec/support/logs/Dispatcher - 1738-53470.log +0 -21
- data/spec/support/logs/Dispatcher - 1747-64173.log +0 -21
- data/spec/support/logs/Dispatcher - 1756-11866.log +0 -23
- data/spec/support/logs/Dispatcher - 1798-12175.log +0 -19
- data/spec/support/logs/Dispatcher - 1807-22790.log +0 -17
- data/spec/support/logs/Dispatcher - 1816-57823.log +0 -15
- data/spec/support/logs/Dispatcher - 1831-64825.log +0 -11
- data/spec/support/logs/Dispatcher - 1845-27623.log +0 -9
- data/spec/support/logs/Dispatcher - 1854-26066.log +0 -9
- data/spec/support/logs/Dispatcher - 1863-37486.log +0 -9
- data/spec/support/logs/Dispatcher - 1874-22463.log +0 -9
- data/spec/support/logs/Dispatcher - 1883-41263.log +0 -11
- data/spec/support/logs/Dispatcher - 1900-53660.log +0 -9
- data/spec/support/logs/Dispatcher - 1909-44423.log +0 -9
- data/spec/support/logs/Dispatcher - 1921-58931.log +0 -9
- data/spec/support/logs/Dispatcher - 1993-6448.log +0 -63
- data/spec/support/logs/Dispatcher - 2002-19206.log +0 -43
- data/spec/support/logs/Dispatcher - 2011-11852.log +0 -39
- data/spec/support/logs/Dispatcher - 2020-65055.log +0 -34
- data/spec/support/logs/Dispatcher - 2029-48445.log +0 -28
- data/spec/support/logs/Dispatcher - 2038-55271.log +0 -21
- data/spec/support/logs/Dispatcher - 2047-45722.log +0 -13
- data/spec/support/logs/Dispatcher - 2057-48194.log +0 -9
- data/spec/support/logs/Dispatcher - 2189-39843.log +0 -19
- data/spec/support/logs/Dispatcher - 2199-15985.log +0 -21
- data/spec/support/logs/Dispatcher - 2208-22080.log +0 -15
- data/spec/support/logs/Dispatcher - 2221-37690.log +0 -19
- data/spec/support/logs/Dispatcher - 2230-47867.log +0 -21
- data/spec/support/logs/Dispatcher - 2239-27060.log +0 -15
- data/spec/support/logs/Dispatcher - 2358-8967.log +0 -17
- data/spec/support/logs/Dispatcher - 2367-27103.log +0 -21
- data/spec/support/logs/Dispatcher - 2376-16287.log +0 -13
- data/spec/support/logs/Dispatcher - 2389-9109.log +0 -19
- data/spec/support/logs/Dispatcher - 2398-62926.log +0 -21
- data/spec/support/logs/Dispatcher - 2407-48685.log +0 -15
- data/spec/support/logs/Dispatcher - 2459-62480.log +0 -17
- data/spec/support/logs/Dispatcher - 2470-57894.log +0 -21
- data/spec/support/logs/Dispatcher - 2479-51883.log +0 -13
- data/spec/support/logs/Dispatcher - 2493-36944.log +0 -17
- data/spec/support/logs/Dispatcher - 2503-59143.log +0 -21
- data/spec/support/logs/Dispatcher - 2513-33084.log +0 -13
- data/spec/support/logs/Dispatcher - 25430-46306.log +0 -9
- data/spec/support/logs/Dispatcher - 25457-10711.log +0 -23
- data/spec/support/logs/Dispatcher - 25603-48892.log +0 -9
- data/spec/support/logs/Dispatcher - 25613-24775.log +0 -19
- data/spec/support/logs/Dispatcher - 25622-59684.log +0 -17
- data/spec/support/logs/Dispatcher - 25631-23195.log +0 -13
- data/spec/support/logs/Dispatcher - 25640-9810.log +0 -9
- data/spec/support/logs/Dispatcher - 25649-52757.log +0 -9
- data/spec/support/logs/Dispatcher - 25658-58550.log +0 -11
- data/spec/support/logs/Dispatcher - 25671-30871.log +0 -11
- data/spec/support/logs/Dispatcher - 25684-48620.log +0 -11
- data/spec/support/logs/Dispatcher - 25697-18124.log +0 -37
- data/spec/support/logs/Dispatcher - 25762-35321.log +0 -21
- data/spec/support/logs/Dispatcher - 25771-64633.log +0 -21
- data/spec/support/logs/Dispatcher - 25780-43558.log +0 -23
- data/spec/support/logs/Dispatcher - 25821-43561.log +0 -19
- data/spec/support/logs/Dispatcher - 25830-39112.log +0 -17
- data/spec/support/logs/Dispatcher - 25839-44093.log +0 -15
- data/spec/support/logs/Dispatcher - 25852-12057.log +0 -11
- data/spec/support/logs/Dispatcher - 25866-49029.log +0 -9
- data/spec/support/logs/Dispatcher - 25875-32179.log +0 -9
- data/spec/support/logs/Dispatcher - 25884-62703.log +0 -9
- data/spec/support/logs/Dispatcher - 25894-4228.log +0 -9
- data/spec/support/logs/Dispatcher - 25903-6709.log +0 -11
- data/spec/support/logs/Dispatcher - 25917-29651.log +0 -9
- data/spec/support/logs/Dispatcher - 25926-12708.log +0 -9
- data/spec/support/logs/Dispatcher - 25935-54092.log +0 -9
- data/spec/support/logs/Dispatcher - 25990-26756.log +0 -63
- data/spec/support/logs/Dispatcher - 25999-4016.log +0 -43
- data/spec/support/logs/Dispatcher - 26008-52076.log +0 -39
- data/spec/support/logs/Dispatcher - 26017-48497.log +0 -34
- data/spec/support/logs/Dispatcher - 26026-28839.log +0 -28
- data/spec/support/logs/Dispatcher - 26035-54215.log +0 -21
- data/spec/support/logs/Dispatcher - 26044-27216.log +0 -13
- data/spec/support/logs/Dispatcher - 26054-53464.log +0 -9
- data/spec/support/logs/Dispatcher - 26163-65271.log +0 -19
- data/spec/support/logs/Dispatcher - 26173-58105.log +0 -21
- data/spec/support/logs/Dispatcher - 26182-40848.log +0 -15
- data/spec/support/logs/Dispatcher - 26195-2855.log +0 -19
- data/spec/support/logs/Dispatcher - 26204-35297.log +0 -21
- data/spec/support/logs/Dispatcher - 26213-59588.log +0 -15
- data/spec/support/logs/Dispatcher - 26333-40774.log +0 -17
- data/spec/support/logs/Dispatcher - 26342-45541.log +0 -21
- data/spec/support/logs/Dispatcher - 26351-3349.log +0 -13
- data/spec/support/logs/Dispatcher - 26364-37456.log +0 -19
- data/spec/support/logs/Dispatcher - 26373-37340.log +0 -21
- data/spec/support/logs/Dispatcher - 26382-54864.log +0 -15
- data/spec/support/logs/Dispatcher - 26434-3070.log +0 -17
- data/spec/support/logs/Dispatcher - 26448-14295.log +0 -21
- data/spec/support/logs/Dispatcher - 26474-30587.log +0 -13
- data/spec/support/logs/Dispatcher - 26500-32529.log +0 -17
- data/spec/support/logs/Dispatcher - 26509-16952.log +0 -21
- data/spec/support/logs/Dispatcher - 26519-43332.log +0 -13
- data/spec/support/logs/Dispatcher - 26750-61867.log +0 -19
- data/spec/support/logs/Dispatcher - 26759-22532.log +0 -21
- data/spec/support/logs/Dispatcher - 26768-18231.log +0 -15
- data/spec/support/logs/Dispatcher - 26792-41661.log +0 -21
- data/spec/support/logs/Dispatcher - 26801-14384.log +0 -25
- data/spec/support/logs/Dispatcher - 26810-2591.log +0 -15
- data/spec/support/logs/Dispatcher - 26846-14591.log +0 -17
- data/spec/support/logs/Dispatcher - 26855-15708.log +0 -21
- data/spec/support/logs/Dispatcher - 26864-2062.log +0 -13
- data/spec/support/logs/Dispatcher - 26877-14471.log +0 -21
- data/spec/support/logs/Dispatcher - 26886-49795.log +0 -25
- data/spec/support/logs/Dispatcher - 26895-21093.log +0 -15
- data/spec/support/logs/Dispatcher - 26931-30049.log +0 -17
- data/spec/support/logs/Dispatcher - 26940-34273.log +0 -21
- data/spec/support/logs/Dispatcher - 26949-30040.log +0 -13
- data/spec/support/logs/Dispatcher - 26962-8152.log +0 -17
- data/spec/support/logs/Dispatcher - 26971-53062.log +0 -21
- data/spec/support/logs/Dispatcher - 26980-7548.log +0 -13
- data/spec/support/logs/Dispatcher - 2737-20989.log +0 -19
- data/spec/support/logs/Dispatcher - 2746-5423.log +0 -21
- data/spec/support/logs/Dispatcher - 2755-53393.log +0 -15
- data/spec/support/logs/Dispatcher - 27615-41812.log +0 -19
- data/spec/support/logs/Dispatcher - 27624-43683.log +0 -21
- data/spec/support/logs/Dispatcher - 27633-11593.log +0 -15
- data/spec/support/logs/Dispatcher - 27658-12186.log +0 -21
- data/spec/support/logs/Dispatcher - 27667-15575.log +0 -25
- data/spec/support/logs/Dispatcher - 27676-17207.log +0 -15
- data/spec/support/logs/Dispatcher - 27712-2233.log +0 -17
- data/spec/support/logs/Dispatcher - 27721-3842.log +0 -21
- data/spec/support/logs/Dispatcher - 27730-22695.log +0 -13
- data/spec/support/logs/Dispatcher - 27743-8364.log +0 -21
- data/spec/support/logs/Dispatcher - 27752-6140.log +0 -25
- data/spec/support/logs/Dispatcher - 27761-25015.log +0 -15
- data/spec/support/logs/Dispatcher - 27797-9270.log +0 -17
- data/spec/support/logs/Dispatcher - 2780-58168.log +0 -21
- data/spec/support/logs/Dispatcher - 27806-48623.log +0 -21
- data/spec/support/logs/Dispatcher - 27815-58778.log +0 -13
- data/spec/support/logs/Dispatcher - 27828-29742.log +0 -17
- data/spec/support/logs/Dispatcher - 27837-46211.log +0 -21
- data/spec/support/logs/Dispatcher - 27846-16143.log +0 -13
- data/spec/support/logs/Dispatcher - 2789-29375.log +0 -25
- data/spec/support/logs/Dispatcher - 2798-10983.log +0 -15
- data/spec/support/logs/Dispatcher - 2836-2354.log +0 -17
- data/spec/support/logs/Dispatcher - 2845-65341.log +0 -21
- data/spec/support/logs/Dispatcher - 2854-18936.log +0 -13
- data/spec/support/logs/Dispatcher - 2867-51979.log +0 -21
- data/spec/support/logs/Dispatcher - 2876-21086.log +0 -25
- data/spec/support/logs/Dispatcher - 2887-17393.log +0 -15
- data/spec/support/logs/Dispatcher - 2930-37394.log +0 -17
- data/spec/support/logs/Dispatcher - 2943-46737.log +0 -21
- data/spec/support/logs/Dispatcher - 2956-37866.log +0 -13
- data/spec/support/logs/Dispatcher - 2976-21012.log +0 -17
- data/spec/support/logs/Dispatcher - 2990-48082.log +0 -21
- data/spec/support/logs/Dispatcher - 2999-16391.log +0 -13
- data/spec/support/logs/Instance - 2204-45164.error.log +0 -356
- data/spec/support/logs/Instance - 2475-49789.error.log +0 -356
- data/spec/support/logs/Instance - 2509-39450.error.log +0 -455
- data/spec/support/logs/Instance - 2533-5785.error.log +0 -354
- data/spec/support/logs/Instance - 2539-42941.error.log +0 -356
- data/spec/support/logs/Instance - 26178-57631.error.log +0 -324
- data/spec/support/logs/Instance - 26458-60253.error.log +0 -326
- data/spec/support/logs/Instance - 26514-44685.error.log +0 -423
- data/spec/support/logs/Instance - 26538-43093.error.log +0 -322
- data/spec/support/logs/Instance - 26544-52217.error.log +0 -328
- data/spec/support/logs/Instance - 26682-37056.error.log +0 -345
- data/spec/support/logs/Instance - 2669-56818.error.log +0 -354
- data/spec/support/logs/Instance - 27547-3928.error.log +0 -309
- data/spec/support/servers/arachni/element/capabilities/auditable/rdiff.rb +0 -162
- data/spec/support/servers/arachni/element/capabilities/auditable/timeout.rb +0 -34
- data/spec/support/servers/arachni/http.rb +0 -127
- data/spec/support/servers/arachni/http_auth.rb +0 -9
- data/spec/support/servers/arachni/module/auditor.rb +0 -136
- data/spec/support/servers/arachni/rpc/server/framework_simple.rb +0 -30
- data/spec/support/servers/arachni/spider.rb +0 -234
- data/spec/support/servers/arachni/spider_https.rb +0 -58
- data/spec/support/servers/modules/audit/code_injection.rb +0 -139
- data/spec/support/servers/modules/audit/code_injection_timing.rb +0 -110
- data/spec/support/servers/modules/audit/file_inclusion.rb +0 -202
- data/spec/support/servers/modules/audit/ldapi.rb +0 -73
- data/spec/support/servers/modules/audit/os_cmd_injection.rb +0 -140
- data/spec/support/servers/modules/audit/os_cmd_injection_timing.rb +0 -103
- data/spec/support/servers/modules/audit/path_traversal.rb +0 -197
- data/spec/support/servers/modules/audit/response_splitting.rb +0 -114
- data/spec/support/servers/modules/audit/session_fixation.rb +0 -87
- data/spec/support/servers/modules/audit/source_code_disclosure.rb +0 -95
- data/spec/support/servers/modules/audit/sqli.rb +0 -118
- data/spec/support/servers/modules/audit/sqli_blind_timing.rb +0 -121
- data/spec/support/servers/modules/audit/unvalidated_redirect.rb +0 -115
- data/spec/support/servers/modules/audit/xpath.rb +0 -111
- data/spec/support/servers/modules/audit/xss.rb +0 -152
- data/spec/support/servers/modules/audit/xss_event.rb +0 -80
- data/spec/support/servers/modules/audit/xss_script_tag.rb +0 -73
- data/spec/support/servers/modules/module_server.rb +0 -14
- data/spec/support/servers/modules/recon/backdoors.rb +0 -4
- data/spec/support/servers/modules/recon/backup_files.rb +0 -28
- data/spec/support/servers/modules/recon/common_directories.rb +0 -6
- data/spec/support/servers/modules/recon/common_files.rb +0 -6
- data/spec/support/servers/modules/recon/directory_listing.rb +0 -30
- data/spec/support/servers/modules/recon/grep/emails.rb +0 -21
- data/spec/support/servers/modules/recon/grep/insecure_cookies.rb +0 -21
- data/spec/support/servers/modules/recon/grep/mixed_resource.rb +0 -83
- data/spec/support/servers/modules/recon/grep/password_autocomplete.rb +0 -33
- data/spec/support/servers/modules/recon/grep/unencrypted_password_forms.rb +0 -33
- data/spec/support/servers/modules/recon/http_put.rb +0 -7
- data/spec/support/servers/modules/recon/interesting_responses.rb +0 -5
- data/spec/support/servers/modules/recon/webdav.rb +0 -25
- data/spec/support/servers/modules/recon/x_forwarded_for_access_restriction_bypass.rb +0 -16
- data/spec/support/servers/plugins/profiler.rb +0 -82
- data/spec/support/servers/plugins/rescan.rb +0 -31
- data/spec/support/shared/module.rb +0 -162
- data/spec/support/shared/reports.rb +0 -47
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Arachni::Browser::Javascript::TaintTracer::Sink::ExecutionFlow do
|
4
|
+
it_should_behave_like 'sink'
|
5
|
+
|
6
|
+
subject { Factory[:execution_flow] }
|
7
|
+
|
8
|
+
%w(data).each do |m|
|
9
|
+
it { should respond_to m }
|
10
|
+
it { should respond_to "#{m}=" }
|
11
|
+
end
|
12
|
+
|
13
|
+
it "supports #{Arachni::RPC::Serializer}" do
|
14
|
+
subject.should == Arachni::RPC::Serializer.deep_clone( subject )
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '#to_rpc_data' do
|
18
|
+
let(:data) { subject.to_rpc_data }
|
19
|
+
|
20
|
+
%w(data).each do |attribute|
|
21
|
+
it "includes '#{attribute}'" do
|
22
|
+
data[attribute.to_sym].should == subject.send( attribute )
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '.from_rpc_data' do
|
28
|
+
let(:restored) { described_class.from_rpc_data data }
|
29
|
+
let(:data) { Arachni::RPC::Serializer.rpc_data( subject ) }
|
30
|
+
|
31
|
+
%w(data).each do |attribute|
|
32
|
+
it "restores '#{attribute}'" do
|
33
|
+
restored.send( attribute ).should == subject.send( attribute )
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe '#to_h' do
|
39
|
+
it 'returns a hash containing frame data' do
|
40
|
+
subject.to_h.should == Factory[:execution_flow]
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'is aliased to #to_hash' do
|
44
|
+
subject.to_h.should == subject.to_hash
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,1304 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Arachni::Browser::Javascript::TaintTracer do
|
4
|
+
|
5
|
+
before( :all ) do
|
6
|
+
@url = Arachni::Utilities.normalize_url( web_server_url_for( :taint_tracer ) )
|
7
|
+
end
|
8
|
+
|
9
|
+
before( :each ) do
|
10
|
+
@browser = Arachni::Browser.new
|
11
|
+
@javascript = @browser.javascript
|
12
|
+
@browser.load @url
|
13
|
+
@taint_tracer = described_class.new( @javascript )
|
14
|
+
end
|
15
|
+
|
16
|
+
def load_with_taint( path )
|
17
|
+
load "#{path}?taint=#{@javascript.taint}"
|
18
|
+
end
|
19
|
+
|
20
|
+
def load( path )
|
21
|
+
@browser.load "#{@url}#{path}", take_snapshot: false
|
22
|
+
end
|
23
|
+
|
24
|
+
subject { @taint_tracer }
|
25
|
+
let(:taint) { 'my_taint' }
|
26
|
+
|
27
|
+
after( :each ) do
|
28
|
+
@browser.shutdown
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '#initialized' do
|
32
|
+
it 'returns true' do
|
33
|
+
subject.initialized.should be_true
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe '#class' do
|
38
|
+
it "returns #{described_class}" do
|
39
|
+
subject.class.should == described_class
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'is aliased to _token_taint_tracer' do
|
44
|
+
load "debug?input=_#{@javascript.token}_taint_tracer.log_execution_flow_sink()"
|
45
|
+
@browser.watir.form.submit
|
46
|
+
subject.execution_flow_sinks.should be_any
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'is aliased to _tokentainttracer' do
|
50
|
+
load "debug?input=_#{@javascript.token}tainttracer.log_execution_flow_sink()"
|
51
|
+
@browser.watir.form.submit
|
52
|
+
subject.execution_flow_sinks.should be_any
|
53
|
+
end
|
54
|
+
|
55
|
+
describe '#taint=' do
|
56
|
+
it 'sets the taint to be traced' do
|
57
|
+
subject.taint = taint
|
58
|
+
subject.taint.should == taint
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'when tainted data pass through' do
|
62
|
+
before { @javascript.taint = @browser.generate_token }
|
63
|
+
|
64
|
+
context 'user-defined global functions' do
|
65
|
+
it 'logs it' do
|
66
|
+
load_with_taint 'data_trace/user-defined-global-functions'
|
67
|
+
|
68
|
+
sink = subject.data_flow_sinks
|
69
|
+
sink.size.should == 1
|
70
|
+
|
71
|
+
entry = sink[0]
|
72
|
+
entry.object.should == 'DOMWindow'
|
73
|
+
entry.function.name.should == 'process'
|
74
|
+
entry.function.source.should start_with 'function process'
|
75
|
+
entry.function.arguments.should == [
|
76
|
+
{
|
77
|
+
'my_data' => 'blah',
|
78
|
+
'input' => @javascript.taint
|
79
|
+
}
|
80
|
+
]
|
81
|
+
entry.tainted_value.should == @javascript.taint
|
82
|
+
entry.taint.should == @javascript.taint
|
83
|
+
@browser.source.split("\n")[entry.trace[0].line-1].should include 'process('
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
context 'window' do
|
88
|
+
%w(encodeURIComponent decodeURIComponent encodeURI decodeURI).each do |function|
|
89
|
+
context ".#{function}" do
|
90
|
+
it 'logs it' do
|
91
|
+
load_with_taint "data_trace/window.#{function}"
|
92
|
+
|
93
|
+
sink = subject.data_flow_sinks
|
94
|
+
sink.size.should == 1
|
95
|
+
|
96
|
+
entry = sink[0]
|
97
|
+
entry.object.should == 'DOMWindow'
|
98
|
+
entry.function.name.should == function
|
99
|
+
entry.function.source.should start_with "function #{function}"
|
100
|
+
entry.function.arguments.should == [ @javascript.taint ]
|
101
|
+
entry.tainted_value.should == @javascript.taint
|
102
|
+
entry.taint.should == @javascript.taint
|
103
|
+
@browser.source.split("\n")[entry.trace[0].line].should include "#{function}("
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
context 'XMLHttpRequest' do
|
110
|
+
context '.open' do
|
111
|
+
it 'logs it' do
|
112
|
+
load_with_taint 'data_trace/XMLHttpRequest.open'
|
113
|
+
|
114
|
+
sink = subject.data_flow_sinks
|
115
|
+
sink.size.should == 1
|
116
|
+
|
117
|
+
entry = sink[0]
|
118
|
+
entry.object.should == 'XMLHttpRequestPrototype'
|
119
|
+
entry.function.name.should == 'open'
|
120
|
+
entry.function.arguments.should == [
|
121
|
+
'GET', "/?taint=#{@javascript.taint}", true
|
122
|
+
]
|
123
|
+
entry.tainted_value.should == "/?taint=#{@javascript.taint}"
|
124
|
+
entry.taint.should == @javascript.taint
|
125
|
+
|
126
|
+
trace = entry.trace[0]
|
127
|
+
@browser.source.split("\n")[trace.line].should include 'open('
|
128
|
+
trace.url.should == @browser.url
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
context '.send' do
|
133
|
+
it 'logs it' do
|
134
|
+
load_with_taint 'data_trace/XMLHttpRequest.send'
|
135
|
+
|
136
|
+
sink = subject.data_flow_sinks
|
137
|
+
sink.size.should == 1
|
138
|
+
|
139
|
+
entry = sink[0]
|
140
|
+
entry.object.should == 'XMLHttpRequestPrototype'
|
141
|
+
entry.function.name.should == 'send'
|
142
|
+
entry.function.arguments.should == [ "taint=#{@javascript.taint}" ]
|
143
|
+
entry.tainted_value.should == "taint=#{@javascript.taint}"
|
144
|
+
entry.taint.should == @javascript.taint
|
145
|
+
|
146
|
+
trace = entry.trace[0]
|
147
|
+
@browser.source.split("\n")[trace.line].should include 'send('
|
148
|
+
trace.url.should == @browser.url
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
context '.setRequestHeader' do
|
153
|
+
it 'logs it' do
|
154
|
+
load_with_taint 'data_trace/XMLHttpRequest.setRequestHeader'
|
155
|
+
|
156
|
+
sink = subject.data_flow_sinks
|
157
|
+
sink.size.should == 1
|
158
|
+
|
159
|
+
entry = sink[0]
|
160
|
+
entry.object.should == 'XMLHttpRequestPrototype'
|
161
|
+
entry.function.name.should == 'setRequestHeader'
|
162
|
+
entry.function.arguments.should == [ 'X-My-Header', "stuff-#{@javascript.taint}" ]
|
163
|
+
entry.tainted_value.should == "stuff-#{@javascript.taint}"
|
164
|
+
entry.taint.should == @javascript.taint
|
165
|
+
|
166
|
+
trace = entry.trace[0]
|
167
|
+
@browser.source.split("\n")[trace.line].should include 'setRequestHeader('
|
168
|
+
trace.url.should == @browser.url
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
context 'AngularJS' do
|
174
|
+
context '.element' do
|
175
|
+
it 'logs it' do
|
176
|
+
load_with_taint 'data_trace/AngularJS.element'
|
177
|
+
|
178
|
+
sink = subject.data_flow_sinks
|
179
|
+
sink.size.should == 2
|
180
|
+
|
181
|
+
entry = sink[1]
|
182
|
+
entry.object.should == 'angular'
|
183
|
+
entry.function.name.should == 'JQLite'
|
184
|
+
entry.function.arguments.should == ["<div>Stuff #{@javascript.taint}</div>"]
|
185
|
+
entry.tainted_value.should == "<div>Stuff #{@javascript.taint}</div>"
|
186
|
+
entry.taint.should == @javascript.taint
|
187
|
+
|
188
|
+
trace = entry.trace[0]
|
189
|
+
@browser.source.split("\n")[trace.line].should include 'angular.element('
|
190
|
+
trace.url.should == @browser.url
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
context '$http' do
|
195
|
+
context '.delete' do
|
196
|
+
it 'logs it' do
|
197
|
+
load_with_taint 'data_trace/AngularJS/$http.delete'
|
198
|
+
|
199
|
+
sink = subject.data_flow_sinks
|
200
|
+
sink.size.should == 4
|
201
|
+
|
202
|
+
entry = sink[1]
|
203
|
+
entry.object.should == 'angular.$http'
|
204
|
+
entry.function.name.should == 'delete'
|
205
|
+
entry.function.arguments.should == [ "/#{@javascript.taint}" ]
|
206
|
+
entry.tainted_value.should == "/#{@javascript.taint}"
|
207
|
+
entry.taint.should == @javascript.taint
|
208
|
+
entry.trace[0].url.should == @browser.url
|
209
|
+
|
210
|
+
entry = sink[3]
|
211
|
+
entry.object.should == 'XMLHttpRequestPrototype'
|
212
|
+
entry.function.name.should == 'open'
|
213
|
+
entry.function.arguments.should == [
|
214
|
+
'DELETE', "/#{@javascript.taint}", true
|
215
|
+
]
|
216
|
+
entry.tainted_value.should == "/#{@javascript.taint}"
|
217
|
+
entry.taint.should == @javascript.taint
|
218
|
+
entry.trace[0].url.should == "#{@url}angular.js"
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
context '.head' do
|
223
|
+
it 'logs it' do
|
224
|
+
load_with_taint 'data_trace/AngularJS/$http.head'
|
225
|
+
|
226
|
+
sink = subject.data_flow_sinks
|
227
|
+
sink.size.should == 4
|
228
|
+
|
229
|
+
entry = sink[1]
|
230
|
+
entry.object.should == 'angular.$http'
|
231
|
+
entry.function.name.should == 'head'
|
232
|
+
entry.function.arguments.should == [ "/#{@javascript.taint}" ]
|
233
|
+
entry.tainted_value.should == "/#{@javascript.taint}"
|
234
|
+
entry.taint.should == @javascript.taint
|
235
|
+
entry.trace[0].url.should == @browser.url
|
236
|
+
|
237
|
+
entry = sink[3]
|
238
|
+
entry.object.should == 'XMLHttpRequestPrototype'
|
239
|
+
entry.function.name.should == 'open'
|
240
|
+
entry.function.arguments.should == [
|
241
|
+
'HEAD', "/#{@javascript.taint}", true
|
242
|
+
]
|
243
|
+
entry.tainted_value.should == "/#{@javascript.taint}"
|
244
|
+
entry.taint.should == @javascript.taint
|
245
|
+
entry.trace[0].url.should == "#{@url}angular.js"
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
context '.jsonp' do
|
250
|
+
it 'logs it' do
|
251
|
+
load_with_taint 'data_trace/AngularJS/$http.jsonp'
|
252
|
+
|
253
|
+
sink = subject.data_flow_sinks
|
254
|
+
sink.size.should == 3
|
255
|
+
|
256
|
+
entry = sink[1]
|
257
|
+
entry.object.should == 'angular.$http'
|
258
|
+
entry.function.name.should == 'jsonp'
|
259
|
+
entry.function.arguments.should == [ "/jsonp-#{@javascript.taint}" ]
|
260
|
+
entry.tainted_value.should == "/jsonp-#{@javascript.taint}"
|
261
|
+
entry.taint.should == @javascript.taint
|
262
|
+
entry.trace[0].url.should == @browser.url
|
263
|
+
|
264
|
+
entry = sink[2]
|
265
|
+
entry.object.should == 'ElementPrototype'
|
266
|
+
entry.function.name.should == 'setAttribute'
|
267
|
+
entry.function.arguments.should == [
|
268
|
+
'href', "/jsonp-#{@javascript.taint}"
|
269
|
+
]
|
270
|
+
entry.tainted_value.should == "/jsonp-#{@javascript.taint}"
|
271
|
+
entry.taint.should == @javascript.taint
|
272
|
+
entry.trace[0].url.should == "#{@url}angular.js"
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
context '.put' do
|
277
|
+
it 'logs it' do
|
278
|
+
load_with_taint 'data_trace/AngularJS/$http.put'
|
279
|
+
|
280
|
+
sink = subject.data_flow_sinks
|
281
|
+
sink.size.should == 3
|
282
|
+
|
283
|
+
entry = sink[1]
|
284
|
+
entry.object.should == 'angular.$http'
|
285
|
+
entry.function.name.should == 'put'
|
286
|
+
entry.function.arguments.should == [
|
287
|
+
'/', "Stuff #{@javascript.taint}"
|
288
|
+
]
|
289
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
290
|
+
entry.taint.should == @javascript.taint
|
291
|
+
entry.trace[0].url.should == @browser.url
|
292
|
+
|
293
|
+
entry = sink[2]
|
294
|
+
entry.object.should == 'XMLHttpRequestPrototype'
|
295
|
+
entry.function.name.should == 'send'
|
296
|
+
entry.function.arguments.should == [ "Stuff #{@javascript.taint}" ]
|
297
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
298
|
+
entry.taint.should == @javascript.taint
|
299
|
+
entry.trace[0].url.should == "#{@url}angular.js"
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
context '.get' do
|
304
|
+
it 'logs it' do
|
305
|
+
load_with_taint 'data_trace/AngularJS/$http.get'
|
306
|
+
|
307
|
+
sink = subject.data_flow_sinks
|
308
|
+
sink.size.should == 4
|
309
|
+
|
310
|
+
entry = sink[1]
|
311
|
+
entry.object.should == 'angular.$http'
|
312
|
+
entry.function.name.should == 'get'
|
313
|
+
entry.function.arguments.should == [ "/#{@javascript.taint}" ]
|
314
|
+
entry.tainted_value.should == "/#{@javascript.taint}"
|
315
|
+
entry.taint.should == @javascript.taint
|
316
|
+
entry.trace[0].url.should == @browser.url
|
317
|
+
|
318
|
+
entry = sink[3]
|
319
|
+
entry.object.should == 'XMLHttpRequestPrototype'
|
320
|
+
entry.function.name.should == 'open'
|
321
|
+
entry.function.arguments.should == [
|
322
|
+
'GET', "/#{@javascript.taint}", true
|
323
|
+
]
|
324
|
+
entry.tainted_value.should == "/#{@javascript.taint}"
|
325
|
+
entry.taint.should == @javascript.taint
|
326
|
+
entry.trace[0].url.should == "#{@url}angular.js"
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
context '.post' do
|
331
|
+
it 'logs it' do
|
332
|
+
load_with_taint 'data_trace/AngularJS/$http.post'
|
333
|
+
|
334
|
+
sink = subject.data_flow_sinks
|
335
|
+
sink.size.should == 4
|
336
|
+
|
337
|
+
entry = sink[1]
|
338
|
+
entry.object.should == 'angular.$http'
|
339
|
+
entry.function.name.should == 'post'
|
340
|
+
entry.function.arguments.should == [
|
341
|
+
'/', '',
|
342
|
+
{
|
343
|
+
'params' => {
|
344
|
+
'stuff' => "Stuff #{@javascript.taint}"
|
345
|
+
},
|
346
|
+
'method' => 'post',
|
347
|
+
'url' => '/',
|
348
|
+
'data' => ''
|
349
|
+
}
|
350
|
+
]
|
351
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
352
|
+
entry.taint.should == @javascript.taint
|
353
|
+
entry.trace[0].url.should == @browser.url
|
354
|
+
|
355
|
+
entry = sink[3]
|
356
|
+
entry.object.should == 'XMLHttpRequestPrototype'
|
357
|
+
entry.function.name.should == 'open'
|
358
|
+
entry.function.arguments.should == [
|
359
|
+
'POST', "/?stuff=Stuff+#{@javascript.taint}", true
|
360
|
+
]
|
361
|
+
entry.tainted_value.should == "/?stuff=Stuff+#{@javascript.taint}"
|
362
|
+
entry.taint.should == @javascript.taint
|
363
|
+
entry.trace[0].url.should == "#{@url}angular.js"
|
364
|
+
end
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
context 'ngRoute' do
|
369
|
+
context 'template' do
|
370
|
+
it 'logs it' do
|
371
|
+
load_with_taint 'data_trace/AngularJS/ngRoute/'
|
372
|
+
|
373
|
+
sink = subject.data_flow_sinks
|
374
|
+
sink.size.should == 6
|
375
|
+
|
376
|
+
# ngRoute module first schedules an HTTP request to grab
|
377
|
+
# the template from the given 'templateUrl'...
|
378
|
+
entry = sink[4]
|
379
|
+
entry.object.should == 'XMLHttpRequestPrototype'
|
380
|
+
entry.function.name.should == 'open'
|
381
|
+
entry.function.arguments.should == [
|
382
|
+
'GET', "template.html?taint=#{@javascript.taint}", true
|
383
|
+
]
|
384
|
+
entry.tainted_value.should == "template.html?taint=#{@javascript.taint}"
|
385
|
+
entry.taint.should == @javascript.taint
|
386
|
+
entry.trace[0].url.should == "#{@url}angular.js"
|
387
|
+
|
388
|
+
#... and then updates the app with the (tainted) template content.
|
389
|
+
entry = sink[5]
|
390
|
+
entry.object.should == 'angular.element'
|
391
|
+
entry.function.name.should == 'html'
|
392
|
+
entry.function.arguments.should == ["Blah blah blah #{@javascript.taint}\n"]
|
393
|
+
entry.tainted_value.should == "Blah blah blah #{@javascript.taint}\n"
|
394
|
+
entry.taint.should == @javascript.taint
|
395
|
+
entry.trace[0].url.should == "#{@url}angular-route.js"
|
396
|
+
end
|
397
|
+
end
|
398
|
+
end
|
399
|
+
|
400
|
+
context 'jqLite' do
|
401
|
+
context '.html' do
|
402
|
+
it 'logs it' do
|
403
|
+
load_with_taint 'data_trace/AngularJS/jqLite.html'
|
404
|
+
|
405
|
+
sink = subject.data_flow_sinks
|
406
|
+
sink.size.should == 2
|
407
|
+
|
408
|
+
entry = sink[1]
|
409
|
+
entry.object.should == 'angular.element'
|
410
|
+
entry.function.name.should == 'html'
|
411
|
+
entry.function.arguments.should == ["Stuff #{@javascript.taint}"]
|
412
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
413
|
+
entry.taint.should == @javascript.taint
|
414
|
+
|
415
|
+
trace = entry.trace[0]
|
416
|
+
@browser.source.split("\n")[trace.line-1].should include 'html('
|
417
|
+
trace.url.should == @browser.url
|
418
|
+
end
|
419
|
+
end
|
420
|
+
|
421
|
+
context '.text' do
|
422
|
+
it 'logs it' do
|
423
|
+
load_with_taint 'data_trace/AngularJS/jqLite.text'
|
424
|
+
|
425
|
+
sink = subject.data_flow_sinks
|
426
|
+
sink.size.should == 2
|
427
|
+
|
428
|
+
entry = sink[1]
|
429
|
+
entry.object.should == 'angular.element'
|
430
|
+
entry.function.name.should == 'text'
|
431
|
+
entry.function.arguments.should == ["Stuff #{@javascript.taint}"]
|
432
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
433
|
+
entry.taint.should == @javascript.taint
|
434
|
+
|
435
|
+
trace = entry.trace[0]
|
436
|
+
@browser.source.split("\n")[trace.line-1].should include 'text('
|
437
|
+
trace.url.should == @browser.url
|
438
|
+
end
|
439
|
+
end
|
440
|
+
|
441
|
+
context '.append' do
|
442
|
+
it 'logs it' do
|
443
|
+
load_with_taint 'data_trace/AngularJS/jqLite.append'
|
444
|
+
|
445
|
+
sink = subject.data_flow_sinks
|
446
|
+
sink.size.should == 2
|
447
|
+
|
448
|
+
entry = sink[1]
|
449
|
+
entry.object.should == 'angular.element'
|
450
|
+
entry.function.name.should == 'append'
|
451
|
+
entry.function.arguments.should == ["Stuff #{@javascript.taint}"]
|
452
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
453
|
+
entry.taint.should == @javascript.taint
|
454
|
+
|
455
|
+
trace = entry.trace[0]
|
456
|
+
@browser.source.split("\n")[trace.line].should include 'append('
|
457
|
+
trace.url.should == @browser.url
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
461
|
+
context '.prepend' do
|
462
|
+
it 'logs it' do
|
463
|
+
load_with_taint 'data_trace/AngularJS/jqLite.prepend'
|
464
|
+
|
465
|
+
sink = subject.data_flow_sinks
|
466
|
+
sink.size.should == 2
|
467
|
+
|
468
|
+
entry = sink[1]
|
469
|
+
entry.object.should == 'angular.element'
|
470
|
+
entry.function.name.should == 'prepend'
|
471
|
+
entry.function.arguments.should == ["Stuff #{@javascript.taint}"]
|
472
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
473
|
+
entry.taint.should == @javascript.taint
|
474
|
+
|
475
|
+
trace = entry.trace[0]
|
476
|
+
@browser.source.split("\n")[trace.line].should include 'prepend('
|
477
|
+
trace.url.should == @browser.url
|
478
|
+
end
|
479
|
+
end
|
480
|
+
|
481
|
+
context '.prop' do
|
482
|
+
it 'logs it' do
|
483
|
+
load_with_taint 'data_trace/AngularJS/jqLite.prop'
|
484
|
+
|
485
|
+
sink = subject.data_flow_sinks
|
486
|
+
sink.size.should == 2
|
487
|
+
|
488
|
+
entry = sink[1]
|
489
|
+
entry.object.should == 'angular.element'
|
490
|
+
entry.function.name.should == 'prop'
|
491
|
+
entry.function.arguments.should == [ 'stuff', "Stuff #{@javascript.taint}"]
|
492
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
493
|
+
entry.taint.should == @javascript.taint
|
494
|
+
|
495
|
+
trace = entry.trace[0]
|
496
|
+
@browser.source.split("\n")[trace.line].should include 'prop('
|
497
|
+
trace.url.should == @browser.url
|
498
|
+
end
|
499
|
+
end
|
500
|
+
|
501
|
+
context '.replaceWith' do
|
502
|
+
it 'logs it' do
|
503
|
+
load_with_taint 'data_trace/AngularJS/jqLite.replaceWith'
|
504
|
+
|
505
|
+
sink = subject.data_flow_sinks
|
506
|
+
sink.size.should == 2
|
507
|
+
|
508
|
+
entry = sink[1]
|
509
|
+
entry.object.should == 'angular.element'
|
510
|
+
entry.function.name.should == 'replaceWith'
|
511
|
+
entry.function.arguments.should == [ "Stuff #{@javascript.taint}"]
|
512
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
513
|
+
entry.taint.should == @javascript.taint
|
514
|
+
|
515
|
+
trace = entry.trace[0]
|
516
|
+
@browser.source.split("\n")[trace.line-1].should include 'replaceWith('
|
517
|
+
trace.url.should == @browser.url
|
518
|
+
end
|
519
|
+
end
|
520
|
+
|
521
|
+
context '.val' do
|
522
|
+
it 'logs it' do
|
523
|
+
load_with_taint 'data_trace/AngularJS/jqLite.val'
|
524
|
+
|
525
|
+
sink = subject.data_flow_sinks
|
526
|
+
sink.size.should == 2
|
527
|
+
|
528
|
+
entry = sink[1]
|
529
|
+
entry.object.should == 'angular.element'
|
530
|
+
entry.function.name.should == 'val'
|
531
|
+
entry.function.arguments.should == [ "Stuff #{@javascript.taint}"]
|
532
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
533
|
+
entry.taint.should == @javascript.taint
|
534
|
+
|
535
|
+
trace = entry.trace[0]
|
536
|
+
@browser.source.split("\n")[trace.line].should include 'val('
|
537
|
+
trace.url.should == @browser.url
|
538
|
+
end
|
539
|
+
end
|
540
|
+
end
|
541
|
+
end
|
542
|
+
|
543
|
+
context 'jQuery' do
|
544
|
+
context '.ajax' do
|
545
|
+
it 'logs it' do
|
546
|
+
load_with_taint 'data_trace/jQuery.ajax'
|
547
|
+
|
548
|
+
sink = subject.data_flow_sinks
|
549
|
+
sink.size.should == 3
|
550
|
+
|
551
|
+
entry = sink[0]
|
552
|
+
entry.object.should == 'jQuery'
|
553
|
+
entry.function.name.should == 'ajax'
|
554
|
+
entry.function.arguments.should == [
|
555
|
+
{
|
556
|
+
'url' => '/',
|
557
|
+
'data' => {
|
558
|
+
'stuff' => "mystuff #{@javascript.taint}"
|
559
|
+
}
|
560
|
+
}
|
561
|
+
]
|
562
|
+
entry.tainted_value.should == "mystuff #{@javascript.taint}"
|
563
|
+
entry.taint.should == @javascript.taint
|
564
|
+
|
565
|
+
trace = entry.trace[0]
|
566
|
+
@browser.source.split("\n")[trace.line].should include 'ajax('
|
567
|
+
trace.url.should == @browser.url
|
568
|
+
end
|
569
|
+
end
|
570
|
+
|
571
|
+
context '.get' do
|
572
|
+
it 'logs it' do
|
573
|
+
load_with_taint 'data_trace/jQuery.get'
|
574
|
+
|
575
|
+
sink = subject.data_flow_sinks
|
576
|
+
sink.size.should == 4
|
577
|
+
|
578
|
+
entry = sink[0]
|
579
|
+
entry.object.should == 'jQuery'
|
580
|
+
entry.function.name.should == 'get'
|
581
|
+
entry.function.arguments.should == [
|
582
|
+
'/',
|
583
|
+
{ 'stuff' => "mystuff #{@javascript.taint}" }
|
584
|
+
]
|
585
|
+
entry.tainted_value.should == "mystuff #{@javascript.taint}"
|
586
|
+
entry.taint.should == @javascript.taint
|
587
|
+
|
588
|
+
trace = entry.trace[0]
|
589
|
+
@browser.source.split("\n")[trace.line].should include 'get('
|
590
|
+
trace.url.should == @browser.url
|
591
|
+
end
|
592
|
+
end
|
593
|
+
|
594
|
+
context '.post' do
|
595
|
+
it 'logs it' do
|
596
|
+
load_with_taint 'data_trace/jQuery.post'
|
597
|
+
|
598
|
+
sink = subject.data_flow_sinks
|
599
|
+
sink.size.should == 3
|
600
|
+
|
601
|
+
entry = sink[0]
|
602
|
+
entry.object.should == 'jQuery'
|
603
|
+
entry.function.name.should == 'post'
|
604
|
+
entry.function.arguments.should == [ "/#{@javascript.taint}" ]
|
605
|
+
entry.tainted_value.should == "/#{@javascript.taint}"
|
606
|
+
entry.taint.should == @javascript.taint
|
607
|
+
|
608
|
+
trace = entry.trace[0]
|
609
|
+
@browser.source.split("\n")[trace.line].should include 'post('
|
610
|
+
trace.url.should == @browser.url
|
611
|
+
end
|
612
|
+
end
|
613
|
+
|
614
|
+
context '.load' do
|
615
|
+
it 'logs it' do
|
616
|
+
load_with_taint 'data_trace/jQuery.load'
|
617
|
+
|
618
|
+
sink = subject.data_flow_sinks
|
619
|
+
sink.size.should == 3
|
620
|
+
|
621
|
+
entry = sink[0]
|
622
|
+
entry.object.should == 'jQuery'
|
623
|
+
entry.function.name.should == 'load'
|
624
|
+
entry.function.arguments.should == [ "/#{@javascript.taint}" ]
|
625
|
+
entry.tainted_value.should == "/#{@javascript.taint}"
|
626
|
+
entry.taint.should == @javascript.taint
|
627
|
+
|
628
|
+
trace = entry.trace[0]
|
629
|
+
@browser.source.split("\n")[trace.line].should include 'load('
|
630
|
+
trace.url.should == @browser.url
|
631
|
+
end
|
632
|
+
end
|
633
|
+
|
634
|
+
context '.html' do
|
635
|
+
it 'logs it' do
|
636
|
+
load_with_taint 'data_trace/jQuery.html'
|
637
|
+
|
638
|
+
sink = subject.data_flow_sinks
|
639
|
+
sink.size.should == 1
|
640
|
+
|
641
|
+
entry = sink[0]
|
642
|
+
entry.object.should == 'jQuery'
|
643
|
+
entry.function.name.should == 'html'
|
644
|
+
entry.function.arguments.should == ["Stuff #{@javascript.taint}"]
|
645
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
646
|
+
entry.taint.should == @javascript.taint
|
647
|
+
|
648
|
+
trace = entry.trace[0]
|
649
|
+
@browser.source.split("\n")[trace.line-1].should include 'html('
|
650
|
+
trace.url.should == @browser.url
|
651
|
+
end
|
652
|
+
end
|
653
|
+
|
654
|
+
context '.text' do
|
655
|
+
it 'logs it' do
|
656
|
+
load_with_taint 'data_trace/jQuery.text'
|
657
|
+
|
658
|
+
sink = subject.data_flow_sinks
|
659
|
+
sink.size.should == 2
|
660
|
+
|
661
|
+
entry = sink[0]
|
662
|
+
entry.object.should == 'jQuery'
|
663
|
+
entry.function.name.should == 'text'
|
664
|
+
entry.function.arguments.should == ["Stuff #{@javascript.taint}"]
|
665
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
666
|
+
entry.taint.should == @javascript.taint
|
667
|
+
|
668
|
+
trace = entry.trace[0]
|
669
|
+
@browser.source.split("\n")[trace.line-1].should include 'text('
|
670
|
+
trace.url.should == @browser.url
|
671
|
+
end
|
672
|
+
end
|
673
|
+
|
674
|
+
context '.append' do
|
675
|
+
it 'logs it' do
|
676
|
+
load_with_taint 'data_trace/jQuery.append'
|
677
|
+
|
678
|
+
sink = subject.data_flow_sinks
|
679
|
+
sink.size.should == 2
|
680
|
+
|
681
|
+
entry = sink[0]
|
682
|
+
entry.object.should == 'jQuery'
|
683
|
+
entry.function.name.should == 'append'
|
684
|
+
entry.function.arguments.should == ["Stuff #{@javascript.taint}"]
|
685
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
686
|
+
entry.taint.should == @javascript.taint
|
687
|
+
|
688
|
+
trace = entry.trace[0]
|
689
|
+
@browser.source.split("\n")[trace.line].should include 'append('
|
690
|
+
trace.url.should == @browser.url
|
691
|
+
end
|
692
|
+
end
|
693
|
+
|
694
|
+
context '.prepend' do
|
695
|
+
it 'logs it' do
|
696
|
+
load_with_taint 'data_trace/jQuery.prepend'
|
697
|
+
|
698
|
+
sink = subject.data_flow_sinks
|
699
|
+
sink.size.should == 2
|
700
|
+
|
701
|
+
entry = sink[0]
|
702
|
+
entry.object.should == 'jQuery'
|
703
|
+
entry.function.name.should == 'prepend'
|
704
|
+
entry.function.arguments.should == ["Stuff #{@javascript.taint}"]
|
705
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
706
|
+
entry.taint.should == @javascript.taint
|
707
|
+
|
708
|
+
trace = entry.trace[0]
|
709
|
+
@browser.source.split("\n")[trace.line].should include 'prepend('
|
710
|
+
trace.url.should == @browser.url
|
711
|
+
end
|
712
|
+
end
|
713
|
+
|
714
|
+
context '.before' do
|
715
|
+
it 'logs it' do
|
716
|
+
load_with_taint 'data_trace/jQuery.before'
|
717
|
+
|
718
|
+
sink = subject.data_flow_sinks
|
719
|
+
sink.size.should == 2
|
720
|
+
|
721
|
+
entry = sink[0]
|
722
|
+
entry.object.should == 'jQuery'
|
723
|
+
entry.function.name.should == 'before'
|
724
|
+
entry.function.arguments.should == ["Stuff #{@javascript.taint}"]
|
725
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
726
|
+
entry.taint.should == @javascript.taint
|
727
|
+
|
728
|
+
trace = entry.trace[0]
|
729
|
+
@browser.source.split("\n")[trace.line].should include 'before('
|
730
|
+
trace.url.should == @browser.url
|
731
|
+
end
|
732
|
+
end
|
733
|
+
|
734
|
+
context '.prop' do
|
735
|
+
it 'logs it' do
|
736
|
+
load_with_taint 'data_trace/jQuery.prop'
|
737
|
+
|
738
|
+
sink = subject.data_flow_sinks
|
739
|
+
sink.size.should == 1
|
740
|
+
|
741
|
+
entry = sink[0]
|
742
|
+
entry.object.should == 'jQuery'
|
743
|
+
entry.function.name.should == 'prop'
|
744
|
+
entry.function.arguments.should == [ 'stuff', "Stuff #{@javascript.taint}"]
|
745
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
746
|
+
entry.taint.should == @javascript.taint
|
747
|
+
|
748
|
+
trace = entry.trace[0]
|
749
|
+
@browser.source.split("\n")[trace.line].should include 'prop('
|
750
|
+
trace.url.should == @browser.url
|
751
|
+
end
|
752
|
+
end
|
753
|
+
|
754
|
+
context '.replaceWith' do
|
755
|
+
it 'logs it' do
|
756
|
+
load_with_taint 'data_trace/jQuery.replaceWith'
|
757
|
+
|
758
|
+
sink = subject.data_flow_sinks
|
759
|
+
sink.size.should == 2
|
760
|
+
|
761
|
+
entry = sink[0]
|
762
|
+
entry.object.should == 'jQuery'
|
763
|
+
entry.function.name.should == 'replaceWith'
|
764
|
+
entry.function.arguments.should == [ "Stuff #{@javascript.taint}"]
|
765
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
766
|
+
entry.taint.should == @javascript.taint
|
767
|
+
|
768
|
+
trace = entry.trace[0]
|
769
|
+
@browser.source.split("\n")[trace.line-1].should include 'replaceWith('
|
770
|
+
trace.url.should == @browser.url
|
771
|
+
end
|
772
|
+
end
|
773
|
+
|
774
|
+
context '.val' do
|
775
|
+
it 'logs it' do
|
776
|
+
load_with_taint 'data_trace/jQuery.val'
|
777
|
+
|
778
|
+
sink = subject.data_flow_sinks
|
779
|
+
sink.size.should == 1
|
780
|
+
|
781
|
+
entry = sink[0]
|
782
|
+
entry.object.should == 'jQuery'
|
783
|
+
entry.function.name.should == 'val'
|
784
|
+
entry.function.arguments.should == [ "Stuff #{@javascript.taint}"]
|
785
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
786
|
+
entry.taint.should == @javascript.taint
|
787
|
+
|
788
|
+
trace = entry.trace[0]
|
789
|
+
@browser.source.split("\n")[trace.line].should include 'val('
|
790
|
+
trace.url.should == @browser.url
|
791
|
+
end
|
792
|
+
end
|
793
|
+
end
|
794
|
+
|
795
|
+
context 'String' do
|
796
|
+
context '.replace' do
|
797
|
+
it 'logs it' do
|
798
|
+
load_with_taint 'data_trace/String.replace'
|
799
|
+
|
800
|
+
sink = subject.data_flow_sinks
|
801
|
+
sink.size.should == 1
|
802
|
+
|
803
|
+
entry = sink[0]
|
804
|
+
entry.object.should == 'String'
|
805
|
+
entry.function.name.should == 'replace'
|
806
|
+
entry.function.source.should start_with 'function replace'
|
807
|
+
entry.function.arguments.should == [
|
808
|
+
'my', @javascript.taint
|
809
|
+
]
|
810
|
+
entry.tainted_value.should == @javascript.taint
|
811
|
+
entry.taint.should == @javascript.taint
|
812
|
+
|
813
|
+
trace = entry.trace[0]
|
814
|
+
@browser.source.split("\n")[trace.line].should include 'replace('
|
815
|
+
trace.url.should == @browser.url
|
816
|
+
end
|
817
|
+
end
|
818
|
+
|
819
|
+
context '.concat' do
|
820
|
+
it 'logs it' do
|
821
|
+
load_with_taint 'data_trace/String.concat'
|
822
|
+
|
823
|
+
sink = subject.data_flow_sinks
|
824
|
+
sink.size.should == 1
|
825
|
+
|
826
|
+
entry = sink[0]
|
827
|
+
entry.object.should == 'String'
|
828
|
+
entry.function.name.should == 'concat'
|
829
|
+
entry.function.source.should start_with 'function concat'
|
830
|
+
entry.function.arguments.should == [ "stuff #{@javascript.taint}" ]
|
831
|
+
entry.tainted_value.should == "stuff #{@javascript.taint}"
|
832
|
+
entry.taint.should == @javascript.taint
|
833
|
+
|
834
|
+
trace = entry.trace[0]
|
835
|
+
@browser.source.split("\n")[trace.line].should include 'concat('
|
836
|
+
trace.url.should == @browser.url
|
837
|
+
end
|
838
|
+
end
|
839
|
+
end
|
840
|
+
|
841
|
+
context 'HTMLElement' do
|
842
|
+
context '.insertAdjacentHTML' do
|
843
|
+
it 'logs it' do
|
844
|
+
load_with_taint 'data_trace/HTMLElement.insertAdjacentHTML'
|
845
|
+
|
846
|
+
sink = subject.data_flow_sinks
|
847
|
+
sink.size.should == 1
|
848
|
+
|
849
|
+
entry = sink[0]
|
850
|
+
entry.object.should == 'HTMLElementPrototype'
|
851
|
+
entry.function.name.should == 'insertAdjacentHTML'
|
852
|
+
entry.function.source.should start_with 'function insertAdjacentHTML'
|
853
|
+
entry.function.arguments.should == [
|
854
|
+
'AfterBegin', "stuff #{@javascript.taint} more stuff"
|
855
|
+
]
|
856
|
+
entry.tainted_value.should == "stuff #{@javascript.taint} more stuff"
|
857
|
+
entry.taint.should == @javascript.taint
|
858
|
+
|
859
|
+
trace = entry.trace[0]
|
860
|
+
@browser.source.split("\n")[trace.line].should include 'insertAdjacentHTML('
|
861
|
+
trace.url.should == @browser.url
|
862
|
+
end
|
863
|
+
end
|
864
|
+
end
|
865
|
+
|
866
|
+
context 'Element' do
|
867
|
+
context '.setAttribute' do
|
868
|
+
it 'logs it' do
|
869
|
+
load_with_taint 'data_trace/Element.setAttribute'
|
870
|
+
|
871
|
+
sink = subject.data_flow_sinks
|
872
|
+
sink.size.should == 1
|
873
|
+
|
874
|
+
entry = sink[0]
|
875
|
+
entry.object.should == 'ElementPrototype'
|
876
|
+
entry.function.name.should == 'setAttribute'
|
877
|
+
entry.function.source.should start_with 'function setAttribute'
|
878
|
+
entry.function.arguments.should == [
|
879
|
+
'my-attribute', "stuff #{@javascript.taint} more stuff"
|
880
|
+
]
|
881
|
+
entry.tainted_value.should == "stuff #{@javascript.taint} more stuff"
|
882
|
+
entry.taint.should == @javascript.taint
|
883
|
+
|
884
|
+
trace = entry.trace[0]
|
885
|
+
@browser.source.split("\n")[trace.line].should include 'setAttribute('
|
886
|
+
trace.url.should == @browser.url
|
887
|
+
end
|
888
|
+
end
|
889
|
+
end
|
890
|
+
|
891
|
+
context 'Document' do
|
892
|
+
context '.createTextNode' do
|
893
|
+
it 'logs it' do
|
894
|
+
load_with_taint 'data_trace/Document.createTextNode'
|
895
|
+
|
896
|
+
sink = subject.data_flow_sinks
|
897
|
+
sink.size.should == 1
|
898
|
+
|
899
|
+
entry = sink[0]
|
900
|
+
entry.object.should == 'DocumentPrototype'
|
901
|
+
entry.function.name.should == 'createTextNode'
|
902
|
+
entry.function.source.should start_with 'function createTextNode'
|
903
|
+
entry.function.arguments.should == [ "node #{@javascript.taint}" ]
|
904
|
+
entry.tainted_value.should == "node #{@javascript.taint}"
|
905
|
+
entry.taint.should == @javascript.taint
|
906
|
+
|
907
|
+
trace = entry.trace[0]
|
908
|
+
@browser.source.split("\n")[trace.line].should include 'document.createTextNode('
|
909
|
+
trace.url.should == @browser.url
|
910
|
+
end
|
911
|
+
end
|
912
|
+
end
|
913
|
+
|
914
|
+
context 'CharacterData' do
|
915
|
+
context '.insertData' do
|
916
|
+
it 'logs it' do
|
917
|
+
load_with_taint 'data_trace/CharacterData.insertData'
|
918
|
+
|
919
|
+
sink = subject.data_flow_sinks
|
920
|
+
sink.size.should == 1
|
921
|
+
|
922
|
+
entry = sink[0]
|
923
|
+
entry.object.should == 'CharacterDataPrototype'
|
924
|
+
entry.function.name.should == 'insertData'
|
925
|
+
entry.function.source.should start_with 'function insertData'
|
926
|
+
entry.function.arguments.should == [ "Stuff #{@javascript.taint}" ]
|
927
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
928
|
+
entry.taint.should == @javascript.taint
|
929
|
+
|
930
|
+
trace = entry.trace[0]
|
931
|
+
@browser.source.split("\n")[trace.line].should include 'insertData('
|
932
|
+
trace.url.should == @browser.url
|
933
|
+
end
|
934
|
+
end
|
935
|
+
|
936
|
+
context '.appendData' do
|
937
|
+
it 'logs it' do
|
938
|
+
load_with_taint 'data_trace/CharacterData.appendData'
|
939
|
+
|
940
|
+
sink = subject.data_flow_sinks
|
941
|
+
sink.size.should == 1
|
942
|
+
|
943
|
+
entry = sink[0]
|
944
|
+
entry.object.should == 'CharacterDataPrototype'
|
945
|
+
entry.function.name.should == 'appendData'
|
946
|
+
entry.function.source.should start_with 'function appendData'
|
947
|
+
entry.function.arguments.should == [ "Stuff #{@javascript.taint}" ]
|
948
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
949
|
+
entry.taint.should == @javascript.taint
|
950
|
+
|
951
|
+
trace = entry.trace[0]
|
952
|
+
@browser.source.split("\n")[trace.line].should include 'appendData('
|
953
|
+
trace.url.should == @browser.url
|
954
|
+
end
|
955
|
+
end
|
956
|
+
|
957
|
+
context '.replaceData' do
|
958
|
+
it 'logs it' do
|
959
|
+
load_with_taint 'data_trace/CharacterData.replaceData'
|
960
|
+
|
961
|
+
sink = subject.data_flow_sinks
|
962
|
+
sink.size.should == 1
|
963
|
+
|
964
|
+
entry = sink[0]
|
965
|
+
entry.object.should == 'CharacterDataPrototype'
|
966
|
+
entry.function.name.should == 'replaceData'
|
967
|
+
entry.function.source.should start_with 'function replaceData'
|
968
|
+
entry.function.arguments.should == [ 0, 0, "Stuff #{@javascript.taint}" ]
|
969
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
970
|
+
entry.taint.should == @javascript.taint
|
971
|
+
|
972
|
+
trace = entry.trace[0]
|
973
|
+
@browser.source.split("\n")[trace.line].should include 'replaceData('
|
974
|
+
trace.url.should == @browser.url
|
975
|
+
end
|
976
|
+
end
|
977
|
+
end
|
978
|
+
|
979
|
+
context 'Text' do
|
980
|
+
context '.replaceWholeText' do
|
981
|
+
it 'logs it' do
|
982
|
+
load_with_taint 'data_trace/Text.replaceWholeText'
|
983
|
+
|
984
|
+
sink = subject.data_flow_sinks
|
985
|
+
sink.size.should == 1
|
986
|
+
|
987
|
+
entry = sink[0]
|
988
|
+
entry.object.should == 'TextPrototype'
|
989
|
+
entry.function.name.should == 'replaceWholeText'
|
990
|
+
entry.function.source.should start_with 'function replaceWholeText'
|
991
|
+
entry.function.arguments.should == [ "Stuff #{@javascript.taint}" ]
|
992
|
+
entry.tainted_value.should == "Stuff #{@javascript.taint}"
|
993
|
+
entry.taint.should == @javascript.taint
|
994
|
+
|
995
|
+
trace = entry.trace[0]
|
996
|
+
@browser.source.split("\n")[trace.line].should include 'replaceWholeText('
|
997
|
+
trace.url.should == @browser.url
|
998
|
+
end
|
999
|
+
end
|
1000
|
+
end
|
1001
|
+
|
1002
|
+
context 'HTMLDocument' do
|
1003
|
+
context '.write' do
|
1004
|
+
it 'logs it' do
|
1005
|
+
load_with_taint 'data_trace/HTMLDocument.write'
|
1006
|
+
|
1007
|
+
sink = subject.data_flow_sinks
|
1008
|
+
sink.size.should == 1
|
1009
|
+
|
1010
|
+
entry = sink[0]
|
1011
|
+
entry.object.should == 'HTMLDocumentPrototype'
|
1012
|
+
entry.function.name.should == 'write'
|
1013
|
+
entry.function.source.should start_with 'function write'
|
1014
|
+
entry.function.arguments.should == [
|
1015
|
+
"Stuff here blah #{@javascript.taint} more stuff nlahblah..."
|
1016
|
+
]
|
1017
|
+
entry.tainted_value.should ==
|
1018
|
+
"Stuff here blah #{@javascript.taint} more stuff nlahblah..."
|
1019
|
+
entry.taint.should == @javascript.taint
|
1020
|
+
|
1021
|
+
trace = entry.trace[0]
|
1022
|
+
@browser.source.split("\n")[trace.line].should include 'document.write('
|
1023
|
+
trace.url.should == @browser.url
|
1024
|
+
end
|
1025
|
+
end
|
1026
|
+
|
1027
|
+
context '.writeln' do
|
1028
|
+
it 'logs it' do
|
1029
|
+
load_with_taint 'data_trace/HTMLDocument.writeln'
|
1030
|
+
|
1031
|
+
sink = subject.data_flow_sinks
|
1032
|
+
sink.size.should == 1
|
1033
|
+
|
1034
|
+
entry = sink[0]
|
1035
|
+
entry.object.should == 'HTMLDocumentPrototype'
|
1036
|
+
entry.function.name.should == 'writeln'
|
1037
|
+
entry.function.source.should start_with 'function writeln'
|
1038
|
+
entry.function.arguments.should == [
|
1039
|
+
"Stuff here blah #{@javascript.taint} more stuff nlahblah..."
|
1040
|
+
]
|
1041
|
+
entry.tainted_value.should ==
|
1042
|
+
"Stuff here blah #{@javascript.taint} more stuff nlahblah..."
|
1043
|
+
entry.taint.should == @javascript.taint
|
1044
|
+
|
1045
|
+
trace = entry.trace[0]
|
1046
|
+
@browser.source.split("\n")[trace.line].should include 'document.writeln('
|
1047
|
+
trace.url.should == @browser.url
|
1048
|
+
end
|
1049
|
+
end
|
1050
|
+
end
|
1051
|
+
end
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
describe '#taint' do
|
1055
|
+
context 'by default' do
|
1056
|
+
it 'returns nil' do
|
1057
|
+
subject.taint.should be_nil
|
1058
|
+
end
|
1059
|
+
end
|
1060
|
+
end
|
1061
|
+
|
1062
|
+
describe '#enable_debugging=' do
|
1063
|
+
it 'sets the debugging flag' do
|
1064
|
+
subject.enable_debugging = false
|
1065
|
+
subject.enable_debugging.should == false
|
1066
|
+
end
|
1067
|
+
end
|
1068
|
+
|
1069
|
+
describe '#enable_debugging' do
|
1070
|
+
context 'by default' do
|
1071
|
+
it 'returns true' do
|
1072
|
+
subject.enable_debugging.should == true
|
1073
|
+
end
|
1074
|
+
end
|
1075
|
+
end
|
1076
|
+
|
1077
|
+
describe '#execution_flow_sinks' do
|
1078
|
+
it 'returns sink data' do
|
1079
|
+
load "debug?input=#{subject.stub.function(:log_execution_flow_sink)}"
|
1080
|
+
@browser.watir.form.submit
|
1081
|
+
subject.execution_flow_sinks.should be_any
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
context 'by default' do
|
1085
|
+
it 'returns []' do
|
1086
|
+
subject.execution_flow_sinks.should == []
|
1087
|
+
end
|
1088
|
+
end
|
1089
|
+
end
|
1090
|
+
|
1091
|
+
describe '#data_flow_sinks' do
|
1092
|
+
it 'returns sink data' do
|
1093
|
+
load "debug?input=#{subject.stub.function(:log_data_flow_sink, { function: 'blah' })}"
|
1094
|
+
@browser.watir.form.submit
|
1095
|
+
subject.data_flow_sinks.should be_any
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
context 'by default' do
|
1099
|
+
it 'returns []' do
|
1100
|
+
subject.data_flow_sinks.should == []
|
1101
|
+
end
|
1102
|
+
end
|
1103
|
+
end
|
1104
|
+
|
1105
|
+
describe '#flush_data_flow_sinks' do
|
1106
|
+
it 'returns sink data' do
|
1107
|
+
load "debug?input=#{subject.stub.function(:log_data_flow_sink, { function: { name: 'blah' } })}"
|
1108
|
+
@browser.watir.form.submit
|
1109
|
+
sink_data = subject.flush_data_flow_sinks
|
1110
|
+
|
1111
|
+
first_entry = sink_data.first
|
1112
|
+
sink_data.should == [first_entry]
|
1113
|
+
|
1114
|
+
first_entry.function.name.should == 'blah'
|
1115
|
+
first_entry.trace.size.should == 2
|
1116
|
+
|
1117
|
+
first_entry.trace[0].function.name.should == 'onClick'
|
1118
|
+
first_entry.trace[0].function.source.should start_with 'function onClick'
|
1119
|
+
@browser.source.split("\n")[first_entry.trace[0].line].should include 'log_data_flow_sink'
|
1120
|
+
first_entry.trace[0].function.arguments.should == %w(some-arg arguments-arg here-arg)
|
1121
|
+
|
1122
|
+
first_entry.trace[1].function.name.should == 'onsubmit'
|
1123
|
+
first_entry.trace[1].function.source.should start_with 'function onsubmit'
|
1124
|
+
@browser.source.split("\n")[first_entry.trace[1].line].should include 'onsubmit'
|
1125
|
+
first_entry.trace[1].function.arguments.size.should == 1
|
1126
|
+
|
1127
|
+
event = first_entry.trace[1].function.arguments.first
|
1128
|
+
|
1129
|
+
form = "<form id=\"my_form\" onsubmit=\"onClick('some-arg', 'arguments-arg', 'here-arg'); return false;\">\n </form>"
|
1130
|
+
event['target'].should == form
|
1131
|
+
event['srcElement'].should == form
|
1132
|
+
event['type'].should == 'submit'
|
1133
|
+
end
|
1134
|
+
|
1135
|
+
it 'empties the sink' do
|
1136
|
+
load "debug?input=#{subject.stub.function(:log_data_flow_sink, { function: { name: 'blah' } })}"
|
1137
|
+
@browser.watir.form.submit
|
1138
|
+
subject.flush_data_flow_sinks
|
1139
|
+
@javascript.flush_data_flow_sinks.should be_empty
|
1140
|
+
end
|
1141
|
+
end
|
1142
|
+
|
1143
|
+
describe '#flush_execution_flow_sinks' do
|
1144
|
+
it 'returns sink data' do
|
1145
|
+
load "debug?input=#{subject.stub.function(:log_execution_flow_sink, 1)}"
|
1146
|
+
@browser.watir.form.submit
|
1147
|
+
sink_data = subject.flush_execution_flow_sinks
|
1148
|
+
|
1149
|
+
first_entry = sink_data.first
|
1150
|
+
sink_data.should == [first_entry]
|
1151
|
+
|
1152
|
+
first_entry.data.should == [1]
|
1153
|
+
first_entry.trace.size.should == 2
|
1154
|
+
|
1155
|
+
first_entry.trace[0].function.name.should == 'onClick'
|
1156
|
+
first_entry.trace[0].function.source.should start_with 'function onClick'
|
1157
|
+
@browser.source.split("\n")[first_entry.trace[0].line].should include 'log_execution_flow_sink(1)'
|
1158
|
+
first_entry.trace[0].function.arguments.should == %w(some-arg arguments-arg here-arg)
|
1159
|
+
|
1160
|
+
first_entry.trace[1].function.name.should == 'onsubmit'
|
1161
|
+
first_entry.trace[1].function.source.should start_with 'function onsubmit'
|
1162
|
+
@browser.source.split("\n")[first_entry.trace[1].line].should include 'onsubmit'
|
1163
|
+
first_entry.trace[1].function.arguments.size.should == 1
|
1164
|
+
|
1165
|
+
event = first_entry.trace[1].function.arguments.first
|
1166
|
+
|
1167
|
+
form = "<form id=\"my_form\" onsubmit=\"onClick('some-arg', 'arguments-arg', 'here-arg'); return false;\">\n </form>"
|
1168
|
+
event['target'].should == form
|
1169
|
+
event['srcElement'].should == form
|
1170
|
+
event['type'].should == 'submit'
|
1171
|
+
end
|
1172
|
+
|
1173
|
+
it 'empties the sink' do
|
1174
|
+
load "debug?input=#{subject.stub.function(:log_data_flow_sink)}"
|
1175
|
+
@browser.watir.form.submit
|
1176
|
+
subject.flush_execution_flow_sinks
|
1177
|
+
@javascript.flush_execution_flow_sinks.should be_empty
|
1178
|
+
end
|
1179
|
+
end
|
1180
|
+
|
1181
|
+
describe '#log_execution_flow_sink' do
|
1182
|
+
it 'logs a sink' do
|
1183
|
+
load "debug?input=#{subject.stub.function(:log_execution_flow_sink, 1)}"
|
1184
|
+
@browser.watir.form.submit
|
1185
|
+
sink_data = subject.execution_flow_sinks
|
1186
|
+
|
1187
|
+
first_entry = sink_data.first
|
1188
|
+
sink_data.should == [first_entry]
|
1189
|
+
|
1190
|
+
first_entry.data.should == [1]
|
1191
|
+
first_entry.trace.size.should == 2
|
1192
|
+
|
1193
|
+
first_entry.trace[0].function.name.should == 'onClick'
|
1194
|
+
first_entry.trace[0].function.source.should start_with 'function onClick'
|
1195
|
+
@browser.source.split("\n")[first_entry.trace[0].line].should include 'log_execution_flow_sink(1)'
|
1196
|
+
first_entry.trace[0].function.arguments.should == %w(some-arg arguments-arg here-arg)
|
1197
|
+
|
1198
|
+
first_entry.trace[1].function.name.should == 'onsubmit'
|
1199
|
+
first_entry.trace[1].function.source.should start_with 'function onsubmit'
|
1200
|
+
@browser.source.split("\n")[first_entry.trace[1].line].should include 'onsubmit'
|
1201
|
+
first_entry.trace[1].function.arguments.size.should == 1
|
1202
|
+
|
1203
|
+
event = first_entry.trace[1].function.arguments.first
|
1204
|
+
|
1205
|
+
form = "<form id=\"my_form\" onsubmit=\"onClick('some-arg', 'arguments-arg', 'here-arg'); return false;\">\n </form>"
|
1206
|
+
event['target'].should == form
|
1207
|
+
event['srcElement'].should == form
|
1208
|
+
event['type'].should == 'submit'
|
1209
|
+
end
|
1210
|
+
end
|
1211
|
+
|
1212
|
+
describe '#log_data_flow_sink' do
|
1213
|
+
it 'logs a sink' do
|
1214
|
+
load "debug?input=#{subject.stub.function(:log_data_flow_sink, { function: { name: 'blah' } })}"
|
1215
|
+
@browser.watir.form.submit
|
1216
|
+
sink_data = subject.data_flow_sinks
|
1217
|
+
|
1218
|
+
first_entry = sink_data.first
|
1219
|
+
sink_data.should == [first_entry]
|
1220
|
+
|
1221
|
+
first_entry.function.name.should == 'blah'
|
1222
|
+
first_entry.trace.size.should == 2
|
1223
|
+
|
1224
|
+
first_entry.trace[0].function.name.should == 'onClick'
|
1225
|
+
first_entry.trace[0].function.source.should start_with 'function onClick'
|
1226
|
+
@browser.source.split("\n")[first_entry.trace[0].line].should include 'log_data_flow_sink'
|
1227
|
+
first_entry.trace[0].function.arguments.should == %w(some-arg arguments-arg here-arg)
|
1228
|
+
|
1229
|
+
first_entry.trace[1].function.name.should == 'onsubmit'
|
1230
|
+
first_entry.trace[1].function.source.should start_with 'function onsubmit'
|
1231
|
+
@browser.source.split("\n")[first_entry.trace[1].line].should include 'onsubmit'
|
1232
|
+
first_entry.trace[1].function.arguments.size.should == 1
|
1233
|
+
|
1234
|
+
event = first_entry.trace[1].function.arguments.first
|
1235
|
+
|
1236
|
+
form = "<form id=\"my_form\" onsubmit=\"onClick('some-arg', 'arguments-arg', 'here-arg'); return false;\">\n </form>"
|
1237
|
+
event['target'].should == form
|
1238
|
+
event['srcElement'].should == form
|
1239
|
+
event['type'].should == 'submit'
|
1240
|
+
end
|
1241
|
+
end
|
1242
|
+
|
1243
|
+
describe '#debugging_data' do
|
1244
|
+
it 'returns debugging information' do
|
1245
|
+
load "debug?input=#{subject.stub.function(:debug, 1)}"
|
1246
|
+
@browser.watir.form.submit
|
1247
|
+
subject.debugging_data.should be_any
|
1248
|
+
end
|
1249
|
+
|
1250
|
+
context 'by default' do
|
1251
|
+
it 'returns []' do
|
1252
|
+
subject.debugging_data.should == []
|
1253
|
+
end
|
1254
|
+
end
|
1255
|
+
end
|
1256
|
+
|
1257
|
+
describe '#debug' do
|
1258
|
+
context 'when debugging is enabled' do
|
1259
|
+
it 'logs debugging data' do
|
1260
|
+
load "debug?input=#{subject.stub.function(:debug, 1)}"
|
1261
|
+
|
1262
|
+
subject.enable_debugging = true
|
1263
|
+
|
1264
|
+
@browser.watir.form.submit
|
1265
|
+
debugging_data = subject.debugging_data
|
1266
|
+
|
1267
|
+
first_entry = debugging_data.first
|
1268
|
+
debugging_data.should == [first_entry]
|
1269
|
+
|
1270
|
+
first_entry.data.should == [1]
|
1271
|
+
first_entry.trace.size.should == 2
|
1272
|
+
|
1273
|
+
first_entry.trace[0].function.name.should == 'onClick'
|
1274
|
+
first_entry.trace[0].function.source.should start_with 'function onClick'
|
1275
|
+
@browser.source.split("\n")[first_entry.trace[0].line].should include 'debug(1)'
|
1276
|
+
first_entry.trace[0].function.arguments.should == %w(some-arg arguments-arg here-arg)
|
1277
|
+
|
1278
|
+
first_entry.trace[1].function.name.should == 'onsubmit'
|
1279
|
+
first_entry.trace[1].function.source.should start_with 'function onsubmit'
|
1280
|
+
@browser.source.split("\n")[first_entry.trace[1].line].should include 'onClick('
|
1281
|
+
first_entry.trace[1].function.arguments.size.should == 1
|
1282
|
+
|
1283
|
+
event = first_entry.trace[1].function.arguments.first
|
1284
|
+
|
1285
|
+
form = "<form id=\"my_form\" onsubmit=\"onClick('some-arg', 'arguments-arg', 'here-arg'); return false;\">\n </form>"
|
1286
|
+
event['target'].should == form
|
1287
|
+
event['srcElement'].should == form
|
1288
|
+
event['type'].should == 'submit'
|
1289
|
+
end
|
1290
|
+
end
|
1291
|
+
|
1292
|
+
context 'when debugging is disabled' do
|
1293
|
+
it 'does not log anything' do
|
1294
|
+
load "debug?input=#{subject.stub.function(:debug, 1)}"
|
1295
|
+
|
1296
|
+
subject.enable_debugging = false
|
1297
|
+
|
1298
|
+
@browser.watir.form.submit
|
1299
|
+
subject.debugging_data.should be_empty
|
1300
|
+
end
|
1301
|
+
end
|
1302
|
+
end
|
1303
|
+
|
1304
|
+
end
|