I installed XAMPP on my development PC, and started Apache HTTP server and MySQL.
It comes with a test page "CD collection", with the following back-end PHP code:
mysql_query("DELETE FROM cds WHERE id=".round($_REQUEST['id']));
I'm not an expert in PHP, I'm guessing the round
call is there to prevent SQL injection. So I removed it from the PHP code, leaving the following:
mysql_query("DELETE FROM cds WHERE id=".$_REQUEST['id']);
I verified that I can modify the query parameters in the URL to do whatever I like to the database, so the SQL injection vulnerability is definitely there.
Now I'm trying to use sqlmap
to find the SQL injection vulnerability. I run it like this:
python sqlmap.py -u "http://127.0.0.1/xampp/cds.php?action=del&id=14"
But it returns the following:
[16:01:47] [WARNING] GET parameter 'id' is not injectable [16:01:47] [CRITICAL] all parameters are not injectable, try to increase --level/--risk values to perform more tests. Rerun without providing the --te chnique switch. Give it a go with the --text-only switch if the target page has a low percentage of textual content (~15.27% of page content is text)
Any idea of what I may be doing wrong?