SQL Injection

SQL Injection

SQL Injection

Complete Website Hacking using SQL Injection

Introduction to SQL: Definition

Structured Query LanguageManagement
DatabaseOperations
DBMSTables
RowsColumns
Queries/Statement 

1: Injection SQL Query.

2: Most common Web attack.

3: High severity level.

4: Can modify or delete the Database.

SQL Operations: Usage

Insert (Input)Update (Modify)
Retrieve (Fetch)Delete (Remove)
Filter (Need)Sort (Arrange)
Adding (Add)Creating (New Table)
Join (Integrate) 

Introduction to Parameters

ValuesStore
VariablesManipulate
FunctionalityUnauthorized access

Manipulating Parameters

CheckFetch
InteractDatabase
SQL Query 

Identifying Parameters

URLUser input
?name=value&name2=value
Examples 

What is SQL Injection

Code Injection attackMalicious SQL Query
StealSensitive Data
Gain AccessDatabase

Types of SQLi

In-BandInferential
Out-of-Band 

In-Band SQLi

Results in the Application’s response

Error-Based: Inject SQL statement to produce
Error.
Union-Based: Inject SQL statement to produce
Multiple results

Blind Based SQLi or Inferential SQLi

Boolean-based Blind: Conditions
Time-based Blind: Response time

Out-of-Band SQLi

Export resultsExternal system
Mail AddressFile
Remote Server 

1: SQLi:1: In-band SQLi      2: Inferential SQLi

  1. Error-based SQLi
  2. Union-based SQLi

1: Error-based SQLi:

1: Relies on error messages.

2: Thrown by the database server.

3: To obtain information.

4: About the structure of the database.

2: Union-based SQLi:

1: Leverages the UNION SQL operator.

2: To combine the results of two/more SELECT statements.

3: Which is returned as part of the HTTP response.

3: Inferential SQLi:

1: Also known as Blink SQLi.

2: More time taken.

3: Boolean-based Blind SQLi.

4: Time-based Blind SQLi.

4: Boolean-based Blind SQLi:

1: Relies on sending an SQL query to the database.

2: Which forces the application to return a different result.

3: Depends on query types (True or False).

5: Time-based Blind SQLi:

1: Forces the database to wait for a specified time.

2: Response time will indicate the result of TRUE? FALASE query.

3: This attack is typically slow.

4: Since enumeration is done character by character.

SQLi Methodology:

1: Understand how the website works.

2: Search for parameters.

3: Try to generate an error and solve the generated error.

4: Accessing DB using tools.

Finding ParametersParameters Status
Parameters FunctionsError Generation
Error ResolvingGrabbing Banner and Database

SQL Injection tools:

1: SQLMAP

2: jSQL injection

3: BBQSQL

4: SQL Ninja

sql injection best practices

1: Open the Vulnweb testing website.

Website: http://testphp.vulnweb.com/login.php

2: Bypass the login and sign in to the website.

Username: admin’ or 1=1#

Password random: wali

sql injection best practices 1

3: The Website has been logged in successfully.

sql injection best practices 2

How to Hack a Website Using SQL Injection

1: Find the SQL injection-affected websites.

2: Use the Google Dork to find the SQL Injection-affected websites.

Browser: inurl: admin login.aspx

How to Hack Website Using SQL Injection 1

3: Try the SQL Injection syntax.

Syntax: ‘1’OR’1’=’1′

Syntax for Password:  1’OR’1’=’1

4: You can use the Home of Acunetix Art website for testing, as it is legal for Penetration testing and other Vulnerabilities.

Website: http://testphp.vulnweb.com/login.php

How to Hack Website Using SQL Injection 2

5: The website has been hacked.

How to Hack Website Using SQL Injection 3

SQL Injection tools

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top