Compare commits

...

3 Commits

Author SHA1 Message Date
Derek 78db967922
Tweak style 2018-06-14 14:33:45 -07:00
Derek d1f1e829c3
Actually set the 'i.redd.it' hack
Whoops almost forgot the whole point of the exploit
2018-06-14 14:08:22 -07:00
Derek d6ab920737
Refactor itmeirl-bot to the more sensible itmeirlbot-protect 2018-06-14 13:52:01 -07:00
3 changed files with 13 additions and 9 deletions

View File

@ -14,14 +14,14 @@ app.config.from_pyfile('settings.cfg')
def index():
return render_template('index.html')
@app.route('/itmeirl-bot')
@app.route('/itmeirlbot-protect')
def meirl_index():
return render_template('itmeirl-bot/index.html')
return render_template('itmeirlbot-protect/index.html')
@app.route('/itmeirl-bot/upload', methods=['POST'])
@app.route('/itmeirlbot-protect/upload', methods=['POST'])
def meirl_upload():
if 'meme' in request.files:
directory = os.path.join(app.config['UPLOAD_DIR'], 'itmeirl')
directory = os.path.join(app.config['UPLOAD_DIR'], 'itmeirlbot-protect')
if not os.path.exists(directory):
os.makedirs(directory)
@ -39,7 +39,7 @@ def meirl_upload():
watermark.close()
meme.close()
url = url_for('meirl_show_reddit', file=filename[:-4])
url = 'i.redd.it.' + request.host + url_for('meirl_show_reddit', file=filename[:-4])
print(request.args)
if request.args.get('noredirect') is not None:
return url
@ -48,11 +48,11 @@ def meirl_upload():
# TODO: do these via nginx before you kill your server
@app.route('/itmeirl-bot/files/<file>')
@app.route('/itmeirlbot-protect/files/<file>')
def meirl_show_reddit(file):
directory = os.path.join(app.config['UPLOAD_DIR'], 'itmeirl')
return send_from_directory(directory, file + '.jpg')
@app.route('/itmeirl-bot/files/<file>.jpg')
@app.route('/itmeirlbot-protect/files/<file>.jpg')
def meirl_show_meirlbot(file):
return app.send_static_file('bad.jpg')

View File

@ -28,6 +28,9 @@ body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 16px 8px;
box-sizing: border-box;
}
#upload_form {
@ -35,11 +38,12 @@ body {
display: flex;
align-items: center;
flex-direction: column;
padding: 8px;
}
#upload_input {
width: 100%;
padding: 100px 0px;
padding: 20px 0px;
}
#upload_button {
width: 100%;

View File

@ -2,7 +2,7 @@
{% block body %}
<div id="mainwrapper">
<h1>
Excuse me sir, that meme appears to be <i>stolen</i>
twitt normies get <i>hecked</i>
</h1>
<p>
Protect your memes from the evil clutches of @ItMeIRL.