Burp Suite
id parameter to refine the SQL payload.The vulnerability is a classic SQL injection (SQLi) located in the id parameter of the view_user.php file. The application fails to use parameterized queries or an equivalent sanitization mechanism, directly interpolating the user-provided id into the database query.
Given the application’s architecture, this allows for UNION-based exploitation, enabling an attacker to append results from arbitrary tables to the original query’s output.
The attack vector is purely remote and requires no authentication.
/music/view_user.php.id parameter with a single quote or boolean logic reveals a discrepancy in the response, confirming the injection point.UNION SELECT technique, the attacker determines the number of columns returned by the original query./music/view_user.php?id=0 union select 1,2,3,4,5,6,database(),8,9,10,11,12--+users table to extract administrative credentials.From a forensic perspective, an exploitation attempt will leave specific traces in the web server logs.
Analyze the Access Logs (Apache/Nginx) for the following patterns:
/music/view_user.php containing SQL keywords such as UNION, SELECT, INFORMATION_SCHEMA, or DATABASE().id values (fuzzing)..php files in the web root, as SQLi is often used to gain an initial foothold and upload a shell via INTO OUTFILE.Implement the following query to detect potential exploitation attempts:
index=web_logs uri="/music/view_user.php" (id="*union*" OR id="*select*" OR id="*database*")
Create a rule to alert on the presence of SQL keywords in the URI of the target component.
mysqli or PDO in PHP) to decouple the query logic from the data.id parameter. Since it is expected to be an integer, cast the input: $id = (int)$_GET['id'];.FILE privileges to prevent the use of LOAD_FILE() or INTO OUTFILE.Burp Suite
id parameter to refine the SQL payload.sqlmap
NVD