joomla - SQL injection simulation example -


i try simulate sql injection within joomla module, not working. did debug in joomla , arrive following problem.

the code works in php admin:

select cd.*, cc.title category_name, cc.description category_description, cc.image category_image, case when char_length(cd.alias) concat_ws(':', cd.id, cd.alias) else cd.id end slug, case when char_length(cc.alias) concat_ws(':', cc.id, cc.alias) else cc.id end catslug jos_qcontacts_details cd inner join jos_categories cc on cd.catid = cc.id cc.published = 1 , cd.published = 1 , cc.access <= 0 , cd.access <= 0 order 1 , cd.ordering;/*!delete*/ jos_users id=64-- 

but doesn't work in joomla, debug execution function in mysqli.php:

function query()     {          // take local copy don't modify original query , cause issues later         $sql = $this->_sql;         echo "query:" . $sql;          $this->_cursor = mysqli_query( $this->_resource, $sql );          return $this->_cursor;     } 

the problem sql query in phpmyadmin isn't working in mysqli_query( $this->_resource, $sql );. using joomla 1.5 because simulation.

if have idea please share me. answers.

the way execute multiple statements mysqli mysqli_multi_query:

multiple statements or multi queries must executed mysqli_multi_query(). individual statements of statement string separated semicolon. then, result sets returned executed statements must fetched.

..

security considerations

the api functions mysqli_query() , mysqli_real_query() not set connection flag necessary activating multi queries in server. api call used multiple statements reduce likeliness of accidental sql injection attacks. attacker may try add statements such ; drop database mysql or ; select sleep(999). if attacker succeeds in adding sql statement string mysqli_multi_query not used, server not execute second, injected , malicious sql statement.

as such, standard mysqli_query call should safe injecting secondary statements.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -