INNER CODE UNIT · Python

info

l4wio/CTF-challenges-by-me · 0x3004/200-XYZBANK/app.py:66

def info():

	try: credential = loads(b64decode(request.cookies.get('credential')))
	except:	credential = []
	if len(credential) != 3: return redirect('/logout')
	app.logger.warning('[DEUBG] info: %s -> %s' % (request.remote_addr,str(b64decode(request.cookies.get('credential')))))
	info = login_query(credential)
	app.logger.warning('--> Result: %s' % str(info))
	if info is None:
		return render_template('index.html',error=WRONG_CRE)
	if info[0] == 'admin':
		flag = 'Good boy! 0x3004{%s}' % info[1] # Flag is an admin's password
	else:
		flag = 'nope...no flag for you'
	return render_template('index.html',username=info[0],pin=str(info[2])[:2]+'**',balance=info[3],flag=flag)


View source record →

📰 Research Paper
Loading…
⏳ Fetching content…