Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # Script que simula inyección de código
- import sqlite3
- conn = sqlite3.connect("base.sqlite")
- cursor = conn.cursor()
- nombre = input("Ingrese su nombre: ")
- edad = int(input("Ingrese su edad: "))
- cursor.executescript(f"INSERT INTO personas VALUES ('{nombre}',{edad})")
- conn.commit()
- print("Datos ingresados correctamente...")
- conn.close()
- """
- >>> Ingrese su nombre: Alejandro', 17); DELETE FROM personas;--
- >>> Ingrese su edad: 14
- "INSERT INTO personas VALUES ('Alejandro', 17); DELETE FROM personas;--',14)"
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement