INNER CODE UNIT · Python

fetch_one_db

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

def fetch_one_db(query,param=()):
	conn = db_init()
	c = conn.cursor()
	c.execute(query,param)
	row = c.fetchone()
	c.close()
	return row


def login_query(params):
	return fetch_one_db(
			'SELECT * FROM {0} WHERE username=%s AND password=%s AND pin=%s'.format(TABLE_USERS)
			,params)

@app.route('/',methods=['GET'])
def index():
	if 'credential' in request.cookies:
		return redirect('/info')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…