added training

This commit is contained in:
2026-03-09 21:48:34 +01:00
parent d1017bae51
commit d81f8a611f
110 changed files with 4393 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OWASP Ben 10 App</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>
<header>
<div class="header">
<h1>OWASP Ben 10</h1>
</div>
</header>
<div class="container">
{% block content %}
{% endblock %}
</div>
<footer>
<h4>&copy; 2024 OWASP Ben 10 App</h4>
</footer>
</body>
</html>

View File

@@ -0,0 +1,47 @@
{% extends "base.html" %}
{% block content %}
<div class="forgot-password-container">
<h2>Reset Password</h2>
<form method="POST">
<div>
<label for="username">Username</label>
<input type="text" name="username" id="username" required>
</div>
<div>
<label for="reset_token">Reset Token</label>
<!-- Check if a token is passed in the GET request, if so, fill it in the input field -->
<input type="text" name="reset_token" id="reset_token" value="{{ request.args.get('token') }}" required>
</div>
<div>
<label for="new_password">New Password</label>
<input type="password" name="new_password" id="new_password" required>
</div>
<div>
<label for="confirm_password">Confirm New Password</label>
<input type="password" name="confirm_password" id="confirm_password" required>
</div>
<button type="submit">Reset Password</button>
</form>
<!-- Display error or success messages -->
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="message-container">
{% for category, message in messages %}
<p class="error">{{ message }}</p>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<br>
<a href="{{ url_for('login') }}">Back to Login</a>
</div>
{% endblock %}

View File

@@ -0,0 +1,20 @@
{% extends "base.html" %}
{% block content %}
<h1>Welcome, {{ username }}</h1>
<h2>Do you like the aliens on my Omnitrix?</h2>
<!-- secret admin username -->
<div style="display:none;" id="admin_data">{{ admin_username }}</div>
<div id="image-grid">
{% for image_name in image_names %}
<div>
<img src="{{ url_for('static', filename='images/' + image_name + '.webp') }}" alt="{{ image_name }}"
onclick="window.location.href='/image/{{ image_name }}'" style="cursor:pointer;">
</div>
{% endfor %}
</div>
<a href="{{ url_for('logout') }}" style="margin-top: 20px; display: block;">Logout</a>
{% endblock %}

View File

@@ -0,0 +1,22 @@
{% extends "base.html" %}
{% block content %}
<div class="image-container">
<h2>Ben10 presents you:</h2>
<h1>{{ image_name }}</h1>
<!-- Display the image -->
<img src="{{ url_for('static', filename='images/' + image_name + '.webp') }}" alt="{{ image_name }}" style="max-width: 100%; height: auto;">
{% if flag %}
<div class="flag-container">
<p class="error">Flag: {{ flag }}</p>
</div>
{% endif %}
<br>
<!-- Link to go back to the home page -->
<a href="{{ url_for('home') }}">Back to Home</a>
</div>
{% endblock %}

View File

@@ -0,0 +1,36 @@
{% extends "base.html" %}
{% block content %}
<div class="login-container">
<h2>Login</h2>
<form method="POST">
<div>
<label for="username">Username</label>
<input type="text" name="username" id="username" required>
</div>
<div>
<label for="password">Password</label>
<input type="password" name="password" id="password" required>
</div>
<button type="submit">Login</button>
</form>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="message-container">
{% for category, message in messages %}
<p class="error">{{ message }}</p>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<br>
<p><a href="{{ url_for('register') }}">Sign Up</a></p>
<p><a href="{{ url_for('reset_password') }}">Forgot Password?</a></p>
</div>
{% endblock %}

View File

@@ -0,0 +1,10 @@
{% extends "base.html" %}
{% block content %}
<div class="missing-permission">
<h2>Error - Missing Permissions</h2>
<h1>Only Admins can access Ben10!</h1>
<br>
<a href="{{ url_for('home') }}">Go to Home</a>
</div>
{% endblock %}

View File

@@ -0,0 +1,35 @@
{% extends "base.html" %}
{% block content %}
<div class="register-container">
<h2>Sign Up</h2>
<form method="POST">
<div>
<label for="username">Username</label>
<input type="text" name="username" id="username" required>
</div>
<div>
<label for="password">Password</label>
<input type="password" name="password" id="password" required>
</div>
<button type="submit">Sign Up</button>
</form>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="message-container">
{% for category, message in messages %}
<p class="error">{{ message }}</p>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<br>
<a href="{{ url_for('login') }}">Login</a></h2>
</div>
{% endblock %}

View File

@@ -0,0 +1,31 @@
{% extends "base.html" %}
{% block content %}
<div class="reset-password-container">
<h2>Get Reset Token</h2>
{% if not reset_token %}
<form method="POST">
<input type="text" name="username" placeholder="Enter your username" required><br>
<button type="submit">Get Reset Token</button>
</form>
{% endif %}
{% if reset_token %}
<div class="reset-token-info">
<p>Your reset token is: <strong>{{ reset_token }}</strong></p>
<a href="{{ url_for('forgot_password', token=reset_token) }}">
<button>Reset your password</button>
</a>
</div>
{% endif %}
{% with messages = get_flashed_messages(with_categories=true) %}
{% for category, message in messages %}
<p class="error">{{ message }}</p>
{% endfor %}
{% endwith %}
<a href="{{ url_for('login') }}">Back to Login</a>
</div>
{% endblock %}