Made changes requested by sinn3r.

unstable
Stephen Haywood 2012-12-06 17:18:50 -05:00
parent d938959e97
commit 4ce51fe889
1 changed files with 13 additions and 20 deletions

View File

@ -1,7 +1,3 @@
##
# $Id$
##
## ##
# This file is part of the Metasploit Framework and may be subject to # This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit # redistribution and commercial restrictions. Please see the Metasploit
@ -25,35 +21,32 @@ class Metasploit3 < Msf::Auxiliary
'Version' => '$Revision$', 'Version' => '$Revision$',
'Description' => %q{ 'Description' => %q{
Scan for servers that allow access to the SVN wc.db file. Scan for servers that allow access to the SVN wc.db file.
Based on the work by Tim Meddin as described at Based on the work by Tim Meddin.
http://pen-testing.sans.org/blog/pen-testing/2012/12/06/all-your-svn-are-belong-to-us#
}, },
'Author' => 'Author' =>
[ [
'Stephen Haywood <stephen@averagesecurityguy.info', 'Stephen Haywood <stephen[at]averagesecurityguy.info>',
], ],
'References' => 'References' =>
[ [
['URL', 'http://pen-testing.sans.org/blog/pen-testing/2012/12/06/all-your-svn-are-belong-to-us#']
], ],
'License' => MSF_LICENSE 'License' => MSF_LICENSE
) )
register_options(
[
], self.class)
end end
def target_url def target_url(path)
if ssl if ssl
return "https://#{vhost}:#{rport}" return "https://#{vhost}:#{rport}#{path}"
else else
return "http://#{vhost}:#{rport}" return "http://#{vhost}:#{rport}#{path}"
end end
end end
def run_host(ip) def run_host(ip)
if wcdb_exists("#{target_url}") path = '/.svn/wc.db'
if wcdb_exists(target_url, path)
print_good("SVN database found on #{target_url}") print_good("SVN database found on #{target_url}")
report_note( report_note(
:host => rhost, :host => rhost,
@ -68,18 +61,18 @@ class Metasploit3 < Msf::Auxiliary
end end
end end
def wcdb_exists(url) def wcdb_exists(url, path)
vprint_status("Trying url: #{url}") vprint_status("Trying #{url}#{path}")
begin begin
res = send_request_cgi( res = send_request_cgi(
{ {
'method' => 'GET', 'method' => 'GET',
'uri' => '/.svn/wc.db', 'uri' => path,
'ctype' => 'text/plain' 'ctype' => 'text/plain'
}, 20) })
if res.code == 200 if res and res.code == 200
return true return true
else else
return false return false