arachni 0.2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ACKNOWLEDGMENTS.md +14 -0
- data/AUTHORS.md +6 -0
- data/CHANGELOG.md +162 -0
- data/CONTRIBUTORS.md +10 -0
- data/EXPLOITATION.md +429 -0
- data/HACKING.md +101 -0
- data/LICENSE.md +341 -0
- data/README.md +350 -0
- data/Rakefile +86 -0
- data/bin/arachni +22 -0
- data/bin/arachni_web +77 -0
- data/bin/arachni_xmlrpc +21 -0
- data/bin/arachni_xmlrpcd +82 -0
- data/bin/arachni_xmlrpcd_monitor +74 -0
- data/conf/README.webui.yaml.txt +44 -0
- data/conf/webui.yaml +11 -0
- data/external/metasploit/LICENSE +24 -0
- data/external/metasploit/modules/exploits/unix/webapp/arachni_exec.rb +142 -0
- data/external/metasploit/modules/exploits/unix/webapp/arachni_path_traversal.rb +113 -0
- data/external/metasploit/modules/exploits/unix/webapp/arachni_php_eval.rb +150 -0
- data/external/metasploit/modules/exploits/unix/webapp/arachni_php_include.rb +141 -0
- data/external/metasploit/modules/exploits/unix/webapp/arachni_sqlmap.rb +92 -0
- data/external/metasploit/plugins/arachni.rb +536 -0
- data/getoptslong.rb +241 -0
- data/lib/anemone.rb +2 -0
- data/lib/anemone/cookie_store.rb +35 -0
- data/lib/anemone/core.rb +371 -0
- data/lib/anemone/exceptions.rb +5 -0
- data/lib/anemone/http.rb +144 -0
- data/lib/anemone/page.rb +337 -0
- data/lib/anemone/page_store.rb +160 -0
- data/lib/anemone/storage.rb +34 -0
- data/lib/anemone/storage/base.rb +75 -0
- data/lib/anemone/storage/exceptions.rb +15 -0
- data/lib/anemone/storage/mongodb.rb +89 -0
- data/lib/anemone/storage/pstore.rb +50 -0
- data/lib/anemone/storage/redis.rb +90 -0
- data/lib/anemone/storage/tokyo_cabinet.rb +57 -0
- data/lib/anemone/tentacle.rb +40 -0
- data/lib/arachni.rb +16 -0
- data/lib/audit_store.rb +346 -0
- data/lib/component_manager.rb +293 -0
- data/lib/component_options.rb +395 -0
- data/lib/exceptions.rb +76 -0
- data/lib/framework.rb +637 -0
- data/lib/http.rb +809 -0
- data/lib/issue.rb +302 -0
- data/lib/module.rb +4 -0
- data/lib/module/auditor.rb +455 -0
- data/lib/module/base.rb +188 -0
- data/lib/module/element_db.rb +158 -0
- data/lib/module/key_filler.rb +87 -0
- data/lib/module/manager.rb +87 -0
- data/lib/module/output.rb +68 -0
- data/lib/module/trainer.rb +240 -0
- data/lib/module/utilities.rb +110 -0
- data/lib/options.rb +547 -0
- data/lib/parser.rb +2 -0
- data/lib/parser/auditable.rb +522 -0
- data/lib/parser/elements.rb +296 -0
- data/lib/parser/page.rb +149 -0
- data/lib/parser/parser.rb +717 -0
- data/lib/plugin.rb +4 -0
- data/lib/plugin/base.rb +110 -0
- data/lib/plugin/manager.rb +162 -0
- data/lib/report.rb +4 -0
- data/lib/report/base.rb +119 -0
- data/lib/report/manager.rb +92 -0
- data/lib/rpc/xml/client/base.rb +71 -0
- data/lib/rpc/xml/client/dispatcher.rb +49 -0
- data/lib/rpc/xml/client/instance.rb +88 -0
- data/lib/rpc/xml/server/base.rb +90 -0
- data/lib/rpc/xml/server/dispatcher.rb +357 -0
- data/lib/rpc/xml/server/framework.rb +206 -0
- data/lib/rpc/xml/server/instance.rb +191 -0
- data/lib/rpc/xml/server/module/manager.rb +46 -0
- data/lib/rpc/xml/server/options.rb +124 -0
- data/lib/rpc/xml/server/output.rb +299 -0
- data/lib/rpc/xml/server/plugin/manager.rb +58 -0
- data/lib/ruby.rb +5 -0
- data/lib/ruby/object.rb +32 -0
- data/lib/ruby/string.rb +74 -0
- data/lib/ruby/xmlrpc/server.rb +27 -0
- data/lib/spider.rb +200 -0
- data/lib/typhoeus/request.rb +91 -0
- data/lib/typhoeus/response.rb +34 -0
- data/lib/ui/cli/cli.rb +744 -0
- data/lib/ui/cli/output.rb +279 -0
- data/lib/ui/web/log.rb +82 -0
- data/lib/ui/web/output_stream.rb +94 -0
- data/lib/ui/web/report_manager.rb +222 -0
- data/lib/ui/web/server.rb +903 -0
- data/lib/ui/web/server/db/placeholder +0 -0
- data/lib/ui/web/server/public/banner.png +0 -0
- data/lib/ui/web/server/public/bodybg-small.png +0 -0
- data/lib/ui/web/server/public/bodybg.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/pbar-ani.gif +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/ui/web/server/public/css/smoothness/jquery-ui-1.8.9.custom.css +573 -0
- data/lib/ui/web/server/public/favicon.ico +0 -0
- data/lib/ui/web/server/public/footer.jpg +0 -0
- data/lib/ui/web/server/public/icons/error.png +0 -0
- data/lib/ui/web/server/public/icons/info.png +0 -0
- data/lib/ui/web/server/public/icons/ok.png +0 -0
- data/lib/ui/web/server/public/icons/status.png +0 -0
- data/lib/ui/web/server/public/js/jquery-1.4.4.min.js +167 -0
- data/lib/ui/web/server/public/js/jquery-ui-1.8.9.custom.min.js +781 -0
- data/lib/ui/web/server/public/logo.png +0 -0
- data/lib/ui/web/server/public/nav-left.jpg +0 -0
- data/lib/ui/web/server/public/nav-right.jpg +0 -0
- data/lib/ui/web/server/public/nav-selected-left.jpg +0 -0
- data/lib/ui/web/server/public/nav-selected-right.jpg +0 -0
- data/lib/ui/web/server/public/reports/placeholder +1 -0
- data/lib/ui/web/server/public/sidebar-bottom.jpg +0 -0
- data/lib/ui/web/server/public/sidebar-h4.jpg +0 -0
- data/lib/ui/web/server/public/sidebar-top.jpg +0 -0
- data/lib/ui/web/server/public/spider.png +0 -0
- data/lib/ui/web/server/public/style.css +604 -0
- data/lib/ui/web/server/tmp/placeholder +0 -0
- data/lib/ui/web/server/views/dispatcher.erb +85 -0
- data/lib/ui/web/server/views/dispatcher_error.erb +14 -0
- data/lib/ui/web/server/views/error.erb +1 -0
- data/lib/ui/web/server/views/flash.erb +18 -0
- data/lib/ui/web/server/views/home.erb +14 -0
- data/lib/ui/web/server/views/instance.erb +213 -0
- data/lib/ui/web/server/views/layout.erb +95 -0
- data/lib/ui/web/server/views/log.erb +40 -0
- data/lib/ui/web/server/views/modules.erb +71 -0
- data/lib/ui/web/server/views/options.erb +23 -0
- data/lib/ui/web/server/views/output_results.erb +51 -0
- data/lib/ui/web/server/views/plugins.erb +42 -0
- data/lib/ui/web/server/views/report_formats.erb +30 -0
- data/lib/ui/web/server/views/reports.erb +55 -0
- data/lib/ui/web/server/views/settings.erb +120 -0
- data/lib/ui/web/server/views/welcome.erb +38 -0
- data/lib/ui/xmlrpc/dispatcher_monitor.rb +204 -0
- data/lib/ui/xmlrpc/xmlrpc.rb +843 -0
- data/logs/placeholder +0 -0
- data/metamodules/autothrottle.rb +74 -0
- data/metamodules/timeout_notice.rb +118 -0
- data/metamodules/uniformity.rb +98 -0
- data/modules/audit/code_injection.rb +136 -0
- data/modules/audit/code_injection_timing.rb +115 -0
- data/modules/audit/code_injection_timing/payloads.txt +4 -0
- data/modules/audit/csrf.rb +301 -0
- data/modules/audit/ldapi.rb +103 -0
- data/modules/audit/ldapi/errors.txt +26 -0
- data/modules/audit/os_cmd_injection.rb +103 -0
- data/modules/audit/os_cmd_injection/payloads.txt +2 -0
- data/modules/audit/os_cmd_injection_timing.rb +104 -0
- data/modules/audit/os_cmd_injection_timing/payloads.txt +3 -0
- data/modules/audit/path_traversal.rb +141 -0
- data/modules/audit/response_splitting.rb +105 -0
- data/modules/audit/rfi.rb +193 -0
- data/modules/audit/sqli.rb +120 -0
- data/modules/audit/sqli/regexp_ids.txt +90 -0
- data/modules/audit/sqli_blind_rdiff.rb +321 -0
- data/modules/audit/sqli_blind_timing.rb +103 -0
- data/modules/audit/sqli_blind_timing/payloads.txt +51 -0
- data/modules/audit/trainer.rb +89 -0
- data/modules/audit/unvalidated_redirect.rb +90 -0
- data/modules/audit/xpath.rb +104 -0
- data/modules/audit/xpath/errors.txt +26 -0
- data/modules/audit/xss.rb +99 -0
- data/modules/audit/xss_event.rb +134 -0
- data/modules/audit/xss_path.rb +125 -0
- data/modules/audit/xss_script_tag.rb +112 -0
- data/modules/audit/xss_tag.rb +112 -0
- data/modules/audit/xss_uri.rb +125 -0
- data/modules/recon/allowed_methods.rb +104 -0
- data/modules/recon/backdoors.rb +131 -0
- data/modules/recon/backdoors/filenames.txt +16 -0
- data/modules/recon/backup_files.rb +177 -0
- data/modules/recon/backup_files/extensions.txt +28 -0
- data/modules/recon/common_directories.rb +138 -0
- data/modules/recon/common_directories/directories.txt +265 -0
- data/modules/recon/common_files.rb +138 -0
- data/modules/recon/common_files/filenames.txt +17 -0
- data/modules/recon/directory_listing.rb +171 -0
- data/modules/recon/grep/captcha.rb +62 -0
- data/modules/recon/grep/credit_card.rb +85 -0
- data/modules/recon/grep/cvs_svn_users.rb +73 -0
- data/modules/recon/grep/emails.rb +59 -0
- data/modules/recon/grep/html_objects.rb +53 -0
- data/modules/recon/grep/private_ip.rb +54 -0
- data/modules/recon/grep/ssn.rb +53 -0
- data/modules/recon/htaccess_limit.rb +82 -0
- data/modules/recon/http_put.rb +95 -0
- data/modules/recon/interesting_responses.rb +118 -0
- data/modules/recon/unencrypted_password_forms.rb +119 -0
- data/modules/recon/webdav.rb +126 -0
- data/modules/recon/xst.rb +107 -0
- data/path_extractors/anchors.rb +35 -0
- data/path_extractors/forms.rb +35 -0
- data/path_extractors/frames.rb +38 -0
- data/path_extractors/generic.rb +39 -0
- data/path_extractors/links.rb +35 -0
- data/path_extractors/meta_refresh.rb +39 -0
- data/path_extractors/scripts.rb +37 -0
- data/path_extractors/sitemap.rb +31 -0
- data/plugins/autologin.rb +137 -0
- data/plugins/content_types.rb +90 -0
- data/plugins/cookie_collector.rb +99 -0
- data/plugins/form_dicattack.rb +185 -0
- data/plugins/healthmap.rb +94 -0
- data/plugins/http_dicattack.rb +133 -0
- data/plugins/metamodules.rb +118 -0
- data/plugins/proxy.rb +248 -0
- data/plugins/proxy/server.rb +66 -0
- data/plugins/waf_detector.rb +184 -0
- data/profiles/comprehensive.afp +74 -0
- data/profiles/full.afp +75 -0
- data/reports/afr.rb +59 -0
- data/reports/ap.rb +55 -0
- data/reports/html.rb +179 -0
- data/reports/html/default.erb +967 -0
- data/reports/metareport.rb +139 -0
- data/reports/metareport/arachni_metareport.rb +174 -0
- data/reports/plugin_formatters/html/content_types.rb +82 -0
- data/reports/plugin_formatters/html/cookie_collector.rb +66 -0
- data/reports/plugin_formatters/html/form_dicattack.rb +54 -0
- data/reports/plugin_formatters/html/healthmap.rb +76 -0
- data/reports/plugin_formatters/html/http_dicattack.rb +54 -0
- data/reports/plugin_formatters/html/metaformatters/timeout_notice.rb +65 -0
- data/reports/plugin_formatters/html/metaformatters/uniformity.rb +71 -0
- data/reports/plugin_formatters/html/metamodules.rb +93 -0
- data/reports/plugin_formatters/html/waf_detector.rb +54 -0
- data/reports/plugin_formatters/stdout/content_types.rb +73 -0
- data/reports/plugin_formatters/stdout/cookie_collector.rb +61 -0
- data/reports/plugin_formatters/stdout/form_dicattack.rb +52 -0
- data/reports/plugin_formatters/stdout/healthmap.rb +72 -0
- data/reports/plugin_formatters/stdout/http_dicattack.rb +53 -0
- data/reports/plugin_formatters/stdout/metaformatters/timeout_notice.rb +55 -0
- data/reports/plugin_formatters/stdout/metaformatters/uniformity.rb +68 -0
- data/reports/plugin_formatters/stdout/metamodules.rb +89 -0
- data/reports/plugin_formatters/stdout/waf_detector.rb +48 -0
- data/reports/plugin_formatters/xml/content_types.rb +91 -0
- data/reports/plugin_formatters/xml/cookie_collector.rb +70 -0
- data/reports/plugin_formatters/xml/form_dicattack.rb +57 -0
- data/reports/plugin_formatters/xml/healthmap.rb +82 -0
- data/reports/plugin_formatters/xml/http_dicattack.rb +57 -0
- data/reports/plugin_formatters/xml/metaformatters/timeout_notice.rb +67 -0
- data/reports/plugin_formatters/xml/metaformatters/uniformity.rb +82 -0
- data/reports/plugin_formatters/xml/metamodules.rb +91 -0
- data/reports/plugin_formatters/xml/waf_detector.rb +58 -0
- data/reports/stdout.rb +182 -0
- data/reports/txt.rb +77 -0
- data/reports/xml.rb +231 -0
- data/reports/xml/buffer.rb +98 -0
- metadata +516 -0
@@ -0,0 +1,103 @@
|
|
1
|
+
=begin
|
2
|
+
Arachni
|
3
|
+
Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
|
4
|
+
|
5
|
+
This is free software; you can copy and distribute and modify
|
6
|
+
this program under the term of the GPL v2.0 License
|
7
|
+
(See LICENSE file for details)
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
module Arachni
|
12
|
+
|
13
|
+
module Modules
|
14
|
+
|
15
|
+
#
|
16
|
+
# Blind SQL Injection module using timing attacks.
|
17
|
+
#
|
18
|
+
# @author: Tasos "Zapotek" Laskos
|
19
|
+
# <tasos.laskos@gmail.com>
|
20
|
+
# <zapotek@segfault.gr>
|
21
|
+
# @version: 0.2
|
22
|
+
#
|
23
|
+
# @see http://cwe.mitre.org/data/definitions/89.html
|
24
|
+
# @see http://capec.mitre.org/data/definitions/7.html
|
25
|
+
# @see http://www.owasp.org/index.php/Blind_SQL_Injection
|
26
|
+
#
|
27
|
+
class BlindTimingSQLInjection < Arachni::Module::Base
|
28
|
+
|
29
|
+
include Arachni::Module::Utilities
|
30
|
+
|
31
|
+
def initialize( page )
|
32
|
+
super( page )
|
33
|
+
end
|
34
|
+
|
35
|
+
def prepare( )
|
36
|
+
|
37
|
+
@@__injection_str ||= []
|
38
|
+
|
39
|
+
if @@__injection_str.empty?
|
40
|
+
read_file( 'payloads.txt' ) {
|
41
|
+
|str|
|
42
|
+
@@__injection_str << str
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
@__opts = {
|
47
|
+
:format => [ Format::STRAIGHT ],
|
48
|
+
:timeout => 4000,
|
49
|
+
:timeout_divider => 1000
|
50
|
+
}
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
def run
|
55
|
+
audit_timeout( @@__injection_str, @__opts )
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.info
|
59
|
+
{
|
60
|
+
:name => 'Blind (timing) SQL injection',
|
61
|
+
:description => %q{Blind SQL Injection module using timing attacks
|
62
|
+
(if the remote server suddenly becomes unresponsive or your network
|
63
|
+
connection suddenly chokes up this module will probably produce false positives).},
|
64
|
+
:elements => [
|
65
|
+
Issue::Element::FORM,
|
66
|
+
Issue::Element::LINK,
|
67
|
+
Issue::Element::COOKIE,
|
68
|
+
Issue::Element::HEADER
|
69
|
+
],
|
70
|
+
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> ',
|
71
|
+
:version => '0.1.1',
|
72
|
+
:references => {
|
73
|
+
'OWASP' => 'http://www.owasp.org/index.php/Blind_SQL_Injection',
|
74
|
+
'MITRE - CAPEC' => 'http://capec.mitre.org/data/definitions/7.html'
|
75
|
+
},
|
76
|
+
:targets => { 'Generic' => 'all' },
|
77
|
+
:issue => {
|
78
|
+
:name => %q{Blind SQL Injection (timing attack)},
|
79
|
+
:description => %q{SQL code can be injected into the web application
|
80
|
+
even though it may not be obvious due to suppression of error messages.
|
81
|
+
(This issue was discovered using a timing attack; timing attacks
|
82
|
+
can result in false positives in cases where the server takes
|
83
|
+
an abnormally long time to respond.
|
84
|
+
Either case, these issues will require further investigation
|
85
|
+
even if they are false positives.)},
|
86
|
+
:tags => [ 'sql', 'blind', 'timing', 'injection', 'database' ],
|
87
|
+
:cwe => '89',
|
88
|
+
:severity => Issue::Severity::HIGH,
|
89
|
+
:cvssv2 => '9.0',
|
90
|
+
:remedy_guidance => %q{Suppression of error messages leads to
|
91
|
+
security through obscurity which is not a good practise.
|
92
|
+
The web application needs to enforce stronger validation
|
93
|
+
on user inputs.},
|
94
|
+
:remedy_code => '',
|
95
|
+
:metasploitable => 'unix/webapp/arachni_sqlmap'
|
96
|
+
}
|
97
|
+
|
98
|
+
}
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
sleep(__TIME__)#
|
2
|
+
1 or sleep(__TIME__)#
|
3
|
+
" or sleep(__TIME__)#
|
4
|
+
' or sleep(__TIME__)#
|
5
|
+
" or sleep(__TIME__)="
|
6
|
+
' or sleep(__TIME__)='
|
7
|
+
1) or sleep(__TIME__)#
|
8
|
+
") or sleep(__TIME__)="
|
9
|
+
') or sleep(__TIME__)='
|
10
|
+
1)) or sleep(__TIME__)#
|
11
|
+
")) or sleep(__TIME__)="
|
12
|
+
')) or sleep(__TIME__)='
|
13
|
+
1 and sleep(__TIME__)#
|
14
|
+
" and sleep(__TIME__)#
|
15
|
+
' and sleep(__TIME__)#
|
16
|
+
" and sleep(__TIME__)="
|
17
|
+
' and sleep(__TIME__)='
|
18
|
+
1) and sleep(__TIME__)#
|
19
|
+
") and sleep(__TIME__)="
|
20
|
+
') and sleep(__TIME__)='
|
21
|
+
1)) and sleep(__TIME__)#
|
22
|
+
")) and sleep(__TIME__)="
|
23
|
+
')) and sleep(__TIME__)='
|
24
|
+
;waitfor delay '0:0:__TIME__'--
|
25
|
+
);waitfor delay '0:0:__TIME__'--
|
26
|
+
';waitfor delay '0:0:__TIME__'--
|
27
|
+
";waitfor delay '0:0:__TIME__'--
|
28
|
+
');waitfor delay '0:0:__TIME__'--
|
29
|
+
");waitfor delay '0:0:__TIME__'--
|
30
|
+
));waitfor delay '0:0:__TIME__'--
|
31
|
+
'));waitfor delay '0:0:__TIME__'--
|
32
|
+
"));waitfor delay '0:0:__TIME__'--
|
33
|
+
pg_sleep(__TIME__)--
|
34
|
+
1 or pg_sleep(__TIME__)--
|
35
|
+
" or pg_sleep(__TIME__)--
|
36
|
+
' or pg_sleep(__TIME__)--
|
37
|
+
1) or pg_sleep(__TIME__)--
|
38
|
+
") or pg_sleep(__TIME__)--
|
39
|
+
') or pg_sleep(__TIME__)--
|
40
|
+
1)) or pg_sleep(__TIME__)--
|
41
|
+
")) or pg_sleep(__TIME__)--
|
42
|
+
')) or pg_sleep(__TIME__)--
|
43
|
+
1 and pg_sleep(__TIME__)--
|
44
|
+
" and pg_sleep(__TIME__)--
|
45
|
+
' and pg_sleep(__TIME__)--
|
46
|
+
1) and pg_sleep(__TIME__)--
|
47
|
+
") and pg_sleep(__TIME__)--
|
48
|
+
') and pg_sleep(__TIME__)--
|
49
|
+
1)) and pg_sleep(__TIME__)--
|
50
|
+
")) and pg_sleep(__TIME__)--
|
51
|
+
')) and pg_sleep(__TIME__)--
|
@@ -0,0 +1,89 @@
|
|
1
|
+
=begin
|
2
|
+
Arachni
|
3
|
+
Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
|
4
|
+
|
5
|
+
This is free software; you can copy and distribute and modify
|
6
|
+
this program under the term of the GPL v2.0 License
|
7
|
+
(See LICENSE file for details)
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
module Arachni
|
12
|
+
|
13
|
+
module Modules
|
14
|
+
|
15
|
+
#
|
16
|
+
#
|
17
|
+
# Pokes and probes all inputs of a given page in order to uncover
|
18
|
+
# new input vectors.
|
19
|
+
#
|
20
|
+
# It also forces Arachni to train itself by analyzing the server responses.
|
21
|
+
#
|
22
|
+
# @author: Tasos "Zapotek" Laskos
|
23
|
+
# <tasos.laskos@gmail.com>
|
24
|
+
# <zapotek@segfault.gr>
|
25
|
+
# @version: 0.1
|
26
|
+
#
|
27
|
+
#
|
28
|
+
class Trainer < Arachni::Module::Base
|
29
|
+
|
30
|
+
include Arachni::Module::Utilities
|
31
|
+
|
32
|
+
def initialize( page )
|
33
|
+
super( page )
|
34
|
+
end
|
35
|
+
|
36
|
+
def prepare( )
|
37
|
+
|
38
|
+
# this will be the used as the injection string
|
39
|
+
@str = '_arachni_trainer_' + seed
|
40
|
+
|
41
|
+
@opts = {
|
42
|
+
#
|
43
|
+
# tell the frameworm to learn from the
|
44
|
+
# server responses that this module will cause.
|
45
|
+
#
|
46
|
+
:train => true,
|
47
|
+
:param_flip => true
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
def run( )
|
52
|
+
|
53
|
+
#
|
54
|
+
# this will inject the string in @str into all available inputs
|
55
|
+
#
|
56
|
+
audit( @str, @opts ) {
|
57
|
+
#
|
58
|
+
# empty block, we don't need to check for anything
|
59
|
+
#
|
60
|
+
# however since we haven't passed at least a regexp to audit()
|
61
|
+
# we need to provide a block otherwise the Auditor will complain...
|
62
|
+
#
|
63
|
+
# that bastard!
|
64
|
+
#
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.info
|
69
|
+
{
|
70
|
+
:name => 'Trainer',
|
71
|
+
:description => %q{Pokes and probes all inputs of a given page in order to uncover new input vectors.
|
72
|
+
It also forces Arachni to train itself by analyzing the server responses.},
|
73
|
+
:elements => [
|
74
|
+
Issue::Element::FORM,
|
75
|
+
Issue::Element::LINK,
|
76
|
+
Issue::Element::COOKIE,
|
77
|
+
Issue::Element::HEADER
|
78
|
+
],
|
79
|
+
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> ',
|
80
|
+
:version => '0.1',
|
81
|
+
:references => {
|
82
|
+
},
|
83
|
+
:targets => { 'Generic' => 'all' },
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
=begin
|
2
|
+
Arachni
|
3
|
+
Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
|
4
|
+
|
5
|
+
This is free software; you can copy and distribute and modify
|
6
|
+
this program under the term of the GPL v2.0 License
|
7
|
+
(See LICENSE file for details)
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
module Arachni
|
12
|
+
|
13
|
+
module Modules
|
14
|
+
|
15
|
+
#
|
16
|
+
# Unvalidated redirect audit module.
|
17
|
+
#
|
18
|
+
# It audits links, forms and cookies, injects URLs and checks
|
19
|
+
# the Location header field to determnine whether the attack was successful.
|
20
|
+
#
|
21
|
+
#
|
22
|
+
# @author: Tasos "Zapotek" Laskos
|
23
|
+
# <tasos.laskos@gmail.com>
|
24
|
+
# <zapotek@segfault.gr>
|
25
|
+
# @version: 0.1.1
|
26
|
+
#
|
27
|
+
# @see http://www.owasp.org/index.php/Top_10_2010-A10-Unvalidated_Redirects_and_Forwards
|
28
|
+
#
|
29
|
+
class UnvalidatedRedirect < Arachni::Module::Base
|
30
|
+
|
31
|
+
def initialize( page )
|
32
|
+
super( page )
|
33
|
+
|
34
|
+
# initialize the array that will hold the results
|
35
|
+
@results = []
|
36
|
+
end
|
37
|
+
|
38
|
+
def prepare( )
|
39
|
+
@__urls = [
|
40
|
+
'www.arachni-boogie-woogie.com',
|
41
|
+
'http://www.arachni-boogie-woogie.com',
|
42
|
+
]
|
43
|
+
end
|
44
|
+
|
45
|
+
def run( )
|
46
|
+
@__urls.each {
|
47
|
+
|url|
|
48
|
+
audit( url ) {
|
49
|
+
|res, opts|
|
50
|
+
log( opts, res ) if( res.headers_hash['Location'] == url )
|
51
|
+
}
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
def self.info
|
57
|
+
{
|
58
|
+
:name => 'UnvalidatedRedirect',
|
59
|
+
:description => %q{Injects URLs and checks the Location header field
|
60
|
+
to determnine whether the attack was successful.},
|
61
|
+
:elements => [
|
62
|
+
Issue::Element::FORM,
|
63
|
+
Issue::Element::LINK,
|
64
|
+
Issue::Element::COOKIE,
|
65
|
+
Issue::Element::HEADER
|
66
|
+
],
|
67
|
+
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> ',
|
68
|
+
:version => '0.1.1',
|
69
|
+
:references => {
|
70
|
+
'OWASP Top 10 2010' => 'http://www.owasp.org/index.php/Top_10_2010-A10-Unvalidated_Redirects_and_Forwards'
|
71
|
+
},
|
72
|
+
:targets => { 'Generic' => 'all' },
|
73
|
+
|
74
|
+
:issue => {
|
75
|
+
:name => %q{Unvalidated redirect},
|
76
|
+
:description => %q{The web application redirects users to unvalidated URLs.},
|
77
|
+
:tags => [ 'unvalidated', 'redirect', 'injection', 'header', 'location' ],
|
78
|
+
:cwe => '819',
|
79
|
+
:severity => Issue::Severity::MEDIUM,
|
80
|
+
:cvssv2 => '',
|
81
|
+
:remedy_guidance => '',
|
82
|
+
:remedy_code => '',
|
83
|
+
}
|
84
|
+
|
85
|
+
}
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
=begin
|
2
|
+
$Id$
|
3
|
+
|
4
|
+
Arachni
|
5
|
+
Copyright (c) 2010-2011 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
|
6
|
+
|
7
|
+
This is free software; you can copy and distribute and modify
|
8
|
+
this program under the term of the GPL v2.0 License
|
9
|
+
(See LICENSE file for details)
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
module Arachni
|
14
|
+
|
15
|
+
module Modules
|
16
|
+
|
17
|
+
#
|
18
|
+
# XPath Injection audit module.
|
19
|
+
#
|
20
|
+
# @author: Tasos "Zapotek" Laskos
|
21
|
+
# <tasos.laskos@gmail.com>
|
22
|
+
# <zapotek@segfault.gr>
|
23
|
+
# @version: 0.1
|
24
|
+
#
|
25
|
+
# @see http://cwe.mitre.org/data/definitions/91.html
|
26
|
+
# @see http://www.owasp.org/index.php/XPATH_Injection
|
27
|
+
# @see http://www.owasp.org/index.php/Testing_for_XPath_Injection_%28OWASP-DV-010%29
|
28
|
+
#
|
29
|
+
class XPathInjection < Arachni::Module::Base
|
30
|
+
|
31
|
+
include Arachni::Module::Utilities
|
32
|
+
|
33
|
+
def initialize( page )
|
34
|
+
super( page )
|
35
|
+
end
|
36
|
+
|
37
|
+
def prepare( )
|
38
|
+
|
39
|
+
#
|
40
|
+
# we make this a class variable and populate it only once
|
41
|
+
# to reduce file IO
|
42
|
+
#
|
43
|
+
@@__errors ||= []
|
44
|
+
|
45
|
+
if @@__errors.empty?
|
46
|
+
read_file( 'errors.txt' ) { |error| @@__errors << error }
|
47
|
+
end
|
48
|
+
|
49
|
+
# prepare the strings that will hopefully cause the webapp
|
50
|
+
# to output XPath error messages
|
51
|
+
@__injection_strs = [
|
52
|
+
"'\"",
|
53
|
+
"<!--"
|
54
|
+
]
|
55
|
+
|
56
|
+
@__opts = {
|
57
|
+
:format => [ Format::APPEND ],
|
58
|
+
:substring => @@__errors
|
59
|
+
}
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
def run( )
|
64
|
+
@__injection_strs.each {
|
65
|
+
|str|
|
66
|
+
audit( str, @__opts )
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
def self.info
|
72
|
+
{
|
73
|
+
:name => 'XPathInjection',
|
74
|
+
:description => %q{XPath injection module},
|
75
|
+
:elements => [
|
76
|
+
Issue::Element::FORM,
|
77
|
+
Issue::Element::LINK,
|
78
|
+
Issue::Element::COOKIE,
|
79
|
+
Issue::Element::HEADER
|
80
|
+
],
|
81
|
+
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>',
|
82
|
+
:version => '0.1',
|
83
|
+
:references => {
|
84
|
+
'OWASP' => 'http://www.owasp.org/index.php/XPATH_Injection'
|
85
|
+
},
|
86
|
+
:targets => { 'Generic' => 'all' },
|
87
|
+
:issue => {
|
88
|
+
:name => %q{XPath Injection},
|
89
|
+
:description => %q{XPath queries can be injected into the web application.},
|
90
|
+
:tags => [ 'xpath', 'database', 'error', 'injection', 'regexp' ],
|
91
|
+
:cwe => '91',
|
92
|
+
:severity => Issue::Severity::HIGH,
|
93
|
+
:cvssv2 => '',
|
94
|
+
:remedy_guidance => 'User inputs must be validated and filtered
|
95
|
+
before being included in database queries.',
|
96
|
+
:remedy_code => ''
|
97
|
+
}
|
98
|
+
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
xmlXPathEval: evaluation failed
|
2
|
+
SimpleXMLElement::xpath()
|
3
|
+
XPathException
|
4
|
+
MS.Internal.Xml.
|
5
|
+
Unknown error in XPath
|
6
|
+
org.apache.xpath.XPath
|
7
|
+
A closing bracket expected in
|
8
|
+
An operand in Union Expression does not produce a node-set
|
9
|
+
Cannot convert expression to a number
|
10
|
+
Document Axis does not allow any context Location Steps
|
11
|
+
Empty Path Expression
|
12
|
+
Empty Relative Location Path
|
13
|
+
Empty Union Expression
|
14
|
+
Expected '\)' in
|
15
|
+
Expected node test or name specification after axis operator
|
16
|
+
Incompatible XPath key
|
17
|
+
Incorrect Variable Binding
|
18
|
+
libxml2 library function failed
|
19
|
+
xmlsec library function
|
20
|
+
error '80004005'
|
21
|
+
A document must contain exactly one root element.
|
22
|
+
Expression must evaluate to a node-set.
|
23
|
+
Expected token '\]'
|
24
|
+
<p>msxml4.dll</font>
|
25
|
+
<p>msxml3.dll</font>
|
26
|
+
4005 Notes error: Query is not understandable
|