1
- ##
2
- # $Id$
3
- ##
4
-
5
1
##
6
2
# This file is part of the Metasploit Framework and may be subject to
7
3
# redistribution and commercial restrictions. Please see the Metasploit
@@ -25,35 +21,32 @@ def initialize
25
21
'Version' => '$Revision$' ,
26
22
'Description' => %q{
27
23
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.
30
25
} ,
31
26
'Author' =>
32
27
[
33
- 'Stephen Haywood <stephen@ averagesecurityguy.info' ,
28
+ 'Stephen Haywood <stephen[at] averagesecurityguy.info> ' ,
34
29
] ,
35
30
'References' =>
36
31
[
32
+ [ 'URL' , 'http://pen-testing.sans.org/blog/pen-testing/2012/12/06/all-your-svn-are-belong-to-us#' ]
37
33
] ,
38
34
'License' => MSF_LICENSE
39
35
)
40
36
41
- register_options (
42
- [
43
- ] , self . class )
44
-
45
37
end
46
38
47
- def target_url
39
+ def target_url ( path )
48
40
if ssl
49
- return "https://#{ vhost } :#{ rport } "
41
+ return "https://#{ vhost } :#{ rport } #{ path } "
50
42
else
51
- return "http://#{ vhost } :#{ rport } "
43
+ return "http://#{ vhost } :#{ rport } #{ path } "
52
44
end
53
45
end
54
46
55
47
def run_host ( ip )
56
- if wcdb_exists ( "#{ target_url } " )
48
+ path = '/.svn/wc.db'
49
+ if wcdb_exists ( target_url , path )
57
50
print_good ( "SVN database found on #{ target_url } " )
58
51
report_note (
59
52
:host => rhost ,
@@ -68,18 +61,18 @@ def run_host(ip)
68
61
end
69
62
end
70
63
71
- def wcdb_exists ( url )
64
+ def wcdb_exists ( url , path )
72
65
73
- vprint_status ( "Trying url: #{ url } " )
66
+ vprint_status ( "Trying #{ url } #{ path } " )
74
67
begin
75
68
res = send_request_cgi (
76
69
{
77
70
'method' => 'GET' ,
78
- 'uri' => '/.svn/wc.db' ,
71
+ 'uri' => path ,
79
72
'ctype' => 'text/plain'
80
- } , 20 )
73
+ } )
81
74
82
- if res . code == 200
75
+ if res and res . code == 200
83
76
return true
84
77
else
85
78
return false
0 commit comments