Web Hacking 3
Web Hacking 3
The previous solution does not work anymore, because the script only
accepts the input when there’s only one row result (Note, the attacker
can’t see the server side script, but he can guess).
How to modify the query to have only one row as result?
IN5290 2018 L07 – Web hacking 3. 10
Type of sql injection exploitations
Based on the situation how the attacker can influence the server side sql
query and the sql engine settings (what is enabled by the configuration
and what is not) the attacker can choose from the following methods:
If we provide a non-existing user e.g. laszlo, the first version of the page
appears. For valid users such as admin (The attacker doesn’t
necessarily has valid user for the site) the second version appears.
Since there’s no input validation for the email parameter, the attacker
can produce both answers:
True False
Example task:
http://193.225.218.118/xpath/index2.php
Get the admin user’s email (flag)!
After detecting the vulnerability the next step is to identify the template
engine that was used (e.g. Smarty, Twig, Jade). Each template engine has
specific exploitation. In case of a successful exploitation the attacker can
even execute arbitrary shell commands.
/proc/self/fd/12
/proc/self/fd/14%00
/proc/self/fd/12
/proc/self/fd/14%00
/proc/<apache_id>/fd/12
/proc/<apache_id>/fd/14 (apache id is from /proc/self/status)
/proc/<apache_id>/fd/12%00
/proc/<apache_id>/fd/14%00