removed unused endpoint

This commit is contained in:
2025-12-16 01:55:09 +10:00
parent 532556dacd
commit fa7d2c7cba
3 changed files with 9 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
services:
vunerable-web-app:
image: web-app:v0.0.1a
image: kulesh_web-app:v0.0.1a
ports:
- "80:8000"
volumes:

6
cookies.txt Normal file
View File

@@ -0,0 +1,6 @@
# Netscape HTTP Cookie File
# https://curl.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
localhost FALSE / FALSE 0 password a
localhost FALSE / FALSE 0 login "' or 1=1-- "

View File

@@ -125,7 +125,7 @@ async def welcome(request: Request):
if not login or not password:
return RedirectResponse(url="/login")
cursor.execute(
f"SELECT * FROM users WHERE login='{login}' AND password='{password}'"
f"SELECT login FROM users WHERE login='{login}' AND password='{password}'"
)
user = cursor.fetchall()
if user:
@@ -133,7 +133,7 @@ async def welcome(request: Request):
<html>
<head><title>Добро пожаловать</title>{STYLES}</head>
<body>
<h1>Привет, {login}</h1>
<h1>Привет, {user}</h1>
<button onclick="
document.cookie = 'login=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
document.cookie = 'password=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
@@ -148,13 +148,6 @@ async def welcome(request: Request):
return RedirectResponse(url="/login")
@app.post("/logout")
async def logout():
response = RedirectResponse(url="/login", status_code=302)
response.delete_cookie("login")
response.delete_cookie("password")
return response
@app.get("/", include_in_schema=False)
async def root():