From 7aa60e124088bbcdea5829e131737f859640bc02 Mon Sep 17 00:00:00 2001
From: cheeest
Date: Sat, 5 Apr 2025 22:42:20 +0300
Subject: [PATCH] feat: section main files
---
app.py | 32 +++++++++++++------
templates/_sidenav.html | 6 ++--
templates/forensic-main.html | 4 +++
templates/index.html | 12 ++++---
templates/osint-main.html | 4 +++
templates/{found.html => task1-metadata.html} | 0
templates/web-main.html | 4 +++
7 files changed, 44 insertions(+), 18 deletions(-)
create mode 100644 templates/forensic-main.html
create mode 100644 templates/osint-main.html
rename templates/{found.html => task1-metadata.html} (100%)
create mode 100644 templates/web-main.html
diff --git a/app.py b/app.py
index ca3bec5..bae33cf 100644
--- a/app.py
+++ b/app.py
@@ -38,7 +38,19 @@ def close_connection(exception):
def index():
return render_template('index.html')
-@app.route("/sql-injection", methods=('GET', 'POST'))
+@app.route("/web")
+def web():
+ return render_template('web-main.html')
+
+@app.route("/forensic")
+def forensic():
+ return render_template('forensic-main.html')
+
+@app.route("/osint")
+def osint():
+ return render_template('osint-main.html')
+
+@app.route("web/sql-injection", methods=('GET', 'POST'))
def sql():
if request.method == 'POST':
login = request.form['login']
@@ -52,20 +64,20 @@ def sql():
return redirect(url_for('success_login'), code=302)
return render_template('sql-injection.html')
-@app.route("/found-me")
-def found():
+@app.route("/task1-metadata")
+def task1():
session['task1_id'] = id = hex(getrandbits(45))[2:]
session['task1_flag'] = flag_task1 = f'C4TchFl4g{{{hex(getrandbits(45))[2:]}}}'
task1_flag(flag_task1, id)
if request.method == 'POST':
user_flag = request.form['user_flag']
if user_flag == flag_task1:
- return render_template('found.html', flag=flag_task1, success_flag='.')
- return render_template('found.html', flag=flag_task1, error='Ошибка: неверный флаг!')
+ return render_template('task1-metadata.html', flag=flag_task1, success_flag='.')
+ return render_template('task1-metadata.html', flag=flag_task1, error='Ошибка: неверный флаг!')
if flag_task1:
- return render_template('found.html', flag=flag_task1)
+ return render_template('task1-metadata.html', flag=flag_task1)
abort(404)
- return render_template('found.html')
+ return render_template('task1-metadata.html')
@app.route("/found-me/task1")
def forensic_task1():
@@ -81,10 +93,10 @@ def success_login():
if request.method == 'POST':
user_flag = request.form['user_flag']
if user_flag == flag:
- return render_template('success.html', flag=flag, success_flag='.')
- return render_template('success.html', flag=flag, error='Ошибка: неверный флаг!')
+ return render_template('success-sql.html', flag=flag, success_flag='.')
+ return render_template('success-sql.html', flag=flag, error='Ошибка: неверный флаг!')
if flag:
- return render_template('success.html', flag=flag)
+ return render_template('success-sql.html', flag=flag)
abort(404)
@app.errorhandler(werkzeug.exceptions.NotFound)
diff --git a/templates/_sidenav.html b/templates/_sidenav.html
index 781533d..2b7227c 100644
--- a/templates/_sidenav.html
+++ b/templates/_sidenav.html
@@ -3,9 +3,9 @@
на главную
{%- for link, text in (
- ('sql', 'Sql-инъекция'),
- ('found', 'Форензика'),
- ('decode', 'Криптография'),
+ ('web', 'Web'),
+ ('forensic', 'Форензика'),
+ ('osint', 'OSINT'),
) %}
{%- if request.path != url_for(link) %}
{{ text }}
diff --git a/templates/forensic-main.html b/templates/forensic-main.html
new file mode 100644
index 0000000..1828592
--- /dev/null
+++ b/templates/forensic-main.html
@@ -0,0 +1,4 @@
+
+{% include '_head.html' %}
+
+ {% include '_header.html' %}
\ No newline at end of file
diff --git a/templates/index.html b/templates/index.html
index ac61d94..c9691a2 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -9,11 +9,9 @@
Разделы заданий:
{%- for name, descr in (
- ('sql', "Sql-инъекция"),
- ('found', "Форензика"),
- ('decode', "Криптография"),
- ('index', "ещё таск"),
- ('index', "и еще один таск")
+ ('web', "Web"),
+ ('forensic', "Форензика"),
+ ('osint', "OSINT"),
) %}
{{ descr }}
{%- endfor %}
@@ -32,6 +30,10 @@
Сайт, где много крутого про Web -
PortSwigger
+
+ CTF Новости России -
+ CTF News
+
diff --git a/templates/osint-main.html b/templates/osint-main.html
new file mode 100644
index 0000000..1828592
--- /dev/null
+++ b/templates/osint-main.html
@@ -0,0 +1,4 @@
+
+{% include '_head.html' %}
+
+ {% include '_header.html' %}
\ No newline at end of file
diff --git a/templates/found.html b/templates/task1-metadata.html
similarity index 100%
rename from templates/found.html
rename to templates/task1-metadata.html
diff --git a/templates/web-main.html b/templates/web-main.html
new file mode 100644
index 0000000..1828592
--- /dev/null
+++ b/templates/web-main.html
@@ -0,0 +1,4 @@
+
+{% include '_head.html' %}
+
+ {% include '_header.html' %}
\ No newline at end of file