Skip to content

Demonstrates SQL injection attacks using malicious SQL queries and SQL prevention techniques.

License

Notifications You must be signed in to change notification settings

AswinBarath/sql-injection-and-prevention

Repository files navigation

SQL Injection and Prevention

sql-injection-and-prevention

Demonstrates SQL injection attacks using malicious SQL queries and SQL prevention techniques.

Deployed project link


Table of content


Demo

SQL Injection Demo

  • In this demo, the Database Schema is displayed first
  • Later, 4 sets of Login credentials are tested:
    1. Correct credentials present in the user database
    2. Wrong credentials to show the failure message
    3. First SQL Injection example is demonstrated
    4. Later the Second SQL Injection example is demonstrated

SQL Injection

Navbar Demo

  • In this demo, the Navigation bar is demonstrated

SQL Injection


What's unique in this Project

  • The project is deployed as Microservices of Front-end, Server, and Database using Heroku Cloud Platfrom
  • Demostrates SQL Injection in an elegant way using LAMP stack
  • Follows best practices and code readability

What's SQL Injection

  • SQL injection is an attack used to take over database servers by dynamically poisoning SQL queries.
    • SQL injection is a cybersecurity vulnerability where attackers input malicious SQL (Structured Query Language) code into a web application's input fields.
    • If the application doesn't properly validate or sanitize the input, it can execute unintended database commands.
    • This can lead to unauthorized access, data theft, or manipulation of the database.
  • To prevent SQL injection, developers should use parameterized queries or prepared statements and validate user inputs.
    • Security measures like input validation and output encoding are crucial to mitigate this risk.
  • In this attack, a special SQL query is passed as user input to the login page.
    • Later, when the backend code compiles the input along with the SQL query.
    • The code then gets hijacked because these queries will change the meaning of the backend code.
  • The SQL injection queries used for this demonstration project are: ' or 1=1--
    • This query will change all the SQL statements to always be true because of the or keyword.
    • And the rest of the SQL statement after '--' will be commented. admin' or '1'='1
  • This query will change all the SQL statements and will also always be true. Because of the or keyword, the two expressions produce true values.

Technologies

Front End

Back End


Installation

To get the project working, you need to install the following dependencies.

  1. XAMPP Control Panel
  2. Heroku CLI

Contributors


⬆ Back to Top

About

Demonstrates SQL injection attacks using malicious SQL queries and SQL prevention techniques.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published