Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from hashlib import sha256
- import sqlite3
- db = sqlite3.connect('../db/sql_inj.db')
- cursor = db.cursor()
- cursor.execute('''CREATE TABLE users
- (id INTEGER PRIMARY KEY, username text, password text)
- ''')
- db.commit()
- admin_username = 'admin'
- admin_password = 'never_gonna_give_you_up'
- hashed_pass = sha256(admin_password.encode('utf-8')).hexdigest()
- cursor.execute('''INSERT INTO users(username, password)
- VALUES(?,?)''', (admin_username, hashed_pass))
- print('Admin user inserted')
- cursor.execute('''CREATE TABLE "314159265358979"
- (id INTEGER PRIMARY KEY, token text, message text)
- ''')
- db.commit()
- token = 'n3v3r53nd4hum4n70d04m4chin35j0b'
- message = 'y0uv3 607 17!'
- cursor.execute('''INSERT INTO "314159265358979"(token, message)
- VALUES(?,?)''', (token, message))
- print('Token inserted')
- db.commit()
- db.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement