Description Link to heading
That’s a big blacklist for a pyjail challenge, don’t you think?
attachement :
from flask import Flask, request, render_template, render_template_string, redirect
import subprocess
import urllib
flag = open('flag.txt').read()
app = Flask(__name__)
@app.route('/')
def main():
return redirect('/login')
@app.route('/login',methods=['GET','POST'])
def login():
if request.method == 'GET':
return render_template('login.html')
elif request.method == 'POST':
if len(request.values["username"]) >= 40:
return render_template_string("Username is too long!")
elif len(request.values["username"].upper()) <= 50:
return render_template_string("Username is too short!")
else:
return flag
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000)
Solving Link to heading
We need to enter a string where the lowercase size is less than 40 but the uppercase size is greater than 50.
data = 'ßßßßßßßßßßßßßßßßßßßßßßßßßß'
print(len(data)) # display 26
print(len(data.upper())) # display 52
Result Link to heading
n00bz{1mp0551bl3_c0nd1t10n5_m0r3_l1k3_p0551bl3_c0nd1t10ns}