-
-
Save 7h3h4ckv157/02b990e095b248b09c7bb520650aba15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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