INNER CODE UNIT · Python

I_N_P_U_T

l4wio/CTF-challenges-by-me · 0x3004/100-prisonbreak/server.py:52

				I_N_P_U_T = ( <input type=text name=code size=10 maxlength=50 /> ) # only a-z0-9[]() and length of code must be <= 50
				
				if I_N_P_U_T == list(F_L_A_G):
					print I_N_P_U_T
			</font></pre>
		</form>
	"""
	return HTML

@app.route('/go',methods=['POST'])
def go():
	code = request.form['code']

	import re
	code = re.sub(r'[^a-z0-9\[\]\(\)]','',code)[:50]

	python_code = "from sys import modules\nmodules.clear()\ndel modules\n\n__builtins__.dir = None\neval = None\nexecfile = None\ninput = None\n\nF_L_A_G = open('./flag','r').read()\nI_N_P_U_T = (%s)\nif I_N_P_U_T == list(F_L_A_G): print I_N_P_U_T" % code

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…