feat: regen forensic_task1 flag
This commit is contained in:
parent
d89afd383e
commit
ab461ad161
3
.idea/MadokaMagicaSite.iml
generated
3
.idea/MadokaMagicaSite.iml
generated
@ -9,7 +9,4 @@
|
||||
<option name="format" value="PLAIN" />
|
||||
<option name="myDocStringFormat" value="Plain" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="PROJECT_TEST_RUNNER" value="py.test" />
|
||||
</component>
|
||||
</module>
|
10
app.py
10
app.py
@ -1,7 +1,8 @@
|
||||
import werkzeug
|
||||
from flask import Flask, render_template, request, url_for, session, redirect, g, abort
|
||||
from flask import Flask, render_template, request, url_for, session, redirect, g, abort, send_file
|
||||
import sqlite3
|
||||
from random import getrandbits
|
||||
from func import *
|
||||
|
||||
connection = sqlite3.connect('database.db')
|
||||
cursor = connection.cursor()
|
||||
@ -53,8 +54,15 @@ def sql():
|
||||
|
||||
@app.route("/found-me")
|
||||
def found():
|
||||
session['task1_id'] = id = hex(getrandbits(45))[2:]
|
||||
session['task1_flag'] = flag_task1 = f'C4TchFl4g{{{hex(getrandbits(45))[2:]}}}'
|
||||
task1_flag(flag_task1, id)
|
||||
return render_template('found.html')
|
||||
|
||||
@app.route("/found-me/task1")
|
||||
def forensic_task1():
|
||||
return send_file(f'/tmp/task1/{session['task1_id']}.jpg')
|
||||
|
||||
@app.route("/decode-me")
|
||||
def decode():
|
||||
return render_template('decode.html')
|
||||
|
7
func.py
Normal file
7
func.py
Normal file
@ -0,0 +1,7 @@
|
||||
import os
|
||||
|
||||
def task1_flag(flag_task1, id):
|
||||
os.system('exiftool -all= static/imgs/task1.jpg')
|
||||
os.system('mkdir /tmp/task1')
|
||||
os.system(f'cp static/imgs/task1.jpg /tmp/task1/{id}.jpg')
|
||||
os.system(f"exiftool -Comment='{flag_task1}' /tmp/task1/{id}.jpg")
|
BIN
static/imgs/task1.jpg
Normal file
BIN
static/imgs/task1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
@ -1 +1,5 @@
|
||||
{% extends '_task.html' %}
|
||||
{% block content %}
|
||||
<p>cat</p>
|
||||
<img src="{{ url_for('forensic_task1') }}">
|
||||
{% endblock %}
|
@ -50,7 +50,7 @@
|
||||
Если вы используете Windows, то можно рабоать с
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://www.virtualbox.org/wiki/Downloads" class="usable-context">Виртуальной Машины</a>
|
||||
</p>
|
||||
<p class="simpletext"> Good luck, have fun :) </p>
|
||||
<p> Good luck, have fun :) </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user