Giter Site home page Giter Site logo

dayeya / sqli Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 22 KB

A website that demonstrates an SQL Injection attack.

Python 66.31% HTML 22.09% CSS 11.60%
flask python sql-injection sql-injection-exploitation sqlite3 web web-exploitation hacking python-web security

sqli's Introduction

SQL Injection tests.

A website demonstrating an SQL Injection attack using Python 3.12 and Flask, Sqlite3.

SQL Injection.

This website uses a simple SQLite3 database that is intentionally vulnerable to SQL Injection attacks. That is by using the f strings in Python, the following code is where the breach occurs.

    def get_user(self, user_name: str, password: str) -> dict:
        all_users = {}
        query = f"SELECT * FROM users WHERE user_name = '{user_name}' AND password = '{password}'"
        # rest of the code...

As a result of using the f-string, parsing an SQL Injection payload can cause trouble.
E.g parsing the ' OR 'a'='a';-- payload and a random password (abcd) can exploit the database.

SELECT * FROM users WHERE user_name = '' OR 'a'='a';-- AND password = 'abcd'

We've managed to make the query always True.

Authors

Daniel Sapojnikov 2023, THIS CODE WAS WRITTEN FOR EDUCATIONAL PURPOSES ONLY.

sqli's People

Contributors

dayeya avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.