Compare commits
6 Commits
fe43dc0497
...
474a6d5cb9
Author | SHA1 | Date | |
---|---|---|---|
474a6d5cb9 | |||
c766258407 | |||
05cd1cbd72 | |||
220d919f91 | |||
734f481715 | |||
5a17934843 |
4
app.py
4
app.py
@ -95,7 +95,7 @@ def fmetadata():
|
||||
abort(404)
|
||||
return render_template('task1-metadata.html')
|
||||
|
||||
@app.route("/found-me/task1") #TODO
|
||||
@app.route("/forensic/getimg")
|
||||
def forensic_task1():
|
||||
return send_file(f'/tmp/task1/{session['task1_id']}.jpg')
|
||||
|
||||
@ -127,7 +127,7 @@ def osintgeoguessr():
|
||||
def osintrht():
|
||||
return render_template('osint-hardtask.html')
|
||||
|
||||
@app.route("/success_login-sqltask", methods=('GET', 'POST'))
|
||||
@app.route("/web/success_login-sqltask", methods=('GET', 'POST'))
|
||||
def success_login():
|
||||
flag = session.get('sql_flag')
|
||||
if request.method == 'POST':
|
||||
|
@ -162,7 +162,7 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
height: 100%;
|
||||
height: 80%;
|
||||
min-width: 40rem;
|
||||
justify-content: center;
|
||||
align-content: flex-start;
|
||||
@ -184,16 +184,38 @@
|
||||
padding-top: 2rem;
|
||||
}
|
||||
|
||||
#sqlInpt {
|
||||
position: relative;
|
||||
.sqlInpt {
|
||||
margin: 3.5rem;
|
||||
background-color: rgb(0 0 0 / 85%);
|
||||
padding: 0.5rem 1.5rem;
|
||||
padding: 0.1rem 1.5rem;
|
||||
text-align: left;
|
||||
width: auto;
|
||||
height: 22rem;
|
||||
transition: 1s;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.meme {
|
||||
width: 50rem;
|
||||
height: auto;
|
||||
max-height: 3rem;
|
||||
background-color: rgb(0 0 0/ 90%);
|
||||
padding: 0.4rem 1rem;
|
||||
margin-left: 6.5rem;
|
||||
margin-top: 3.5rem;
|
||||
box-shadow: 0.4em 0.4em 0em 0px rgba(186, 65, 166, 0.6);
|
||||
transform: translateX(-165%);
|
||||
transition: 0.5s;
|
||||
display: block;
|
||||
position: sticky;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.meme:hover {
|
||||
box-shadow: 0.8em 0.8em 0em 0px rgba(186, 65, 166, 0.9);
|
||||
}
|
||||
|
||||
.slideinInpt {
|
||||
transition: 1s;
|
||||
transform: translateX(calc(65vw + .8em + 3.5rem));
|
||||
@ -317,7 +339,7 @@
|
||||
}
|
||||
|
||||
.navigation{
|
||||
width: 18%;
|
||||
width: 19.5rem;
|
||||
height: clamp(27rem, 65%, 39rem);
|
||||
padding: 0;
|
||||
top: 17.5%;
|
||||
@ -423,9 +445,10 @@
|
||||
width: 3rem;
|
||||
height: auto;
|
||||
margin: 2rem;
|
||||
bottom: 0.2vw;
|
||||
left: 0.2vw;
|
||||
position: absolute;
|
||||
display: block;
|
||||
position: sticky;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
box-shadow: 0.4em 0.4em 0em 0px rgba(0, 0, 0, 0.8);
|
||||
transition: 0.5s;
|
||||
border-radius: 0.5rem;
|
||||
|
@ -1,9 +1,7 @@
|
||||
function showPopup() {
|
||||
const popup = document.getElementById("popup");
|
||||
const sqlInpt = document.getElementById("sqlInpt");
|
||||
|
||||
popup.classList.remove('slideoutHelp');
|
||||
sqlInpt.classList.remove('slideoutInpt');
|
||||
popup.style.display = "block";
|
||||
|
||||
setTimeout(() => {
|
||||
@ -14,15 +12,11 @@ function showPopup() {
|
||||
|
||||
function hidePopup() {
|
||||
const popup = document.getElementById("popup");
|
||||
const sqlInpt = document.getElementById("sqlInpt");
|
||||
|
||||
sqlInpt.classList.remove('slideinInpt');
|
||||
sqlInpt.classList.add('slideoutInpt')
|
||||
popup.classList.remove('slideinHelp');
|
||||
popup.classList.add('slideoutHelp');
|
||||
|
||||
setTimeout(() => {
|
||||
popup.style.display = "none"
|
||||
popup.style.position = "absolute"
|
||||
}, 1000);
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
|
||||
{% block head %}
|
||||
{%- include '_head.html' %}
|
||||
{%- endblock %}
|
||||
|
||||
<body>
|
||||
{% include '_header.html' -%}
|
||||
|
||||
{% block content -%}{% endblock -%}
|
||||
|
||||
|
||||
<img id="help" onclick="showPopup()" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,22 +1,24 @@
|
||||
<html lang="ru">
|
||||
{% include '_head.html' %}
|
||||
{% include 'utils/_head.html' %}
|
||||
<body>
|
||||
{% include '_header.html' %}
|
||||
{% include '_mainsidenav.html' %}
|
||||
{% include 'utils/_header.html' %}
|
||||
{% include 'utils/_mainsidenav.html' %}
|
||||
<div class="container">
|
||||
<div class="small info1 capsule-window">
|
||||
<p class="simpletext">< Задания категории Форензика ></p>
|
||||
<nav class="navbtn">
|
||||
{%- for name, descr in (
|
||||
('fmetadata', "Метаданные и как их найти"),
|
||||
('fbinwalk', "Что не так с моим докладом?"),
|
||||
('fbase', "0K3RgtC+INCx0LDQt9Cw"),
|
||||
('fhex', "Hex в картинках"),
|
||||
('fhash', "Зачем Cat нужен hash"),
|
||||
) %}
|
||||
<a href="{{ url_for(name) }}" class="btn1">{{ descr }}</a>
|
||||
{%- endfor %}
|
||||
<nav class="navbtn">
|
||||
{%- for name, descr in (
|
||||
('fmetadata', "Метаданные и как их найти"),
|
||||
('fbinwalk', "Что не так с моим докладом?"),
|
||||
('fbase', "0K3RgtC+INCx0LDQt9Cw"),
|
||||
('fhex', "Hex в картинках"),
|
||||
('fhash', "Зачем Cat нужен hash"),
|
||||
) %}
|
||||
<a href="{{ url_for(name) }}" class="btn1">{{ descr }}</a>
|
||||
{%- endfor %}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<img id="help" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
<img id="help" title="Да, именно тут будет подсказка" onclick="showPopup()" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
</body>
|
||||
</html>
|
@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
{% include '_head.html' %}
|
||||
{% include 'utils/_head.html' %}
|
||||
<body>
|
||||
{% include '_header.html' %}
|
||||
{% include 'utils/_header.html' %}
|
||||
|
||||
<div class="container">
|
||||
<div class="small info1 capsule-window">
|
||||
@ -55,7 +55,10 @@
|
||||
<p> Good luck, have fun =) </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<img id="help" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
<div id="popup" class="meme capsule-window">
|
||||
<p class="simpletext" style="text-align:left; margin:0">Ха! Самое начало, а уже подсказки ищешь?) Глупыха!!!!</p>
|
||||
<span class="close-btn usable-context" onclick="hidePopup()">скрыть</span>
|
||||
</div>
|
||||
<img id="help" title="Да, именно тут будет подсказка" onclick="showPopup()" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,20 +1,22 @@
|
||||
<html lang="ru">
|
||||
{% include '_head.html' %}
|
||||
{% include 'utils/_head.html' %}
|
||||
<body>
|
||||
{% include '_header.html' %}
|
||||
{% include '_mainsidenav.html' %}
|
||||
{% include 'utils/_header.html' %}
|
||||
{% include 'utils/_mainsidenav.html' %}
|
||||
<div class="container">
|
||||
<div class="small info1 capsule-window">
|
||||
<p class="simpletext">< Задания категории OSINT ></p>
|
||||
<nav class="navbtn">
|
||||
{%- for name, descr in (
|
||||
('osintquestions', "Чур ответы не гуглить!"),
|
||||
('osintgeoguessr', "Профессионал Яндекс-карт"),
|
||||
('osintrht', "Реально сложный таск"),
|
||||
) %}
|
||||
<a href="{{ url_for(name) }}" class="btn1">{{ descr }}</a>
|
||||
{%- endfor %}
|
||||
<nav class="navbtn">
|
||||
{%- for name, descr in (
|
||||
('osintquestions', "Чур ответы не гуглить!"),
|
||||
('osintgeoguessr', "Профессионал Яндекс-карт"),
|
||||
('osintrht', "Реально сложный таск"),
|
||||
) %}
|
||||
<a href="{{ url_for(name) }}" class="btn1">{{ descr }}</a>
|
||||
{%- endfor %}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<img id="help" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
<img id="help" title="Да, именно тут будет подсказка" onclick="showPopup()" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
</body>
|
||||
</html>
|
@ -1,5 +1,5 @@
|
||||
{% extends '_task.html' %}
|
||||
{% include '_osintsidenav.html' %}
|
||||
{% extends 'utils/_task.html' %}
|
||||
{% include 'utils/_osintsidenav.html' %}
|
||||
{% block content %}
|
||||
|
||||
|
||||
|
@ -1,23 +1,23 @@
|
||||
{% extends '_task.html' %}
|
||||
{% include '_websidenav.html' %}
|
||||
{% extends 'utils/_task.html' %}
|
||||
{% include 'utils/_websidenav.html' %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div id="popup" class="sql-guide capsule-window">
|
||||
<p class="simpletext"style="text-align: left"><a class="hltext" href="https://book.hacktricks.wiki/en/pentesting-web/sql-injection/index.html?highlight=sql%20inje#what-is-sql-injection">SQL-инъекция</a> - уязвимость системы, позволяющая пользователю ввести вредоносный код в SQL-запрос.<br />
|
||||
<p class="simpletext" style="text-align: left">Как именно это работает? Все дело в том, что данные, которые ввёл пользователь, вставляются в запрос напрямую <span class="context" style="font-size: 0.9rem">(пример кода с сервера ниже)</span></p>
|
||||
<pre><code class="codefont python">#Как же это работает на сервере?(не стоит так делать, иначе ваш код будет иметь ту же уязвимость)
|
||||
<div id="popup" class="sql-guide capsule-window">
|
||||
<p class="simpletext" style="text-align: left"><a class="hltext" href="https://book.hacktricks.wiki/en/pentesting-web/sql-injection/index.html?highlight=sql%20inje#what-is-sql-injection">SQL-инъекция</a> - уязвимость системы, позволяющая пользователю ввести вредоносный код в SQL-запрос.<br />
|
||||
<p class="simpletext" style="text-align: left">Как именно это работает? Все дело в том, что данные, которые ввёл пользователь, вставляются в запрос напрямую <span class="context" style="font-size: 0.9rem">(пример кода с сервера ниже)</span></p>
|
||||
<pre><code class="codefont python">#Как же это работает на сервере?(не стоит так делать, иначе ваш код будет иметь ту же уязвимость)
|
||||
login = request.form['login'] # Получаем данные из окна с логином, которые пользователь ввёл в форму
|
||||
password = request.form['pass'] # Так же получаем данные из окна с паролем
|
||||
cursor = get_db().cursor() # Получение доступа к базе данных
|
||||
cursor.execute(f'SELECT * FROM Users WHERE login == "{login}" AND password == "{password}"') # Вставляем в запрос данные от пользователя</code></pre>
|
||||
<p class="simpletext" style="text-align: left">Так в место того, чтобы вводить свои данные, можно ввести определённые команды <span class="context" style="font-size: 0.9rem">(как правило - вредоносные)</span>
|
||||
Вводим в соответствующее поле предполагаемый логин админа - <span class="mono">admin</span>, а часть кода с проверкой пароля, которая идёт после проверки логина, просто закомментируем знаками <span class="mono">";--</span> или <span class="mono">"#</span>.
|
||||
Если мы введём <span class="mono">admin";--</span> в поле логин, то наш запрос на сервер отправится вот так:</p>
|
||||
<pre><code class="codefont python">cursor.execute(f'SELECT * FROM Users WHERE login == "admin";--" AND password == "{password}"')</code></pre>
|
||||
<p class="simpletext">Соответственно вся часть после знака комментария просто не учитывается. Вы успешно вошли под логином <span class="mono">admin</span>.</p>
|
||||
<span class="close-btn usable-context" onclick="hidePopup()">скрыть</span>
|
||||
</div>
|
||||
<div class="capsule-window" id="sqlInpt">
|
||||
<p class="simpletext" style="text-align: left">Так в место того, чтобы вводить свои данные, можно ввести определённые команды <span class="context" style="font-size: 0.9rem">(как правило - вредоносные)</span>
|
||||
Вводим в соответствующее поле предполагаемый логин админа - <span class="mono">admin</span>, а часть кода с проверкой пароля, которая идёт после проверки логина, просто закомментируем знаками <span class="mono">";--</span> или <span class="mono">"#</span>.
|
||||
Если мы введём <span class="mono">admin";--</span> в поле логин, то наш запрос на сервер отправится вот так:</p>
|
||||
<pre><code class="codefont python">cursor.execute(f'SELECT * FROM Users WHERE login == "admin";--" AND password == "{password}"')</code></pre>
|
||||
<p class="simpletext">Соответственно вся часть после знака комментария просто не учитывается. Вы успешно вошли под логином <span class="mono">admin</span>.</p>
|
||||
<span class="close-btn usable-context" onclick="hidePopup()">скрыть</span>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="capsule-window sqlInpt" >
|
||||
<form action="sql-injection" method="post" class="simpletext">
|
||||
<p class="simpletext">Попробуй войти от имени админа,<br />
|
||||
используя уязвимость<abbr class="hltext" title="Смотри подсказку(кнопка снизу слева)">SQL-инъекции</abbr>. Найдите флаг</p>
|
||||
@ -25,9 +25,8 @@ cursor.execute(f'SELECT * FROM Users WHERE login == "{login}" AND password == "{
|
||||
<div class="small-container"><p>Пароль:</p> <input type="password" name="pass" class="inpt"/></div>
|
||||
<input type="submit" value="Submit" class="btn1" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% if error %}
|
||||
<div id="error"> <p>{{ error }}</p> </div>
|
||||
{% elif success %}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
{% include '_head.html' %}
|
||||
{% include 'utils/_head.html' %}
|
||||
<body>
|
||||
{% include '_header.html' %}
|
||||
{% include 'utils/_header.html' %}
|
||||
<div class="container" style="max-width:70%; justify-content: space-between;min-width: 40rem; flex-wrap: nowrap">
|
||||
<div class="profile">
|
||||
<h2 class="header" style="text-align:left">Ваш Профиль:</h2>
|
||||
@ -13,12 +13,12 @@
|
||||
</div>
|
||||
<div class="flag-input ">
|
||||
<h3 class="header" style="text-align:left">Введите ответ:</h3>
|
||||
<form action="success_login" method="post" class="simpletext">
|
||||
<form action="/web/success_login-sqltask" method="post" class="simpletext">
|
||||
<input class="inpt" type="text" name="user_flag" style="width: 100%; height: 1.25rem; margin: 0">
|
||||
<input type="submit" value="Submit" class="btn1" style="margin-top: 1.25rem">
|
||||
</div>
|
||||
</div>
|
||||
{% include '_sidenav.html' %}
|
||||
{% include 'utils/_websidenav.html' %}
|
||||
|
||||
{% if error %}
|
||||
<div id="error"> <p>{{ error }}</p> </div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% extends '_task.html' %}
|
||||
{% include '_forensicsidenav.html' %}
|
||||
{% extends 'utils/_task.html' %}
|
||||
{% include 'utils/_forensicsidenav.html' %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="capsule-window info1">
|
||||
@ -12,6 +12,7 @@
|
||||
<input class="inpt" type="text" name="user_flag" style="width: 100%; height: 1.25rem; margin: 0">
|
||||
<input type="submit" value="Submit" class="btn1" style="margin-top: 1.25rem">
|
||||
</div>
|
||||
|
||||
<div id="popup" class="sql-guide capsule-window">
|
||||
<p class="simpletext"style="text-align: left"><a class="hltext" href="https://book.hacktricks.wiki/en/pentesting-web/sql-injection/index.html?highlight=sql%20inje#what-is-sql-injection">SQL-инъекция</a> - уязвимость системы, позволяющая пользователю ввести вредоносный код в SQL-запрос.<br />
|
||||
|
||||
|
@ -3,8 +3,6 @@
|
||||
<script src="{{ url_for('static', filename='scripts/animation.js') }}"></script>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
|
||||
|
||||
{%- if request.path != url_for('index') %}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/base16/ros-pine-moon.min.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
17
templates/utils/_task.html
Normal file
17
templates/utils/_task.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
|
||||
{% block head %}
|
||||
{%- include 'utils/_head.html' %}
|
||||
{%- endblock %}
|
||||
|
||||
<body>
|
||||
{% include 'utils/_header.html' -%}
|
||||
|
||||
{% block content -%}{% endblock -%}
|
||||
|
||||
|
||||
<img id="help" title="" onclick="showPopup()" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,22 +1,24 @@
|
||||
<html lang="ru">
|
||||
{% include '_head.html' %}
|
||||
{% include 'utils/_head.html' %}
|
||||
<body>
|
||||
{% include '_header.html' %}
|
||||
{% include '_mainsidenav.html' %}
|
||||
{% include 'utils/_header.html' %}
|
||||
{% include 'utils/_mainsidenav.html' %}
|
||||
<div class="container">
|
||||
<div class="small info1 capsule-window">
|
||||
<p class="simpletext">< Задания категории Web ></p>
|
||||
<nav class="navbtn">
|
||||
{%- for name, descr in (
|
||||
('websql', "SQL-инъекция"),
|
||||
('webidor', "Уязвимость IDOR"),
|
||||
('webpt', "Уязвимость Path Traversal"),
|
||||
('webssti', "Уязвимость SSTI"),
|
||||
('webpsguide', "Немного о PortSwigger"),
|
||||
) %}
|
||||
<a href="{{ url_for(name) }}" class="btn1">{{ descr }}</a>
|
||||
{%- endfor %}
|
||||
<nav class="navbtn">
|
||||
{%- for name, descr in (
|
||||
('websql', "SQL-инъекция"),
|
||||
('webidor', "Уязвимость IDOR"),
|
||||
('webpt', "Уязвимость Path Traversal"),
|
||||
('webssti', "Уязвимость SSTI"),
|
||||
('webpsguide', "Немного о PortSwigger"),
|
||||
) %}
|
||||
<a href="{{ url_for(name) }}" class="btn1">{{ descr }}</a>
|
||||
{%- endfor %}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<img id="help" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
<img id="help" title="Да, именно тут будет подсказка" onclick="showPopup()" src="{{ url_for('static', filename='imgs/icon.png') }}">
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user