InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

Member-only story

Definitive Guide to SQL Injection

Security Lit Limited
InfoSec Write-ups
Published in
5 min readAug 29, 2022
Photo by David Pupaza on Unsplash

Introduction

There are two applications on a mobile or web—static and dynamic. The static site is just a bunch of web pages compiled together, showing you the same information every time. It doesn't display information as per the user type/role and has no interaction with a back-end database.

On the other hand, a Dynamic site fetches data from a back-end database. Depending upon the site type, it can show you data as per your taste and preferences, like Facebook and YouTube or could show you an article like medium.com.

There are different types of databases. We can group them into two classes depending on how they store data. If they store data in rows and columns, it is called a relational database or a SQL database, and if it stores data in the form of objects, it's called a non-SQL database.

Unlike non-SQL databases, SQL databases have been used for a long time and are preferred by many developers over non-SQL databases.

What is SQLi Vulnerability?

Source: Avast

SQL Injection is a vulnerability that occurs when an attacker can fetch information from the SQL Database. This is usually the information they shouldn't have access to. It could range from access to credentials and sensitive tokens to bypassing authentication, exfiltrating data, and installing back doors.

Only SQL-type databases are vulnerable to this attack, called a SQLi Vulnerability.

Source: Cloudflare

A SQL injection can occur if a web application accepts a web form, input parameter (e.g., Search Query), cookie, etc., without validating and passing them directly to the database server.

The database server interprets the input as code rather than data and ends up executing it. It can have severe consequences. Some of them are mentioned below.

· Bypass Authentication

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

No responses yet

Write a response