arachni 0.4.5.2 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +9 -9
- data/CHANGELOG.md +97 -0
- data/CONTRIBUTORS.md +1 -0
- data/NOTICE +1 -1
- data/README.md +4 -4
- data/Rakefile +111 -26
- data/arachni.gemspec +2 -2
- data/bin/arachni +1 -1
- data/bin/arachni_console +1 -1
- data/bin/arachni_multi +1 -1
- data/bin/arachni_rpc +1 -1
- data/bin/arachni_rpcd +1 -1
- data/bin/arachni_rpcd_monitor +1 -1
- data/bin/arachni_script +1 -1
- data/external/metasploit/LICENSE +1 -1
- data/fingerprinters/frameworks/rack.rb +1 -1
- data/fingerprinters/languages/asp.rb +1 -1
- data/fingerprinters/languages/aspx.rb +1 -1
- data/fingerprinters/languages/jsp.rb +3 -5
- data/fingerprinters/languages/php.rb +1 -1
- data/fingerprinters/languages/python.rb +1 -1
- data/fingerprinters/languages/ruby.rb +1 -1
- data/fingerprinters/os/bsd.rb +1 -1
- data/fingerprinters/os/linux.rb +1 -1
- data/fingerprinters/os/solaris.rb +1 -1
- data/fingerprinters/os/unix.rb +1 -1
- data/fingerprinters/os/windows.rb +1 -1
- data/fingerprinters/servers/apache.rb +1 -1
- data/fingerprinters/servers/iis.rb +1 -1
- data/fingerprinters/servers/jetty.rb +1 -1
- data/fingerprinters/servers/nginx.rb +1 -1
- data/fingerprinters/servers/tomcat.rb +1 -1
- data/lib/arachni.rb +6 -1
- data/lib/arachni/audit_store.rb +1 -1
- data/lib/arachni/banner.rb +1 -1
- data/lib/arachni/component/manager.rb +1 -1
- data/lib/arachni/component/options.rb +1 -1
- data/lib/arachni/component/options/address.rb +1 -1
- data/lib/arachni/component/options/base.rb +1 -1
- data/lib/arachni/component/options/bool.rb +1 -1
- data/lib/arachni/component/options/enum.rb +1 -1
- data/lib/arachni/component/options/float.rb +1 -1
- data/lib/arachni/component/options/int.rb +1 -1
- data/lib/arachni/component/options/path.rb +1 -1
- data/lib/arachni/component/options/port.rb +1 -1
- data/lib/arachni/component/options/string.rb +1 -1
- data/lib/arachni/component/options/url.rb +1 -1
- data/lib/arachni/element/base.rb +1 -1
- data/lib/arachni/element/body.rb +1 -1
- data/lib/arachni/element/capabilities/auditable.rb +45 -22
- data/lib/arachni/element/capabilities/auditable/rdiff.rb +378 -122
- data/lib/arachni/element/capabilities/auditable/taint.rb +57 -20
- data/lib/arachni/element/capabilities/auditable/timeout.rb +95 -68
- data/lib/arachni/element/capabilities/mutable.rb +77 -40
- data/lib/arachni/element/capabilities/refreshable.rb +7 -1
- data/lib/arachni/element/cookie.rb +46 -167
- data/lib/arachni/element/form.rb +77 -517
- data/lib/arachni/element/header.rb +21 -15
- data/lib/arachni/element/link.rb +2 -2
- data/lib/arachni/element/path.rb +1 -1
- data/lib/arachni/element/server.rb +1 -1
- data/lib/arachni/element_filter.rb +1 -1
- data/lib/arachni/error.rb +1 -1
- data/lib/arachni/framework.rb +16 -7
- data/lib/arachni/http.rb +111 -118
- data/lib/arachni/http/cookie_jar.rb +8 -2
- data/lib/arachni/issue.rb +4 -1
- data/lib/arachni/mixins/observable.rb +1 -1
- data/lib/arachni/mixins/progress_bar.rb +1 -1
- data/lib/arachni/mixins/terminal.rb +1 -1
- data/lib/arachni/module.rb +1 -1
- data/lib/arachni/module/auditor.rb +23 -17
- data/lib/arachni/module/base.rb +1 -1
- data/lib/arachni/module/manager.rb +4 -4
- data/lib/arachni/module/output.rb +1 -1
- data/lib/arachni/module/utilities.rb +1 -1
- data/lib/arachni/options.rb +28 -7
- data/lib/arachni/page.rb +4 -5
- data/lib/arachni/parser.rb +3 -2
- data/lib/arachni/platform.rb +1 -1
- data/lib/arachni/platform/fingerprinter.rb +1 -1
- data/lib/arachni/platform/list.rb +11 -29
- data/lib/arachni/platform/manager.rb +31 -8
- data/lib/arachni/plugin.rb +1 -1
- data/lib/arachni/plugin/base.rb +1 -1
- data/lib/arachni/plugin/manager.rb +1 -1
- data/lib/arachni/processes.rb +1 -1
- data/lib/arachni/processes/dispatchers.rb +1 -1
- data/lib/arachni/processes/helpers.rb +1 -1
- data/lib/arachni/processes/helpers/dispatchers.rb +1 -1
- data/lib/arachni/processes/helpers/instances.rb +1 -1
- data/lib/arachni/processes/helpers/processes.rb +1 -1
- data/lib/arachni/processes/instances.rb +1 -1
- data/lib/arachni/processes/manager.rb +1 -1
- data/lib/arachni/report.rb +1 -1
- data/lib/arachni/report/base.rb +1 -1
- data/lib/arachni/report/manager.rb +1 -1
- data/lib/arachni/rpc/client/base.rb +1 -1
- data/lib/arachni/rpc/client/dispatcher.rb +1 -1
- data/lib/arachni/rpc/client/instance.rb +1 -1
- data/lib/arachni/rpc/server/active_options.rb +1 -1
- data/lib/arachni/rpc/server/base.rb +1 -1
- data/lib/arachni/rpc/server/dispatcher.rb +10 -6
- data/lib/arachni/rpc/server/dispatcher/handler.rb +1 -1
- data/lib/arachni/rpc/server/dispatcher/node.rb +5 -3
- data/lib/arachni/rpc/server/framework.rb +5 -3
- data/lib/arachni/rpc/server/framework/distributor.rb +24 -19
- data/lib/arachni/rpc/server/framework/master.rb +1 -1
- data/lib/arachni/rpc/server/framework/multi_instance.rb +7 -1
- data/lib/arachni/rpc/server/framework/slave.rb +1 -1
- data/lib/arachni/rpc/server/instance.rb +5 -4
- data/lib/arachni/rpc/server/module/manager.rb +1 -1
- data/lib/arachni/rpc/server/output.rb +1 -1
- data/lib/arachni/rpc/server/plugin/manager.rb +1 -1
- data/lib/arachni/rpc/server/spider.rb +5 -2
- data/lib/arachni/ruby.rb +1 -1
- data/lib/arachni/ruby/array.rb +9 -1
- data/lib/arachni/ruby/enumerable.rb +1 -1
- data/lib/arachni/ruby/hash.rb +24 -5
- data/lib/arachni/ruby/io.rb +1 -1
- data/lib/arachni/ruby/object.rb +1 -1
- data/lib/arachni/ruby/set.rb +1 -1
- data/lib/arachni/ruby/string.rb +13 -2
- data/lib/arachni/ruby/webrick.rb +3 -15
- data/lib/arachni/ruby/webrick/cookie.rb +30 -0
- data/lib/arachni/ruby/webrick/httprequest.rb +42 -0
- data/lib/arachni/session.rb +21 -8
- data/lib/arachni/spider.rb +18 -11
- data/lib/arachni/support.rb +3 -1
- data/lib/arachni/support/buffer.rb +1 -1
- data/lib/arachni/support/buffer/autoflush.rb +1 -1
- data/lib/arachni/support/buffer/base.rb +1 -1
- data/lib/arachni/support/cache.rb +1 -1
- data/lib/arachni/support/cache/base.rb +1 -1
- data/lib/arachni/support/cache/least_cost_replacement.rb +1 -1
- data/lib/arachni/support/cache/least_recently_used.rb +1 -1
- data/lib/arachni/support/cache/preference.rb +1 -1
- data/lib/arachni/support/cache/random_replacement.rb +1 -1
- data/lib/arachni/support/crypto.rb +1 -1
- data/lib/arachni/support/crypto/rsa_aes_cbc.rb +1 -1
- data/lib/arachni/support/database.rb +1 -1
- data/lib/arachni/support/database/base.rb +5 -5
- data/lib/arachni/support/database/hash.rb +1 -1
- data/lib/arachni/support/database/queue.rb +52 -69
- data/lib/arachni/{module → support}/key_filler.rb +11 -17
- data/lib/arachni/support/lookup.rb +1 -1
- data/lib/arachni/support/lookup/base.rb +1 -1
- data/lib/arachni/support/lookup/hash_set.rb +1 -1
- data/lib/arachni/support/lookup/moolb.rb +1 -1
- data/lib/arachni/support/queue.rb +1 -1
- data/lib/arachni/support/queue/disk.rb +1 -1
- data/lib/arachni/support/signature.rb +153 -0
- data/lib/arachni/trainer.rb +30 -19
- data/lib/arachni/typhoeus/hydra.rb +1 -1
- data/lib/arachni/typhoeus/request.rb +1 -1
- data/lib/arachni/typhoeus/response.rb +8 -2
- data/lib/arachni/typhoeus/utils.rb +1 -1
- data/lib/arachni/ui/cli/cli.rb +18 -7
- data/lib/arachni/ui/cli/output.rb +28 -1
- data/lib/arachni/ui/cli/rpc/dispatcher_monitor.rb +1 -1
- data/lib/arachni/ui/cli/rpc/instance.rb +1 -1
- data/lib/arachni/ui/cli/rpc/local.rb +1 -1
- data/lib/arachni/ui/cli/rpc/remote.rb +1 -1
- data/lib/arachni/ui/cli/utilities.rb +14 -29
- data/lib/arachni/ui/foo/output.rb +1 -1
- data/lib/arachni/uri.rb +2 -3
- data/lib/arachni/utilities.rb +1 -1
- data/lib/arachni/version.rb +1 -1
- data/lib/version +1 -1
- data/modules/audit/code_injection.rb +1 -1
- data/modules/audit/code_injection_php_input_wrapper.rb +1 -1
- data/modules/audit/code_injection_timing.rb +1 -1
- data/modules/audit/csrf.rb +1 -1
- data/modules/audit/file_inclusion.rb +5 -5
- data/modules/audit/ldapi.rb +1 -1
- data/modules/audit/os_cmd_injection.rb +1 -1
- data/modules/audit/os_cmd_injection_timing.rb +4 -3
- data/modules/audit/path_traversal.rb +5 -5
- data/modules/audit/response_splitting.rb +1 -1
- data/modules/audit/rfi.rb +1 -1
- data/modules/audit/session_fixation.rb +1 -1
- data/modules/audit/source_code_disclosure.rb +21 -17
- data/modules/audit/sqli.rb +11 -8
- data/modules/audit/sqli/patterns/pgsql +1 -0
- data/modules/audit/sqli/regexp_ignore.txt +1 -0
- data/modules/audit/sqli_blind_rdiff.rb +12 -12
- data/modules/audit/sqli_blind_rdiff/payloads.txt +1 -5
- data/modules/audit/sqli_blind_timing.rb +4 -6
- data/modules/audit/sqli_blind_timing/mssql.txt +9 -9
- data/modules/audit/sqli_blind_timing/mysql.txt +9 -31
- data/modules/audit/sqli_blind_timing/pgsql.txt +6 -28
- data/modules/audit/trainer.rb +1 -1
- data/modules/audit/unvalidated_redirect.rb +1 -1
- data/modules/audit/xpath.rb +1 -1
- data/modules/audit/xss.rb +12 -12
- data/modules/audit/xss_event.rb +1 -1
- data/modules/audit/xss_path.rb +1 -1
- data/modules/audit/xss_script_tag.rb +13 -20
- data/modules/audit/xss_tag.rb +5 -7
- data/modules/recon/allowed_methods.rb +1 -1
- data/modules/recon/backdoors.rb +1 -1
- data/modules/recon/backup_files.rb +1 -1
- data/modules/recon/common_directories.rb +1 -1
- data/modules/recon/common_files.rb +1 -1
- data/modules/recon/common_files/filenames.txt +1 -0
- data/modules/recon/directory_listing.rb +2 -2
- data/modules/recon/grep/captcha.rb +1 -1
- data/modules/recon/grep/credit_card.rb +1 -1
- data/modules/recon/grep/cvs_svn_users.rb +1 -1
- data/modules/recon/grep/emails.rb +1 -1
- data/modules/recon/grep/form_upload.rb +1 -1
- data/modules/recon/grep/html_objects.rb +1 -1
- data/modules/recon/grep/http_only_cookies.rb +1 -1
- data/modules/recon/grep/insecure_cookies.rb +1 -1
- data/modules/recon/grep/mixed_resource.rb +1 -1
- data/modules/recon/grep/password_autocomplete.rb +1 -1
- data/modules/recon/grep/private_ip.rb +1 -1
- data/modules/recon/grep/ssn.rb +1 -1
- data/modules/recon/grep/unencrypted_password_forms.rb +1 -1
- data/modules/recon/htaccess_limit.rb +1 -1
- data/modules/recon/http_put.rb +1 -1
- data/modules/recon/interesting_responses.rb +1 -1
- data/modules/recon/localstart_asp.rb +5 -5
- data/modules/recon/webdav.rb +1 -1
- data/modules/recon/x_forwarded_for_access_restriction_bypass.rb +1 -1
- data/modules/recon/xst.rb +1 -1
- data/path_extractors/anchors.rb +1 -1
- data/path_extractors/areas.rb +1 -1
- data/path_extractors/forms.rb +1 -1
- data/path_extractors/frames.rb +1 -1
- data/path_extractors/generic.rb +1 -1
- data/path_extractors/links.rb +1 -1
- data/path_extractors/meta_refresh.rb +1 -1
- data/path_extractors/scripts.rb +1 -1
- data/plugins/autologin.rb +16 -8
- data/plugins/beep_notify.rb +1 -1
- data/plugins/{defaults/content_types.rb → content_types.rb} +1 -1
- data/plugins/cookie_collector.rb +21 -11
- data/plugins/defaults/autothrottle.rb +1 -1
- data/plugins/defaults/healthmap.rb +1 -1
- data/plugins/defaults/meta/remedies/discovery.rb +1 -1
- data/plugins/defaults/meta/remedies/timing_attacks.rb +6 -8
- data/plugins/defaults/meta/uniformity.rb +1 -1
- data/plugins/defaults/resolver.rb +1 -1
- data/plugins/email_notify.rb +1 -1
- data/plugins/form_dicattack.rb +1 -1
- data/plugins/http_dicattack.rb +1 -1
- data/plugins/libnotify.rb +1 -1
- data/plugins/profiler.rb +1 -1
- data/plugins/proxy.rb +2 -1
- data/plugins/proxy/server.rb +3 -1
- data/plugins/proxy/template_scope.rb +1 -1
- data/plugins/rescan.rb +1 -1
- data/plugins/script.rb +1 -1
- data/plugins/uncommon_headers.rb +2 -1
- data/plugins/vector_feed.rb +1 -1
- data/plugins/waf_detector.rb +1 -1
- data/reports/afr.rb +8 -9
- data/reports/ap.rb +1 -1
- data/reports/html.rb +8 -12
- data/reports/html/default.erb +2 -3
- data/reports/html/default/issue.erb +0 -12
- data/reports/html/default/issues.erb +2 -2
- data/reports/json.rb +13 -10
- data/reports/marshal.rb +8 -9
- data/reports/metareport.rb +9 -10
- data/reports/plugin_formatters/html/autologin.rb +1 -1
- data/reports/plugin_formatters/html/content_types.rb +1 -1
- data/reports/plugin_formatters/html/cookie_collector.rb +1 -1
- data/reports/plugin_formatters/html/discovery.rb +1 -1
- data/reports/plugin_formatters/html/form_dicattack.rb +1 -1
- data/reports/plugin_formatters/html/healthmap.rb +1 -1
- data/reports/plugin_formatters/html/http_dicattack.rb +1 -1
- data/reports/plugin_formatters/html/profiler.rb +1 -1
- data/reports/plugin_formatters/html/resolver.rb +1 -1
- data/reports/plugin_formatters/html/timing_attacks.rb +1 -1
- data/reports/plugin_formatters/html/uncommon_headers.rb +1 -1
- data/reports/plugin_formatters/html/uniformity.rb +1 -1
- data/reports/plugin_formatters/html/waf_detector.rb +1 -1
- data/reports/plugin_formatters/stdout/autologin.rb +1 -1
- data/reports/plugin_formatters/stdout/content_types.rb +1 -1
- data/reports/plugin_formatters/stdout/cookie_collector.rb +1 -1
- data/reports/plugin_formatters/stdout/discovery.rb +1 -1
- data/reports/plugin_formatters/stdout/form_dicattack.rb +1 -1
- data/reports/plugin_formatters/stdout/healthmap.rb +2 -4
- data/reports/plugin_formatters/stdout/http_dicattack.rb +1 -1
- data/reports/plugin_formatters/stdout/profiler.rb +1 -1
- data/reports/plugin_formatters/stdout/resolver.rb +1 -1
- data/reports/plugin_formatters/stdout/timing_attacks.rb +1 -1
- data/reports/plugin_formatters/stdout/uncommon_headers.rb +1 -1
- data/reports/plugin_formatters/stdout/uniformity.rb +1 -1
- data/reports/plugin_formatters/stdout/waf_detector.rb +1 -1
- data/reports/plugin_formatters/xml/autologin.rb +1 -1
- data/reports/plugin_formatters/xml/content_types.rb +1 -1
- data/reports/plugin_formatters/xml/cookie_collector.rb +1 -1
- data/reports/plugin_formatters/xml/discovery.rb +1 -1
- data/reports/plugin_formatters/xml/form_dicattack.rb +1 -1
- data/reports/plugin_formatters/xml/healthmap.rb +1 -1
- data/reports/plugin_formatters/xml/http_dicattack.rb +1 -1
- data/reports/plugin_formatters/xml/profiler.rb +1 -1
- data/reports/plugin_formatters/xml/resolver.rb +1 -1
- data/reports/plugin_formatters/xml/timing_attacks.rb +1 -1
- data/reports/plugin_formatters/xml/uncommon_headers.rb +1 -1
- data/reports/plugin_formatters/xml/uniformity.rb +1 -1
- data/reports/plugin_formatters/xml/waf_detector.rb +1 -1
- data/reports/stdout.rb +1 -1
- data/reports/txt.rb +1 -1
- data/reports/xml.rb +8 -9
- data/reports/xml/buffer.rb +2 -2
- data/reports/yaml.rb +8 -9
- data/spec/arachni/element/capabilities/auditable/rdiff_spec.rb +80 -2
- data/spec/arachni/element/capabilities/auditable/timeout_spec.rb +44 -29
- data/spec/arachni/element/cookie_spec.rb +1 -1
- data/spec/arachni/element/form_spec.rb +31 -13
- data/spec/arachni/http/cookie_jar_spec.rb +11 -0
- data/spec/arachni/http_spec.rb +33 -7
- data/spec/arachni/issue_spec.rb +10 -3
- data/spec/arachni/options_spec.rb +18 -1
- data/spec/arachni/parser_spec.rb +27 -26
- data/spec/arachni/rpc/server/dispatcher/node_spec.rb +10 -1
- data/spec/arachni/rpc/server/dispatcher_spec.rb +15 -0
- data/spec/arachni/ruby/array_spec.rb +11 -0
- data/spec/arachni/ruby/hash_spec.rb +28 -1
- data/spec/arachni/ruby/string_spec.rb +14 -1
- data/spec/arachni/session_spec.rb +39 -0
- data/spec/arachni/spider_spec.rb +23 -14
- data/spec/arachni/{module → support}/key_filler.rb +20 -2
- data/spec/arachni/support/signature_spec.rb +158 -0
- data/spec/arachni/trainer_spec.rb +31 -0
- data/spec/arachni/typhoeus/response_spec.rb +17 -0
- data/spec/arachni/uri_spec.rb +1 -1
- data/spec/external/wavsep/active/lfi_spec.rb +94 -0
- data/spec/external/wavsep/active/rfi_spec.rb +35 -0
- data/spec/external/wavsep/active/sqli_spec.rb +108 -0
- data/spec/external/wavsep/active/xss_spec.rb +41 -0
- data/spec/external/wavsep/false_positives/lfi_spec.rb +33 -0
- data/spec/external/wavsep/false_positives/rfi_spec.rb +21 -0
- data/spec/external/wavsep/false_positives/sqli_spec.rb +32 -0
- data/spec/external/wavsep/false_positives/xss_spec.rb +21 -0
- data/spec/modules/audit/source_code_disclosure_spec.rb +4 -4
- data/spec/modules/audit/sqli_blind_rdiff_spec.rb +1 -1
- data/spec/modules/audit/sqli_blind_timing_spec.rb +3 -3
- data/spec/modules/audit/sqli_spec.rb +1 -1
- data/spec/modules/audit/xss_script_tag_spec.rb +1 -1
- data/spec/plugins/autologin_spec.rb +25 -7
- data/spec/plugins/cookie_collector_spec.rb +17 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/support/fixtures/fingerprinters/test.rb +1 -1
- data/spec/support/fixtures/modules/test.rb +1 -1
- data/spec/support/fixtures/modules/test2.rb +1 -1
- data/spec/support/fixtures/modules/test3.rb +1 -1
- data/spec/support/fixtures/plugins/bad.rb +1 -1
- data/spec/support/fixtures/plugins/defaults/default.rb +1 -1
- data/spec/support/fixtures/plugins/distributable.rb +1 -1
- data/spec/support/fixtures/plugins/loop.rb +1 -1
- data/spec/support/fixtures/plugins/spider_hook.rb +1 -1
- data/spec/support/fixtures/plugins/wait.rb +1 -1
- data/spec/support/fixtures/plugins/with_options.rb +1 -1
- data/spec/support/fixtures/reports/base_spec/plugin_formatters/with_formatters/foobar.rb +1 -1
- data/spec/support/fixtures/reports/base_spec/with_formatters.rb +1 -1
- data/spec/support/fixtures/reports/base_spec/with_outfile.rb +1 -1
- data/spec/support/fixtures/reports/base_spec/without_outfile.rb +1 -1
- data/spec/support/fixtures/reports/manager_spec/afr.rb +1 -1
- data/spec/support/fixtures/reports/manager_spec/foo.rb +1 -1
- data/spec/support/fixtures/run_mod/body.rb +1 -1
- data/spec/support/fixtures/run_mod/cookies.rb +1 -1
- data/spec/support/fixtures/run_mod/empty.rb +1 -1
- data/spec/support/fixtures/run_mod/flch.rb +1 -1
- data/spec/support/fixtures/run_mod/forms.rb +1 -1
- data/spec/support/fixtures/run_mod/headers.rb +1 -1
- data/spec/support/fixtures/run_mod/links.rb +1 -1
- data/spec/support/fixtures/run_mod/nil.rb +1 -1
- data/spec/support/fixtures/run_mod/path.rb +1 -1
- data/spec/support/fixtures/run_mod/server.rb +1 -1
- data/spec/support/fixtures/taint_module/taint.rb +1 -1
- data/spec/support/fixtures/wait_module/wait.rb +1 -1
- data/spec/support/helpers/framework.rb +1 -1
- data/spec/support/helpers/misc.rb +1 -1
- data/spec/support/helpers/paths.rb +1 -1
- data/spec/support/helpers/requires.rb +1 -1
- data/spec/support/helpers/resets.rb +1 -1
- data/spec/support/helpers/web_server.rb +1 -1
- data/spec/support/lib/web_server_manager.rb +1 -1
- data/spec/support/logs/Dispatcher - 10129-46995.log +9 -0
- data/spec/support/logs/Dispatcher - 10139-63648.log +19 -0
- data/spec/support/logs/Dispatcher - 10149-5551.log +17 -0
- data/spec/support/logs/Dispatcher - 10158-34385.log +13 -0
- data/spec/support/logs/Dispatcher - 10167-55701.log +9 -0
- data/spec/support/logs/Dispatcher - 10176-8922.log +9 -0
- data/spec/support/logs/Dispatcher - 10185-53716.log +11 -0
- data/spec/support/logs/Dispatcher - 10198-44724.log +11 -0
- data/spec/support/logs/Dispatcher - 10211-7697.log +11 -0
- data/spec/support/logs/Dispatcher - 10224-3751.log +35 -0
- data/spec/support/logs/Dispatcher - 10285-7404.log +21 -0
- data/spec/support/logs/Dispatcher - 10294-56221.log +21 -0
- data/spec/support/logs/Dispatcher - 10303-2483.log +23 -0
- data/spec/support/logs/Dispatcher - 10344-60543.log +19 -0
- data/spec/support/logs/Dispatcher - 10355-31708.log +17 -0
- data/spec/support/logs/Dispatcher - 10364-63170.log +15 -0
- data/spec/support/logs/Dispatcher - 10377-37936.log +11 -0
- data/spec/support/logs/Dispatcher - 10390-37511.log +9 -0
- data/spec/support/logs/Dispatcher - 10400-29603.log +9 -0
- data/spec/support/logs/Dispatcher - 10409-57042.log +9 -0
- data/spec/support/logs/Dispatcher - 10418-17812.log +9 -0
- data/spec/support/logs/Dispatcher - 10427-59862.log +11 -0
- data/spec/support/logs/Dispatcher - 10440-48351.log +9 -0
- data/spec/support/logs/Dispatcher - 10449-24218.log +9 -0
- data/spec/support/logs/Dispatcher - 10458-54646.log +9 -0
- data/spec/support/logs/Dispatcher - 10511-3333.log +63 -0
- data/spec/support/logs/Dispatcher - 10520-50009.log +43 -0
- data/spec/support/logs/Dispatcher - 10529-44870.log +39 -0
- data/spec/support/logs/Dispatcher - 10538-49556.log +34 -0
- data/spec/support/logs/Dispatcher - 10547-61887.log +28 -0
- data/spec/support/logs/Dispatcher - 10556-31163.log +21 -0
- data/spec/support/logs/Dispatcher - 10565-40008.log +13 -0
- data/spec/support/logs/Dispatcher - 10575-18836.log +9 -0
- data/spec/support/logs/Dispatcher - 10747-32268.log +19 -0
- data/spec/support/logs/Dispatcher - 10757-4081.log +21 -0
- data/spec/support/logs/Dispatcher - 10766-49190.log +15 -0
- data/spec/support/logs/Dispatcher - 10780-46610.log +19 -0
- data/spec/support/logs/Dispatcher - 10789-5332.log +21 -0
- data/spec/support/logs/Dispatcher - 10798-56243.log +15 -0
- data/spec/support/logs/Dispatcher - 10920-32037.log +17 -0
- data/spec/support/logs/Dispatcher - 10929-35662.log +21 -0
- data/spec/support/logs/Dispatcher - 10938-64010.log +13 -0
- data/spec/support/logs/Dispatcher - 10951-44746.log +19 -0
- data/spec/support/logs/Dispatcher - 10961-55791.log +21 -0
- data/spec/support/logs/Dispatcher - 10972-58913.log +15 -0
- data/spec/support/logs/Dispatcher - 11023-45004.log +17 -0
- data/spec/support/logs/Dispatcher - 11033-55505.log +21 -0
- data/spec/support/logs/Dispatcher - 11042-46123.log +13 -0
- data/spec/support/logs/Dispatcher - 11055-26836.log +17 -0
- data/spec/support/logs/Dispatcher - 11064-60361.log +21 -0
- data/spec/support/logs/Dispatcher - 11073-17507.log +13 -0
- data/spec/support/logs/Dispatcher - 11298-28357.log +19 -0
- data/spec/support/logs/Dispatcher - 11307-62669.log +21 -0
- data/spec/support/logs/Dispatcher - 11316-9391.log +15 -0
- data/spec/support/logs/Dispatcher - 11340-45921.log +21 -0
- data/spec/support/logs/Dispatcher - 11349-8693.log +25 -0
- data/spec/support/logs/Dispatcher - 11358-53753.log +15 -0
- data/spec/support/logs/Dispatcher - 11394-29437.log +17 -0
- data/spec/support/logs/Dispatcher - 11403-59953.log +21 -0
- data/spec/support/logs/Dispatcher - 11412-51134.log +13 -0
- data/spec/support/logs/Dispatcher - 11425-42569.log +21 -0
- data/spec/support/logs/Dispatcher - 11434-16150.log +25 -0
- data/spec/support/logs/Dispatcher - 11443-19072.log +15 -0
- data/spec/support/logs/Dispatcher - 11479-39149.log +17 -0
- data/spec/support/logs/Dispatcher - 11488-42169.log +21 -0
- data/spec/support/logs/Dispatcher - 11497-29822.log +13 -0
- data/spec/support/logs/Dispatcher - 11510-8273.log +17 -0
- data/spec/support/logs/Dispatcher - 11519-18206.log +21 -0
- data/spec/support/logs/Dispatcher - 11528-55825.log +13 -0
- data/spec/support/logs/Dispatcher - 9969-52890.log +9 -0
- data/spec/support/logs/Dispatcher - 9996-38451.log +21 -0
- data/spec/support/logs/{Instance - 12589-35500.error.log → Instance - 10762-33696.error.log } +63 -40
- data/spec/support/logs/{Instance - 16415-47240.error.log → Instance - 11038-18065.error.log } +65 -42
- data/spec/support/logs/{Instance - 16762-48636.error.log → Instance - 11069-34848.error.log } +162 -139
- data/spec/support/logs/{Instance - 16789-61713.error.log → Instance - 11091-33954.error.log } +60 -37
- data/spec/support/logs/{Instance - 16795-55306.error.log → Instance - 11097-33191.error.log } +65 -42
- data/spec/support/logs/{Instance - 12909-9442.error.log → Instance - 11229-38634.error.log } +60 -37
- data/spec/support/servers/arachni/element/capabilities/auditable/rdiff.rb +131 -7
- data/spec/support/servers/arachni/element/capabilities/auditable/timeout.rb +4 -0
- data/spec/support/servers/arachni/element/form.rb +27 -0
- data/spec/support/servers/arachni/element/link.rb +16 -0
- data/spec/support/servers/arachni/session.rb +17 -1
- data/spec/support/servers/arachni/spider.rb +25 -1
- data/spec/support/servers/arachni/trainer.rb +8 -0
- data/spec/support/servers/modules/audit/os_cmd_injection_timing.rb +2 -1
- data/spec/support/servers/modules/audit/source_code_disclosure.rb +0 -1
- data/spec/support/servers/modules/audit/sqli/postgresql +2 -0
- data/spec/support/servers/modules/audit/sqli_blind_rdiff.rb +9 -13
- data/spec/support/shared/element/capabilities/auditable.rb +62 -3
- data/spec/support/shared/element/capabilities/refreshable.rb +27 -0
- data/spec/support/shared/external/wavsep.rb +89 -0
- metadata +1081 -1206
- data/lib/arachni/platforms.rb +0 -499
- data/logs/Dispatcher - 12101-7331.log +0 -15
- data/spec/support/logs/Dispatcher - 11821-58635.log +0 -9
- data/spec/support/logs/Dispatcher - 11848-37716.log +0 -21
- data/spec/support/logs/Dispatcher - 11974-31477.log +0 -9
- data/spec/support/logs/Dispatcher - 11984-10290.log +0 -19
- data/spec/support/logs/Dispatcher - 11993-33501.log +0 -17
- data/spec/support/logs/Dispatcher - 12002-62227.log +0 -13
- data/spec/support/logs/Dispatcher - 12013-45779.log +0 -9
- data/spec/support/logs/Dispatcher - 12022-22434.log +0 -9
- data/spec/support/logs/Dispatcher - 12031-41130.log +0 -11
- data/spec/support/logs/Dispatcher - 12045-23894.log +0 -11
- data/spec/support/logs/Dispatcher - 12059-57317.log +0 -35
- data/spec/support/logs/Dispatcher - 12122-60206.log +0 -21
- data/spec/support/logs/Dispatcher - 12132-58445.log +0 -21
- data/spec/support/logs/Dispatcher - 12141-13273.log +0 -23
- data/spec/support/logs/Dispatcher - 12183-2341.log +0 -19
- data/spec/support/logs/Dispatcher - 12192-56486.log +0 -17
- data/spec/support/logs/Dispatcher - 12201-8840.log +0 -15
- data/spec/support/logs/Dispatcher - 12214-47545.log +0 -11
- data/spec/support/logs/Dispatcher - 12227-23676.log +0 -9
- data/spec/support/logs/Dispatcher - 12236-16018.log +0 -9
- data/spec/support/logs/Dispatcher - 12245-61980.log +0 -9
- data/spec/support/logs/Dispatcher - 12254-30185.log +0 -9
- data/spec/support/logs/Dispatcher - 12263-29578.log +0 -11
- data/spec/support/logs/Dispatcher - 12276-64279.log +0 -9
- data/spec/support/logs/Dispatcher - 12285-49975.log +0 -9
- data/spec/support/logs/Dispatcher - 12347-26600.log +0 -63
- data/spec/support/logs/Dispatcher - 12356-43960.log +0 -43
- data/spec/support/logs/Dispatcher - 12365-30567.log +0 -39
- data/spec/support/logs/Dispatcher - 12374-49263.log +0 -34
- data/spec/support/logs/Dispatcher - 12401-6543.log +0 -28
- data/spec/support/logs/Dispatcher - 12410-21678.log +0 -21
- data/spec/support/logs/Dispatcher - 12419-42381.log +0 -13
- data/spec/support/logs/Dispatcher - 12429-25829.log +0 -9
- data/spec/support/logs/Dispatcher - 12574-63838.log +0 -19
- data/spec/support/logs/Dispatcher - 12584-33256.log +0 -21
- data/spec/support/logs/Dispatcher - 12593-45982.log +0 -15
- data/spec/support/logs/Dispatcher - 12606-64171.log +0 -19
- data/spec/support/logs/Dispatcher - 12615-52258.log +0 -21
- data/spec/support/logs/Dispatcher - 12624-48032.log +0 -15
- data/spec/support/logs/Dispatcher - 12744-31691.log +0 -17
- data/spec/support/logs/Dispatcher - 12753-9777.log +0 -21
- data/spec/support/logs/Dispatcher - 12762-14195.log +0 -13
- data/spec/support/logs/Dispatcher - 12775-52778.log +0 -19
- data/spec/support/logs/Dispatcher - 12784-33121.log +0 -21
- data/spec/support/logs/Dispatcher - 12793-23476.log +0 -15
- data/spec/support/logs/Dispatcher - 12845-33401.log +0 -17
- data/spec/support/logs/Dispatcher - 12854-58592.log +0 -21
- data/spec/support/logs/Dispatcher - 12863-38667.log +0 -13
- data/spec/support/logs/Dispatcher - 12876-18504.log +0 -17
- data/spec/support/logs/Dispatcher - 12885-8765.log +0 -21
- data/spec/support/logs/Dispatcher - 12894-7708.log +0 -13
- data/spec/support/logs/Dispatcher - 13112-20247.log +0 -19
- data/spec/support/logs/Dispatcher - 13121-37610.log +0 -21
- data/spec/support/logs/Dispatcher - 13130-55144.log +0 -15
- data/spec/support/logs/Dispatcher - 13154-11476.log +0 -21
- data/spec/support/logs/Dispatcher - 13163-28157.log +0 -25
- data/spec/support/logs/Dispatcher - 13172-1403.log +0 -15
- data/spec/support/logs/Dispatcher - 13208-39214.log +0 -17
- data/spec/support/logs/Dispatcher - 13217-25789.log +0 -21
- data/spec/support/logs/Dispatcher - 13226-32449.log +0 -13
- data/spec/support/logs/Dispatcher - 13239-50344.log +0 -21
- data/spec/support/logs/Dispatcher - 13248-35317.log +0 -25
- data/spec/support/logs/Dispatcher - 13257-20820.log +0 -15
- data/spec/support/logs/Dispatcher - 13293-39307.log +0 -17
- data/spec/support/logs/Dispatcher - 13302-62417.log +0 -21
- data/spec/support/logs/Dispatcher - 13311-57144.log +0 -13
- data/spec/support/logs/Dispatcher - 13324-35654.log +0 -17
- data/spec/support/logs/Dispatcher - 13333-9999.log +0 -21
- data/spec/support/logs/Dispatcher - 13342-64466.log +0 -13
- data/spec/support/logs/Dispatcher - 15092-40680.log +0 -9
- data/spec/support/logs/Dispatcher - 15119-21562.log +0 -21
- data/spec/support/logs/Dispatcher - 15680-63471.log +0 -9
- data/spec/support/logs/Dispatcher - 15690-15104.log +0 -19
- data/spec/support/logs/Dispatcher - 15699-36034.log +0 -17
- data/spec/support/logs/Dispatcher - 15708-21275.log +0 -13
- data/spec/support/logs/Dispatcher - 15717-6134.log +0 -9
- data/spec/support/logs/Dispatcher - 15727-5906.log +0 -9
- data/spec/support/logs/Dispatcher - 15736-27941.log +0 -11
- data/spec/support/logs/Dispatcher - 15749-31464.log +0 -11
- data/spec/support/logs/Dispatcher - 15762-52837.log +0 -35
- data/spec/support/logs/Dispatcher - 15823-2486.log +0 -21
- data/spec/support/logs/Dispatcher - 15832-34792.log +0 -21
- data/spec/support/logs/Dispatcher - 15841-3367.log +0 -23
- data/spec/support/logs/Dispatcher - 15886-2171.log +0 -19
- data/spec/support/logs/Dispatcher - 15895-6022.log +0 -17
- data/spec/support/logs/Dispatcher - 15904-51624.log +0 -15
- data/spec/support/logs/Dispatcher - 15917-11227.log +0 -11
- data/spec/support/logs/Dispatcher - 15930-17170.log +0 -9
- data/spec/support/logs/Dispatcher - 15939-24891.log +0 -9
- data/spec/support/logs/Dispatcher - 15948-26858.log +0 -9
- data/spec/support/logs/Dispatcher - 15957-12278.log +0 -9
- data/spec/support/logs/Dispatcher - 15967-37642.log +0 -11
- data/spec/support/logs/Dispatcher - 15981-57959.log +0 -9
- data/spec/support/logs/Dispatcher - 16000-51003.log +0 -9
- data/spec/support/logs/Dispatcher - 16064-25969.log +0 -63
- data/spec/support/logs/Dispatcher - 16073-13164.log +0 -43
- data/spec/support/logs/Dispatcher - 16083-21729.log +0 -39
- data/spec/support/logs/Dispatcher - 16092-48691.log +0 -34
- data/spec/support/logs/Dispatcher - 16101-7385.log +0 -28
- data/spec/support/logs/Dispatcher - 16110-24222.log +0 -21
- data/spec/support/logs/Dispatcher - 16119-29645.log +0 -13
- data/spec/support/logs/Dispatcher - 16129-23325.log +0 -9
- data/spec/support/logs/Dispatcher - 16399-42716.log +0 -19
- data/spec/support/logs/Dispatcher - 16410-3301.log +0 -21
- data/spec/support/logs/Dispatcher - 16419-8500.log +0 -15
- data/spec/support/logs/Dispatcher - 16432-2467.log +0 -19
- data/spec/support/logs/Dispatcher - 16441-27407.log +0 -21
- data/spec/support/logs/Dispatcher - 16450-28157.log +0 -15
- data/spec/support/logs/Dispatcher - 16607-37339.log +0 -17
- data/spec/support/logs/Dispatcher - 16616-50971.log +0 -21
- data/spec/support/logs/Dispatcher - 16625-28154.log +0 -13
- data/spec/support/logs/Dispatcher - 16638-17094.log +0 -19
- data/spec/support/logs/Dispatcher - 16647-25657.log +0 -21
- data/spec/support/logs/Dispatcher - 16656-11108.log +0 -15
- data/spec/support/logs/Dispatcher - 16716-31067.log +0 -17
- data/spec/support/logs/Dispatcher - 16726-34466.log +0 -21
- data/spec/support/logs/Dispatcher - 16735-55150.log +0 -13
- data/spec/support/logs/Dispatcher - 16748-7910.log +0 -17
- data/spec/support/logs/Dispatcher - 16757-62118.log +0 -21
- data/spec/support/logs/Dispatcher - 16766-31937.log +0 -13
- data/spec/support/logs/Dispatcher - 16999-6441.log +0 -19
- data/spec/support/logs/Dispatcher - 17008-51788.log +0 -21
- data/spec/support/logs/Dispatcher - 17017-20096.log +0 -15
- data/spec/support/logs/Dispatcher - 17041-15877.log +0 -21
- data/spec/support/logs/Dispatcher - 17050-42137.log +0 -25
- data/spec/support/logs/Dispatcher - 17059-12767.log +0 -15
- data/spec/support/logs/Dispatcher - 17095-3041.log +0 -17
- data/spec/support/logs/Dispatcher - 17104-42336.log +0 -21
- data/spec/support/logs/Dispatcher - 17113-11660.log +0 -13
- data/spec/support/logs/Dispatcher - 17126-64859.log +0 -21
- data/spec/support/logs/Dispatcher - 17135-11634.log +0 -25
- data/spec/support/logs/Dispatcher - 17144-37598.log +0 -15
- data/spec/support/logs/Dispatcher - 17180-55804.log +0 -17
- data/spec/support/logs/Dispatcher - 17189-5599.log +0 -21
- data/spec/support/logs/Dispatcher - 17198-13188.log +0 -13
- data/spec/support/logs/Dispatcher - 17211-23553.log +0 -17
- data/spec/support/logs/Dispatcher - 17220-36701.log +0 -21
- data/spec/support/logs/Dispatcher - 17229-41502.log +0 -13
- data/spec/support/logs/Instance - 12859-23151.error.log +0 -314
- data/spec/support/logs/Instance - 12890-17901.error.log +0 -413
- data/spec/support/logs/Instance - 12915-45947.error.log +0 -314
- data/spec/support/logs/Instance - 13044-48074.error.log +0 -312
- data/spec/support/logs/Instance - 16731-60738.error.log +0 -314
- data/spec/support/logs/Instance - 16931-37511.error.log +0 -312
@@ -47,6 +47,13 @@ describe Arachni::RPC::Server::Dispatcher do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
describe '#dispatch' do
|
50
|
+
context 'when Options#rpc_external_address has been set' do
|
51
|
+
it 'advertises that address' do
|
52
|
+
address = '9.9.9.9'
|
53
|
+
dispatcher = dispatcher_light_spawn( rpc_external_address: address )
|
54
|
+
dispatcher.dispatch['url'].should start_with "#{address}:"
|
55
|
+
end
|
56
|
+
end
|
50
57
|
context 'when not a Grid member' do
|
51
58
|
it 'returns valid Instance info' do
|
52
59
|
info = dispatcher_light_spawn.dispatch
|
@@ -197,6 +204,14 @@ describe Arachni::RPC::Server::Dispatcher do
|
|
197
204
|
stats['node'].delete( 'score' ).should == dispatcher.workload_score
|
198
205
|
stats['node'].keys.should == @node_info_keys
|
199
206
|
end
|
207
|
+
|
208
|
+
context 'when Options#rpc_external_address has been set' do
|
209
|
+
it 'advertises that address' do
|
210
|
+
address = '9.9.9.9'
|
211
|
+
dispatcher = dispatcher_light_spawn( rpc_external_address: address )
|
212
|
+
dispatcher.stats['node']['url'].should start_with "#{address}:"
|
213
|
+
end
|
214
|
+
end
|
200
215
|
end
|
201
216
|
|
202
217
|
describe '#log' do
|
@@ -73,6 +73,17 @@ describe Array do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
describe '#recode' do
|
77
|
+
it 'recursively converts String data to UTF8' do
|
78
|
+
recoded = [
|
79
|
+
"\xE2\x9C\x93",
|
80
|
+
[ "\xE2\x9C\x93" ]
|
81
|
+
].recode
|
82
|
+
recoded.first.should == "\u2713"
|
83
|
+
recoded.last.should == ["\u2713"]
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
76
87
|
describe '#chunk' do
|
77
88
|
it 'splits the array into chunks' do
|
78
89
|
chunks = @arr.chunk( 5 )
|
@@ -44,7 +44,7 @@ describe Hash do
|
|
44
44
|
|
45
45
|
describe '#symbolize_keys' do
|
46
46
|
it 'recursively converts keys to symbols' do
|
47
|
-
with_strings.symbolize_keys.should ==with_symbols
|
47
|
+
with_strings.symbolize_keys.should == with_symbols
|
48
48
|
end
|
49
49
|
|
50
50
|
context 'when the recursive is set to false' do
|
@@ -61,10 +61,37 @@ describe Hash do
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
+
describe '#recode' do
|
65
|
+
it 'recursively converts String data to UTF8' do
|
66
|
+
recoded = {
|
67
|
+
blah: "\xE2\x9C\x93",
|
68
|
+
blah2: {
|
69
|
+
blah3: "\xE2\x9C\x93"
|
70
|
+
}
|
71
|
+
}.recode
|
72
|
+
recoded[:blah].should == "\u2713"
|
73
|
+
recoded[:blah2][:blah3].should == "\u2713"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
64
77
|
describe '#downcase' do
|
65
78
|
it 'converts keys and values to lower-case strings' do
|
66
79
|
{ Stuff: 'VaLue', 'BlAh' => 'VaLUe 2' }.downcase.should ==
|
67
80
|
{ 'stuff' => 'value', 'blah' => 'value 2' }
|
68
81
|
end
|
69
82
|
end
|
83
|
+
|
84
|
+
describe '#find_symbol_keys_recursively' do
|
85
|
+
it 'returns all symbol keys from self and children hashes' do
|
86
|
+
{
|
87
|
+
stuff: 'VaLue',
|
88
|
+
stuff2: {
|
89
|
+
stuff3: {
|
90
|
+
stuff4: 'Blah'
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}.find_symbol_keys_recursively.sort.should ==
|
94
|
+
[:stuff, :stuff2, :stuff3, :stuff4].sort
|
95
|
+
end
|
96
|
+
end
|
70
97
|
end
|
@@ -16,19 +16,21 @@ describe String do
|
|
16
16
|
END
|
17
17
|
|
18
18
|
str.rdiff( str2 ).should == " This is the test.\n" +
|
19
|
-
|
19
|
+
' Not really sure what else to put here'
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
describe '#diff_ratio' do
|
24
24
|
context 'when the strings are identical' do
|
25
25
|
it 'returns 0.0' do
|
26
|
+
''.diff_ratio( '' ).should == 0
|
26
27
|
'test'.diff_ratio( 'test' ).should == 0
|
27
28
|
'test this'.diff_ratio( 'test this' ).should == 0
|
28
29
|
end
|
29
30
|
end
|
30
31
|
context 'when the strings completely different' do
|
31
32
|
it 'returns 1.0' do
|
33
|
+
''.diff_ratio( 'toast' ).should == 1
|
32
34
|
'test'.diff_ratio( 'toast' ).should == 1
|
33
35
|
'test this'.diff_ratio( 'toast that' ).should == 1
|
34
36
|
end
|
@@ -106,4 +108,15 @@ describe String do
|
|
106
108
|
end
|
107
109
|
end
|
108
110
|
|
111
|
+
describe '#longest_word' do
|
112
|
+
it 'returns the longest word' do
|
113
|
+
'o tw longest'.longest_word.should == 'longest'
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
describe '#shortest_word' do
|
118
|
+
it 'returns the longest word' do
|
119
|
+
'o tw longest'.shortest_word.should == 'o'
|
120
|
+
end
|
121
|
+
end
|
109
122
|
end
|
@@ -259,6 +259,45 @@ describe Arachni::Session do
|
|
259
259
|
end
|
260
260
|
|
261
261
|
describe '#ensure_logged_in' do
|
262
|
+
context 'when the login is successful' do
|
263
|
+
it 'returns true' do
|
264
|
+
s = new_session
|
265
|
+
s.set_login_check @url + '/with_nonce', 'logged-in user'
|
266
|
+
s.login_form = s.find_login_form( url: @url + '/nonce_login' ).
|
267
|
+
update( username: 'nonce_john', password: 'nonce_doe' )
|
268
|
+
|
269
|
+
s.logged_in?.should be_false
|
270
|
+
s.ensure_logged_in
|
271
|
+
s.logged_in?.should be_true
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
context 'when the login fails' do
|
276
|
+
it 'returns false' do
|
277
|
+
s = new_session
|
278
|
+
s.set_login_check @url + '/with_nonce', 'logged-in user'
|
279
|
+
s.login_form = s.find_login_form( url: @url + '/nonce_login' ).
|
280
|
+
update( username: '1', password: '2' )
|
281
|
+
|
282
|
+
s.logged_in?.should be_false
|
283
|
+
s.ensure_logged_in
|
284
|
+
s.logged_in?.should be_false
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
context 'when the login attempt fails' do
|
289
|
+
it 'retries 5 times' do
|
290
|
+
s = new_session
|
291
|
+
s.set_login_check @url, 'logged-in user'
|
292
|
+
s.login_form = s.find_login_form( url: @url + '/disappearing_login' ).
|
293
|
+
update( username: 'john', password: 'doe' )
|
294
|
+
|
295
|
+
s.logged_in?.should be_false
|
296
|
+
s.ensure_logged_in
|
297
|
+
s.logged_in?.should be_true
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
262
301
|
context 'when there is no login capability' do
|
263
302
|
it 'returns nil' do
|
264
303
|
s = new_session
|
data/spec/arachni/spider_spec.rb
CHANGED
@@ -191,11 +191,30 @@ describe Arachni::Spider do
|
|
191
191
|
end
|
192
192
|
|
193
193
|
context 'Options.exclude_pages' do
|
194
|
-
it 'skips pages which match the configured patterns' do
|
195
|
-
@opts.exclude_pages = /skip
|
196
|
-
@opts.url = @url
|
194
|
+
it 'skips pages which match the configured patterns (but not the seed URL)' do
|
195
|
+
@opts.exclude_pages = /skip-me/i
|
196
|
+
@opts.url = "#{@url}skip"
|
197
197
|
|
198
|
-
Arachni::Spider.new.run.should
|
198
|
+
Arachni::Spider.new.run.should == [@opts.url, "#{@url}follow-me"]
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
context 'Options.exclude' do
|
203
|
+
it 'skips paths which match the configured patterns (but not the seed URL)' do
|
204
|
+
@opts.exclude = /skip-me/i
|
205
|
+
@opts.url = "#{@url}skip"
|
206
|
+
|
207
|
+
Arachni::Spider.new.run.should == [@opts.url, "#{@url}follow-me"]
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
context 'Options.include' do
|
212
|
+
it 'skips paths which do not match the configured patterns (but not the seed URL)' do
|
213
|
+
@opts.include = /include-me/i
|
214
|
+
@opts.url = "#{@url}include"
|
215
|
+
|
216
|
+
Arachni::Spider.new.run.sort.should ==
|
217
|
+
[@opts.url, "#{@url}include-me/1", "#{@url}include-me/2"].sort
|
199
218
|
end
|
200
219
|
end
|
201
220
|
|
@@ -425,16 +444,6 @@ describe Arachni::Spider do
|
|
425
444
|
end
|
426
445
|
end
|
427
446
|
end
|
428
|
-
|
429
|
-
#context 'when called after the crawl has finished' do
|
430
|
-
# it 'should wake the crawler up after pushing the new paths' do
|
431
|
-
# s = Arachni::Spider.new
|
432
|
-
# s.run
|
433
|
-
# s.done?.should be_true
|
434
|
-
# s.push( '/a_pushed_path' )
|
435
|
-
# s.done?.should be_false
|
436
|
-
# end
|
437
|
-
#end
|
438
447
|
end
|
439
448
|
|
440
449
|
describe '#done?' do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Arachni::
|
3
|
+
describe Arachni::Support::KeyFiller do
|
4
4
|
|
5
5
|
describe '#fill' do
|
6
6
|
it 'fills in all inputs with appropriate seed values' do
|
@@ -29,7 +29,7 @@ describe Arachni::Module::KeyFiller do
|
|
29
29
|
}
|
30
30
|
end
|
31
31
|
|
32
|
-
context 'when there is a
|
32
|
+
context 'when there is a value' do
|
33
33
|
it 'skips it' do
|
34
34
|
with_values = {
|
35
35
|
'stuff' => 'blah'
|
@@ -37,6 +37,24 @@ describe Arachni::Module::KeyFiller do
|
|
37
37
|
described_class.fill( with_values ) == with_values
|
38
38
|
end
|
39
39
|
end
|
40
|
+
|
41
|
+
context 'when no match is found' do
|
42
|
+
it 'uses "1"' do
|
43
|
+
with_values = {
|
44
|
+
'stuff' => ''
|
45
|
+
}
|
46
|
+
described_class.fill( with_values )['stuff'] == '1'
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'and a default value has been provided' do
|
50
|
+
it 'uses it' do
|
51
|
+
with_values = {
|
52
|
+
'stuff' => ''
|
53
|
+
}
|
54
|
+
described_class.fill( with_values, 'myval' )['stuff'] == 'myval'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
40
58
|
end
|
41
59
|
|
42
60
|
end
|
@@ -0,0 +1,158 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Arachni::Support::Signature do
|
4
|
+
def string_with_noise
|
5
|
+
<<-END
|
6
|
+
This #{rand(999999)} is a test.
|
7
|
+
Not #{rand(999999)} really sure what #{rand(999999)} else to put here...
|
8
|
+
#{rand(999999)}
|
9
|
+
END
|
10
|
+
end
|
11
|
+
|
12
|
+
def different_string_with_noise
|
13
|
+
<<-END
|
14
|
+
This #{rand(999999)} is a different test.
|
15
|
+
END
|
16
|
+
end
|
17
|
+
|
18
|
+
let(:signature) { described_class.new( string_with_noise ) }
|
19
|
+
|
20
|
+
describe '#initialize' do
|
21
|
+
describe 'option' do
|
22
|
+
describe :threshold do
|
23
|
+
it 'sets the maximum difference in tokens when performing comparisons' do
|
24
|
+
seed1 = 'test this here 1'
|
25
|
+
seed2 = 'test that here 2'
|
26
|
+
|
27
|
+
s = described_class.new( seed1, threshold: 1 )
|
28
|
+
s1 = described_class.new( seed2 )
|
29
|
+
s.should_not be_similar s1
|
30
|
+
|
31
|
+
s = described_class.new( seed1, threshold: 2 )
|
32
|
+
s1 = described_class.new( seed2 )
|
33
|
+
s.should_not be_similar s1
|
34
|
+
|
35
|
+
s = described_class.new( seed1, threshold: 5 )
|
36
|
+
s1 = described_class.new( seed2 )
|
37
|
+
s.should be_similar s1
|
38
|
+
|
39
|
+
s = described_class.new( seed1, threshold: 6 )
|
40
|
+
s1 = described_class.new( seed2 )
|
41
|
+
s.should be_similar s1
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'when not a number' do
|
45
|
+
it 'raises ArgumentError' do
|
46
|
+
expect do
|
47
|
+
described_class.new( 'test', threshold: 'stuff' )
|
48
|
+
end.to raise_error ArgumentError
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe '#refine' do
|
56
|
+
it 'removes noise from the signature' do
|
57
|
+
string_with_noise.should_not == string_with_noise
|
58
|
+
|
59
|
+
signature1 = described_class.new( string_with_noise )
|
60
|
+
|
61
|
+
10.times{ signature1 = signature1.refine( string_with_noise ) }
|
62
|
+
|
63
|
+
signature2 = described_class.new( string_with_noise )
|
64
|
+
10.times{ signature2 = signature2.refine( string_with_noise ) }
|
65
|
+
|
66
|
+
signature1.should == signature2
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'returns a new signature instance' do
|
70
|
+
signature1 = described_class.new( string_with_noise )
|
71
|
+
signature1.refine( string_with_noise ).object_id.should_not == signature1.object_id
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe '#refine!' do
|
76
|
+
it 'destructively removes noise from the signature' do
|
77
|
+
string_with_noise.should_not == string_with_noise
|
78
|
+
|
79
|
+
signature1 = described_class.new( string_with_noise )
|
80
|
+
10.times{ signature1.refine!( string_with_noise ) }
|
81
|
+
|
82
|
+
signature2 = described_class.new( string_with_noise )
|
83
|
+
10.times{ signature2.refine!( string_with_noise ) }
|
84
|
+
|
85
|
+
signature1.should == signature2
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'returns self' do
|
89
|
+
signature = described_class.new( string_with_noise )
|
90
|
+
signature.refine!( string_with_noise ).object_id.should == signature.object_id
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#distance' do
|
95
|
+
it 'returns the Levenshtein distance between signature tokens' do
|
96
|
+
signature1 = described_class.new( string_with_noise )
|
97
|
+
signature2 = described_class.new( string_with_noise )
|
98
|
+
signature3 = described_class.new( different_string_with_noise )
|
99
|
+
signature4 = described_class.new( different_string_with_noise )
|
100
|
+
|
101
|
+
signature1.distance( signature2 ).should == 4
|
102
|
+
signature2.distance( signature2 ).should == 0
|
103
|
+
|
104
|
+
signature3.distance( signature4 ).should == 1
|
105
|
+
signature4.distance( signature4 ).should == 0
|
106
|
+
signature1.distance( signature3 ).should == 93
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
describe '#differences' do
|
111
|
+
it 'returns amount of differences between signature tokens' do
|
112
|
+
signature1 = described_class.new( string_with_noise )
|
113
|
+
signature2 = described_class.new( string_with_noise )
|
114
|
+
signature3 = described_class.new( different_string_with_noise )
|
115
|
+
signature4 = described_class.new( different_string_with_noise )
|
116
|
+
|
117
|
+
signature1.differences( signature2 ).should == 8
|
118
|
+
signature2.differences( signature2 ).should == 0
|
119
|
+
|
120
|
+
signature3.differences( signature4 ).should == 2
|
121
|
+
signature4.differences( signature4 ).should == 0
|
122
|
+
signature1.differences( signature3 ).should == 14
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
describe '#==' do
|
127
|
+
context 'when the signature are identical' do
|
128
|
+
it 'returns true' do
|
129
|
+
signature1 = described_class.new( string_with_noise )
|
130
|
+
10.times{ signature1.refine!( string_with_noise ) }
|
131
|
+
|
132
|
+
signature2 = described_class.new( string_with_noise )
|
133
|
+
10.times{ signature2.refine!( string_with_noise ) }
|
134
|
+
|
135
|
+
signature1.should == signature2
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
context 'when the signature are not identical' do
|
140
|
+
it 'returns false' do
|
141
|
+
signature1 = described_class.new( string_with_noise )
|
142
|
+
10.times{ signature1.refine!( string_with_noise ) }
|
143
|
+
|
144
|
+
signature2 = described_class.new( different_string_with_noise )
|
145
|
+
10.times{ signature2.refine!( different_string_with_noise ) }
|
146
|
+
|
147
|
+
signature1.should_not == signature2
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
describe '#dup' do
|
153
|
+
it 'returns a duplicate instance' do
|
154
|
+
signature.dup.should == signature
|
155
|
+
signature.dup.object_id.should_not == signature.object_id
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
@@ -64,6 +64,37 @@ describe Arachni::Trainer do
|
|
64
64
|
@trainer = @framework.trainer
|
65
65
|
end
|
66
66
|
|
67
|
+
context 'when Options.fingerprint? is' do
|
68
|
+
context true do
|
69
|
+
it 'fingerprints the page' do
|
70
|
+
Arachni::Options.no_fingerprinting = false
|
71
|
+
Arachni::Options.fingerprint?.should be_true
|
72
|
+
|
73
|
+
@framework.pages.should be_empty
|
74
|
+
|
75
|
+
Arachni::HTTP.request( @url + '/fingerprint', train: true )
|
76
|
+
@framework.run
|
77
|
+
|
78
|
+
@framework.pages.size.should == 1
|
79
|
+
@framework.pages.first.platforms.to_a.should == [:php]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
context false do
|
84
|
+
it 'does not fingerprint the page' do
|
85
|
+
Arachni::Options.no_fingerprinting = true
|
86
|
+
Arachni::Options.fingerprint?.should be_false
|
87
|
+
|
88
|
+
@framework.pages.should be_empty
|
89
|
+
|
90
|
+
Arachni::HTTP.request( @url + '/fingerprint', train: true )
|
91
|
+
@framework.run
|
92
|
+
|
93
|
+
@framework.pages.should be_empty
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
67
98
|
describe 'HTTP requests with "train" set to' do
|
68
99
|
describe 'nil' do
|
69
100
|
it 'skips the Trainer' do
|