arachni 0.2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,112 @@
|
|
|
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
|
+
# XSS in HTML tag. <br/>
|
|
17
|
+
# It injects a string and checks if it appears inside any HTML tags.
|
|
18
|
+
#
|
|
19
|
+
# @author: Tasos "Zapotek" Laskos
|
|
20
|
+
# <tasos.laskos@gmail.com>
|
|
21
|
+
# <zapotek@segfault.gr>
|
|
22
|
+
# @version: 0.1.1
|
|
23
|
+
#
|
|
24
|
+
# @see http://cwe.mitre.org/data/definitions/79.html
|
|
25
|
+
# @see http://ha.ckers.org/xss.html
|
|
26
|
+
# @see http://secunia.com/advisories/9716/
|
|
27
|
+
#
|
|
28
|
+
class XSSHTMLTag < Arachni::Module::Base
|
|
29
|
+
|
|
30
|
+
include Arachni::Module::Utilities
|
|
31
|
+
|
|
32
|
+
TAG_NAME = 'arachni_xss_in_tag'
|
|
33
|
+
|
|
34
|
+
def initialize( page )
|
|
35
|
+
super( page )
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def prepare( )
|
|
39
|
+
@_injection_strs = [
|
|
40
|
+
" #{TAG_NAME}=" + seed,
|
|
41
|
+
"\" #{TAG_NAME}=\"" + seed,
|
|
42
|
+
"' #{TAG_NAME}='" + seed,
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
@_opts = {
|
|
46
|
+
:format => [ Format::APPEND ],
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def run( )
|
|
51
|
+
@_injection_strs.each {
|
|
52
|
+
|str|
|
|
53
|
+
audit( str, @_opts ) {
|
|
54
|
+
|res, opts|
|
|
55
|
+
_log( res, opts )
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def _log( res, opts )
|
|
61
|
+
# if we have no body or it doesn't contain the TAG_NAME under any
|
|
62
|
+
# context there's no point in parsing the HMTL to verify the vulnerability
|
|
63
|
+
return if !res.body || !res.body.substring?( TAG_NAME )
|
|
64
|
+
|
|
65
|
+
begin
|
|
66
|
+
doc = Nokogiri::HTML( res.body )
|
|
67
|
+
|
|
68
|
+
# see if we managed to inject a working HTML attribute to any
|
|
69
|
+
# elements
|
|
70
|
+
if !(html_elem = doc.xpath("//*[@#{TAG_NAME}]")).empty?
|
|
71
|
+
opts[:match] = html_elem.to_s
|
|
72
|
+
log( opts, res )
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def self.info
|
|
78
|
+
{
|
|
79
|
+
:name => 'XSS in HTML tag',
|
|
80
|
+
:description => %q{Cross-Site Scripting in HTML tag.},
|
|
81
|
+
:elements => [
|
|
82
|
+
Issue::Element::FORM,
|
|
83
|
+
Issue::Element::LINK,
|
|
84
|
+
Issue::Element::COOKIE,
|
|
85
|
+
Issue::Element::HEADER
|
|
86
|
+
],
|
|
87
|
+
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> ',
|
|
88
|
+
:version => '0.1.1',
|
|
89
|
+
:references => {
|
|
90
|
+
'ha.ckers' => 'http://ha.ckers.org/xss.html',
|
|
91
|
+
'Secunia' => 'http://secunia.com/advisories/9716/'
|
|
92
|
+
},
|
|
93
|
+
:targets => { 'Generic' => 'all' },
|
|
94
|
+
:issue => {
|
|
95
|
+
:name => %q{Cross-Site Scripting in HTML tag.},
|
|
96
|
+
:description => %q{Unvalidated user input is being embedded in a HTML element.
|
|
97
|
+
This can lead to a Cross-Site Scripting vulnerability or a form of HTML manipulation.},
|
|
98
|
+
:tags => [ 'xss', 'script', 'tag', 'regexp', 'dom', 'attribute', 'injection' ],
|
|
99
|
+
:cwe => '79',
|
|
100
|
+
:severity => Issue::Severity::HIGH,
|
|
101
|
+
:cvssv2 => '9.0',
|
|
102
|
+
:remedy_guidance => 'User inputs must be validated and filtered
|
|
103
|
+
before being returned as part of the HTML code of a page.',
|
|
104
|
+
:remedy_code => '',
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
@@ -0,0 +1,125 @@
|
|
|
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
|
+
# XSS in URI audit module.
|
|
17
|
+
#
|
|
18
|
+
# @author: Tasos "Zapotek" Laskos
|
|
19
|
+
# <tasos.laskos@gmail.com>
|
|
20
|
+
# <zapotek@segfault.gr>
|
|
21
|
+
# @version: 0.1.3
|
|
22
|
+
#
|
|
23
|
+
# @see http://cwe.mitre.org/data/definitions/79.html
|
|
24
|
+
# @see http://ha.ckers.org/xss.html
|
|
25
|
+
# @see http://secunia.com/advisories/9716/
|
|
26
|
+
#
|
|
27
|
+
class XSSURI < Arachni::Module::Base
|
|
28
|
+
|
|
29
|
+
include Arachni::Module::Utilities
|
|
30
|
+
|
|
31
|
+
def initialize( page )
|
|
32
|
+
super( page )
|
|
33
|
+
|
|
34
|
+
@results = []
|
|
35
|
+
|
|
36
|
+
# since we'll bypass the Auditor we need to keep track of our audits
|
|
37
|
+
@@__audited ||= Set.new
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def prepare( )
|
|
41
|
+
@str = '/<arachni_xss_uri_' + seed
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def run( )
|
|
45
|
+
|
|
46
|
+
uri = URI( normalize_url( @page.url ) )
|
|
47
|
+
url = uri.scheme + '://' + uri.host + uri.path + @str
|
|
48
|
+
|
|
49
|
+
if @@__audited.include?( url )
|
|
50
|
+
print_info( 'Skipping already audited url: ' + url )
|
|
51
|
+
return
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
@@__audited << url
|
|
55
|
+
|
|
56
|
+
req = @http.get( url )
|
|
57
|
+
|
|
58
|
+
req.on_complete {
|
|
59
|
+
|res|
|
|
60
|
+
__log_results( res )
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def self.info
|
|
67
|
+
{
|
|
68
|
+
:name => 'XSSURI',
|
|
69
|
+
:description => %q{Cross-Site Scripting module for path injection},
|
|
70
|
+
:elements => [ ],
|
|
71
|
+
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> ',
|
|
72
|
+
:version => '0.1.3',
|
|
73
|
+
:references => {
|
|
74
|
+
'ha.ckers' => 'http://ha.ckers.org/xss.html',
|
|
75
|
+
'Secunia' => 'http://secunia.com/advisories/9716/'
|
|
76
|
+
},
|
|
77
|
+
:targets => { 'Generic' => 'all' },
|
|
78
|
+
:issue => {
|
|
79
|
+
:name => %q{Cross-Site Scripting (XSS) in URI},
|
|
80
|
+
:description => %q{Client-side code, like JavaScript, can
|
|
81
|
+
be injected into the web application.},
|
|
82
|
+
:tags => [ 'xss', 'uri', 'path', 'regexp', 'injection', 'script' ],
|
|
83
|
+
:cwe => '79',
|
|
84
|
+
:severity => Issue::Severity::HIGH,
|
|
85
|
+
:cvssv2 => '9.0',
|
|
86
|
+
:remedy_guidance => '',
|
|
87
|
+
:remedy_code => '',
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def __log_results( res )
|
|
94
|
+
|
|
95
|
+
if res.body.substring?( @str )
|
|
96
|
+
|
|
97
|
+
url = res.effective_url
|
|
98
|
+
# append the result to the results hash
|
|
99
|
+
@results << Issue.new( {
|
|
100
|
+
:url => url,
|
|
101
|
+
:injected => @str,
|
|
102
|
+
:id => @str,
|
|
103
|
+
:regexp => @str,
|
|
104
|
+
:regexp_match => @str,
|
|
105
|
+
:elem => Issue::Element::PATH,
|
|
106
|
+
:response => res.body,
|
|
107
|
+
:headers => {
|
|
108
|
+
:request => res.request.headers,
|
|
109
|
+
:response => res.headers,
|
|
110
|
+
}
|
|
111
|
+
}.merge( self.class.info ) )
|
|
112
|
+
|
|
113
|
+
# inform the user that we have a match
|
|
114
|
+
print_ok( "In #{@page.url} at " + url )
|
|
115
|
+
|
|
116
|
+
# register our results with the system
|
|
117
|
+
register_results( @results )
|
|
118
|
+
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
# Allowed HTTP methods recon module.
|
|
17
|
+
#
|
|
18
|
+
# @author: Tasos "Zapotek" Laskos
|
|
19
|
+
# <tasos.laskos@gmail.com>
|
|
20
|
+
# <zapotek@segfault.gr>
|
|
21
|
+
# @version: 0.1
|
|
22
|
+
#
|
|
23
|
+
# @see http://en.wikipedia.org/wiki/WebDAV
|
|
24
|
+
# @see http://www.webdav.org/specs/rfc4918.html
|
|
25
|
+
#
|
|
26
|
+
class AllowedMethods < Arachni::Module::Base
|
|
27
|
+
|
|
28
|
+
include Arachni::Module::Utilities
|
|
29
|
+
|
|
30
|
+
def initialize( page )
|
|
31
|
+
super( page )
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def prepare
|
|
35
|
+
@@__ran ||= false
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def run( )
|
|
39
|
+
|
|
40
|
+
return if @@__ran
|
|
41
|
+
|
|
42
|
+
print_status( "Checking..." )
|
|
43
|
+
|
|
44
|
+
@http.request( URI( normalize_url( @page.url ) ).host, :method => :options ).on_complete {
|
|
45
|
+
|res|
|
|
46
|
+
__log_results( res )
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def clean_up
|
|
51
|
+
@@__ran = true
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def self.info
|
|
55
|
+
{
|
|
56
|
+
:name => 'AllowedMethods',
|
|
57
|
+
:description => %q{Checks for supported HTTP methods.},
|
|
58
|
+
:elements => [ ],
|
|
59
|
+
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>',
|
|
60
|
+
:version => '0.1',
|
|
61
|
+
:references => {
|
|
62
|
+
},
|
|
63
|
+
:targets => { 'Generic' => 'all' },
|
|
64
|
+
:issue => {
|
|
65
|
+
:name => %q{Allowed HTTP methods},
|
|
66
|
+
:description => %q{The webserver claims that it supports the logged methods.},
|
|
67
|
+
:tags => [ 'http', 'methods', 'options' ],
|
|
68
|
+
:cwe => '',
|
|
69
|
+
:severity => Issue::Severity::INFORMATIONAL,
|
|
70
|
+
:cvssv2 => '',
|
|
71
|
+
:remedy_guidance => '',
|
|
72
|
+
:remedy_code => '',
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def __log_results( res )
|
|
78
|
+
|
|
79
|
+
methods = res.headers_hash['Allow']
|
|
80
|
+
|
|
81
|
+
return if !methods || methods.empty?
|
|
82
|
+
|
|
83
|
+
issue = Issue.new( {
|
|
84
|
+
:url => res.effective_url,
|
|
85
|
+
:method => res.request.method.to_s.upcase,
|
|
86
|
+
:regexp_match => methods,
|
|
87
|
+
:elem => Issue::Element::SERVER,
|
|
88
|
+
:response => res.body,
|
|
89
|
+
:headers => {
|
|
90
|
+
:request => res.request.headers,
|
|
91
|
+
:response => res.headers,
|
|
92
|
+
}
|
|
93
|
+
}.merge( self.class.info ) )
|
|
94
|
+
|
|
95
|
+
# register our results with the system
|
|
96
|
+
register_results( [issue] )
|
|
97
|
+
|
|
98
|
+
# inform the user that we have a match
|
|
99
|
+
print_ok( methods )
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
# Looks for common backdoors on the server.
|
|
17
|
+
#
|
|
18
|
+
# @author: Tasos "Zapotek" Laskos
|
|
19
|
+
# <tasos.laskos@gmail.com>
|
|
20
|
+
# <zapotek@segfault.gr>
|
|
21
|
+
# @version: 0.1
|
|
22
|
+
#
|
|
23
|
+
#
|
|
24
|
+
class Backdoors < Arachni::Module::Base
|
|
25
|
+
|
|
26
|
+
include Arachni::Module::Utilities
|
|
27
|
+
|
|
28
|
+
def initialize( page )
|
|
29
|
+
super( page )
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def prepare
|
|
33
|
+
# to keep track of the requests and not repeat them
|
|
34
|
+
@@__audited ||= Set.new
|
|
35
|
+
|
|
36
|
+
# our results array
|
|
37
|
+
@results = []
|
|
38
|
+
|
|
39
|
+
@@__filenames ||=[]
|
|
40
|
+
return if !@@__filenames.empty?
|
|
41
|
+
|
|
42
|
+
read_file( 'filenames.txt' ) {
|
|
43
|
+
|file|
|
|
44
|
+
@@__filenames << file
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def run( )
|
|
49
|
+
|
|
50
|
+
path = get_path( @page.url )
|
|
51
|
+
return if @@__audited.include?( path )
|
|
52
|
+
|
|
53
|
+
print_status( "Scanning..." )
|
|
54
|
+
@@__filenames.each {
|
|
55
|
+
|file|
|
|
56
|
+
|
|
57
|
+
url = path + file
|
|
58
|
+
|
|
59
|
+
print_status( "Checking for #{url}" )
|
|
60
|
+
|
|
61
|
+
req = @http.get( url, :train => true )
|
|
62
|
+
|
|
63
|
+
req.on_complete {
|
|
64
|
+
|res|
|
|
65
|
+
print_status( "Analyzing #{res.effective_url}" )
|
|
66
|
+
__log_results( res, file )
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@@__audited << path
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def self.info
|
|
75
|
+
{
|
|
76
|
+
:name => 'Backdoors',
|
|
77
|
+
:description => %q{Tries to find common backdoors on the server.},
|
|
78
|
+
:elements => [ ],
|
|
79
|
+
:author => 'Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> ',
|
|
80
|
+
:version => '0.1',
|
|
81
|
+
:references => {},
|
|
82
|
+
:targets => { 'Generic' => 'all' },
|
|
83
|
+
:issue => {
|
|
84
|
+
:name => %q{A backdoor file exists on the server.},
|
|
85
|
+
:description => %q{},
|
|
86
|
+
:tags => [ 'path', 'backdoor', 'file' ],
|
|
87
|
+
:cwe => '',
|
|
88
|
+
:severity => Issue::Severity::HIGH,
|
|
89
|
+
:cvssv2 => '',
|
|
90
|
+
:remedy_guidance => '',
|
|
91
|
+
:remedy_code => '',
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
#
|
|
98
|
+
# Adds an issue to the @results array<br/>
|
|
99
|
+
# and outputs an "OK" message with the filename and its url.
|
|
100
|
+
#
|
|
101
|
+
# @param [Net::HTTPResponse] res the HTTP response
|
|
102
|
+
# @param [String] filename the discovered filename
|
|
103
|
+
#
|
|
104
|
+
def __log_results( res, filename )
|
|
105
|
+
|
|
106
|
+
return if( res.code != 200 || @http.custom_404?( res ) )
|
|
107
|
+
|
|
108
|
+
url = res.effective_url
|
|
109
|
+
# append the result to the results array
|
|
110
|
+
@results << Issue.new( {
|
|
111
|
+
:url => url,
|
|
112
|
+
:injected => filename,
|
|
113
|
+
:id => filename,
|
|
114
|
+
:elem => Issue::Element::PATH,
|
|
115
|
+
:response => res.body,
|
|
116
|
+
:headers => {
|
|
117
|
+
:request => res.request.headers,
|
|
118
|
+
:response => res.headers,
|
|
119
|
+
}
|
|
120
|
+
}.merge( self.class.info ) )
|
|
121
|
+
|
|
122
|
+
# register our results with the system
|
|
123
|
+
register_results( @results )
|
|
124
|
+
|
|
125
|
+
# inform the user that we have a match
|
|
126
|
+
print_ok( "Found #{filename} at " + url )
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|