arachni 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/ACKNOWLEDGMENTS.md +1 -1
- data/CHANGELOG.md +146 -0
- data/CONTRIBUTORS.md +1 -0
- data/HACKING.md +3 -3
- data/README.md +81 -49
- data/Rakefile +11 -14
- data/bin/arachni +4 -8
- data/bin/arachni_rpc +17 -0
- data/bin/arachni_rpcd +18 -0
- data/bin/arachni_rpcd_monitor +18 -0
- data/bin/arachni_web +25 -48
- data/bin/arachni_web_autostart +3 -3
- data/conf/README.webui.yaml.txt +7 -21
- data/external/metasploit/plugins/arachni.rb +0 -7
- data/extras/modules/recon/raft_dirs.rb +108 -0
- data/extras/modules/recon/raft_dirs/raft-large-directories.txt +62290 -0
- data/extras/modules/recon/raft_files.rb +110 -0
- data/extras/modules/recon/raft_files/raft-large-files.txt +37037 -0
- data/extras/modules/recon/svn_digger_dirs.rb +108 -0
- data/extras/modules/recon/svn_digger_dirs/Licence.txt +674 -0
- data/extras/modules/recon/svn_digger_dirs/ReadMe-Arachni.txt +4 -0
- data/extras/modules/recon/svn_digger_dirs/ReadMe.txt +6 -0
- data/extras/modules/recon/svn_digger_dirs/all-dirs.txt +5960 -0
- data/extras/modules/recon/svn_digger_files.rb +114 -0
- data/extras/modules/recon/svn_digger_files/Licence.txt +674 -0
- data/extras/modules/recon/svn_digger_files/ReadMe-Arachni.txt +4 -0
- data/extras/modules/recon/svn_digger_files/ReadMe.txt +6 -0
- data/extras/modules/recon/svn_digger_files/all-extensionless.txt +25419 -0
- data/extras/modules/recon/svn_digger_files/all.txt +43135 -0
- data/lib/arachni.rb +2 -7
- data/lib/{audit_store.rb → arachni/audit_store.rb} +68 -60
- data/lib/{component_manager.rb → arachni/component_manager.rb} +8 -8
- data/lib/{component_options.rb → arachni/component_options.rb} +34 -4
- data/lib/{crypto → arachni/crypto}/rsa_aes_cbc.rb +1 -2
- data/lib/arachni/database.rb +4 -0
- data/lib/arachni/database/base.rb +125 -0
- data/lib/arachni/database/hash.rb +384 -0
- data/lib/arachni/database/queue.rb +93 -0
- data/lib/{exceptions.rb → arachni/exceptions.rb} +1 -1
- data/lib/arachni/framework.rb +899 -0
- data/lib/{http.rb → arachni/http.rb} +63 -166
- data/lib/{issue.rb → arachni/issue.rb} +46 -17
- data/lib/{mixins → arachni/mixins}/observable.rb +1 -1
- data/lib/arachni/mixins/progress_bar.rb +81 -0
- data/lib/arachni/mixins/terminal.rb +106 -0
- data/lib/{module.rb → arachni/module.rb} +0 -0
- data/lib/{module → arachni/module}/auditor.rb +250 -86
- data/lib/{module → arachni/module}/base.rb +8 -18
- data/lib/{module → arachni/module}/element_db.rb +10 -2
- data/lib/{module → arachni/module}/key_filler.rb +1 -1
- data/lib/arachni/module/manager.rb +145 -0
- data/lib/{module → arachni/module}/output.rb +6 -1
- data/lib/{module → arachni/module}/trainer.rb +48 -52
- data/lib/{module → arachni/module}/utilities.rb +66 -15
- data/lib/{nokogiri → arachni/nokogiri}/xml/node.rb +0 -0
- data/lib/arachni/options.rb +986 -0
- data/lib/{parser.rb → arachni/parser.rb} +0 -0
- data/lib/{parser → arachni/parser}/auditable.rb +111 -32
- data/lib/{parser → arachni/parser}/elements.rb +28 -20
- data/lib/{parser → arachni/parser}/page.rb +20 -3
- data/lib/{parser → arachni/parser}/parser.rb +100 -63
- data/lib/{plugin.rb → arachni/plugin.rb} +0 -0
- data/lib/{plugin → arachni/plugin}/base.rb +43 -6
- data/lib/{plugin → arachni/plugin}/manager.rb +40 -13
- data/lib/{report.rb → arachni/report.rb} +0 -0
- data/lib/{report → arachni/report}/base.rb +43 -2
- data/lib/{report → arachni/report}/manager.rb +7 -18
- data/lib/arachni/rpc/client/base.rb +42 -0
- data/lib/{rpc/xml → arachni/rpc}/client/dispatcher.rb +12 -13
- data/lib/arachni/rpc/client/instance.rb +62 -0
- data/lib/arachni/rpc/server/base.rb +51 -0
- data/lib/arachni/rpc/server/dispatcher.rb +438 -0
- data/lib/arachni/rpc/server/framework.rb +1163 -0
- data/lib/arachni/rpc/server/instance.rb +184 -0
- data/lib/{rpc/xml → arachni/rpc}/server/module/manager.rb +8 -5
- data/lib/arachni/rpc/server/node.rb +267 -0
- data/lib/{rpc/xml → arachni/rpc}/server/options.rb +6 -35
- data/lib/{rpc/xml → arachni/rpc}/server/output.rb +29 -3
- data/lib/{rpc/xml → arachni/rpc}/server/plugin/manager.rb +5 -6
- data/lib/{ruby.rb → arachni/ruby.rb} +1 -2
- data/lib/arachni/ruby/array.rb +31 -0
- data/lib/{ruby → arachni/ruby}/object.rb +1 -1
- data/lib/{ruby → arachni/ruby}/string.rb +1 -1
- data/lib/{spider.rb → arachni/spider.rb} +83 -110
- data/lib/arachni/typhoeus/hydra.rb +7 -0
- data/lib/{typhoeus → arachni/typhoeus}/request.rb +11 -9
- data/lib/{typhoeus → arachni/typhoeus}/response.rb +4 -0
- data/lib/{ui → arachni/ui}/cli/cli.rb +154 -84
- data/lib/{ui → arachni/ui}/cli/output.rb +57 -19
- data/lib/{ui/xmlrpc → arachni/ui/rpc}/dispatcher_monitor.rb +11 -10
- data/lib/{ui/xmlrpc/xmlrpc.rb → arachni/ui/rpc/rpc.rb} +102 -158
- data/lib/{ui → arachni/ui}/web/addon_manager.rb +23 -3
- data/lib/arachni/ui/web/addons/autodeploy.rb +207 -0
- data/lib/{ui → arachni/ui}/web/addons/autodeploy/lib/manager.rb +142 -35
- data/lib/arachni/ui/web/addons/autodeploy/views/index.erb +291 -0
- data/lib/{ui → arachni/ui}/web/addons/sample.rb +1 -1
- data/lib/{ui → arachni/ui}/web/addons/sample/views/index.erb +0 -0
- data/lib/{ui → arachni/ui}/web/addons/scheduler.rb +30 -22
- data/lib/{ui → arachni/ui}/web/addons/scheduler/views/index.erb +56 -22
- data/lib/{ui → arachni/ui}/web/addons/scheduler/views/options.erb +0 -0
- data/lib/arachni/ui/web/dispatcher_manager.rb +274 -0
- data/lib/arachni/ui/web/instance_manager.rb +69 -0
- data/lib/{ui → arachni/ui}/web/log.rb +1 -1
- data/lib/arachni/ui/web/output_stream.rb +54 -0
- data/lib/{ui → arachni/ui}/web/report_manager.rb +48 -54
- data/lib/{ui → arachni/ui}/web/scheduler.rb +42 -47
- data/lib/arachni/ui/web/server.rb +1197 -0
- data/lib/{ui → arachni/ui}/web/server/db/placeholder +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/banner.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/bodybg-small.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/bodybg.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/pbar-ani.gif +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/css/smoothness/jquery-ui-1.8.9.custom.css +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/favicon.ico +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/footer.jpg +0 -0
- data/lib/{ui/web/server/public/icons/error.png → arachni/ui/web/server/public/icons/bad.png} +0 -0
- data/lib/arachni/ui/web/server/public/icons/error.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/icons/info.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/icons/ok.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/icons/status.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/js/jquery-1.4.4.min.js +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/js/jquery-ui-1.8.9.custom.min.js +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/js/jquery-ui-timepicker.js +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/logo.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/nav-left.jpg +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/nav-right.jpg +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/nav-selected-left.jpg +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/nav-selected-right.jpg +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/plugins/sample/style.css +0 -0
- data/lib/{ui/web/server/tmp → arachni/ui/web/server/public/reports}/placeholder +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/sidebar-bottom.jpg +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/sidebar-h4.jpg +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/sidebar-top.jpg +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/spider.png +0 -0
- data/lib/{ui → arachni/ui}/web/server/public/style.css +3 -2
- data/lib/arachni/ui/web/server/tmp/placeholder +0 -0
- data/lib/{ui → arachni/ui}/web/server/views/addon.erb +0 -0
- data/lib/{ui → arachni/ui}/web/server/views/addons.erb +0 -0
- data/lib/{ui → arachni/ui}/web/server/views/dispatcher_error.erb +0 -0
- data/lib/arachni/ui/web/server/views/dispatchers.erb +175 -0
- data/lib/arachni/ui/web/server/views/dispatchers_edit.erb +71 -0
- data/lib/arachni/ui/web/server/views/error.erb +22 -0
- data/lib/{ui → arachni/ui}/web/server/views/flash.erb +2 -2
- data/lib/arachni/ui/web/server/views/home.erb +60 -0
- data/lib/{ui → arachni/ui}/web/server/views/instance.erb +55 -75
- data/lib/arachni/ui/web/server/views/js/home.erb +32 -0
- data/lib/{ui → arachni/ui}/web/server/views/layout.erb +2 -2
- data/lib/{ui → arachni/ui}/web/server/views/log.erb +0 -0
- data/lib/arachni/ui/web/server/views/module.erb +30 -0
- data/lib/{ui → arachni/ui}/web/server/views/modules.erb +2 -22
- data/lib/{ui → arachni/ui}/web/server/views/options.erb +0 -0
- data/lib/{ui → arachni/ui}/web/server/views/output_results.erb +4 -4
- data/lib/{ui → arachni/ui}/web/server/views/plugins.erb +23 -12
- data/lib/{ui → arachni/ui}/web/server/views/report_formats.erb +1 -1
- data/lib/{ui → arachni/ui}/web/server/views/reports.erb +1 -1
- data/lib/{ui → arachni/ui}/web/server/views/settings.erb +59 -16
- data/lib/{ui → arachni/ui}/web/server/views/welcome.erb +3 -1
- data/lib/{ui → arachni/ui}/web/utilities.rb +8 -3
- data/lib/arachni/version.rb +16 -0
- data/modules/audit/code_injection.rb +11 -20
- data/modules/audit/code_injection_timing.rb +2 -6
- data/modules/audit/csrf.rb +8 -16
- data/modules/audit/ldapi.rb +5 -11
- data/modules/audit/os_cmd_injection.rb +5 -9
- data/modules/audit/os_cmd_injection_timing.rb +4 -8
- data/modules/audit/path_traversal.rb +7 -13
- data/modules/audit/response_splitting.rb +8 -21
- data/modules/audit/rfi.rb +6 -46
- data/modules/audit/sqli.rb +5 -11
- data/modules/audit/sqli/regexp_ids.txt +0 -6
- data/modules/audit/sqli_blind_rdiff.rb +5 -10
- data/modules/audit/sqli_blind_timing.rb +4 -9
- data/modules/audit/trainer.rb +6 -12
- data/modules/audit/unvalidated_redirect.rb +6 -17
- data/modules/audit/xpath.rb +5 -12
- data/modules/audit/xss.rb +37 -23
- data/modules/audit/xss_event.rb +5 -10
- data/modules/audit/xss_path.rb +47 -41
- data/modules/audit/xss_script_tag.rb +5 -10
- data/modules/audit/xss_tag.rb +5 -10
- data/modules/audit/xss_uri.rb +17 -89
- data/modules/recon/allowed_methods.rb +6 -15
- data/modules/recon/backdoors.rb +12 -52
- data/modules/recon/backup_files.rb +25 -88
- data/modules/recon/common_directories.rb +8 -54
- data/modules/recon/common_files.rb +7 -58
- data/modules/recon/directory_listing.rb +6 -15
- data/modules/recon/grep/captcha.rb +1 -1
- data/modules/recon/grep/credit_card.rb +62 -27
- data/modules/recon/grep/cvs_svn_users.rb +1 -1
- data/modules/recon/grep/emails.rb +1 -1
- data/modules/recon/grep/html_objects.rb +1 -1
- data/modules/recon/grep/private_ip.rb +1 -1
- data/modules/recon/grep/ssn.rb +9 -9
- data/modules/recon/htaccess_limit.rb +6 -14
- data/modules/recon/http_put.rb +7 -15
- data/modules/recon/interesting_responses.rb +7 -13
- data/modules/recon/mixed_resource.rb +100 -0
- data/modules/recon/unencrypted_password_forms.rb +8 -20
- data/modules/recon/webdav.rb +6 -16
- data/modules/recon/xst.rb +7 -13
- data/path_extractors/anchors.rb +1 -1
- data/path_extractors/forms.rb +1 -1
- data/path_extractors/frames.rb +1 -1
- data/path_extractors/generic.rb +47 -3
- data/path_extractors/links.rb +1 -1
- data/path_extractors/meta_refresh.rb +1 -1
- data/path_extractors/scripts.rb +3 -4
- data/path_extractors/sitemap.rb +1 -1
- data/plugins/autologin.rb +9 -18
- data/plugins/beep_notify.rb +51 -0
- data/plugins/cookie_collector.rb +12 -12
- data/plugins/defaults/autothrottle.rb +86 -0
- data/plugins/{content_types.rb → defaults/content_types.rb} +25 -19
- data/plugins/{healthmap.rb → defaults/healthmap.rb} +30 -18
- data/plugins/defaults/metamodules/remedies/discovery.rb +164 -0
- data/plugins/defaults/metamodules/remedies/manual_verification.rb +65 -0
- data/{metamodules/timeout_notice.rb → plugins/defaults/metamodules/remedies/timing_attacks.rb} +26 -22
- data/{metamodules → plugins/defaults/metamodules}/uniformity.rb +15 -14
- data/plugins/{profiler.rb → defaults/profiler.rb} +19 -30
- data/plugins/defaults/resolver.rb +55 -0
- data/plugins/email_notify.rb +108 -0
- data/plugins/form_dicattack.rb +8 -16
- data/plugins/http_dicattack.rb +4 -12
- data/plugins/libnotify.rb +86 -0
- data/plugins/proxy.rb +8 -17
- data/plugins/proxy/server.rb +3 -3
- data/plugins/rescan.rb +60 -0
- data/plugins/waf_detector.rb +5 -16
- data/profiles/full.afp +3 -30
- data/reports/afr.rb +2 -5
- data/reports/ap.rb +3 -1
- data/reports/html.rb +210 -68
- data/reports/html/default.erb +72 -1014
- data/reports/html/default/configuration.erb +126 -0
- data/reports/html/default/css/jquery-ui.css +570 -0
- data/reports/html/default/css/jquery.jqplot.min.css +1 -0
- data/reports/html/default/css/main.css +391 -0
- data/reports/html/default/issue.erb +189 -0
- data/reports/html/default/issues.erb +65 -0
- data/reports/html/default/js/charts.js +146 -0
- data/reports/html/default/js/helpers.js +95 -0
- data/reports/html/default/js/init.js +73 -0
- data/reports/html/default/js/lib/jqplot.barRenderer.min.js +57 -0
- data/reports/html/default/js/lib/jqplot.categoryAxisRenderer.min.js +57 -0
- data/reports/html/default/js/lib/jqplot.cursor.min.js +57 -0
- data/reports/html/default/js/lib/jqplot.pieRenderer.min.js +57 -0
- data/reports/html/default/js/lib/jqplot.pointLabels.min.js +57 -0
- data/reports/html/default/js/lib/jquery-ui.min.js +404 -0
- data/reports/html/default/js/lib/jquery.jqplot.min.js +57 -0
- data/reports/html/default/js/lib/jquery.min.js +167 -0
- data/reports/html/default/plugins.erb +22 -0
- data/reports/html/default/search.erb +8 -0
- data/reports/html/default/sitemap.erb +15 -0
- data/reports/html/default/summary.erb +68 -0
- data/reports/html/default/summary_issue.erb +19 -0
- data/reports/json.rb +51 -0
- data/reports/marshal.rb +49 -0
- data/reports/metareport.rb +4 -6
- data/reports/metareport/arachni_metareport.rb +1 -1
- data/reports/plugin_formatters/html/autologin.rb +30 -41
- data/reports/plugin_formatters/html/content_types.rb +1 -10
- data/reports/plugin_formatters/html/cookie_collector.rb +36 -44
- data/reports/plugin_formatters/html/discovery.rb +50 -0
- data/reports/plugin_formatters/html/form_dicattack.rb +24 -32
- data/reports/plugin_formatters/html/healthmap.rb +45 -54
- data/reports/plugin_formatters/html/http_dicattack.rb +24 -32
- data/reports/plugin_formatters/html/profiler.rb +17 -48
- data/reports/plugin_formatters/html/profiler/template.erb +6 -99
- data/reports/plugin_formatters/html/resolver.rb +63 -0
- data/reports/plugin_formatters/html/{metaformatters/timeout_notice.rb → timing_attacks.rb} +7 -19
- data/reports/plugin_formatters/html/{metaformatters/uniformity.rb → uniformity.rb} +5 -17
- data/reports/plugin_formatters/html/waf_detector.rb +24 -32
- data/reports/plugin_formatters/stdout/autologin.rb +30 -35
- data/reports/plugin_formatters/stdout/content_types.rb +41 -46
- data/reports/plugin_formatters/stdout/cookie_collector.rb +33 -38
- data/reports/plugin_formatters/stdout/discovery.rb +47 -0
- data/reports/plugin_formatters/stdout/form_dicattack.rb +27 -32
- data/reports/plugin_formatters/stdout/healthmap.rb +47 -51
- data/reports/plugin_formatters/stdout/http_dicattack.rb +27 -32
- data/reports/plugin_formatters/stdout/metamodules.rb +48 -55
- data/reports/plugin_formatters/stdout/profiler.rb +60 -65
- data/reports/plugin_formatters/stdout/resolver.rb +45 -0
- data/reports/plugin_formatters/stdout/{metaformatters/timeout_notice.rb → timing_attacks.rb} +6 -14
- data/reports/plugin_formatters/stdout/{metaformatters/uniformity.rb → uniformity.rb} +6 -14
- data/reports/plugin_formatters/stdout/waf_detector.rb +23 -28
- data/reports/plugin_formatters/xml/autologin.rb +36 -41
- data/reports/plugin_formatters/xml/content_types.rb +47 -52
- data/reports/plugin_formatters/xml/cookie_collector.rb +39 -44
- data/reports/plugin_formatters/xml/discovery.rb +54 -0
- data/reports/plugin_formatters/xml/form_dicattack.rb +22 -27
- data/reports/plugin_formatters/xml/healthmap.rb +53 -58
- data/reports/plugin_formatters/xml/http_dicattack.rb +22 -27
- data/reports/plugin_formatters/xml/profiler.rb +61 -77
- data/reports/plugin_formatters/xml/resolver.rb +53 -0
- data/reports/plugin_formatters/xml/{metaformatters/timeout_notice.rb → timing_attacks.rb} +3 -15
- data/reports/plugin_formatters/xml/{metaformatters/uniformity.rb → uniformity.rb} +4 -14
- data/reports/plugin_formatters/xml/waf_detector.rb +23 -28
- data/reports/stdout.rb +1 -1
- data/reports/txt.rb +2 -5
- data/reports/xml.rb +2 -5
- data/reports/xml/buffer.rb +6 -2
- data/reports/yaml.rb +49 -0
- metadata +419 -278
- data/bin/arachni_xmlrpc +0 -21
- data/bin/arachni_xmlrpcd +0 -82
- data/bin/arachni_xmlrpcd_monitor +0 -74
- data/getoptslong.rb +0 -242
- data/lib/anemone.rb +0 -2
- data/lib/framework.rb +0 -673
- data/lib/module/manager.rb +0 -111
- data/lib/options.rb +0 -547
- data/lib/rpc/xml/client/base.rb +0 -76
- data/lib/rpc/xml/client/instance.rb +0 -88
- data/lib/rpc/xml/server/base.rb +0 -112
- data/lib/rpc/xml/server/dispatcher.rb +0 -386
- data/lib/rpc/xml/server/framework.rb +0 -206
- data/lib/rpc/xml/server/instance.rb +0 -191
- data/lib/ruby/xmlrpc/server.rb +0 -27
- data/lib/ui/web/addons/autodeploy.rb +0 -172
- data/lib/ui/web/addons/autodeploy/views/index.erb +0 -124
- data/lib/ui/web/dispatcher_manager.rb +0 -165
- data/lib/ui/web/instance_manager.rb +0 -87
- data/lib/ui/web/output_stream.rb +0 -94
- data/lib/ui/web/server.rb +0 -925
- data/lib/ui/web/server/public/reports/placeholder +0 -1
- data/lib/ui/web/server/views/dispatchers.erb +0 -100
- data/lib/ui/web/server/views/dispatchers_edit.erb +0 -42
- data/lib/ui/web/server/views/error.erb +0 -1
- data/lib/ui/web/server/views/home.erb +0 -25
- data/metamodules/autothrottle.rb +0 -74
- data/plugins/metamodules.rb +0 -118
- data/profiles/comprehensive.afp +0 -74
- data/reports/plugin_formatters/html/metamodules.rb +0 -93
- data/reports/plugin_formatters/xml/metamodules.rb +0 -91
@@ -1,6 +1,6 @@
|
|
1
1
|
=begin
|
2
2
|
Arachni
|
3
|
-
Copyright (c) 2010-
|
3
|
+
Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
|
4
4
|
|
5
5
|
This is free software; you can copy and distribute and modify
|
6
6
|
this program under the term of the GPL v2.0 License
|
@@ -12,6 +12,7 @@ require 'typhoeus'
|
|
12
12
|
|
13
13
|
module Arachni
|
14
14
|
|
15
|
+
require Options.instance.dir['lib'] + 'typhoeus/hydra'
|
15
16
|
require Options.instance.dir['lib'] + 'typhoeus/request'
|
16
17
|
require Options.instance.dir['lib'] + 'typhoeus/response'
|
17
18
|
require Options.instance.dir['lib'] + 'module/utilities'
|
@@ -34,7 +35,7 @@ require Options.instance.dir['lib'] + 'mixins/observable'
|
|
34
35
|
# @author: Tasos "Zapotek" Laskos
|
35
36
|
# <tasos.laskos@gmail.com>
|
36
37
|
# <zapotek@segfault.gr>
|
37
|
-
# @version: 0.2.
|
38
|
+
# @version: 0.2.7
|
38
39
|
#
|
39
40
|
class HTTP
|
40
41
|
|
@@ -109,7 +110,7 @@ class HTTP
|
|
109
110
|
'From' => opts.authed_by || '',
|
110
111
|
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
111
112
|
'User-Agent' => opts.user_agent
|
112
|
-
}
|
113
|
+
}.merge( opts.custom_headers )
|
113
114
|
|
114
115
|
cookies = {}
|
115
116
|
cookies.merge!( self.class.parse_cookiejar( opts.cookie_jar ) ) if opts.cookie_jar
|
@@ -126,7 +127,6 @@ class HTTP
|
|
126
127
|
} if opts.proxy_addr
|
127
128
|
|
128
129
|
@opts = {
|
129
|
-
:user_agent => opts.user_agent,
|
130
130
|
:follow_location => false,
|
131
131
|
:disable_ssl_peer_verification => true,
|
132
132
|
:timeout => 50000
|
@@ -149,7 +149,7 @@ class HTTP
|
|
149
149
|
# Runs Hydra (all the asynchronous queued HTTP requests)
|
150
150
|
#
|
151
151
|
# Should only be called by the framework
|
152
|
-
# after all module threads have
|
152
|
+
# after all module threads have been joined!
|
153
153
|
#
|
154
154
|
def run
|
155
155
|
exception_jail {
|
@@ -195,7 +195,7 @@ class HTTP
|
|
195
195
|
|
196
196
|
#
|
197
197
|
# Queues a Tyhpoeus::Request and applies an 'on_complete' callback
|
198
|
-
# on
|
198
|
+
# on behalf of the trainer.
|
199
199
|
#
|
200
200
|
# @param [Tyhpoeus::Request] req the request to queue
|
201
201
|
# @param [Bool] async run request async?
|
@@ -233,7 +233,7 @@ class HTTP
|
|
233
233
|
|
234
234
|
call_on_complete( res )
|
235
235
|
|
236
|
-
parse_and_set_cookies( res )
|
236
|
+
parse_and_set_cookies( res ) if req.update_cookies?
|
237
237
|
|
238
238
|
print_debug( '------------' )
|
239
239
|
print_debug( 'Got response.' )
|
@@ -285,53 +285,20 @@ class HTTP
|
|
285
285
|
# @return [Typhoeus::Request]
|
286
286
|
#
|
287
287
|
def request( url, opts )
|
288
|
-
headers = opts[:headers] || {}
|
289
|
-
opts[:headers] = @init_headers.dup.merge( headers )
|
290
|
-
|
291
|
-
train = opts[:train]
|
292
|
-
async = opts[:async]
|
293
|
-
async = true if async == nil
|
294
|
-
|
295
|
-
exception_jail {
|
296
|
-
|
297
|
-
req = Typhoeus::Request.new( normalize_url( url ), opts.merge( @opts ) )
|
298
|
-
req.train! if train
|
299
|
-
|
300
|
-
queue( req, async )
|
301
|
-
return req
|
302
|
-
}
|
303
|
-
end
|
304
|
-
|
305
|
-
#
|
306
|
-
# Gets a URL passing the provided query parameters
|
307
|
-
#
|
308
|
-
# @param [URI] url URL to GET
|
309
|
-
# @param [Hash] opts request options
|
310
|
-
# * :params => request parameters || {}
|
311
|
-
# * :train => force Arachni to analyze the HTML code || false
|
312
|
-
# * :async => make the request async? || true
|
313
|
-
# * :headers => HTTP request headers || {}
|
314
|
-
# * :follow_location => follow redirects || false
|
315
|
-
#
|
316
|
-
# @return [Typhoeus::Request]
|
317
|
-
#
|
318
|
-
def get( url, opts = { } )
|
319
|
-
|
320
288
|
params = opts[:params] || {}
|
321
289
|
remove_id = opts[:remove_id]
|
322
290
|
train = opts[:train]
|
323
291
|
timeout = opts[:timeout]
|
292
|
+
cookies = opts[:cookies]
|
324
293
|
|
325
|
-
|
294
|
+
update_cookies = opts[:update_cookies]
|
326
295
|
|
327
296
|
async = opts[:async]
|
328
297
|
async = true if async == nil
|
329
298
|
|
330
|
-
|
331
|
-
headers = @init_headers.dup.merge( headers )
|
332
|
-
|
299
|
+
follow_location = opts[:follow_location] || false
|
333
300
|
|
334
|
-
|
301
|
+
headers = opts[:headers] || {}
|
335
302
|
|
336
303
|
#
|
337
304
|
# the exception jail function wraps the block passed to it
|
@@ -341,6 +308,11 @@ class HTTP
|
|
341
308
|
#
|
342
309
|
exception_jail {
|
343
310
|
|
311
|
+
headers = @init_headers.merge( headers )
|
312
|
+
headers['cookie'] = get_cookies_str( cookies, false ) if cookies
|
313
|
+
|
314
|
+
params = params.merge( { @rand_seed => '' } ) if !remove_id
|
315
|
+
|
344
316
|
#
|
345
317
|
# There are cases where the url already has a query and we also have
|
346
318
|
# some params to work with. Some webapp frameworks will break
|
@@ -350,31 +322,51 @@ class HTTP
|
|
350
322
|
# params of the url query and remove the latter from the url.
|
351
323
|
#
|
352
324
|
cparams = params.dup
|
353
|
-
curl =
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
325
|
+
curl = normalize_url( url.dup )
|
326
|
+
|
327
|
+
if opts[:method] != :post
|
328
|
+
begin
|
329
|
+
cparams = q_to_h( curl ).merge( cparams )
|
330
|
+
curl.gsub!( "?#{URI(curl).query}", '' ) if URI(curl).query
|
331
|
+
rescue
|
332
|
+
return
|
333
|
+
end
|
361
334
|
end
|
362
335
|
|
363
336
|
opts = {
|
364
337
|
:headers => headers,
|
365
338
|
:params => cparams.empty? ? nil : cparams,
|
366
|
-
:
|
339
|
+
:method => opts[:method].nil? ? :get : opts[:method]
|
367
340
|
}.merge( @opts )
|
368
341
|
|
342
|
+
opts[:follow_location] = follow_location if follow_location
|
343
|
+
|
369
344
|
opts[:timeout] = timeout if timeout
|
370
345
|
|
371
346
|
req = Typhoeus::Request.new( curl, opts )
|
372
347
|
req.train! if train
|
348
|
+
req.update_cookies! if update_cookies
|
373
349
|
|
374
350
|
queue( req, async )
|
375
351
|
return req
|
376
352
|
}
|
353
|
+
end
|
377
354
|
|
355
|
+
#
|
356
|
+
# Gets a URL passing the provided query parameters
|
357
|
+
#
|
358
|
+
# @param [URI] url URL to GET
|
359
|
+
# @param [Hash] opts request options
|
360
|
+
# * :params => request parameters || {}
|
361
|
+
# * :train => force Arachni to analyze the HTML code || false
|
362
|
+
# * :async => make the request async? || true
|
363
|
+
# * :headers => HTTP request headers || {}
|
364
|
+
# * :follow_location => follow redirects || false
|
365
|
+
#
|
366
|
+
# @return [Typhoeus::Request]
|
367
|
+
#
|
368
|
+
def get( url, opts = { } )
|
369
|
+
request( url, opts )
|
378
370
|
end
|
379
371
|
|
380
372
|
#
|
@@ -390,33 +382,7 @@ class HTTP
|
|
390
382
|
# @return [Typhoeus::Request]
|
391
383
|
#
|
392
384
|
def post( url, opts = { } )
|
393
|
-
|
394
|
-
params = opts[:params]
|
395
|
-
train = opts[:train]
|
396
|
-
timeout = opts[:timeout]
|
397
|
-
|
398
|
-
async = opts[:async]
|
399
|
-
async = true if async == nil
|
400
|
-
|
401
|
-
headers = opts[:headers] || {}
|
402
|
-
headers = @init_headers.dup.merge( headers )
|
403
|
-
|
404
|
-
exception_jail {
|
405
|
-
|
406
|
-
opts = {
|
407
|
-
:method => :post,
|
408
|
-
:headers => headers,
|
409
|
-
:params => params,
|
410
|
-
:follow_location => false,
|
411
|
-
}.merge( @opts )
|
412
|
-
opts[:timeout] = timeout if timeout
|
413
|
-
|
414
|
-
req = Typhoeus::Request.new( normalize_url( url ), opts )
|
415
|
-
req.train! if train
|
416
|
-
|
417
|
-
queue( req, async )
|
418
|
-
return req
|
419
|
-
}
|
385
|
+
request( url, opts.merge( :method => :post ) )
|
420
386
|
end
|
421
387
|
|
422
388
|
#
|
@@ -432,31 +398,7 @@ class HTTP
|
|
432
398
|
# @return [Typhoeus::Request]
|
433
399
|
#
|
434
400
|
def trace( url, opts = { } )
|
435
|
-
|
436
|
-
params = opts[:params]
|
437
|
-
train = opts[:train]
|
438
|
-
|
439
|
-
async = opts[:async]
|
440
|
-
async = true if async == nil
|
441
|
-
|
442
|
-
headers = opts[:headers] || {}
|
443
|
-
headers = @init_headers.dup.merge( headers )
|
444
|
-
|
445
|
-
exception_jail {
|
446
|
-
|
447
|
-
opts = {
|
448
|
-
:method => :trace,
|
449
|
-
:headers => headers,
|
450
|
-
:params => params,
|
451
|
-
:follow_location => false
|
452
|
-
}.merge( @opts )
|
453
|
-
|
454
|
-
req = Typhoeus::Request.new( normalize_url( url ), opts )
|
455
|
-
req.train! if train
|
456
|
-
|
457
|
-
queue( req, async )
|
458
|
-
return req
|
459
|
-
}
|
401
|
+
request( url, opts.merge( :method => :trace ) )
|
460
402
|
end
|
461
403
|
|
462
404
|
|
@@ -473,39 +415,9 @@ class HTTP
|
|
473
415
|
# @return [Typhoeus::Request]
|
474
416
|
#
|
475
417
|
def cookie( url, opts = { } )
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
train = opts[:train]
|
480
|
-
timeout = opts[:timeout]
|
481
|
-
|
482
|
-
|
483
|
-
async = opts[:async]
|
484
|
-
async = true if async == nil
|
485
|
-
|
486
|
-
headers = opts[:headers] || {}
|
487
|
-
|
488
|
-
headers = @init_headers.dup.
|
489
|
-
merge( { 'cookie' => get_cookies_str( cookies ) } ).merge( headers )
|
490
|
-
|
491
|
-
# wrap the code in exception handling
|
492
|
-
exception_jail {
|
493
|
-
|
494
|
-
opts = {
|
495
|
-
:headers => headers,
|
496
|
-
:follow_location => false,
|
497
|
-
# :params => params
|
498
|
-
:timeout => opts[:timeout]
|
499
|
-
}.merge( @opts )
|
500
|
-
opts[:timeout] = timeout if timeout
|
501
|
-
|
502
|
-
|
503
|
-
req = Typhoeus::Request.new( normalize_url( url ), opts )
|
504
|
-
req.train! if train
|
505
|
-
|
506
|
-
queue( req, async )
|
507
|
-
return req
|
508
|
-
}
|
418
|
+
opts[:cookies] = opts[:params].dup || {}
|
419
|
+
opts[:params] = nil
|
420
|
+
request( url, opts )
|
509
421
|
end
|
510
422
|
|
511
423
|
#
|
@@ -522,34 +434,17 @@ class HTTP
|
|
522
434
|
def header( url, opts = { } )
|
523
435
|
|
524
436
|
headers = opts[:params] || {}
|
525
|
-
# params = opts[:params]
|
526
|
-
train = opts[:train]
|
527
|
-
|
528
|
-
async = opts[:async]
|
529
|
-
async = true if async == nil
|
530
|
-
|
531
437
|
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
orig_headers = @init_headers.clone
|
536
|
-
@init_headers = @init_headers.merge( headers )
|
537
|
-
|
538
|
-
req = Typhoeus::Request.new( normalize_url( url ),
|
539
|
-
:headers => @init_headers.dup,
|
540
|
-
:user_agent => @init_headers['User-Agent'],
|
541
|
-
:follow_location => false,
|
542
|
-
# :params => params
|
543
|
-
:timeout => opts[:timeout]
|
544
|
-
)
|
545
|
-
req.train! if train
|
438
|
+
orig_headers = @init_headers.clone
|
439
|
+
opts[:headers] = @init_headers = @init_headers.merge( headers )
|
440
|
+
opts[:user_agent] = @init_headers['User-Agent']
|
546
441
|
|
547
|
-
|
442
|
+
opts[:params] = nil
|
548
443
|
|
549
|
-
|
550
|
-
return req
|
551
|
-
}
|
444
|
+
req = request( url, opts )
|
552
445
|
|
446
|
+
@init_headers = orig_headers.clone
|
447
|
+
return req
|
553
448
|
end
|
554
449
|
|
555
450
|
def q_to_h( url )
|
@@ -652,16 +547,18 @@ class HTTP
|
|
652
547
|
#
|
653
548
|
# @return [string]
|
654
549
|
#
|
655
|
-
def get_cookies_str( cookies = { } )
|
550
|
+
def get_cookies_str( cookies = { }, with_existing = true )
|
656
551
|
|
657
|
-
|
658
|
-
|
552
|
+
if with_existing
|
553
|
+
jar = parse_cookie_str( @init_headers['cookie'] )
|
554
|
+
cookies = jar.merge( cookies )
|
555
|
+
end
|
659
556
|
|
660
557
|
str = ''
|
661
558
|
cookies.each_pair {
|
662
559
|
|name, value|
|
663
560
|
value = '' if !value
|
664
|
-
val =
|
561
|
+
val = uri_encode( uri_encode( value ), '+;' )
|
665
562
|
str += "#{name}=#{val};"
|
666
563
|
}
|
667
564
|
return str
|
@@ -1,8 +1,6 @@
|
|
1
1
|
=begin
|
2
|
-
$Id$
|
3
|
-
|
4
2
|
Arachni
|
5
|
-
Copyright (c) 2010-
|
3
|
+
Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
|
6
4
|
|
7
5
|
This is free software; you can copy and distribute and modify
|
8
6
|
this program under the term of the GPL v2.0 License
|
@@ -20,7 +18,7 @@
|
|
20
18
|
# @author: Tasos "Zapotek" Laskos
|
21
19
|
# <tasos.laskos@gmail.com>
|
22
20
|
# <zapotek@segfault.gr>
|
23
|
-
# @version: 0.1
|
21
|
+
# @version: 0.1.1
|
24
22
|
#
|
25
23
|
module Arachni
|
26
24
|
|
@@ -80,7 +78,7 @@ class Issue
|
|
80
78
|
attr_accessor :url
|
81
79
|
|
82
80
|
#
|
83
|
-
# The headers
|
81
|
+
# The headers exchanged during the attack
|
84
82
|
#
|
85
83
|
# @return [Hash<String, Hash>] request and reply headers
|
86
84
|
#
|
@@ -112,7 +110,7 @@ class Issue
|
|
112
110
|
#
|
113
111
|
# @return [String]
|
114
112
|
#
|
115
|
-
|
113
|
+
attr_reader :regexp
|
116
114
|
|
117
115
|
#
|
118
116
|
# The data that was matched by the regexp
|
@@ -187,7 +185,7 @@ class Issue
|
|
187
185
|
attr_accessor :remedy_guidance
|
188
186
|
|
189
187
|
#
|
190
|
-
# A code
|
188
|
+
# A code snippet showing the user how to remedy the situation
|
191
189
|
#
|
192
190
|
# @return [String]
|
193
191
|
#
|
@@ -216,29 +214,28 @@ class Issue
|
|
216
214
|
#
|
217
215
|
attr_accessor :metasploitable
|
218
216
|
|
219
|
-
|
217
|
+
attr_reader :opts
|
220
218
|
|
221
219
|
attr_accessor :internal_modname
|
222
220
|
attr_accessor :tags
|
223
221
|
attr_accessor :_hash
|
224
222
|
|
225
223
|
#
|
226
|
-
# Sets up the
|
224
|
+
# Sets up the instance attributes
|
227
225
|
#
|
228
|
-
# @param Hash
|
226
|
+
# @param Hash configuration hash
|
229
227
|
# Usually the returned data of a module's
|
230
228
|
# info() method for the references
|
231
229
|
# merged with a name=>value pair hash holding
|
232
230
|
# class attributes
|
233
231
|
#
|
234
232
|
def initialize( opts = {} )
|
235
|
-
|
236
233
|
@verification = false
|
237
234
|
|
238
235
|
opts.each {
|
239
236
|
|k, v|
|
240
237
|
begin
|
241
|
-
send( "#{k.to_s.downcase}=", v )
|
238
|
+
send( "#{k.to_s.downcase}=", encode( v ) )
|
242
239
|
rescue Exception => e
|
243
240
|
end
|
244
241
|
}
|
@@ -246,10 +243,18 @@ class Issue
|
|
246
243
|
opts[:issue].each {
|
247
244
|
|k, v|
|
248
245
|
begin
|
249
|
-
send( "#{k.to_s.downcase}=", v )
|
246
|
+
send( "#{k.to_s.downcase}=", encode( v ) )
|
250
247
|
rescue Exception => e
|
251
248
|
end
|
252
|
-
}
|
249
|
+
} if opts[:issue]
|
250
|
+
|
251
|
+
if opts[:headers] && opts[:headers][:request]
|
252
|
+
@headers[:request] = {}.merge( opts[:headers][:request] )
|
253
|
+
end
|
254
|
+
|
255
|
+
if opts[:headers] && opts[:headers][:response].is_a?( Hash )
|
256
|
+
@headers[:response] = {}.merge( opts[:headers][:response] )
|
257
|
+
end
|
253
258
|
|
254
259
|
if( @cwe )
|
255
260
|
@cwe_url = "http://cwe.mitre.org/data/definitions/" + @cwe + ".html"
|
@@ -257,7 +262,6 @@ class Issue
|
|
257
262
|
|
258
263
|
@mod_name = opts[:name]
|
259
264
|
@references = opts[:references] || {}
|
260
|
-
|
261
265
|
end
|
262
266
|
|
263
267
|
def regexp=( regexp )
|
@@ -272,6 +276,28 @@ class Issue
|
|
272
276
|
@opts = hash.dup
|
273
277
|
end
|
274
278
|
|
279
|
+
def []( k )
|
280
|
+
instance_variable_get( "@#{k.to_s}".to_sym )
|
281
|
+
end
|
282
|
+
|
283
|
+
def []=( k, v )
|
284
|
+
v= encode( v )
|
285
|
+
begin
|
286
|
+
send( "#{k.to_s}=", v )
|
287
|
+
rescue
|
288
|
+
instance_variable_set( "@#{k.to_s}".to_sym, v )
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
def to_h
|
293
|
+
h = {}
|
294
|
+
each_pair {
|
295
|
+
|k, v|
|
296
|
+
h[k] = v
|
297
|
+
}
|
298
|
+
h
|
299
|
+
end
|
300
|
+
|
275
301
|
def each
|
276
302
|
self.instance_variables.each {
|
277
303
|
|var|
|
@@ -292,11 +318,14 @@ class Issue
|
|
292
318
|
|
293
319
|
private
|
294
320
|
|
321
|
+
def encode( str )
|
322
|
+
return str if !str || !str.is_a?( String )
|
323
|
+
str.encode( 'UTF-8', :invalid => :replace, :undef => :replace )
|
324
|
+
end
|
325
|
+
|
295
326
|
def normalize_name( name )
|
296
327
|
name.to_s.gsub( /@/, '' )
|
297
328
|
end
|
298
329
|
|
299
|
-
|
300
330
|
end
|
301
|
-
|
302
331
|
end
|