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,308 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Arachni::Page::DOM do
|
4
|
+
|
5
|
+
def create_page( options = {} )
|
6
|
+
Arachni::Page.new response: Arachni::HTTP::Response.new(
|
7
|
+
request: Arachni::HTTP::Request.new(
|
8
|
+
url: 'http://a-url.com/',
|
9
|
+
method: :get,
|
10
|
+
headers: {
|
11
|
+
'req-header-name' => 'req header value'
|
12
|
+
}
|
13
|
+
),
|
14
|
+
|
15
|
+
code: 200,
|
16
|
+
url: 'http://a-url.com/?myvar=my%20value',
|
17
|
+
body: options[:body],
|
18
|
+
headers: options[:headers]
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
before( :all ) do
|
23
|
+
@url = Arachni::Utilities.normalize_url( web_server_url_for( :page_dom ) )
|
24
|
+
end
|
25
|
+
|
26
|
+
after( :each ) do
|
27
|
+
Arachni::Options.reset
|
28
|
+
Arachni::Framework.reset
|
29
|
+
@browser.shutdown if @browser
|
30
|
+
@browser = nil
|
31
|
+
end
|
32
|
+
|
33
|
+
let(:browser) { @browser = Arachni::Browser.new }
|
34
|
+
let(:dom) { Factory[:dom] }
|
35
|
+
let(:empty_dom) { create_page.dom }
|
36
|
+
subject { dom }
|
37
|
+
|
38
|
+
it "supports #{Arachni::RPC::Serializer}" do
|
39
|
+
subject.should == Arachni::RPC::Serializer.deep_clone( subject )
|
40
|
+
end
|
41
|
+
|
42
|
+
describe '#to_rpc_data' do
|
43
|
+
let(:data) { subject.to_rpc_data }
|
44
|
+
|
45
|
+
%w(url digest).each do |attribute|
|
46
|
+
it "includes '#{attribute}'" do
|
47
|
+
data[attribute].should == subject.send( attribute )
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
%w(data_flow_sinks execution_flow_sinks).each do |attribute|
|
52
|
+
it "includes '#{attribute}'" do
|
53
|
+
data[attribute].should == subject.send(attribute).map(&:to_rpc_data)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it "includes 'skip_states'" do
|
58
|
+
data['skip_states'].should == subject.skip_states.collection.to_a
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '.from_rpc_data' do
|
63
|
+
let(:restored) { described_class.from_rpc_data data }
|
64
|
+
let(:data) { Arachni::RPC::Serializer.rpc_data( subject ) }
|
65
|
+
|
66
|
+
%w(url transitions digest skip_states data_flow_sinks
|
67
|
+
execution_flow_sinks).each do |attribute|
|
68
|
+
it "restores '#{attribute}'" do
|
69
|
+
restored.send( attribute ).should == subject.send( attribute )
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe '#url' do
|
75
|
+
it 'defaults to the page URL' do
|
76
|
+
dom.url.should == create_page.url
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe '#transitions' do
|
81
|
+
it 'defaults to an empty Array' do
|
82
|
+
empty_dom.transitions.should == []
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe '#playable_transitions' do
|
87
|
+
it 'returns playable transitions' do
|
88
|
+
dom.transitions = [
|
89
|
+
{ :page => :load },
|
90
|
+
{ "http://test.com/" => :request },
|
91
|
+
{ "<body onload='loadStuff();'>" => :onload },
|
92
|
+
{ "http://test.com/ajax" => :request },
|
93
|
+
{ "<a href='javascript:clickMe();'>" => :click },
|
94
|
+
].map { |t| described_class::Transition.new *t.first }
|
95
|
+
|
96
|
+
dom.playable_transitions.should == [
|
97
|
+
{ :page => :load },
|
98
|
+
{ "<body onload='loadStuff();'>" => :onload },
|
99
|
+
{ "<a href='javascript:clickMe();'>" => :click },
|
100
|
+
].map { |t| described_class::Transition.new *t.first }
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
describe '#data_flow_sinks' do
|
105
|
+
it 'defaults to an empty Array' do
|
106
|
+
empty_dom.data_flow_sinks.should == []
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
describe '#data_flow_sinks=' do
|
111
|
+
it 'sets #data_flow_sinks' do
|
112
|
+
sink = [
|
113
|
+
data: ['stuff'],
|
114
|
+
trace: [
|
115
|
+
[
|
116
|
+
function: "function onClick(some, arguments, here) " <<
|
117
|
+
"{\n _16744290dd4cf3a3" <<
|
118
|
+
"d72033b82f11df32f785b50239268efb173c" <<
|
119
|
+
"e9ac269714e5.send_to_sink(1);\n " <<
|
120
|
+
" return false;\n }",
|
121
|
+
arguments: %w(some-arg arguments-arg here-arg)
|
122
|
+
]
|
123
|
+
]
|
124
|
+
]
|
125
|
+
|
126
|
+
dom.data_flow_sinks = sink
|
127
|
+
dom.data_flow_sinks.should == sink
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
describe '#execution_flow_sinks' do
|
132
|
+
it 'defaults to an empty Array' do
|
133
|
+
empty_dom.execution_flow_sinks.should == []
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
describe '#execution_flow_sinks=' do
|
138
|
+
it 'sets #execution_flow_sinks' do
|
139
|
+
sink = [
|
140
|
+
data: ['stuff'],
|
141
|
+
trace: [
|
142
|
+
[
|
143
|
+
function: "function onClick(some, arguments, here) " <<
|
144
|
+
"{\n _16744290dd4cf3a3" <<
|
145
|
+
"d72033b82f11df32f785b50239268efb173c" <<
|
146
|
+
"e9ac269714e5.send_to_sink(1);\n " <<
|
147
|
+
" return false;\n }",
|
148
|
+
arguments: %w(some-arg arguments-arg here-arg)
|
149
|
+
]
|
150
|
+
]
|
151
|
+
]
|
152
|
+
|
153
|
+
dom.execution_flow_sinks = sink
|
154
|
+
dom.execution_flow_sinks.should == sink
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
describe '#transitions=' do
|
159
|
+
it 'sets #transitions' do
|
160
|
+
transitions = [ { element: :stuffed } ]
|
161
|
+
|
162
|
+
dom.transitions = transitions
|
163
|
+
dom.transitions.should == transitions
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
describe '#skip_states=' do
|
168
|
+
it 'sets #skip_states' do
|
169
|
+
skip_states = Arachni::Support::LookUp::HashSet.new.tap { |h| h << 0 }
|
170
|
+
|
171
|
+
dom.skip_states = skip_states
|
172
|
+
dom.skip_states.should == skip_states
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
describe '#depth' do
|
177
|
+
it 'returns the amount of DOM transitions' do
|
178
|
+
dom.transitions = [
|
179
|
+
{ "http://test.com/" => :request },
|
180
|
+
{ :page => :load },
|
181
|
+
{ "<body onload='loadStuff();'>" => :onload },
|
182
|
+
{ "http://test.com/ajax" => :request },
|
183
|
+
{ "<a href='javascript:clickMe();'>" => :click },
|
184
|
+
].map { |t| described_class::Transition.new *t.first }
|
185
|
+
|
186
|
+
dom.depth.should == 3
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
describe '#push_transition' do
|
191
|
+
it 'pushes a state transition' do
|
192
|
+
transitions = [
|
193
|
+
{ element: :stuffed },
|
194
|
+
{ element2: :stuffed2 }
|
195
|
+
].each do |t|
|
196
|
+
empty_dom.push_transition described_class::Transition.new( *t.first )
|
197
|
+
end
|
198
|
+
|
199
|
+
empty_dom.transitions.should == transitions.map { |t| described_class::Transition.new *t.first }
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
describe '#to_hash' do
|
204
|
+
it 'returns a hash with DOM data' do
|
205
|
+
data = {
|
206
|
+
url: 'http://test/dom',
|
207
|
+
skip_states: Arachni::Support::LookUp::HashSet.new.tap { |h| h << 0 },
|
208
|
+
transitions: [
|
209
|
+
{ element: :stuffed },
|
210
|
+
{ element2: :stuffed2 }
|
211
|
+
].map { |t| described_class::Transition.new *t.first },
|
212
|
+
data_flow_sinks: [Factory[:data_flow]],
|
213
|
+
execution_flow_sinks: [Factory[:execution_flow]]
|
214
|
+
}
|
215
|
+
|
216
|
+
empty_dom.url = data[:url]
|
217
|
+
data[:transitions].each do |t|
|
218
|
+
empty_dom.push_transition t
|
219
|
+
end
|
220
|
+
empty_dom.skip_states = data[:skip_states]
|
221
|
+
empty_dom.data_flow_sinks = data[:data_flow_sinks]
|
222
|
+
empty_dom.execution_flow_sinks = data[:execution_flow_sinks]
|
223
|
+
|
224
|
+
empty_dom.to_h.should == {
|
225
|
+
url: data[:url],
|
226
|
+
transitions: data[:transitions].map(&:to_hash),
|
227
|
+
digest: empty_dom.digest,
|
228
|
+
skip_states: data[:skip_states],
|
229
|
+
data_flow_sinks: data[:data_flow_sinks].map(&:to_hash),
|
230
|
+
execution_flow_sinks: data[:execution_flow_sinks].map(&:to_hash)
|
231
|
+
}
|
232
|
+
end
|
233
|
+
it 'is aliased to #to_h' do
|
234
|
+
empty_dom.to_h.should == empty_dom.to_h
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
describe '#hash' do
|
239
|
+
it 'calculates a hash based on #digest' do
|
240
|
+
dom = empty_dom.dup
|
241
|
+
dom.digest = 'stuff'
|
242
|
+
|
243
|
+
dom2 = empty_dom.dup
|
244
|
+
dom2.digest = 'stuff'
|
245
|
+
|
246
|
+
dom.hash.should == dom2.hash
|
247
|
+
|
248
|
+
dom2.digest = 'other stuff'
|
249
|
+
dom.hash.should_not == dom2.hash
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
describe '#restore' do
|
254
|
+
context 'when the state can be restored by #url' do
|
255
|
+
it 'loads the #url' do
|
256
|
+
url = "#{@url}restore/by-url"
|
257
|
+
|
258
|
+
browser.load "#{@url}restore/by-url"
|
259
|
+
pages = browser.explore_and_flush
|
260
|
+
page = pages.last
|
261
|
+
|
262
|
+
page.url.should == url
|
263
|
+
page.dom.url.should == "#{url}#destination"
|
264
|
+
page.body.should include 'final-vector'
|
265
|
+
|
266
|
+
page.dom.transitions.clear
|
267
|
+
page.dom.transitions.should be_empty
|
268
|
+
|
269
|
+
browser.load page
|
270
|
+
browser.source.should include 'final-vector'
|
271
|
+
end
|
272
|
+
end
|
273
|
+
|
274
|
+
context 'when the state cannot be restored by URL' do
|
275
|
+
it 'replays its #transitions' do
|
276
|
+
url = "#{@url}restore/by-transitions"
|
277
|
+
|
278
|
+
browser.load url
|
279
|
+
page = browser.explore_and_flush.last
|
280
|
+
|
281
|
+
page.url.should == url
|
282
|
+
page.dom.url.should == "#{url}#destination"
|
283
|
+
page.body.should include 'final-vector'
|
284
|
+
|
285
|
+
browser.load page
|
286
|
+
browser.source.should include 'final-vector'
|
287
|
+
|
288
|
+
page.dom.transitions.clear
|
289
|
+
page.dom.transitions.should be_empty
|
290
|
+
|
291
|
+
browser.load page
|
292
|
+
browser.source.should_not include 'final-vector'
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
context 'when a transition could not be replayed' do
|
297
|
+
it 'returns nil' do
|
298
|
+
Arachni::Page::DOM::Transition.any_instance.stub(:play){ false }
|
299
|
+
|
300
|
+
browser.load "#{@url}restore/by-transitions"
|
301
|
+
page = browser.explore_and_flush.last
|
302
|
+
|
303
|
+
page.dom.restore( browser ).should be_nil
|
304
|
+
end
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Arachni::Page::Scope do
|
4
|
+
|
5
|
+
before :each do
|
6
|
+
Arachni::Options.reset
|
7
|
+
end
|
8
|
+
|
9
|
+
let(:scope){ Arachni::Options.scope }
|
10
|
+
let(:page) { Factory[:page] }
|
11
|
+
subject { page.scope }
|
12
|
+
|
13
|
+
describe '#out?' do
|
14
|
+
it 'returns false' do
|
15
|
+
subject.out?.should be_false
|
16
|
+
end
|
17
|
+
|
18
|
+
context "when #{Arachni::HTTP::Response::Scope}#out?" do
|
19
|
+
context true do
|
20
|
+
it 'returns true' do
|
21
|
+
# We can't stub #out? because we also override it.
|
22
|
+
Arachni::HTTP::Response::Scope.any_instance.stub(:exclude?) { true }
|
23
|
+
subject.out?.should be_true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context false do
|
28
|
+
it 'returns false' do
|
29
|
+
Arachni::HTTP::Response::Scope.any_instance.stub(:exclude?) { false }
|
30
|
+
subject.out?.should be_false
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'when #dom_depth_limit_reached?' do
|
36
|
+
context true do
|
37
|
+
it 'returns true' do
|
38
|
+
subject.stub(:dom_depth_limit_reached?) { true }
|
39
|
+
subject.out?.should be_true
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
context false do
|
44
|
+
it 'returns false' do
|
45
|
+
subject.stub(:dom_depth_limit_reached?) { false }
|
46
|
+
subject.out?.should be_false
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe '#dom_depth_limit_reached?' do
|
53
|
+
context "when #{Arachni::OptionGroups::Scope}#dom_depth_limit has" do
|
54
|
+
context 'been exceeded' do
|
55
|
+
it 'returns true' do
|
56
|
+
scope.dom_depth_limit = 2
|
57
|
+
page.dom.stub(:depth) { 3 }
|
58
|
+
|
59
|
+
subject.dom_depth_limit_reached?.should be_true
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context 'not been exceeded' do
|
64
|
+
it 'returns false' do
|
65
|
+
scope.dom_depth_limit = 2
|
66
|
+
page.dom.stub(:depth) { 1 }
|
67
|
+
subject.dom_depth_limit_reached?.should be_false
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
context 'not been set' do
|
72
|
+
it 'returns false' do
|
73
|
+
page.dom.stub(:depth) { 3 }
|
74
|
+
subject.dom_depth_limit_reached?.should be_false
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
data/spec/arachni/page_spec.rb
CHANGED
@@ -1,72 +1,512 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Arachni::Page do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
'myvar
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
'header-name' => 'header value'
|
18
|
-
},
|
19
|
-
paths: [
|
20
|
-
'http://a-url.com/path',
|
21
|
-
'http://a-url.com/a/path',
|
22
|
-
'http://a-url.com/another/path/'
|
23
|
-
],
|
24
|
-
links: [],
|
25
|
-
forms: [],
|
26
|
-
cookies: [],
|
27
|
-
headers: [],
|
28
|
-
cookiejar: {
|
29
|
-
'cookiename' => 'cokie value'
|
4
|
+
|
5
|
+
def create_page( options = {} )
|
6
|
+
described_class.new(
|
7
|
+
response: Arachni::HTTP::Response.new(
|
8
|
+
request: Factory[:request],
|
9
|
+
code: 200,
|
10
|
+
url: 'http://a-url.com/?myvar=my%20value',
|
11
|
+
body: options[:body],
|
12
|
+
headers: options[:headers],
|
13
|
+
),
|
14
|
+
dom: {
|
15
|
+
url: 'http://a-url.com/#/stuff?myvar=my%20value',
|
16
|
+
transitions: [ described_class::DOM::Transition.new( :page, :load )]
|
30
17
|
}
|
31
|
-
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
let(:url) { Arachni::Utilities.normalize_url web_server_url_for( :parser ) }
|
22
|
+
let(:response) { Factory[:response] }
|
23
|
+
let(:page) { Factory[:page] }
|
24
|
+
let(:page_with_nonces) { described_class.from_url( url + 'with_nonce' ) }
|
25
|
+
let(:rpc_subject) do
|
26
|
+
page_with_nonces.dom.digest = 'stuff'
|
27
|
+
|
28
|
+
# Load all elements in their caches.
|
29
|
+
page_with_nonces.elements
|
30
|
+
|
31
|
+
page_with_nonces.do_not_audit_elements
|
32
|
+
|
33
|
+
dom = Factory[:dom]
|
34
|
+
page_with_nonces.dom.transitions = dom.transitions
|
35
|
+
page_with_nonces.dom.data_flow_sinks = dom.data_flow_sinks
|
36
|
+
page_with_nonces.dom.execution_flow_sinks = dom.execution_flow_sinks
|
37
|
+
|
38
|
+
# Assign external forms.
|
39
|
+
page_with_nonces.forms = page_with_nonces.forms
|
40
|
+
|
41
|
+
page_with_nonces.update_element_audit_whitelist page_with_nonces.elements.first
|
42
|
+
|
43
|
+
page_with_nonces
|
44
|
+
end
|
45
|
+
let(:data) { subject.to_rpc_data }
|
46
|
+
|
47
|
+
subject { page }
|
48
|
+
|
49
|
+
it "supports #{Arachni::RPC::Serializer}" do
|
50
|
+
page_with_nonces.forms = page_with_nonces.forms
|
51
|
+
page_with_nonces.should == Arachni::RPC::Serializer.deep_clone( page_with_nonces )
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#to_rpc_data' do
|
55
|
+
subject { rpc_subject }
|
56
|
+
|
57
|
+
it "includes 'metadata'" do
|
58
|
+
data['metadata'].should == subject.metadata
|
59
|
+
end
|
60
|
+
|
61
|
+
%w(response dom).each do |attribute|
|
62
|
+
it "includes '#{attribute}'" do
|
63
|
+
data[attribute].should == subject.send( attribute ).to_rpc_data
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
it "includes 'forms'" do
|
68
|
+
data['forms'].should == subject.forms.map(&:to_rpc_data)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "includes 'do_not_audit_elements'" do
|
72
|
+
data['do_not_audit_elements'].should be_true
|
73
|
+
end
|
74
|
+
|
75
|
+
it "includes 'element_audit_whitelist'" do
|
76
|
+
data['element_audit_whitelist'].should == subject.element_audit_whitelist.to_a
|
77
|
+
end
|
78
|
+
|
79
|
+
it "does not include 'cookie_jar'" do
|
80
|
+
data.should_not include 'cookie_jar'
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe '.from_rpc_data' do
|
85
|
+
subject { rpc_subject }
|
86
|
+
let(:restored) { described_class.from_rpc_data data }
|
87
|
+
let(:data) { Arachni::RPC::Serializer.rpc_data( subject ) }
|
88
|
+
|
89
|
+
%w(response dom metadata forms).each do |attribute|
|
90
|
+
it "restores '#{attribute}'" do
|
91
|
+
restored.send( attribute ).should == subject.send( attribute )
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
it "restores #{described_class::DOM}#page" do
|
96
|
+
restored.dom.page.should == subject
|
97
|
+
end
|
98
|
+
|
99
|
+
it "restores 'do_not_audit_elements'" do
|
100
|
+
restored.instance_variable_get(:@do_not_audit_elements).should be_true
|
101
|
+
end
|
102
|
+
|
103
|
+
it "restores 'element_audit_whitelist'" do
|
104
|
+
restored.element_audit_whitelist.should == subject.element_audit_whitelist
|
105
|
+
end
|
106
|
+
|
107
|
+
it 'restores Arachni::Element::Form#node of #forms' do
|
108
|
+
form = subject.forms.last
|
109
|
+
form.node.should be_kind_of Nokogiri::XML::Element
|
110
|
+
form.node.should be_true
|
111
|
+
|
112
|
+
restored.forms.last.node.to_s.should == form.node.to_s
|
113
|
+
end
|
114
|
+
|
115
|
+
it 'restores Arachni::Element::Link#node of #links' do
|
116
|
+
link = subject.links.last
|
117
|
+
link.node.should be_kind_of Nokogiri::XML::Element
|
118
|
+
link.node.should be_true
|
119
|
+
|
120
|
+
restored.links.last.node.to_s.should == link.node.to_s
|
121
|
+
end
|
122
|
+
|
123
|
+
context Arachni::Page::DOM do
|
124
|
+
[:url, :skip_states, :transitions, :data_flow_sinks, :execution_flow_sinks].each do |m|
|
125
|
+
it "restores ##{m}" do
|
126
|
+
# Make sure we're not comparing nils.
|
127
|
+
subject.dom.send( m ).should be_true
|
128
|
+
|
129
|
+
# Make sure we're not comparing empty stuff.
|
130
|
+
if (enumerable = restored.dom.send( m )).is_a? Enumerable
|
131
|
+
enumerable.should be_any
|
132
|
+
end
|
133
|
+
|
134
|
+
restored.dom.send( m ).should == subject.dom.send( m )
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
describe '#initialize' do
|
142
|
+
describe 'option' do
|
143
|
+
describe :response do
|
144
|
+
it 'uses it to populate the page data' do
|
145
|
+
page = described_class.new( response: response )
|
146
|
+
parser = Arachni::Parser.new( response )
|
147
|
+
|
148
|
+
page.url.should == parser.url
|
149
|
+
page.method.should == parser.response.request.method
|
150
|
+
page.response.should == parser.response
|
151
|
+
page.body.should == parser.response.body
|
152
|
+
page.query_vars.should == parser.link_vars
|
153
|
+
page.paths.should == parser.paths
|
154
|
+
page.links.should == parser.links
|
155
|
+
page.forms.should == parser.forms
|
156
|
+
page.cookies.should == parser.cookies_to_be_audited
|
157
|
+
page.headers.should == parser.headers
|
158
|
+
page.cookie_jar.should == parser.cookie_jar
|
159
|
+
page.text?.should == parser.text?
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
describe :parser do
|
164
|
+
it 'uses it to populate the page data' do
|
165
|
+
parser = Arachni::Parser.new( response )
|
166
|
+
page = described_class.new( parser: parser )
|
167
|
+
|
168
|
+
page.url.should == parser.url
|
169
|
+
page.method.should == parser.response.request.method
|
170
|
+
page.response.should == parser.response
|
171
|
+
page.body.should == parser.response.body
|
172
|
+
page.query_vars.should == parser.link_vars
|
173
|
+
page.paths.should == parser.paths
|
174
|
+
page.links.should == parser.links
|
175
|
+
page.forms.should == parser.forms
|
176
|
+
page.cookies.should == parser.cookies_to_be_audited
|
177
|
+
page.headers.should == parser.headers
|
178
|
+
page.cookie_jar.should == parser.cookie_jar
|
179
|
+
page.text?.should == parser.text?
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
describe :dom do
|
184
|
+
it 'uses it to populate the DOM data' do
|
185
|
+
dom = described_class.new(
|
186
|
+
url: 'http://test/',
|
187
|
+
dom: {
|
188
|
+
url: 'http://test/#/stuff',
|
189
|
+
transitions: [
|
190
|
+
page: :load
|
191
|
+
]
|
192
|
+
}
|
193
|
+
).dom
|
194
|
+
|
195
|
+
dom.url.should == 'http://test/#/stuff'
|
196
|
+
dom.transitions.should == [ page: :load ]
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
context 'when called without options' do
|
202
|
+
it 'raises ArgumentError' do
|
203
|
+
expect{ described_class.new }.to raise_error ArgumentError
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
context 'when called with empty options' do
|
208
|
+
it 'raises ArgumentError' do
|
209
|
+
expect{ described_class.new({}) }.to raise_error ArgumentError
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
describe '#element_audit_whitelist' do
|
215
|
+
describe 'by default' do
|
216
|
+
it 'returns an empty Set' do
|
217
|
+
subject.element_audit_whitelist.should be_empty
|
218
|
+
subject.element_audit_whitelist.should be_kind_of Set
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
describe '#performer' do
|
224
|
+
it "returns the #{Arachni::HTTP::Request}#performer" do
|
225
|
+
page.request.stub(:performer){ :stuff }
|
226
|
+
subject.performer.should == :stuff
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
describe '#update_element_audit_whitelist' do
|
231
|
+
context 'when passed a' do
|
232
|
+
context Arachni::Element::Capabilities::Auditable do
|
233
|
+
it 'updates the #element_audit_whitelist' do
|
234
|
+
subject.update_element_audit_whitelist subject.elements.first
|
235
|
+
subject.element_audit_whitelist.should include subject.elements.first.coverage_hash
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
context Integer do
|
240
|
+
it 'updates the #element_audit_whitelist' do
|
241
|
+
subject.update_element_audit_whitelist subject.elements.first.coverage_hash
|
242
|
+
subject.element_audit_whitelist.should include subject.elements.first.coverage_hash
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
context Array do
|
247
|
+
context Arachni::Element::Capabilities::Auditable do
|
248
|
+
it 'updates the #element_audit_whitelist' do
|
249
|
+
subject.update_element_audit_whitelist [subject.elements[0],subject.elements[1]]
|
250
|
+
subject.element_audit_whitelist.should include subject.elements[0].coverage_hash
|
251
|
+
subject.element_audit_whitelist.should include subject.elements[1].coverage_hash
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
context Integer do
|
256
|
+
it 'updates the #element_audit_whitelist' do
|
257
|
+
subject.update_element_audit_whitelist [subject.elements[0].coverage_hash, subject.elements[1].coverage_hash]
|
258
|
+
subject.element_audit_whitelist.should include subject.elements[0].coverage_hash
|
259
|
+
subject.element_audit_whitelist.should include subject.elements[1].coverage_hash
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
describe '#do_not_audit_elements' do
|
267
|
+
it 'forces #audit_element? to always return false' do
|
268
|
+
subject.do_not_audit_elements
|
269
|
+
subject.element_audit_whitelist.should be_empty
|
270
|
+
subject.audit_element?( subject.elements.first ).should be_false
|
32
271
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
272
|
+
subject.update_element_audit_whitelist subject.elements.first
|
273
|
+
subject.audit_element?( subject.elements.first ).should be_false
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
describe '#audit_element?' do
|
278
|
+
context 'when there is no #element_audit_whitelist' do
|
279
|
+
it 'returns true' do
|
280
|
+
subject.element_audit_whitelist.should be_empty
|
281
|
+
subject.audit_element?( subject.elements.first ).should be_true
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
285
|
+
context 'when there is an #element_audit_whitelist' do
|
286
|
+
context 'and the element is in it' do
|
287
|
+
context 'represented by' do
|
288
|
+
context Integer do
|
289
|
+
it 'returns true' do
|
290
|
+
subject.update_element_audit_whitelist subject.elements.first
|
291
|
+
subject.audit_element?( subject.elements.first.coverage_hash ).should be_true
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
context Arachni::Element::Capabilities::Auditable do
|
296
|
+
it 'returns true' do
|
297
|
+
subject.update_element_audit_whitelist subject.elements.first
|
298
|
+
subject.audit_element?( subject.elements.first ).should be_true
|
299
|
+
end
|
300
|
+
end
|
301
|
+
end
|
302
|
+
end
|
303
|
+
context 'and the element is not in it' do
|
304
|
+
context 'represented by' do
|
305
|
+
context Integer do
|
306
|
+
it 'returns false' do
|
307
|
+
subject.update_element_audit_whitelist subject.elements.first
|
308
|
+
subject.audit_element?( subject.elements.last.coverage_hash ).should be_false
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
context Arachni::Element::Capabilities::Auditable do
|
313
|
+
it 'returns false' do
|
314
|
+
subject.update_element_audit_whitelist subject.elements.first
|
315
|
+
subject.audit_element?( subject.elements.last ).should be_false
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
38
322
|
|
39
|
-
|
40
|
-
|
323
|
+
describe '#response' do
|
324
|
+
it 'returns the HTTP response for that page' do
|
325
|
+
page.response.should == response
|
326
|
+
end
|
327
|
+
end
|
328
|
+
|
329
|
+
describe '#request' do
|
330
|
+
it 'returns the HTTP request for that page' do
|
331
|
+
page.request.should == response.request
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
describe '#body=' do
|
336
|
+
it 'sets the #body' do
|
337
|
+
subject.body = 'stuff'
|
338
|
+
subject.body.should == 'stuff'
|
339
|
+
end
|
340
|
+
it 'sets the applicable #parser body' do
|
341
|
+
subject.body = 'stuff'
|
342
|
+
subject.parser.body.should == 'stuff'
|
343
|
+
end
|
344
|
+
it 'calls #clear_cache' do
|
345
|
+
subject.should receive(:clear_cache)
|
346
|
+
subject.body = 'stuff'
|
347
|
+
end
|
348
|
+
it 'resets the #has_script? flag' do
|
349
|
+
page = create_page(
|
350
|
+
body: 'stuff',
|
351
|
+
headers: { 'content-type' => 'text/html' }
|
352
|
+
)
|
353
|
+
|
354
|
+
page.has_script?.should be_false
|
355
|
+
page.body = '<script></script>'
|
356
|
+
page.has_script?.should be_true
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
describe '#parser' do
|
361
|
+
it 'is lazy-loaded' do
|
362
|
+
subject.cache[:parser].should be_nil
|
363
|
+
subject.parser.should be_kind_of Arachni::Parser
|
364
|
+
subject.cache[:parser].should == subject.parser
|
365
|
+
end
|
366
|
+
|
367
|
+
it 'is cached' do
|
368
|
+
s = subject.dup
|
369
|
+
|
370
|
+
s.parser
|
371
|
+
Arachni::Parser.should_not receive(:new)
|
372
|
+
s.parser
|
373
|
+
end
|
374
|
+
|
375
|
+
it 'uses the Page#body instead of HTTP::Response#body' do
|
376
|
+
page = described_class.new(
|
377
|
+
response: response.tap { |r| r.body = 'blah'},
|
378
|
+
body: 'stuff'
|
379
|
+
)
|
380
|
+
page.body.should == 'stuff'
|
381
|
+
page.parser.body.should == page.body
|
382
|
+
|
383
|
+
page.body = 'stuff2'
|
384
|
+
page.parser.body.should == page.body
|
385
|
+
end
|
386
|
+
end
|
387
|
+
|
388
|
+
[:links, :forms, :cookies, :headers].each do |element|
|
389
|
+
parser_method = element
|
390
|
+
parser_method = :cookies_to_be_audited if element == :cookies
|
391
|
+
|
392
|
+
describe "##{element}" do
|
393
|
+
it 'sets the correct #page association' do
|
394
|
+
subject.send(element).each { |e| e.page.should == subject }
|
395
|
+
end
|
396
|
+
|
397
|
+
it 'is lazy-loaded' do
|
398
|
+
subject.cache[element].should be_nil
|
399
|
+
subject.send(element).should be_any
|
400
|
+
subject.cache[element].should == subject.send(element)
|
401
|
+
end
|
402
|
+
|
403
|
+
it 'delegates to Parser' do
|
404
|
+
s = subject.dup
|
405
|
+
s.parser.should receive(parser_method).and_return([])
|
406
|
+
s.send(element)
|
407
|
+
end
|
408
|
+
|
409
|
+
it 'is cached' do
|
410
|
+
s = subject.dup
|
411
|
+
|
412
|
+
s.send(element)
|
413
|
+
s.parser.should_not receive(parser_method)
|
414
|
+
s.send(element)
|
415
|
+
end
|
416
|
+
|
417
|
+
it 'is frozen' do
|
418
|
+
subject.send(element).should be_frozen
|
419
|
+
end
|
420
|
+
end
|
421
|
+
|
422
|
+
describe "##{element}=" do
|
423
|
+
element_klass = Arachni::Element.const_get( element.to_s[0...-1].capitalize )
|
424
|
+
let(:klass) { element_klass }
|
425
|
+
let(:list) { [element_klass.new( url: subject.url, inputs: { test: 1 } )] }
|
426
|
+
|
427
|
+
it "sets the page ##{element}" do
|
428
|
+
subject.send(element).should be_any
|
429
|
+
subject.send("#{element}=", [])
|
430
|
+
subject.send(element).should be_empty
|
431
|
+
subject.send("#{element}=", list)
|
432
|
+
subject.send(element).should == list
|
433
|
+
end
|
434
|
+
|
435
|
+
it 'caches it' do
|
436
|
+
subject.cache[element].should be_nil
|
437
|
+
subject.send("#{element}=", list)
|
438
|
+
subject.cache[element].should == list
|
439
|
+
end
|
440
|
+
|
441
|
+
it "sets the #page association on the #{element_klass} elements" do
|
442
|
+
subject.send( "#{element}=", list )
|
443
|
+
subject.send(element).first.page.should == subject
|
444
|
+
end
|
445
|
+
|
446
|
+
it 'freezes the list' do
|
447
|
+
subject.send(element).should be_frozen
|
448
|
+
end
|
449
|
+
end
|
41
450
|
end
|
42
451
|
|
43
452
|
describe '#platforms' do
|
44
453
|
it 'returns platforms for the given page' do
|
45
|
-
|
454
|
+
page.platforms.should be_kind_of Arachni::Platform::Manager
|
455
|
+
end
|
456
|
+
end
|
457
|
+
|
458
|
+
describe '#has_script?' do
|
459
|
+
context 'when the page has' do
|
460
|
+
context '<script>' do
|
461
|
+
it 'returns true' do
|
462
|
+
create_page(
|
463
|
+
body: '<Script>var i = '';</script>',
|
464
|
+
headers: { 'content-type' => 'text/html' }
|
465
|
+
).has_script?.should be_true
|
466
|
+
end
|
467
|
+
end
|
468
|
+
context 'elements with event attributes' do
|
469
|
+
it 'returns true' do
|
470
|
+
create_page(
|
471
|
+
body: '<a onmouseover="doStuff();">Stuff</a>',
|
472
|
+
headers: { 'content-type' => 'text/html' }
|
473
|
+
).has_script?.should be_true
|
474
|
+
end
|
475
|
+
end
|
476
|
+
context 'anchors with javacript: in href' do
|
477
|
+
it 'returns true' do
|
478
|
+
create_page(
|
479
|
+
body: '<a href="javascript:doStuff();">Stuff</a>',
|
480
|
+
headers: { 'content-type' => 'text/html' }
|
481
|
+
).has_script?.should be_true
|
482
|
+
end
|
483
|
+
end
|
484
|
+
context 'forms with javacript: in action' do
|
485
|
+
it 'returns true' do
|
486
|
+
create_page(
|
487
|
+
body: '<form action="javascript:doStuff();"></form>',
|
488
|
+
headers: { 'content-type' => 'text/html' }
|
489
|
+
).has_script?.should be_true
|
490
|
+
end
|
491
|
+
end
|
492
|
+
context 'no client-side code' do
|
493
|
+
it 'returns false' do
|
494
|
+
create_page( body: 'stuff' ).has_script?.should be_false
|
495
|
+
end
|
496
|
+
end
|
46
497
|
end
|
47
498
|
end
|
48
499
|
|
49
500
|
describe '#text?' do
|
50
|
-
context 'when the HTTP response
|
501
|
+
context 'when the HTTP response is text/html' do
|
51
502
|
it 'returns true' do
|
52
|
-
|
53
|
-
effective_url: 'http://test.com',
|
54
|
-
body: '',
|
55
|
-
request: Typhoeus::Request.new( 'http://test.com' ),
|
56
|
-
headers_hash: {
|
57
|
-
'Content-Type' => 'text/html',
|
58
|
-
'Set-Cookie' => 'cname=cval'
|
59
|
-
}
|
60
|
-
)
|
61
|
-
Arachni::Parser.new( res, @opts ).page.text?.should be_true
|
503
|
+
Arachni::Parser.new( Factory[:html_response] ).page.text?.should be_true
|
62
504
|
end
|
63
505
|
end
|
64
506
|
|
65
507
|
context 'when the response is not text based' do
|
66
508
|
it 'returns false' do
|
67
|
-
|
68
|
-
request: Typhoeus::Request.new( 'http://test.com' ), )
|
69
|
-
Arachni::Parser.new( res, @opts ).page.text?.should be_false
|
509
|
+
Arachni::Parser.new( Factory[:binary_response] ).page.text?.should be_false
|
70
510
|
end
|
71
511
|
end
|
72
512
|
end
|
@@ -74,56 +514,49 @@ describe Arachni::Page do
|
|
74
514
|
describe '#==' do
|
75
515
|
context 'when the pages are different' do
|
76
516
|
it 'returns false' do
|
77
|
-
p =
|
78
|
-
p.links
|
79
|
-
p.forms
|
80
|
-
p.cookies
|
81
|
-
p.
|
517
|
+
p = create_page( body: 'stuff here' )
|
518
|
+
p.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
519
|
+
p.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
520
|
+
p.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
521
|
+
p.dom.push_transition described_class::DOM::Transition.new( "<a href='#' id='stuff'>", :onclick )
|
82
522
|
|
83
523
|
c = p.dup
|
84
|
-
c.
|
524
|
+
c.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
85
525
|
c.should_not == p
|
86
526
|
|
87
527
|
c = p.dup
|
88
|
-
c.
|
528
|
+
c.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
89
529
|
c.should_not == p
|
90
530
|
|
91
531
|
c = p.dup
|
92
|
-
c.
|
532
|
+
c.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
93
533
|
c.should_not == p
|
94
534
|
|
95
535
|
c = p.dup
|
96
|
-
c.
|
97
|
-
c.should_not == p
|
98
|
-
|
99
|
-
c = p.dup
|
100
|
-
c.headers << Arachni::Element::Header.new( 'http://test.com', 'test' => 'stuff2' )
|
536
|
+
c.dom.push_transition described_class::DOM::Transition.new( "<a href='#' id='stuff'>", :onhover )
|
101
537
|
c.should_not == p
|
102
538
|
end
|
103
539
|
end
|
104
540
|
context 'when the pages are identical' do
|
105
541
|
it 'returns true' do
|
106
|
-
p =
|
107
|
-
p.links
|
108
|
-
p.forms
|
109
|
-
p.cookies
|
110
|
-
p.headers << Arachni::Element::Header.new( 'http://test.com', 'test' => 'stuff' )
|
542
|
+
p = create_page( body: 'stuff here')
|
543
|
+
p.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
544
|
+
p.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
545
|
+
p.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
111
546
|
|
112
547
|
c = p.dup
|
113
548
|
c.should == p
|
114
549
|
|
115
|
-
|
116
|
-
p.
|
117
|
-
p.
|
118
|
-
p.
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
c.
|
123
|
-
c.
|
124
|
-
|
125
|
-
c.cookies << Arachni::Element::Cookie.new( 'http://test.com', 'test' => 'stuff2' )
|
126
|
-
c.headers << Arachni::Element::Header.new( 'http://test.com', 'test' => 'stuff2' )
|
550
|
+
p.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
551
|
+
p.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
552
|
+
p.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
553
|
+
p.dom.push_transition described_class::DOM::Transition.new( "<a href='#' id='stuff'>", :onhover )
|
554
|
+
|
555
|
+
c.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
556
|
+
c.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
557
|
+
c.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
558
|
+
c.dom.push_transition described_class::DOM::Transition.new( "<a href='#' id='stuff'>", :onhover )
|
559
|
+
|
127
560
|
c.should == p
|
128
561
|
end
|
129
562
|
end
|
@@ -132,56 +565,42 @@ describe Arachni::Page do
|
|
132
565
|
describe '#eql?' do
|
133
566
|
context 'when the pages are different' do
|
134
567
|
it 'returns false' do
|
135
|
-
p =
|
136
|
-
p.links
|
137
|
-
p.forms
|
138
|
-
p.cookies
|
139
|
-
p.headers << Arachni::Element::Header.new( 'http://test.com', 'test' => 'stuff' )
|
568
|
+
p = create_page( body: 'stuff here')
|
569
|
+
p.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
570
|
+
p.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
571
|
+
p.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
140
572
|
|
141
573
|
c = p.dup
|
142
|
-
c.
|
574
|
+
c.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
143
575
|
c.should_not eql p
|
144
576
|
|
145
577
|
c = p.dup
|
146
|
-
c.
|
578
|
+
c.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
147
579
|
c.should_not eql p
|
148
580
|
|
149
581
|
c = p.dup
|
150
|
-
c.
|
151
|
-
c.should_not eql p
|
152
|
-
|
153
|
-
c = p.dup
|
154
|
-
c.cookies << Arachni::Element::Cookie.new( 'http://test.com', 'test' => 'stuff2' )
|
155
|
-
c.should_not eql p
|
156
|
-
|
157
|
-
c = p.dup
|
158
|
-
c.headers << Arachni::Element::Header.new( 'http://test.com', 'test' => 'stuff2' )
|
582
|
+
c.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
159
583
|
c.should_not eql p
|
160
584
|
end
|
161
585
|
end
|
162
586
|
context 'when the pages are identical' do
|
163
587
|
it 'returns true' do
|
164
|
-
p =
|
165
|
-
p.links
|
166
|
-
p.forms
|
167
|
-
p.cookies
|
168
|
-
p.headers << Arachni::Element::Header.new( 'http://test.com', 'test' => 'stuff' )
|
588
|
+
p = create_page( body: 'stuff here')
|
589
|
+
p.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
590
|
+
p.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
591
|
+
p.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff' } )]
|
169
592
|
|
170
593
|
c = p.dup
|
171
594
|
c.should eql p
|
172
595
|
|
173
596
|
c = p.dup
|
174
|
-
p.
|
175
|
-
p.
|
176
|
-
p.
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
c.
|
181
|
-
c.links << Arachni::Element::Link.new( 'http://test.com', 'test' => 'stuff2' )
|
182
|
-
c.forms << Arachni::Element::Form.new( 'http://test.com', 'test' => 'stuff2' )
|
183
|
-
c.cookies << Arachni::Element::Cookie.new( 'http://test.com', 'test' => 'stuff2' )
|
184
|
-
c.headers << Arachni::Element::Header.new( 'http://test.com', 'test' => 'stuff2' )
|
597
|
+
p.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
598
|
+
p.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
599
|
+
p.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
600
|
+
|
601
|
+
c.links |= [Arachni::Element::Link.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
602
|
+
c.forms |= [Arachni::Element::Form.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
603
|
+
c.cookies |= [Arachni::Element::Cookie.new( url: 'http://test.com', inputs: { 'test' => 'stuff2' } )]
|
185
604
|
c.should eql p
|
186
605
|
end
|
187
606
|
end
|
@@ -191,118 +610,313 @@ describe Arachni::Page do
|
|
191
610
|
context 'when the page has a title' do
|
192
611
|
it 'returns the page title' do
|
193
612
|
title = 'Stuff here'
|
194
|
-
|
195
|
-
|
196
|
-
Arachni::Page.new( body: "<title></title>").title.should == ''
|
613
|
+
create_page( body: "<title>#{title}</title>" ).title.should == title
|
614
|
+
create_page( body: '<title></title>' ).title.should == ''
|
197
615
|
end
|
198
616
|
end
|
199
617
|
context 'when the page does not have a title' do
|
200
618
|
it 'returns nil' do
|
201
|
-
|
202
|
-
|
619
|
+
create_page.title.should be_nil
|
620
|
+
create_page( body: '' ).title.should be_nil
|
203
621
|
end
|
204
622
|
end
|
205
623
|
end
|
206
624
|
|
207
|
-
|
208
|
-
it '
|
209
|
-
|
210
|
-
|
625
|
+
describe '#elements' do
|
626
|
+
it 'returns all page elements' do
|
627
|
+
page.elements.should == (page.links | page.forms | page.cookies | page.headers)
|
628
|
+
end
|
629
|
+
end
|
630
|
+
|
631
|
+
describe '#clear_cache' do
|
632
|
+
it 'returns self' do
|
633
|
+
subject.clear_cache.should == subject
|
634
|
+
end
|
635
|
+
|
636
|
+
it 'clears the #cache' do
|
637
|
+
cachable = [:query_vars, :links, :forms, :cookies, :headers, :paths,
|
638
|
+
:document, :parser]
|
639
|
+
|
640
|
+
subject.cache.keys.should == [:parser]
|
641
|
+
|
642
|
+
cachable.each do |attribute|
|
643
|
+
subject.send attribute
|
211
644
|
end
|
645
|
+
|
646
|
+
subject.cache.keys.sort.should == cachable.sort
|
647
|
+
subject.clear_cache
|
648
|
+
subject.cache.keys.should be_empty
|
212
649
|
end
|
213
650
|
|
214
|
-
|
215
|
-
|
216
|
-
|
651
|
+
[:links, :forms, :cookies, :headers].each do |type|
|
652
|
+
context "when ##{type} have been externally set" do
|
653
|
+
it 'does not empty their cache' do
|
654
|
+
subject.send("#{type}=", subject.send(type))
|
655
|
+
subject.clear_cache
|
656
|
+
subject.cache.keys.should == [type]
|
657
|
+
subject.cache[type].should == subject.send(type)
|
658
|
+
end
|
217
659
|
end
|
218
660
|
end
|
219
661
|
|
220
|
-
|
221
|
-
it '
|
222
|
-
|
662
|
+
context 'when #forms have nonces' do
|
663
|
+
it 'preserves them' do
|
664
|
+
page_with_nonces.forms.map { |f| f.nonce_name }.sort.
|
665
|
+
should == %w(nonce nonce2).sort
|
666
|
+
|
667
|
+
page_with_nonces.clear_cache
|
668
|
+
|
669
|
+
page_with_nonces.forms.map { |f| f.nonce_name }.sort.
|
670
|
+
should == %w(nonce nonce2).sort
|
223
671
|
end
|
224
672
|
end
|
225
673
|
end
|
226
674
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
675
|
+
describe '#prepare_for_report' do
|
676
|
+
it 'clears the #cache' do
|
677
|
+
s = subject.dup
|
678
|
+
s.prepare_for_report
|
679
|
+
s.cache.should be_empty
|
232
680
|
end
|
233
681
|
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
682
|
+
it 'removes #dom#digest' do
|
683
|
+
subject.dom.digest = 'stuff'
|
684
|
+
subject.prepare_for_report
|
685
|
+
subject.dom.digest.should be_nil
|
238
686
|
end
|
239
687
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
688
|
+
it 'removes #dom#skip_states' do
|
689
|
+
subject.dom.skip_states.should be_true
|
690
|
+
subject.prepare_for_report
|
691
|
+
subject.dom.digest.should be_nil
|
244
692
|
end
|
245
693
|
|
246
|
-
|
247
|
-
|
248
|
-
@empty_page.headers.should == []
|
249
|
-
end
|
694
|
+
it 'returns self' do
|
695
|
+
subject.prepare_for_report.should == subject
|
250
696
|
end
|
251
697
|
|
252
|
-
|
253
|
-
|
254
|
-
|
698
|
+
context 'if the body is not #text?' do
|
699
|
+
let(:page) { Factory[:binary_response].to_page }
|
700
|
+
|
701
|
+
it 'clears it' do
|
702
|
+
page.body.should_not be_empty
|
703
|
+
page.prepare_for_report
|
704
|
+
page.body.should be_empty
|
255
705
|
end
|
256
|
-
end
|
257
706
|
|
258
|
-
|
259
|
-
|
260
|
-
|
707
|
+
it 'clears the #response#body' do
|
708
|
+
page.response.body.should_not be_empty
|
709
|
+
page.prepare_for_report
|
710
|
+
page.response.body.should be_empty
|
261
711
|
end
|
262
712
|
end
|
713
|
+
end
|
714
|
+
|
715
|
+
describe '#to_h' do
|
716
|
+
it 'converts the page to a hash' do
|
717
|
+
subject.to_h.should be_kind_of Hash
|
263
718
|
|
264
|
-
|
265
|
-
|
266
|
-
@empty_page.paths.should == []
|
719
|
+
subject.to_h.each do |k, v|
|
720
|
+
v.should == subject.send(k)
|
267
721
|
end
|
268
722
|
end
|
269
723
|
|
270
|
-
|
271
|
-
it
|
272
|
-
|
724
|
+
[:document, :do_not_audit_elements, :has_custom_elements, :parser].each do |k|
|
725
|
+
it "does not include ':#{k}'" do
|
726
|
+
subject.to_h.should_not include k
|
273
727
|
end
|
274
728
|
end
|
729
|
+
end
|
730
|
+
|
731
|
+
[:dup, :deep_clone].each do |method|
|
732
|
+
describe "##{method}" do
|
733
|
+
it 'returns a copy of the page' do
|
734
|
+
dupped = subject.send(method)
|
735
|
+
dupped.should == subject
|
736
|
+
end
|
737
|
+
|
738
|
+
[:response, :metadata, :body, :links, :forms, :cookies, :headers, :cookie_jar, :paths].each do |m|
|
739
|
+
it "preserves ##{m}" do
|
740
|
+
dupped = subject.send(method)
|
741
|
+
|
742
|
+
# Make sure we're not comparing nils.
|
743
|
+
subject.send( m ).should be_true
|
744
|
+
|
745
|
+
# Make sure we're not comparing empty stuff.
|
746
|
+
if (enumerable = dupped.send( m )).is_a? Enumerable
|
747
|
+
enumerable.should be_any
|
748
|
+
end
|
749
|
+
|
750
|
+
dupped.send( m ).should == subject.send( m )
|
751
|
+
end
|
752
|
+
end
|
753
|
+
|
754
|
+
it 'preserves #element_audit_whitelist' do
|
755
|
+
subject.update_element_audit_whitelist subject.elements.first
|
756
|
+
dupped = subject.send(method)
|
757
|
+
dupped.element_audit_whitelist.should include subject.elements.first.coverage_hash
|
758
|
+
end
|
759
|
+
|
760
|
+
it 'preserves Arachni::Element::Form#node of #forms' do
|
761
|
+
form = subject.forms.last
|
762
|
+
form.node.should be_kind_of Nokogiri::XML::Element
|
763
|
+
form.node.should be_true
|
764
|
+
|
765
|
+
subject.send(method).forms.last.node.to_s.should == form.node.to_s
|
766
|
+
end
|
767
|
+
|
768
|
+
it 'preserves Arachni::Element::Link#node of #links' do
|
769
|
+
link = subject.links.last
|
770
|
+
link.node.should be_kind_of Nokogiri::XML::Element
|
771
|
+
link.node.should be_true
|
275
772
|
|
276
|
-
|
277
|
-
it 'defaults to empty string' do
|
278
|
-
@empty_page.body.should == ''
|
773
|
+
subject.send(method).links.last.node.to_s.should == link.node.to_s
|
279
774
|
end
|
775
|
+
|
776
|
+
it 'preserves #page associations for #elements' do
|
777
|
+
dup = subject.send(method)
|
778
|
+
dup.elements.should be_any
|
779
|
+
dup.elements.each { |e| e.page.should == subject }
|
780
|
+
end
|
781
|
+
|
782
|
+
context 'when #forms have nonces' do
|
783
|
+
it 'preserves them' do
|
784
|
+
page_with_nonces.forms.map { |f| f.nonce_name }.sort.should == %w(nonce nonce2).sort
|
785
|
+
page_with_nonces.send(method).forms.map { |f| f.nonce_name }.sort.should == %w(nonce nonce2).sort
|
786
|
+
end
|
787
|
+
end
|
788
|
+
|
789
|
+
context Arachni::Page::DOM do
|
790
|
+
[:url, :skip_states, :transitions, :data_flow_sinks, :execution_flow_sinks].each do |m|
|
791
|
+
it "preserves ##{m}" do
|
792
|
+
dupped = subject.send(method)
|
793
|
+
|
794
|
+
# Make sure we're not comparing nils.
|
795
|
+
subject.dom.send( m ).should be_true
|
796
|
+
|
797
|
+
# Make sure we're not comparing empty stuff.
|
798
|
+
if (enumerable = dupped.dom.send( m )).is_a? Enumerable
|
799
|
+
enumerable.should be_any
|
800
|
+
end
|
801
|
+
|
802
|
+
dupped.dom.send( m ).should == subject.dom.send( m )
|
803
|
+
end
|
804
|
+
end
|
805
|
+
end
|
806
|
+
|
807
|
+
end
|
808
|
+
end
|
809
|
+
|
810
|
+
describe '.from_url' do
|
811
|
+
it 'returns a page from the given url' do
|
812
|
+
described_class.from_url( url + 'with_nonce' ).should be_kind_of described_class
|
280
813
|
end
|
281
814
|
|
282
|
-
|
283
|
-
it '
|
284
|
-
|
815
|
+
context 'when #forms have nonces' do
|
816
|
+
it 'preserves them' do
|
817
|
+
described_class.from_url( url + 'with_nonce' ).forms.
|
818
|
+
map { |f| f.nonce_name }.sort.should == %w(nonce nonce2).sort
|
285
819
|
end
|
286
820
|
end
|
287
821
|
end
|
288
822
|
|
289
|
-
describe '
|
290
|
-
it '
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
823
|
+
describe '.from_data' do
|
824
|
+
it 'creates a page from the given data' do
|
825
|
+
elem_opts = {
|
826
|
+
url: 'http://test.com',
|
827
|
+
inputs: { 'test' => 'stuff' }
|
828
|
+
}
|
829
|
+
|
830
|
+
data = {
|
831
|
+
url: 'http://test/',
|
832
|
+
body: 'test',
|
833
|
+
paths: [ 'http://test/1', 'http://test/2' ],
|
834
|
+
links: [Arachni::Element::Link.new( elem_opts )],
|
835
|
+
forms: [Arachni::Element::Form.new( elem_opts )],
|
836
|
+
cookies: [Arachni::Element::Cookie.new( elem_opts )],
|
837
|
+
cookie_jar: [
|
838
|
+
Arachni::Element::Cookie.new( elem_opts ),
|
839
|
+
Arachni::Element::Cookie.new( elem_opts )
|
840
|
+
],
|
841
|
+
headers: [Arachni::Element::Header.new( elem_opts )],
|
842
|
+
response: {
|
843
|
+
code: 200
|
844
|
+
},
|
845
|
+
|
846
|
+
dom: {
|
847
|
+
url: 'http://test/#/stuff',
|
848
|
+
transitions: [ described_class::DOM::Transition.new( :page, :load )]
|
849
|
+
}
|
850
|
+
}
|
851
|
+
|
852
|
+
page = Arachni::Page.from_data( data )
|
853
|
+
page.code.should == data[:response][:code]
|
854
|
+
page.url.should == data[:url]
|
855
|
+
page.body.should == data[:body]
|
856
|
+
page.paths.should == data[:paths]
|
857
|
+
|
858
|
+
page.links.should == data[:links]
|
859
|
+
page.forms.should == data[:forms]
|
860
|
+
page.cookies.should == data[:cookies]
|
861
|
+
page.headers.should == data[:headers]
|
862
|
+
|
863
|
+
page.cookie_jar.should == data[:cookie_jar]
|
864
|
+
|
865
|
+
page.response.code.should == data[:response][:code]
|
866
|
+
page.response.url.should == data[:url]
|
867
|
+
page.response.body.should == data[:body]
|
868
|
+
page.response.request.url.should == data[:url]
|
869
|
+
|
870
|
+
page.dom.url.should == data[:dom][:url]
|
871
|
+
page.dom.transitions.should == data[:dom][:transitions]
|
872
|
+
end
|
873
|
+
|
874
|
+
context 'when no HTTP data is given' do
|
875
|
+
it 'creates them with default values' do
|
876
|
+
data = {
|
877
|
+
url: 'http://test/',
|
878
|
+
body: 'test'
|
879
|
+
}
|
880
|
+
|
881
|
+
page = Arachni::Page.from_data( data )
|
882
|
+
page.url.should == data[:url]
|
883
|
+
page.body.should == data[:body]
|
884
|
+
page.code.should == 200
|
885
|
+
|
886
|
+
page.links.should == []
|
887
|
+
page.forms.should == []
|
888
|
+
page.cookies.should == []
|
889
|
+
page.headers.should == []
|
890
|
+
|
891
|
+
page.cookie_jar.should == []
|
892
|
+
|
893
|
+
page.response.code.should == 200
|
894
|
+
page.response.url.should == data[:url]
|
895
|
+
page.response.body.should == data[:body]
|
896
|
+
page.response.request.url.should == data[:url]
|
897
|
+
end
|
297
898
|
end
|
298
899
|
end
|
299
900
|
|
300
|
-
describe '.
|
301
|
-
it '
|
302
|
-
|
303
|
-
request: Typhoeus::Request.new( 'http://test.com' ))
|
304
|
-
page = Arachni::Page.from_http_response( res, Arachni::Options.instance )
|
901
|
+
describe '.from_response' do
|
902
|
+
it 'creates a page from an HTTP response' do
|
903
|
+
page = Arachni::Page.from_response( response )
|
305
904
|
page.class.should == Arachni::Page
|
905
|
+
parser = Arachni::Parser.new( response )
|
906
|
+
|
907
|
+
page.url.should == parser.url
|
908
|
+
page.method.should == parser.response.request.method
|
909
|
+
page.response.should == parser.response
|
910
|
+
page.body.should == parser.response.body
|
911
|
+
page.query_vars.should == parser.link_vars
|
912
|
+
page.paths.should == parser.paths
|
913
|
+
page.links.should == parser.links
|
914
|
+
page.forms.should == parser.forms
|
915
|
+
page.cookies.should == parser.cookies_to_be_audited
|
916
|
+
page.headers.should == parser.headers
|
917
|
+
page.cookie_jar.should == parser.cookie_jar
|
918
|
+
page.text?.should == parser.text?
|
919
|
+
|
306
920
|
end
|
307
921
|
end
|
308
922
|
|