Skip to content

Instantly share code, notes, and snippets.

@7h3h4ckv157
Created January 24, 2022 15:54
Show Gist options
  • Save 7h3h4ckv157/02b990e095b248b09c7bb520650aba15 to your computer and use it in GitHub Desktop.
Save 7h3h4ckv157/02b990e095b248b09c7bb520650aba15 to your computer and use it in GitHub Desktop.
def query_login_attempt():
username = flask.request.form.get('username', '')
password = flask.request.form.get('password', '')
if not username and not password:
return False
sql = ("SELECT id, account"
" FROM target_credentials"
" WHERE password = '{}'").format(hashlib.md5(password.encode()).hexdigest())
user = sql_exec(sql)
name = user[0][1] if user and user[0] and user[0][1] else ''
return name == username
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment