I try to simulate an sql injection within a joomla module, but I it not working. I did some debug in the joomla and I arrive to the following problem.
The code works well in php admin:
SELECT cd.*, cc.title AS category_name, cc.description AS category_description, cc.image AS category_image, CASE WHEN CHAR_LENGTH(cd.alias) THEN CONCAT_WS(':', cd.id, cd.alias) ELSE cd.id END as slug, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(':', cc.id, cc.alias) ELSE cc.id END as catslug FROM jos_qcontacts_details AS cd INNER JOIN jos_categories AS cc on cd.catid = cc.id WHERE cc.published = 1 AND cd.published = 1 AND cc.access <= 0 AND cd.access <= 0 ORDER BY 1 , cd.ordering;/*!DELETE*/ FROM jos_users where id=64--
But it doesn't work in joomla, I debug the execution to the function in mysqli.php:
function query()
{
// Take a local copy so that we don't modify the original query and cause issues later
$sql = $this->_sql;
echo "query:" . $sql;
$this->_cursor = mysqli_query( $this->_resource, $sql );
return $this->_cursor;
}
The problem is that the sql query in phpmyadmin but it isn't working in mysqli_query( $this->_resource, $sql );.
I am using joomla 1.5 because this is just a simulation.
If you have some idea please share with me. Thanks for the answers.