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
data/lib/arachni/framework.rb
CHANGED
@@ -1,74 +1,65 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
=begin
|
4
|
-
Copyright 2010-2014 Tasos Laskos <tasos.laskos@
|
4
|
+
Copyright 2010-2014 Tasos Laskos <tasos.laskos@arachni-scanner.com>
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
|
12
|
-
Unless required by applicable law or agreed to in writing, software
|
13
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
-
See the License for the specific language governing permissions and
|
16
|
-
limitations under the License.
|
6
|
+
This file is part of the Arachni Framework project and is subject to
|
7
|
+
redistribution and commercial restrictions. Please see the Arachni Framework
|
8
|
+
web site for more information on licensing and terms of use.
|
17
9
|
=end
|
18
10
|
|
19
11
|
require 'rubygems'
|
12
|
+
require 'monitor'
|
20
13
|
require 'bundler/setup'
|
21
14
|
|
22
15
|
require 'ap'
|
23
16
|
require 'pp'
|
24
17
|
|
25
|
-
|
18
|
+
require_relative 'options'
|
26
19
|
|
27
20
|
module Arachni
|
28
21
|
|
29
|
-
lib = Options.
|
22
|
+
lib = Options.paths.lib
|
30
23
|
require lib + 'version'
|
31
24
|
require lib + 'ruby'
|
32
25
|
require lib + 'error'
|
33
|
-
require lib + '
|
26
|
+
require lib + 'scope'
|
34
27
|
require lib + 'utilities'
|
28
|
+
require lib + 'support'
|
35
29
|
require lib + 'uri'
|
36
|
-
require lib + 'component
|
30
|
+
require lib + 'component'
|
37
31
|
require lib + 'platform'
|
38
|
-
require lib + '
|
32
|
+
require lib + 'http'
|
33
|
+
require lib + 'snapshot'
|
39
34
|
require lib + 'parser'
|
40
35
|
require lib + 'issue'
|
41
|
-
require lib + '
|
36
|
+
require lib + 'check'
|
42
37
|
require lib + 'plugin'
|
43
|
-
require lib + 'audit_store'
|
44
|
-
require lib + 'http'
|
45
38
|
require lib + 'report'
|
39
|
+
require lib + 'reporter'
|
46
40
|
require lib + 'session'
|
47
41
|
require lib + 'trainer'
|
42
|
+
require lib + 'browser_cluster'
|
48
43
|
|
49
|
-
|
50
|
-
|
51
|
-
#
|
52
|
-
# The Framework class ties together all the components.
|
44
|
+
# The Framework class ties together all the systems.
|
53
45
|
#
|
54
|
-
# It's the brains of the operation, it bosses the rest of the
|
55
|
-
# It runs the audit, loads
|
46
|
+
# It's the brains of the operation, it bosses the rest of the subsystems around.
|
47
|
+
# It runs the audit, loads checks and reports and runs them according to
|
56
48
|
# user options.
|
57
49
|
#
|
58
|
-
# @author Tasos "Zapotek" Laskos <tasos.laskos@
|
59
|
-
#
|
50
|
+
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
|
60
51
|
class Framework
|
61
|
-
#
|
62
|
-
# include the output interface but try to use it as little as possible
|
63
|
-
#
|
64
|
-
# the UI classes should take care of communicating with the user
|
65
|
-
#
|
66
52
|
include UI::Output
|
67
53
|
|
68
54
|
include Utilities
|
69
|
-
include Mixins::Observable
|
55
|
+
include Support::Mixins::Observable
|
56
|
+
|
57
|
+
# @!method on_page_audit( &block )
|
58
|
+
advertise :on_page_audit
|
59
|
+
|
60
|
+
# @!method after_page_audit( &block )
|
61
|
+
advertise :after_page_audit
|
70
62
|
|
71
|
-
#
|
72
63
|
# {Framework} error namespace.
|
73
64
|
#
|
74
65
|
# All {Framework} errors inherit from and live under it.
|
@@ -76,97 +67,87 @@ class Framework
|
|
76
67
|
# When I say Framework I mean the {Framework} class, not the
|
77
68
|
# entire Arachni Framework.
|
78
69
|
#
|
79
|
-
# @author Tasos "Zapotek" Laskos <tasos.laskos@
|
80
|
-
#
|
70
|
+
# @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com>
|
81
71
|
class Error < Arachni::Error
|
82
72
|
end
|
83
73
|
|
84
|
-
# The version of this class.
|
85
|
-
REVISION = '0.2.8'
|
86
|
-
|
87
74
|
# How many times to request a page upon failure.
|
88
75
|
AUDIT_PAGE_MAX_TRIES = 5
|
89
76
|
|
90
|
-
# @return
|
91
|
-
|
77
|
+
# @return [Options]
|
78
|
+
# System options
|
79
|
+
attr_reader :options
|
92
80
|
|
93
|
-
# @return [Arachni::
|
94
|
-
attr_reader :
|
81
|
+
# @return [Arachni::Reporter::Manager]
|
82
|
+
attr_reader :reporters
|
95
83
|
|
96
|
-
# @return [Arachni::
|
97
|
-
attr_reader :
|
84
|
+
# @return [Arachni::Check::Manager]
|
85
|
+
attr_reader :checks
|
98
86
|
|
99
87
|
# @return [Arachni::Plugin::Manager]
|
100
88
|
attr_reader :plugins
|
101
89
|
|
102
|
-
# @return [Session]
|
90
|
+
# @return [Session]
|
91
|
+
# Web application session manager.
|
103
92
|
attr_reader :session
|
104
93
|
|
105
|
-
# @return [Spider] Web application spider.
|
106
|
-
attr_reader :spider
|
107
|
-
|
108
94
|
# @return [Arachni::HTTP]
|
109
95
|
attr_reader :http
|
110
96
|
|
111
|
-
# @return [Array] URLs of all discovered pages.
|
112
|
-
attr_reader :sitemap
|
113
|
-
|
114
97
|
# @return [Trainer]
|
115
98
|
attr_reader :trainer
|
116
99
|
|
117
|
-
# @return [Integer] Total number of pages added to their audit queue.
|
118
|
-
attr_reader :page_queue_total_size
|
119
|
-
|
120
|
-
# @return [Integer] Total number of urls added to their audit queue.
|
121
|
-
attr_reader :url_queue_total_size
|
122
|
-
|
123
100
|
# @return [Array<String>]
|
124
101
|
# Page URLs which elicited no response from the server and were not audited.
|
125
102
|
# Not determined by HTTP status codes, we're talking network failures here.
|
126
103
|
attr_reader :failures
|
127
104
|
|
105
|
+
# @param [String] afs
|
106
|
+
# Path to an `.afs.` (Arachni Framework Snapshot) file created by {#suspend}.
|
128
107
|
#
|
129
|
-
# @
|
108
|
+
# @return [Framework]
|
109
|
+
# Restored instance.
|
110
|
+
def self.restore( afs, &block )
|
111
|
+
framework = new
|
112
|
+
framework.restore( afs )
|
113
|
+
|
114
|
+
if block_given?
|
115
|
+
begin
|
116
|
+
block.call framework
|
117
|
+
ensure
|
118
|
+
framework.clean_up
|
119
|
+
framework.reset
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
framework
|
124
|
+
end
|
125
|
+
|
126
|
+
# @param [Options] options
|
130
127
|
# @param [Block] block
|
131
128
|
# Block to be passed a {Framework} instance which will then be {#reset}.
|
132
|
-
|
133
|
-
|
129
|
+
def initialize( options = Arachni::Options.instance, &block )
|
130
|
+
super()
|
134
131
|
|
135
132
|
Encoding.default_external = 'BINARY'
|
136
133
|
Encoding.default_internal = 'BINARY'
|
137
134
|
|
138
|
-
@
|
135
|
+
@options = options
|
139
136
|
|
140
|
-
@
|
141
|
-
@
|
142
|
-
@plugins
|
137
|
+
@checks = Check::Manager.new( self )
|
138
|
+
@reporters = Reporter::Manager.new
|
139
|
+
@plugins = Plugin::Manager.new( self )
|
143
140
|
|
144
|
-
|
145
|
-
|
146
|
-
@http = HTTP.instance
|
141
|
+
reset_session
|
142
|
+
@http = HTTP::Client.instance
|
147
143
|
|
148
144
|
reset_trainer
|
149
145
|
|
150
|
-
#
|
151
|
-
#
|
152
|
-
@
|
153
|
-
@page_queue_total_size = 0
|
146
|
+
# Deep clone the redundancy rules to preserve their original counters
|
147
|
+
# for the reports.
|
148
|
+
@orig_redundant = options.scope.redundant_path_patterns.deep_clone
|
154
149
|
|
155
|
-
|
156
|
-
# and ultimately audited by the modules
|
157
|
-
@url_queue = Queue.new
|
158
|
-
@url_queue_total_size = 0
|
159
|
-
|
160
|
-
# deep clone the redundancy rules to preserve their counter
|
161
|
-
# for the reports
|
162
|
-
@orig_redundant = @opts.redundant.deep_clone
|
163
|
-
|
164
|
-
@running = false
|
165
|
-
@status = :ready
|
166
|
-
@paused = []
|
167
|
-
|
168
|
-
@auditmap = []
|
169
|
-
@sitemap = []
|
150
|
+
state.status = :ready
|
170
151
|
|
171
152
|
@current_url = ''
|
172
153
|
|
@@ -174,353 +155,402 @@ class Framework
|
|
174
155
|
@failures = []
|
175
156
|
@retries = {}
|
176
157
|
|
158
|
+
@after_page_audit_blocks = []
|
159
|
+
|
160
|
+
# Little helper to run a piece of code and reset the framework to be
|
161
|
+
# ready to be reused.
|
177
162
|
if block_given?
|
178
|
-
|
179
|
-
|
163
|
+
begin
|
164
|
+
block.call self
|
165
|
+
ensure
|
166
|
+
clean_up
|
167
|
+
reset
|
168
|
+
end
|
180
169
|
end
|
181
170
|
end
|
182
171
|
|
183
|
-
#
|
172
|
+
# @return [Integer]
|
173
|
+
# Total number of pages added to the {#push_to_page_queue page audit queue}.
|
174
|
+
def page_queue_total_size
|
175
|
+
data.page_queue_total_size
|
176
|
+
end
|
177
|
+
|
178
|
+
# @return [Integer]
|
179
|
+
# Total number of URLs added to the {#push_to_url_queue URL audit queue}.
|
180
|
+
def url_queue_total_size
|
181
|
+
data.url_queue_total_size
|
182
|
+
end
|
183
|
+
|
184
|
+
# @return [Hash<String, Integer>]
|
185
|
+
# List of crawled URLs with their HTTP codes.
|
186
|
+
def sitemap
|
187
|
+
data.sitemap
|
188
|
+
end
|
189
|
+
|
190
|
+
# @return [BrowserCluster, nil]
|
191
|
+
# A lazy-loaded browser cluster or `nil` if
|
192
|
+
# {OptionGroups::BrowserCluster#pool_size} or
|
193
|
+
# {OptionGroups::Scope#dom_depth_limit} are 0 or not
|
194
|
+
# {#host_has_browser?}.
|
195
|
+
def browser_cluster
|
196
|
+
return if options.browser_cluster.pool_size == 0 ||
|
197
|
+
Options.scope.dom_depth_limit == 0 || !host_has_browser?
|
198
|
+
|
199
|
+
# Initialization may take a while so since we lazy load this make sure
|
200
|
+
# that only one thread gets to this code at a time.
|
201
|
+
synchronize { @browser_cluster ||= BrowserCluster.new }
|
202
|
+
end
|
203
|
+
|
184
204
|
# Starts the scan.
|
185
205
|
#
|
186
206
|
# @param [Block] block
|
187
|
-
# A block to call after the audit has finished but before running
|
188
|
-
#
|
207
|
+
# A block to call after the audit has finished but before running {#reporters}.
|
189
208
|
def run( &block )
|
190
209
|
prepare
|
210
|
+
handle_signals
|
211
|
+
return if aborted?
|
191
212
|
|
192
|
-
#
|
193
|
-
# exit the
|
213
|
+
# Catch exceptions so that if something breaks down or the user opted to
|
214
|
+
# exit the reporters will still run with whatever results Arachni managed
|
215
|
+
# to gather.
|
194
216
|
exception_jail( false ){ audit }
|
217
|
+
# print_with_statistics
|
218
|
+
|
219
|
+
return if aborted?
|
220
|
+
return if suspended?
|
195
221
|
|
196
222
|
clean_up
|
197
223
|
exception_jail( false ){ block.call } if block_given?
|
198
|
-
|
199
|
-
|
200
|
-
# run reports
|
201
|
-
@reports.run( audit_store ) if !@reports.empty?
|
224
|
+
state.status = :done
|
202
225
|
|
203
226
|
true
|
204
227
|
end
|
205
228
|
|
206
|
-
#
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
229
|
+
# @return [State::Framework]
|
230
|
+
def state
|
231
|
+
State.framework
|
232
|
+
end
|
233
|
+
|
234
|
+
# @return [Data::Framework]
|
235
|
+
def data
|
236
|
+
Data.framework
|
237
|
+
end
|
238
|
+
|
239
|
+
# @note Will update the {HTTP::Client#cookie_jar} with {Page#cookie_jar}.
|
240
|
+
# @note It will audit just the given `page` and not any subsequent pages
|
241
|
+
# discovered by the {Trainer} -- i.e. ignore any new elements that might
|
242
|
+
# appear as a result.
|
243
|
+
# @note It will pass the `page` to the {BrowserCluster} for analysis if the
|
244
|
+
# {Page::Scope#dom_depth_limit_reached? DOM depth limit} has
|
245
|
+
# not been reached and push resulting pages to {#push_to_page_queue} but
|
246
|
+
# will not audit those pages either.
|
211
247
|
#
|
212
248
|
# @param [Page] page
|
213
|
-
#
|
249
|
+
# Runs loaded checks against `page`
|
214
250
|
def audit_page( page )
|
215
251
|
return if !page
|
216
252
|
|
217
|
-
if
|
218
|
-
print_info "Ignoring page due to exclusion criteria: #{page.url}"
|
253
|
+
if page.scope.out?
|
254
|
+
print_info "Ignoring page due to exclusion criteria: #{page.dom.url}"
|
219
255
|
return false
|
220
256
|
end
|
221
257
|
|
222
|
-
|
223
|
-
|
224
|
-
|
258
|
+
# Initialize the BrowserCluster.
|
259
|
+
browser_cluster
|
260
|
+
|
261
|
+
state.audited_page_count += 1
|
262
|
+
add_to_sitemap( page )
|
263
|
+
sitemap.merge!( browser_sitemap )
|
225
264
|
|
226
265
|
print_line
|
227
|
-
print_status "
|
266
|
+
print_status "[HTTP: #{page.code}] #{page.dom.url}"
|
267
|
+
# print_object_space
|
268
|
+
# print_with_statistics
|
228
269
|
|
229
270
|
if page.platforms.any?
|
230
271
|
print_info "Identified as: #{page.platforms.to_a.join( ', ' )}"
|
231
272
|
end
|
232
273
|
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
@modules.schedule.each do |mod|
|
238
|
-
wait_if_paused
|
239
|
-
run_module_against_page( mod, page )
|
274
|
+
if crawl?
|
275
|
+
pushed = push_paths_from_page( page )
|
276
|
+
print_info "Analysis resulted in #{pushed.size} usable paths."
|
240
277
|
end
|
241
278
|
|
242
|
-
|
279
|
+
if host_has_browser?
|
280
|
+
print_info "DOM depth: #{page.dom.depth} (Limit: #{options.scope.dom_depth_limit})"
|
243
281
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
Module::Auditor.timeout_audit_run
|
282
|
+
if page.dom.transitions.any?
|
283
|
+
print_info ' Transitions:'
|
284
|
+
page.dom.print_transitions( method(:print_info), ' ' )
|
285
|
+
end
|
249
286
|
end
|
250
287
|
|
251
|
-
|
252
|
-
end
|
253
|
-
|
254
|
-
def on_audit_page( &block )
|
255
|
-
add_on_audit_page( &block )
|
256
|
-
end
|
257
|
-
alias :on_run_mods :on_audit_page
|
258
|
-
|
259
|
-
# @return [Bool]
|
260
|
-
# `true` if the {Options#link_count_limit} has been reached, `false`
|
261
|
-
# otherwise.
|
262
|
-
def link_count_limit_reached?
|
263
|
-
@opts.link_count_limit_reached? @sitemap.size
|
264
|
-
end
|
288
|
+
notify_on_page_audit( page )
|
265
289
|
|
266
|
-
|
267
|
-
# Returns the following framework stats:
|
268
|
-
#
|
269
|
-
# * `:requests` -- HTTP request count
|
270
|
-
# * `:responses` -- HTTP response count
|
271
|
-
# * `:time_out_count` -- Amount of timed-out requests
|
272
|
-
# * `:time` -- Amount of running time
|
273
|
-
# * `:avg` -- Average requests per second
|
274
|
-
# * `:sitemap_size` -- Number of discovered pages
|
275
|
-
# * `:auditmap_size` -- Number of audited pages
|
276
|
-
# * `:progress` -- Progress percentage
|
277
|
-
# * `:curr_res_time` -- Average response time for the current burst of requests
|
278
|
-
# * `:curr_res_cnt` -- Amount of responses for the current burst
|
279
|
-
# * `:curr_avg` -- Average requests per second for the current burst
|
280
|
-
# * `:average_res_time` -- Average response time
|
281
|
-
# * `:max_concurrency` -- Current maximum concurrency of HTTP requests
|
282
|
-
# * `:current_page` -- URL of the currently audited page
|
283
|
-
# * `:eta` -- Estimated time of arrival i.e. estimated remaining time
|
284
|
-
#
|
285
|
-
# @param [Bool] refresh_time updates the running time of the audit
|
286
|
-
# (usefully when you want stats while paused without messing with the clocks)
|
287
|
-
#
|
288
|
-
# @param [Bool] override_refresh
|
289
|
-
#
|
290
|
-
# @return [Hash]
|
291
|
-
#
|
292
|
-
def stats( refresh_time = false, override_refresh = false )
|
293
|
-
req_cnt = http.request_count
|
294
|
-
res_cnt = http.response_count
|
290
|
+
@current_url = page.dom.url.to_s
|
295
291
|
|
296
|
-
|
292
|
+
http.update_cookies( page.cookie_jar )
|
293
|
+
perform_browser_analysis( page )
|
297
294
|
|
298
|
-
|
299
|
-
|
295
|
+
# Run checks which **don't** benefit from fingerprinting first, so that
|
296
|
+
# we can use the responses of their HTTP requests to fingerprint the
|
297
|
+
# webapp platforms, so that the checks which **do** benefit from knowing
|
298
|
+
# the remote platforms can run more efficiently.
|
299
|
+
ran = false
|
300
|
+
@checks.without_platforms.values.each do |check|
|
301
|
+
ran = true
|
302
|
+
check_page( check, page )
|
303
|
+
end
|
304
|
+
harvest_http_responses if ran
|
305
|
+
run_http = ran
|
300
306
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
307
|
+
ran = false
|
308
|
+
@checks.with_platforms.values.each do |check|
|
309
|
+
ran = true
|
310
|
+
check_page( check, page )
|
305
311
|
end
|
312
|
+
harvest_http_responses if ran
|
313
|
+
run_http ||= ran
|
306
314
|
|
307
|
-
|
308
|
-
|
315
|
+
if Check::Auditor.has_timeout_candidates?
|
316
|
+
print_line
|
317
|
+
print_status "Verifying timeout-analysis candidates for: #{page.dom.url}"
|
318
|
+
print_info '---------------------------------------'
|
319
|
+
Check::Auditor.timeout_audit_run
|
320
|
+
run_http = true
|
321
|
+
end
|
309
322
|
|
310
|
-
#
|
311
|
-
|
312
|
-
#
|
313
|
-
# This is because even though these URLs are valid webapp paths
|
314
|
-
# they are not actual pages and thus can't be audited;
|
315
|
-
# so the sitemap and auditmap will never match and the progress will
|
316
|
-
# never get to 100% which may confuse users.
|
317
|
-
#
|
318
|
-
sitemap_sz -= spider.redirects.size
|
319
|
-
sitemap_sz = 0 if sitemap_sz < 0
|
323
|
+
# Makes it easier on the GC.
|
324
|
+
page.clear_cache
|
320
325
|
|
321
|
-
|
322
|
-
|
323
|
-
|
326
|
+
notify_after_page_audit( page )
|
327
|
+
run_http
|
328
|
+
end
|
324
329
|
|
325
|
-
|
330
|
+
# @return [Bool]
|
331
|
+
# `true` if the environment has a browser, `false` otherwise.
|
332
|
+
def host_has_browser?
|
333
|
+
Browser.has_executable?
|
334
|
+
end
|
326
335
|
|
327
|
-
|
328
|
-
|
329
|
-
|
336
|
+
# @return [Bool]
|
337
|
+
# `true` if the {OptionGroups::Scope#page_limit} has been reached,
|
338
|
+
# `false` otherwise.
|
339
|
+
def page_limit_reached?
|
340
|
+
options.scope.page_limit_reached?( sitemap.size )
|
341
|
+
end
|
330
342
|
|
331
|
-
|
332
|
-
|
343
|
+
def crawl?
|
344
|
+
options.scope.crawl? && options.scope.restrict_paths.empty?
|
345
|
+
end
|
333
346
|
|
334
|
-
|
347
|
+
# @return [Bool]
|
348
|
+
# `true` if the framework can process more pages, `false` is scope limits
|
349
|
+
# have been reached.
|
350
|
+
def accepts_more_pages?
|
351
|
+
crawl? && !page_limit_reached?
|
352
|
+
end
|
335
353
|
|
354
|
+
# @return [Hash]
|
355
|
+
#
|
356
|
+
# Framework statistics:
|
357
|
+
#
|
358
|
+
# * `:http` -- {HTTP::Client#statistics}
|
359
|
+
# * `:runtime` -- Scan runtime in seconds.
|
360
|
+
# * `:found_pages` -- Number of discovered pages.
|
361
|
+
# * `:audited_pages` -- Number of audited pages.
|
362
|
+
# * `:current_page` -- URL of the currently audited page.
|
363
|
+
# * `:status` -- {#status}
|
364
|
+
# * `:messages` -- {#status_messages}
|
365
|
+
def statistics
|
336
366
|
{
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
sitemap_size: auditstore_sitemap.size,
|
343
|
-
auditmap_size: auditmap_sz,
|
344
|
-
progress: progress,
|
345
|
-
curr_res_time: http.curr_res_time,
|
346
|
-
curr_res_cnt: http.curr_res_cnt,
|
347
|
-
curr_avg: http.curr_res_per_second,
|
348
|
-
average_res_time: http.average_res_time,
|
349
|
-
max_concurrency: http.max_concurrency,
|
350
|
-
current_page: @current_url,
|
351
|
-
eta: pb
|
367
|
+
http: http.statistics,
|
368
|
+
runtime: @start_datetime ? Time.now - @start_datetime : 0,
|
369
|
+
found_pages: sitemap.size,
|
370
|
+
audited_pages: state.audited_page_count,
|
371
|
+
current_page: @current_url
|
352
372
|
}
|
353
373
|
end
|
354
374
|
|
355
|
-
#
|
356
|
-
#
|
357
|
-
#
|
375
|
+
# @return [Array<String>]
|
376
|
+
# Messages providing more information about the current {#status} of
|
377
|
+
# the framework.
|
378
|
+
def status_messages
|
379
|
+
state.status_messages
|
380
|
+
end
|
381
|
+
|
358
382
|
# @param [Page] page
|
383
|
+
# Page to push to the page audit queue -- increases {#page_queue_total_size}
|
359
384
|
#
|
360
385
|
# @return [Bool]
|
361
386
|
# `true` if push was successful, `false` if the `page` matched any
|
362
|
-
# exclusion criteria.
|
363
|
-
|
364
|
-
|
365
|
-
|
387
|
+
# exclusion criteria or has already been seen.
|
388
|
+
def push_to_page_queue( page, force = false )
|
389
|
+
return false if !force && (!accepts_more_pages? || state.page_seen?( page ) ||
|
390
|
+
page.scope.out? || page.scope.redundant?)
|
391
|
+
|
392
|
+
# We want to update from the already loaded page cache (if there is one)
|
393
|
+
# as we have to store the page anyways (needs to go through Browser analysis)
|
394
|
+
# and it's not worth the resources to parse its elements.
|
395
|
+
#
|
396
|
+
# We're basically doing this to give the Browser and Trainer a better
|
397
|
+
# view of what elements have been seen, so that they won't feed us pages
|
398
|
+
# with elements that they think are new, but have been provided to us by
|
399
|
+
# some other component; however, it wouldn't be the end of the world if
|
400
|
+
# that were to happen.
|
401
|
+
ElementFilter.update_from_page_cache page
|
366
402
|
|
367
|
-
|
368
|
-
|
403
|
+
data.push_to_page_queue page
|
404
|
+
state.page_seen page
|
369
405
|
|
370
|
-
@sitemap |= [page.url]
|
371
406
|
true
|
372
407
|
end
|
373
408
|
|
374
|
-
#
|
375
|
-
# Pushes a URL to the URL audit queue and updates {#url_queue_total_size}
|
376
|
-
#
|
377
409
|
# @param [String] url
|
410
|
+
# URL to push to the audit queue -- increases {#url_queue_total_size}
|
378
411
|
#
|
379
412
|
# @return [Bool]
|
380
413
|
# `true` if push was successful, `false` if the `url` matched any
|
381
|
-
# exclusion criteria.
|
382
|
-
|
383
|
-
|
384
|
-
return false if skip_path? url
|
414
|
+
# exclusion criteria or has already been seen.
|
415
|
+
def push_to_url_queue( url, force = false )
|
416
|
+
return if !force && !accepts_more_pages?
|
385
417
|
|
386
|
-
|
418
|
+
url = to_absolute( url ) || url
|
419
|
+
if state.url_seen?( url ) || skip_path?( url ) || redundant_path?( url )
|
420
|
+
return false
|
421
|
+
end
|
387
422
|
|
388
|
-
|
389
|
-
|
423
|
+
data.push_to_url_queue url
|
424
|
+
state.url_seen url
|
390
425
|
|
391
|
-
|
392
|
-
false
|
426
|
+
true
|
393
427
|
end
|
394
428
|
|
395
|
-
#
|
396
|
-
#
|
397
|
-
|
398
|
-
|
399
|
-
#
|
400
|
-
def audit_store
|
401
|
-
opts = @opts.to_hash.deep_clone
|
429
|
+
# @return [Report]
|
430
|
+
# Scan results.
|
431
|
+
def report
|
432
|
+
opts = options.to_hash.deep_clone
|
402
433
|
|
403
434
|
# restore the original redundancy rules and their counters
|
404
|
-
opts[
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
plugins: @plugins.results
|
435
|
+
opts[:scope][:redundant_path_patterns] = @orig_redundant
|
436
|
+
|
437
|
+
Report.new(
|
438
|
+
options: options,
|
439
|
+
sitemap: sitemap,
|
440
|
+
issues: Data.issues.sort,
|
441
|
+
plugins: @plugins.results,
|
442
|
+
start_datetime: @start_datetime,
|
443
|
+
finish_datetime: @finish_datetime
|
414
444
|
)
|
415
445
|
end
|
416
|
-
alias :auditstore :audit_store
|
417
446
|
|
447
|
+
# Runs a reporter component and returns the contents of the generated report.
|
418
448
|
#
|
419
|
-
#
|
420
|
-
#
|
421
|
-
# Only accepts reports which support an `outfile` option.
|
449
|
+
# Only accepts reporters which support an `outfile` option.
|
422
450
|
#
|
423
451
|
# @param [String] name
|
424
|
-
# Name of the
|
452
|
+
# Name of the reporter component to run, as presented by {#list_reporters}'s
|
425
453
|
# `:shortname` key.
|
426
|
-
# @param [
|
454
|
+
# @param [Report] external_report
|
427
455
|
# Report to use -- defaults to the local one.
|
428
456
|
#
|
429
|
-
# @return [String]
|
457
|
+
# @return [String]
|
458
|
+
# Scan report.
|
430
459
|
#
|
431
460
|
# @raise [Component::Error::NotFound]
|
432
|
-
# If the given
|
461
|
+
# If the given reporter name doesn't correspond to a valid reporter component.
|
433
462
|
#
|
434
463
|
# @raise [Component::Options::Error::Invalid]
|
435
|
-
# If the requested
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
fail Component::Error::NotFound, "Report '#{name}' could not be found."
|
464
|
+
# If the requested reporter doesn't format the scan results as a String.
|
465
|
+
def report_as( name, external_report = report )
|
466
|
+
if !@reporters.available.include?( name.to_s )
|
467
|
+
fail Component::Error::NotFound, "Reporter '#{name}' could not be found."
|
440
468
|
end
|
441
469
|
|
442
|
-
loaded = @
|
470
|
+
loaded = @reporters.loaded
|
443
471
|
begin
|
444
|
-
@
|
472
|
+
@reporters.clear
|
445
473
|
|
446
|
-
if !@
|
474
|
+
if !@reporters[name].has_outfile?
|
447
475
|
fail Component::Options::Error::Invalid,
|
448
|
-
"
|
476
|
+
"Reporter '#{name}' cannot format the audit results as a String."
|
449
477
|
end
|
450
478
|
|
451
|
-
outfile = "
|
452
|
-
@
|
479
|
+
outfile = "#{Dir.tmpdir}/#{generate_token}"
|
480
|
+
@reporters.run( name, external_report, outfile: outfile )
|
453
481
|
|
454
|
-
IO.
|
482
|
+
IO.binread( outfile )
|
455
483
|
ensure
|
456
484
|
File.delete( outfile ) if outfile
|
457
|
-
@
|
458
|
-
@
|
485
|
+
@reporters.clear
|
486
|
+
@reporters.load loaded
|
459
487
|
end
|
460
488
|
end
|
461
489
|
|
462
|
-
# @return [Array<Hash>]
|
463
|
-
|
464
|
-
|
490
|
+
# @return [Array<Hash>]
|
491
|
+
# Information about all available {Checks}.
|
492
|
+
def list_checks( patterns = nil )
|
493
|
+
loaded = @checks.loaded
|
465
494
|
|
466
495
|
begin
|
467
|
-
@
|
468
|
-
@
|
469
|
-
path = @
|
470
|
-
next if !
|
496
|
+
@checks.clear
|
497
|
+
@checks.available.map do |name|
|
498
|
+
path = @checks.name_to_path( name )
|
499
|
+
next if !list_check?( path, patterns )
|
471
500
|
|
472
|
-
@
|
473
|
-
mod_name: name,
|
501
|
+
@checks[name].info.merge(
|
474
502
|
shortname: name,
|
475
|
-
author: [@
|
503
|
+
author: [@checks[name].info[:author]].
|
476
504
|
flatten.map { |a| a.strip },
|
477
|
-
path: path.strip
|
505
|
+
path: path.strip,
|
506
|
+
platforms: @checks[name].platforms,
|
507
|
+
elements: @checks[name].elements
|
478
508
|
)
|
479
509
|
end.compact
|
480
510
|
ensure
|
481
|
-
@
|
482
|
-
@
|
511
|
+
@checks.clear
|
512
|
+
@checks.load loaded
|
483
513
|
end
|
484
514
|
end
|
485
|
-
alias :lsmod :list_modules
|
486
515
|
|
487
|
-
# @return [Array<Hash>]
|
488
|
-
|
489
|
-
|
516
|
+
# @return [Array<Hash>]
|
517
|
+
# Information about all available {Reporters}.
|
518
|
+
def list_reporters( patterns = nil )
|
519
|
+
loaded = @reporters.loaded
|
490
520
|
|
491
521
|
begin
|
492
|
-
@
|
493
|
-
@
|
494
|
-
path = @
|
495
|
-
next if !
|
522
|
+
@reporters.clear
|
523
|
+
@reporters.available.map do |report|
|
524
|
+
path = @reporters.name_to_path( report )
|
525
|
+
next if !list_reporter?( path, patterns )
|
496
526
|
|
497
|
-
@
|
498
|
-
|
527
|
+
@reporters[report].info.merge(
|
528
|
+
options: @reporters[report].info[:options] || [],
|
499
529
|
shortname: report,
|
500
530
|
path: path,
|
501
|
-
author: [@
|
531
|
+
author: [@reporters[report].info[:author]].
|
502
532
|
flatten.map { |a| a.strip }
|
503
533
|
)
|
504
534
|
end.compact
|
505
535
|
ensure
|
506
|
-
@
|
507
|
-
@
|
536
|
+
@reporters.clear
|
537
|
+
@reporters.load loaded
|
508
538
|
end
|
509
539
|
end
|
510
|
-
alias :lsrep :list_reports
|
511
540
|
|
512
|
-
# @return [Array<Hash>]
|
513
|
-
|
541
|
+
# @return [Array<Hash>]
|
542
|
+
# Information about all available {Plugins}.
|
543
|
+
def list_plugins( patterns = nil )
|
514
544
|
loaded = @plugins.loaded
|
515
545
|
|
516
546
|
begin
|
517
547
|
@plugins.clear
|
518
548
|
@plugins.available.map do |plugin|
|
519
549
|
path = @plugins.name_to_path( plugin )
|
520
|
-
next if !
|
550
|
+
next if !list_plugin?( path, patterns )
|
521
551
|
|
522
552
|
@plugins[plugin].info.merge(
|
523
|
-
|
553
|
+
options: @plugins[plugin].info[:options] || [],
|
524
554
|
shortname: plugin,
|
525
555
|
path: path,
|
526
556
|
author: [@plugins[plugin].info[:author]].
|
@@ -532,9 +562,9 @@ class Framework
|
|
532
562
|
@plugins.load loaded
|
533
563
|
end
|
534
564
|
end
|
535
|
-
alias :lsplug :list_plugins
|
536
565
|
|
537
|
-
# @return [Array<Hash>]
|
566
|
+
# @return [Array<Hash>]
|
567
|
+
# Information about all available platforms.
|
538
568
|
def list_platforms
|
539
569
|
platforms = Platform::Manager.new
|
540
570
|
platforms.valid.inject({}) do |h, platform|
|
@@ -544,264 +574,598 @@ class Framework
|
|
544
574
|
h
|
545
575
|
end
|
546
576
|
end
|
547
|
-
alias :lsplat :list_platforms
|
548
577
|
|
549
|
-
# @return [
|
578
|
+
# @return [Symbol]
|
550
579
|
# Status of the instance, possible values are (in order):
|
551
580
|
#
|
552
|
-
# *
|
553
|
-
# *
|
554
|
-
# * `
|
555
|
-
# * `
|
556
|
-
# *
|
557
|
-
# * `
|
558
|
-
#
|
559
|
-
# * `
|
560
|
-
#
|
581
|
+
# * `:ready` -- {#initialize Initialised} and waiting for instructions.
|
582
|
+
# * `:preparing` -- Getting ready to start (i.e. initializing plugins etc.).
|
583
|
+
# * `:scanning` -- The instance is currently {#run auditing} the webapp.
|
584
|
+
# * `:pausing` -- The instance is being {#pause paused} (if applicable).
|
585
|
+
# * `:paused` -- The instance has been {#pause paused} (if applicable).
|
586
|
+
# * `:suspending` -- The instance is being {#suspend suspended} (if applicable).
|
587
|
+
# * `:suspended` -- The instance has being {#suspend suspended} (if applicable).
|
588
|
+
# * `:cleanup` -- The scan has completed and the instance is
|
589
|
+
# {Framework#clean_up cleaning up} after itself (i.e. waiting for
|
590
|
+
# plugins to finish etc.).
|
591
|
+
# * `:aborted` -- The scan has been {Framework#abort}, you can grab the
|
592
|
+
# report and shutdown.
|
593
|
+
# * `:done` -- The scan has completed, you can grab the report and shutdown.
|
561
594
|
def status
|
562
|
-
|
563
|
-
@status.to_s
|
595
|
+
state.status
|
564
596
|
end
|
565
597
|
|
566
|
-
# @return [Bool]
|
598
|
+
# @return [Bool]
|
599
|
+
# `true` if the framework is running, `false` otherwise. This is `true`
|
600
|
+
# even if the scan is {#paused?}.
|
567
601
|
def running?
|
568
|
-
|
602
|
+
state.running?
|
569
603
|
end
|
570
604
|
|
571
|
-
# @return [Bool]
|
605
|
+
# @return [Bool]
|
606
|
+
# `true` if the system is scanning, `false` otherwise.
|
607
|
+
def scanning?
|
608
|
+
state.scanning?
|
609
|
+
end
|
610
|
+
|
611
|
+
# @return [Bool]
|
612
|
+
# `true` if the framework is paused, `false` otherwise.
|
572
613
|
def paused?
|
573
|
-
|
614
|
+
state.paused?
|
574
615
|
end
|
575
616
|
|
576
|
-
# @return [
|
577
|
-
#
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
true
|
617
|
+
# @return [Bool]
|
618
|
+
# `true` if the framework has been instructed to pause (i.e. is in the
|
619
|
+
# process of being paused or has been paused), `false` otherwise.
|
620
|
+
def pause?
|
621
|
+
state.pause?
|
582
622
|
end
|
583
623
|
|
584
|
-
# @return [
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
true
|
624
|
+
# @return [Bool]
|
625
|
+
# `true` if the framework is in the process of pausing, `false` otherwise.
|
626
|
+
def pausing?
|
627
|
+
state.pausing?
|
589
628
|
end
|
590
629
|
|
591
|
-
# @
|
592
|
-
|
593
|
-
|
630
|
+
# @note Each call from a unique caller is counted as a pause request
|
631
|
+
# and in order for the system to resume **all** pause callers need to
|
632
|
+
# {#resume} it.
|
633
|
+
#
|
634
|
+
# Pauses the framework on a best effort basis.
|
635
|
+
#
|
636
|
+
# @param [Bool] wait
|
637
|
+
# Wait until the system has been paused.
|
638
|
+
#
|
639
|
+
# @return [Integer]
|
640
|
+
# ID identifying this pause request.
|
641
|
+
def pause( wait = true )
|
642
|
+
id = generate_token.hash
|
643
|
+
state.pause id, wait
|
644
|
+
id
|
594
645
|
end
|
595
646
|
|
596
|
-
# @return
|
597
|
-
|
598
|
-
|
647
|
+
# @return [Bool]
|
648
|
+
# `true` if the framework {#run} has been aborted, `false` otherwise.
|
649
|
+
def aborted?
|
650
|
+
state.aborted?
|
599
651
|
end
|
600
652
|
|
653
|
+
# @return [Bool]
|
654
|
+
# `true` if the framework has been instructed to abort (i.e. is in the
|
655
|
+
# process of being aborted or has been aborted), `false` otherwise.
|
656
|
+
def abort?
|
657
|
+
state.abort?
|
658
|
+
end
|
659
|
+
|
660
|
+
# @return [Bool]
|
661
|
+
# `true` if the framework is in the process of aborting, `false` otherwise.
|
662
|
+
def aborting?
|
663
|
+
state.aborting?
|
664
|
+
end
|
665
|
+
|
666
|
+
# Aborts the framework {#run} on a best effort basis.
|
667
|
+
#
|
668
|
+
# @param [Bool] wait
|
669
|
+
# Wait until the system has been aborted.
|
670
|
+
def abort( wait = true )
|
671
|
+
state.abort wait
|
672
|
+
end
|
673
|
+
|
674
|
+
# @note Each call from a unique caller is counted as a pause request
|
675
|
+
# and in order for the system to resume **all** pause callers need to
|
676
|
+
# {#resume} it.
|
677
|
+
#
|
678
|
+
# Removes a {#pause} request for the current caller.
|
679
|
+
#
|
680
|
+
# @param [Integer] id
|
681
|
+
# ID of the {#pause} request.
|
682
|
+
def resume( id )
|
683
|
+
state.resume id
|
684
|
+
end
|
685
|
+
|
686
|
+
# Writes a {Snapshot.dump} to disk and aborts the scan.
|
687
|
+
#
|
688
|
+
# @param [Bool] wait
|
689
|
+
# Wait for the system to write it state to disk.
|
601
690
|
#
|
691
|
+
# @return [String,nil]
|
692
|
+
# Path to the state file `wait` is `true`, `nil` otherwise.
|
693
|
+
def suspend( wait = true )
|
694
|
+
state.suspend( wait )
|
695
|
+
return snapshot_path if wait
|
696
|
+
nil
|
697
|
+
end
|
698
|
+
|
699
|
+
# @return [Bool]
|
700
|
+
# `true` if the system is in the process of being suspended, `false`
|
701
|
+
# otherwise.
|
702
|
+
def suspend?
|
703
|
+
state.suspend?
|
704
|
+
end
|
705
|
+
|
706
|
+
# @return [Bool]
|
707
|
+
# `true` if the system has been suspended, `false` otherwise.
|
708
|
+
def suspended?
|
709
|
+
state.suspended?
|
710
|
+
end
|
711
|
+
|
712
|
+
# @return [String]
|
713
|
+
# Provisioned {#suspend} dump file for this instance.
|
714
|
+
def snapshot_path
|
715
|
+
return @state_archive if @state_archive
|
716
|
+
|
717
|
+
default_filename =
|
718
|
+
"#{URI(options.url).host} #{Time.now.to_s.gsub( ':', '_' )} #{generate_token}.afs"
|
719
|
+
|
720
|
+
location = options.snapshot.save_path
|
721
|
+
|
722
|
+
if !location
|
723
|
+
location = default_filename
|
724
|
+
elsif File.directory? location
|
725
|
+
location += "/#{default_filename}"
|
726
|
+
end
|
727
|
+
|
728
|
+
@state_archive ||= File.expand_path( location )
|
729
|
+
end
|
730
|
+
|
731
|
+
# @param [String] afs
|
732
|
+
# Path to an `.afs.` (Arachni Framework Snapshot) file created by {#suspend}.
|
733
|
+
#
|
734
|
+
# @return [Framework]
|
735
|
+
# Restored instance.
|
736
|
+
def restore( afs )
|
737
|
+
Snapshot.load afs
|
738
|
+
|
739
|
+
browser_job_update_skip_states state.browser_skip_states
|
740
|
+
|
741
|
+
checks.load Options.checks
|
742
|
+
plugins.load Options.plugins.keys
|
743
|
+
|
744
|
+
nil
|
745
|
+
end
|
746
|
+
|
747
|
+
def wait_for_browser?
|
748
|
+
@browser_cluster && !browser_cluster.done?
|
749
|
+
end
|
750
|
+
|
602
751
|
# Cleans up the framework; should be called after running the audit or
|
603
752
|
# after canceling a running scan.
|
604
753
|
#
|
605
754
|
# It stops the clock and waits for the plugins to finish up.
|
606
|
-
|
607
|
-
|
608
|
-
@
|
755
|
+
def clean_up( shutdown_browsers = true )
|
756
|
+
return if @cleaned_up
|
757
|
+
@cleaned_up = true
|
609
758
|
|
610
|
-
|
759
|
+
state.status = :cleanup
|
611
760
|
|
612
|
-
|
613
|
-
|
761
|
+
sitemap.merge!( browser_sitemap )
|
762
|
+
|
763
|
+
if shutdown_browsers
|
764
|
+
state.set_status_message :browser_cluster_shutdown
|
765
|
+
shutdown_browser_cluster
|
766
|
+
end
|
614
767
|
|
615
|
-
|
768
|
+
state.set_status_message :clearing_queues
|
769
|
+
page_queue.clear
|
770
|
+
url_queue.clear
|
616
771
|
|
617
|
-
|
772
|
+
@finish_datetime = Time.now
|
773
|
+
@start_datetime ||= Time.now
|
774
|
+
|
775
|
+
# Make sure this is disabled or it'll break reporter output.
|
618
776
|
disable_only_positives
|
619
777
|
|
620
|
-
|
778
|
+
state.running = false
|
621
779
|
|
622
|
-
|
780
|
+
state.set_status_message :waiting_for_plugins
|
623
781
|
@plugins.block
|
624
782
|
|
783
|
+
# Plugins may need the session right till the very end so save it for last.
|
784
|
+
@session.clean_up
|
785
|
+
@session = nil
|
786
|
+
|
625
787
|
true
|
626
788
|
end
|
627
789
|
|
628
|
-
def
|
629
|
-
|
790
|
+
def browser_job_skip_states
|
791
|
+
return if !@browser_cluster
|
792
|
+
browser_cluster.skip_states( browser_job.id )
|
630
793
|
end
|
631
794
|
|
632
|
-
|
633
|
-
|
795
|
+
# @return [String]
|
796
|
+
# Returns the version of the framework.
|
797
|
+
def version
|
798
|
+
Arachni::VERSION
|
634
799
|
end
|
635
800
|
|
801
|
+
# @note Prefer this from {.reset} if you already have an instance.
|
802
|
+
# @note You should first reset {Arachni::Options}.
|
636
803
|
#
|
637
804
|
# Resets everything and allows the framework to be re-used.
|
638
|
-
#
|
639
|
-
# You should first update {Arachni::Options}.
|
640
|
-
#
|
641
|
-
# Prefer this if you already have an instance.
|
642
|
-
#
|
643
805
|
def reset
|
644
|
-
@
|
645
|
-
@
|
806
|
+
@cleaned_up = false
|
807
|
+
@browser_job = nil
|
808
|
+
|
646
809
|
@failures.clear
|
647
810
|
@retries.clear
|
648
|
-
@sitemap.clear
|
649
|
-
@page_queue.clear
|
650
811
|
|
651
|
-
#
|
652
|
-
#
|
812
|
+
# This needs to happen before resetting the other components so they
|
813
|
+
# will be able to put in their hooks.
|
653
814
|
self.class.reset
|
654
815
|
|
655
816
|
clear_observers
|
656
817
|
reset_trainer
|
657
|
-
|
658
|
-
@
|
659
|
-
@
|
818
|
+
reset_session
|
819
|
+
@checks.clear
|
820
|
+
@reporters.clear
|
660
821
|
@plugins.clear
|
661
822
|
end
|
662
823
|
|
824
|
+
# @note You should first reset {Arachni::Options}.
|
663
825
|
#
|
664
|
-
# Resets everything and allows the framework to be re-used.
|
665
|
-
#
|
666
|
-
# You should first update {Arachni::Options}.
|
667
|
-
#
|
826
|
+
# Resets everything and allows the framework environment to be re-used.
|
668
827
|
def self.reset
|
669
|
-
|
828
|
+
State.clear
|
829
|
+
Data.clear
|
830
|
+
|
670
831
|
Platform::Manager.reset
|
671
|
-
|
832
|
+
Check::Auditor.reset
|
672
833
|
ElementFilter.reset
|
673
834
|
Element::Capabilities::Auditable.reset
|
674
|
-
|
835
|
+
Element::Capabilities::Analyzable.reset
|
836
|
+
Check::Manager.reset
|
675
837
|
Plugin::Manager.reset
|
676
|
-
|
677
|
-
HTTP.reset
|
838
|
+
Reporter::Manager.reset
|
839
|
+
HTTP::Client.reset
|
840
|
+
end
|
841
|
+
|
842
|
+
# @private
|
843
|
+
def reset_trainer
|
844
|
+
@trainer = Trainer.new( self )
|
678
845
|
end
|
679
846
|
|
680
847
|
private
|
681
848
|
|
849
|
+
def shutdown_browser_cluster
|
850
|
+
return if !@browser_cluster
|
851
|
+
|
852
|
+
browser_cluster.shutdown
|
853
|
+
|
854
|
+
@browser_cluster = nil
|
855
|
+
@browser_job = nil
|
856
|
+
end
|
857
|
+
|
858
|
+
def push_paths_from_page( page )
|
859
|
+
page.paths.select { |path| push_to_url_queue( path ) }
|
860
|
+
end
|
861
|
+
|
862
|
+
def browser_sitemap
|
863
|
+
return {} if !@browser_cluster
|
864
|
+
browser_cluster.sitemap
|
865
|
+
end
|
866
|
+
|
867
|
+
def browser_job_update_skip_states( states )
|
868
|
+
return if states.empty?
|
869
|
+
browser_cluster.update_skip_states browser_job.id, states
|
870
|
+
end
|
871
|
+
|
872
|
+
def reset_session
|
873
|
+
@session.clean_up if @session
|
874
|
+
@session = Session.new
|
875
|
+
end
|
876
|
+
|
877
|
+
def abort_if_signaled
|
878
|
+
return if !abort?
|
879
|
+
clean_up
|
880
|
+
state.aborted
|
881
|
+
end
|
882
|
+
|
883
|
+
def suspend_if_signaled
|
884
|
+
return if !suspend?
|
885
|
+
suspend_to_disk
|
886
|
+
end
|
887
|
+
|
888
|
+
def suspend_to_disk
|
889
|
+
while wait_for_browser?
|
890
|
+
last_pending_jobs ||= 0
|
891
|
+
pending_jobs = browser_cluster.pending_job_counter
|
892
|
+
|
893
|
+
if pending_jobs != last_pending_jobs
|
894
|
+
state.set_status_message :waiting_for_browser_cluster_jobs, pending_jobs
|
895
|
+
print_info "Suspending: #{status_messages.first}"
|
896
|
+
end
|
897
|
+
|
898
|
+
last_pending_jobs = pending_jobs
|
899
|
+
sleep 0.1
|
900
|
+
end
|
901
|
+
|
902
|
+
# Make sure the component options are up to date with what's actually
|
903
|
+
# happening.
|
904
|
+
options.checks = checks.loaded
|
905
|
+
options.plugins = plugins.loaded.
|
906
|
+
inject({}) { |h, name| h[name.to_s] = Options.plugins[name.to_s] || {}; h }
|
907
|
+
|
908
|
+
if browser_job_skip_states
|
909
|
+
state.browser_skip_states.merge browser_job_skip_states
|
910
|
+
end
|
911
|
+
|
912
|
+
state.set_status_message :suspending_plugins
|
913
|
+
@plugins.suspend
|
914
|
+
|
915
|
+
state.set_status_message :saving_snapshot, snapshot_path
|
916
|
+
Snapshot.dump( snapshot_path )
|
917
|
+
state.clear_status_messages
|
918
|
+
|
919
|
+
clean_up
|
920
|
+
|
921
|
+
state.set_status_message :snapshot_location, snapshot_path
|
922
|
+
print_info status_messages.first
|
923
|
+
state.suspended
|
924
|
+
end
|
925
|
+
|
926
|
+
def handle_signals
|
927
|
+
wait_if_paused
|
928
|
+
abort_if_signaled
|
929
|
+
suspend_if_signaled
|
930
|
+
end
|
931
|
+
|
932
|
+
def wait_if_paused
|
933
|
+
state.paused if pause?
|
934
|
+
sleep 0.2 while pause? && !abort?
|
935
|
+
end
|
936
|
+
|
937
|
+
# @note Must be called before calling any audit methods.
|
682
938
|
#
|
683
939
|
# Prepares the framework for the audit.
|
684
940
|
#
|
685
|
-
# Sets the status to
|
686
|
-
#
|
687
|
-
#
|
688
|
-
#
|
941
|
+
# * Sets the status to `:preparing`.
|
942
|
+
# * Starts the clock.
|
943
|
+
# * Runs the plugins.
|
689
944
|
def prepare
|
690
|
-
|
691
|
-
|
692
|
-
@
|
945
|
+
state.status = :preparing
|
946
|
+
state.running = true
|
947
|
+
@start_datetime = Time.now
|
693
948
|
|
694
|
-
|
695
|
-
@plugins.run
|
949
|
+
Snapshot.restored? ? @plugins.restore : @plugins.run
|
696
950
|
end
|
697
951
|
|
952
|
+
def handle_browser_page( page )
|
953
|
+
synchronize do
|
954
|
+
return if !push_to_page_queue page
|
955
|
+
|
956
|
+
pushed_paths = nil
|
957
|
+
if crawl?
|
958
|
+
pushed_paths = push_paths_from_page( page ).size
|
959
|
+
end
|
960
|
+
|
961
|
+
print_status "Got new page from the browser-cluster: #{page.dom.url}"
|
962
|
+
print_info "DOM depth: #{page.dom.depth} (Limit: #{options.scope.dom_depth_limit})"
|
963
|
+
|
964
|
+
if page.dom.transitions.any?
|
965
|
+
print_info ' Transitions:'
|
966
|
+
page.dom.print_transitions( method(:print_info), ' ' )
|
967
|
+
end
|
968
|
+
|
969
|
+
if pushed_paths
|
970
|
+
print_info " -- Analysis resulted in #{pushed_paths} usable paths."
|
971
|
+
end
|
972
|
+
end
|
973
|
+
end
|
974
|
+
|
975
|
+
# Passes the `page` to {BrowserCluster#queue} and then pushes
|
976
|
+
# the resulting pages to {#push_to_page_queue}.
|
698
977
|
#
|
699
|
-
#
|
700
|
-
#
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
978
|
+
# @param [Page] page
|
979
|
+
# Page to analyze.
|
980
|
+
def perform_browser_analysis( page )
|
981
|
+
return if !browser_cluster || !accepts_more_pages? ||
|
982
|
+
Options.scope.dom_depth_limit.to_i < page.dom.depth + 1 ||
|
983
|
+
!page.has_script?
|
984
|
+
|
985
|
+
browser_cluster.queue( browser_job.forward( resource: page ) ) do |response|
|
986
|
+
handle_browser_page response.page
|
987
|
+
end
|
988
|
+
|
989
|
+
true
|
990
|
+
end
|
991
|
+
|
992
|
+
def browser_job
|
993
|
+
# We'll recycle the same job since all of them will have the same
|
994
|
+
# callback. This will force the BrowserCluster to use the same block
|
995
|
+
# for all queued jobs.
|
996
|
+
#
|
997
|
+
# Also, this job should never end so that all analysis operations
|
998
|
+
# share the same state.
|
999
|
+
@browser_job ||= BrowserCluster::Jobs::ResourceExploration.new(
|
1000
|
+
never_ending: true
|
1001
|
+
)
|
1002
|
+
end
|
1003
|
+
|
1004
|
+
# Performs the audit.
|
705
1005
|
def audit
|
706
|
-
|
1006
|
+
handle_signals
|
1007
|
+
return if aborted?
|
1008
|
+
|
1009
|
+
state.status = :scanning if !pausing?
|
1010
|
+
|
1011
|
+
push_to_url_queue( options.url )
|
1012
|
+
options.scope.restrict_paths.each { |url| push_to_url_queue( url, true ) }
|
1013
|
+
|
1014
|
+
# Initialize the BrowserCluster.
|
1015
|
+
browser_cluster
|
1016
|
+
|
1017
|
+
# Keep auditing until there are no more resources in the queues and the
|
1018
|
+
# browsers have stopped spinning.
|
1019
|
+
loop do
|
1020
|
+
show_workload_msg = true
|
1021
|
+
while !has_audit_workload? && wait_for_browser?
|
1022
|
+
if show_workload_msg
|
1023
|
+
print_line
|
1024
|
+
print_status 'Workload exhausted, waiting for new pages' <<
|
1025
|
+
' from the browser-cluster...'
|
1026
|
+
end
|
1027
|
+
show_workload_msg = false
|
1028
|
+
|
1029
|
+
last_pending_jobs ||= 0
|
1030
|
+
pending_jobs = browser_cluster.pending_job_counter
|
1031
|
+
if pending_jobs != last_pending_jobs
|
1032
|
+
browser_cluster.print_info "Pending jobs: #{pending_jobs}"
|
1033
|
+
end
|
1034
|
+
last_pending_jobs = pending_jobs
|
707
1035
|
|
708
|
-
|
709
|
-
|
710
|
-
# if we're restricted to a given list of paths there's no reason to run the spider
|
711
|
-
if @opts.restrict_paths && !@opts.restrict_paths.empty?
|
712
|
-
@opts.restrict_paths = @opts.restrict_paths.map { |p| to_absolute( p ) }
|
713
|
-
@sitemap = @opts.restrict_paths.dup
|
714
|
-
@opts.restrict_paths.each { |url| push_to_url_queue( url ) }
|
715
|
-
else
|
716
|
-
# initiates the crawl
|
717
|
-
spider.run do |page|
|
718
|
-
@sitemap |= spider.sitemap
|
719
|
-
push_to_url_queue page.url
|
720
|
-
|
721
|
-
next if page.platforms.empty?
|
722
|
-
print_info "Identified as: #{page.platforms.to_a.join( ', ' )}"
|
1036
|
+
sleep 0.1
|
723
1037
|
end
|
1038
|
+
|
1039
|
+
audit_queues
|
1040
|
+
|
1041
|
+
break if page_limit_reached?
|
1042
|
+
break if !has_audit_workload? && !wait_for_browser?
|
724
1043
|
end
|
1044
|
+
end
|
725
1045
|
|
726
|
-
|
1046
|
+
def has_audit_workload?
|
1047
|
+
!url_queue.empty? || !page_queue.empty?
|
727
1048
|
end
|
728
1049
|
|
729
|
-
|
730
|
-
|
731
|
-
|
1050
|
+
def page_queue
|
1051
|
+
data.page_queue
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
def url_queue
|
1055
|
+
data.url_queue
|
1056
|
+
end
|
1057
|
+
|
1058
|
+
# Audits the {Data::Framework.url_queue URL} and {Data::Framework.page_queue Page}
|
1059
|
+
# queues while maintaining a valid session with the webapp if we've got
|
1060
|
+
# login capabilities.
|
732
1061
|
def audit_queues
|
733
|
-
return if
|
1062
|
+
return if @audit_queues_done == false || !has_audit_workload? ||
|
1063
|
+
page_limit_reached?
|
734
1064
|
|
735
|
-
@
|
1065
|
+
@audit_queues_done = false
|
736
1066
|
|
737
1067
|
# If for some reason we've got pages in the page queue this early,
|
738
1068
|
# consume them and get it over with.
|
739
1069
|
audit_page_queue
|
740
1070
|
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
# Yes...repeating the request is wasteful but we can't store the
|
745
|
-
# responses of the spider to consume them here because there's no way
|
746
|
-
# of knowing how big the site will be.
|
747
|
-
while !@url_queue.empty?
|
748
|
-
page = Page.from_url( @url_queue.pop, precision: 2 )
|
1071
|
+
next_page = nil
|
1072
|
+
while !suspended? && !page_limit_reached? &&
|
1073
|
+
(page = next_page || pop_page_from_url_queue)
|
749
1074
|
|
750
|
-
|
1075
|
+
# Helps us schedule the next page to be grabbed along with the audit
|
1076
|
+
# requests for the current page to avoid blocking.
|
1077
|
+
next_page = nil
|
1078
|
+
next_page_call = proc do
|
1079
|
+
pop_page_from_url_queue { |p| next_page = p }
|
1080
|
+
end
|
751
1081
|
|
752
|
-
|
753
|
-
|
754
|
-
|
1082
|
+
# If we can login capabilities make sure that our session is valid
|
1083
|
+
# before grabbing and auditing the next page.
|
1084
|
+
if session.can_login?
|
1085
|
+
# Schedule the login check to happen along with the audit requests
|
1086
|
+
# to prevent blocking and grab the next page as well.
|
1087
|
+
session.logged_in? do |bool|
|
1088
|
+
next next_page_call.call if bool
|
755
1089
|
|
756
|
-
|
757
|
-
|
758
|
-
else
|
759
|
-
print_bad "Retrying for: #{page.url}"
|
760
|
-
@retries[page.url.hash] += 1
|
761
|
-
@url_queue << page.url
|
1090
|
+
session.login
|
1091
|
+
next_page_call
|
762
1092
|
end
|
1093
|
+
else
|
1094
|
+
next_page_call.call
|
1095
|
+
end
|
763
1096
|
|
764
|
-
|
1097
|
+
# We're counting on piggybacking the next page retrieval with the
|
1098
|
+
# page audit, however if there wasn't an audit we need to force an
|
1099
|
+
# HTTP run.
|
1100
|
+
audit_page( page ) or http.run
|
1101
|
+
|
1102
|
+
if next_page && suspend?
|
1103
|
+
data.page_queue << next_page
|
765
1104
|
end
|
766
1105
|
|
767
|
-
|
1106
|
+
handle_signals
|
768
1107
|
|
769
1108
|
# Consume pages somehow triggered by the audit and pushed by the
|
770
|
-
# trainer or plugins or whatever
|
1109
|
+
# trainer or plugins or whatever.
|
771
1110
|
audit_page_queue
|
772
1111
|
end
|
773
1112
|
|
774
1113
|
audit_page_queue
|
775
|
-
end
|
776
1114
|
|
777
|
-
|
778
|
-
|
779
|
-
#
|
780
|
-
def audit_page_queue
|
781
|
-
# this will run until no new elements appear for the given page
|
782
|
-
audit_page( @page_queue.pop ) while !@page_queue.empty?
|
1115
|
+
@audit_queues_done = true
|
1116
|
+
true
|
783
1117
|
end
|
784
1118
|
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
1119
|
+
def pop_page_from_url_queue( &block )
|
1120
|
+
return if url_queue.empty?
|
1121
|
+
|
1122
|
+
grabbed_page = nil
|
1123
|
+
Page.from_url( url_queue.pop, http: { update_cookies: true } ) do |page|
|
1124
|
+
@retries[page.url.hash] ||= 0
|
1125
|
+
|
1126
|
+
if (location = page.response.headers['Location'])
|
1127
|
+
print_info "Scheduled #{page.code} redirection: #{page.url} => #{location}"
|
1128
|
+
push_to_url_queue to_absolute( location, page.url )
|
1129
|
+
end
|
1130
|
+
|
1131
|
+
if page.code != 0
|
1132
|
+
grabbed_page = page
|
1133
|
+
block.call grabbed_page if block_given?
|
1134
|
+
next
|
1135
|
+
end
|
1136
|
+
|
1137
|
+
if @retries[page.url.hash] >= AUDIT_PAGE_MAX_TRIES
|
1138
|
+
@failures << page.url
|
1139
|
+
|
1140
|
+
print_error "Giving up trying to audit: #{page.url}"
|
1141
|
+
print_error "Couldn't get a response after #{AUDIT_PAGE_MAX_TRIES} tries."
|
1142
|
+
else
|
1143
|
+
print_bad "Retrying for: #{page.url}"
|
1144
|
+
@retries[page.url.hash] += 1
|
1145
|
+
url_queue << page.url
|
1146
|
+
end
|
1147
|
+
|
1148
|
+
grabbed_page = nil
|
1149
|
+
block.call grabbed_page if block_given?
|
1150
|
+
end
|
1151
|
+
http.run if !block_given?
|
1152
|
+
grabbed_page
|
795
1153
|
end
|
796
1154
|
|
797
|
-
|
798
|
-
|
799
|
-
|
1155
|
+
# Audits the page queue.
|
1156
|
+
#
|
1157
|
+
# @see #pop_page_from_queue
|
1158
|
+
def audit_page_queue
|
1159
|
+
while !suspended? && !page_limit_reached? && (page = pop_page_from_queue)
|
1160
|
+
audit_page( page )
|
1161
|
+
handle_signals
|
800
1162
|
end
|
801
1163
|
end
|
802
1164
|
|
803
|
-
|
804
|
-
|
1165
|
+
# @return [Page]
|
1166
|
+
def pop_page_from_queue
|
1167
|
+
return if page_queue.empty?
|
1168
|
+
page_queue.pop
|
805
1169
|
end
|
806
1170
|
|
807
1171
|
def harvest_http_responses
|
@@ -814,43 +1178,44 @@ class Framework
|
|
814
1178
|
|
815
1179
|
# Needed for some HTTP callbacks.
|
816
1180
|
http.run
|
817
|
-
|
818
|
-
session.ensure_logged_in
|
819
1181
|
end
|
820
1182
|
|
1183
|
+
# Passes a page to the check and runs it.
|
1184
|
+
# It also handles any exceptions thrown by the check at runtime.
|
821
1185
|
#
|
822
|
-
#
|
823
|
-
#
|
824
|
-
#
|
825
|
-
# @see Page
|
826
|
-
#
|
827
|
-
# @param [Arachni::Module::Base] mod the module to run
|
1186
|
+
# @param [Check::Base] check
|
1187
|
+
# Check to run.
|
828
1188
|
# @param [Page] page
|
829
|
-
|
830
|
-
def run_module_against_page( mod, page )
|
1189
|
+
def check_page( check, page )
|
831
1190
|
begin
|
832
|
-
@
|
833
|
-
rescue SystemExit
|
834
|
-
raise
|
1191
|
+
@checks.run_one( check, page )
|
835
1192
|
rescue => e
|
836
|
-
print_error "Error in #{
|
1193
|
+
print_error "Error in #{check.to_s}: #{e.to_s}"
|
837
1194
|
print_error_backtrace e
|
838
1195
|
end
|
839
1196
|
end
|
840
1197
|
|
841
|
-
def
|
842
|
-
|
1198
|
+
def add_to_sitemap( page )
|
1199
|
+
data.add_page_to_sitemap( page )
|
1200
|
+
end
|
1201
|
+
|
1202
|
+
def list_reporter?( path, patterns = nil )
|
1203
|
+
regexp_array_match( patterns, path )
|
843
1204
|
end
|
844
1205
|
|
845
|
-
def
|
846
|
-
regexp_array_match(
|
1206
|
+
def list_check?( path, patterns = nil )
|
1207
|
+
regexp_array_match( patterns, path )
|
847
1208
|
end
|
848
1209
|
|
849
|
-
def
|
850
|
-
regexp_array_match(
|
1210
|
+
def list_plugin?( path, patterns = nil )
|
1211
|
+
regexp_array_match( patterns, path )
|
851
1212
|
end
|
852
1213
|
|
853
1214
|
def regexp_array_match( regexps, str )
|
1215
|
+
regexps = [regexps].flatten.compact.
|
1216
|
+
map { |s| s.is_a?( Regexp ) ? s : Regexp.new( s.to_s ) }
|
1217
|
+
return true if regexps.empty?
|
1218
|
+
|
854
1219
|
cnt = 0
|
855
1220
|
regexps.each { |filter| cnt += 1 if str =~ filter }
|
856
1221
|
cnt == regexps.size
|