Skip to content

Commit 4ce51fe

Browse files
Made changes requested by sinn3r.
1 parent d938959 commit 4ce51fe

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

modules/auxiliary/scanner/http/svn_wcdb_scanner.rb

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
##
2-
# $Id$
3-
##
4-
51
##
62
# This file is part of the Metasploit Framework and may be subject to
73
# redistribution and commercial restrictions. Please see the Metasploit
@@ -25,35 +21,32 @@ def initialize
2521
'Version' => '$Revision$',
2622
'Description' => %q{
2723
Scan for servers that allow access to the SVN wc.db file.
28-
Based on the work by Tim Meddin as described at
29-
http://pen-testing.sans.org/blog/pen-testing/2012/12/06/all-your-svn-are-belong-to-us#
24+
Based on the work by Tim Meddin.
3025
},
3126
'Author' =>
3227
[
33-
'Stephen Haywood <stephen@averagesecurityguy.info',
28+
'Stephen Haywood <stephen[at]averagesecurityguy.info>',
3429
],
3530
'References' =>
3631
[
32+
['URL', 'http://pen-testing.sans.org/blog/pen-testing/2012/12/06/all-your-svn-are-belong-to-us#']
3733
],
3834
'License' => MSF_LICENSE
3935
)
4036

41-
register_options(
42-
[
43-
], self.class)
44-
4537
end
4638

47-
def target_url
39+
def target_url(path)
4840
if ssl
49-
return "https://#{vhost}:#{rport}"
41+
return "https://#{vhost}:#{rport}#{path}"
5042
else
51-
return "http://#{vhost}:#{rport}"
43+
return "http://#{vhost}:#{rport}#{path}"
5244
end
5345
end
5446

5547
def run_host(ip)
56-
if wcdb_exists("#{target_url}")
48+
path = '/.svn/wc.db'
49+
if wcdb_exists(target_url, path)
5750
print_good("SVN database found on #{target_url}")
5851
report_note(
5952
:host => rhost,
@@ -68,18 +61,18 @@ def run_host(ip)
6861
end
6962
end
7063

71-
def wcdb_exists(url)
64+
def wcdb_exists(url, path)
7265

73-
vprint_status("Trying url: #{url}")
66+
vprint_status("Trying #{url}#{path}")
7467
begin
7568
res = send_request_cgi(
7669
{
7770
'method' => 'GET',
78-
'uri' => '/.svn/wc.db',
71+
'uri' => path,
7972
'ctype' => 'text/plain'
80-
}, 20)
73+
})
8174

82-
if res.code == 200
75+
if res and res.code == 200
8376
return true
8477
else
8578
return false

0 commit comments

Comments
 (0)