SQL INJECTION
DATABASE ATTACK
GOALS OF CYBER ATTACK
 Money
 Power
 Control
 Publicity
 Revenge
 Crackers
 Learning
 Future protection/Penetration testing
 Or Just to do it!
CONTENT
WHAT IS SQL
WHAT IS SQL INJECTION
SQL INJECTION ATTACK TYPES
INTRODUCTION TO SQL
 SQL is a special-purpose programming language designed for
managing data held in a relational database management systems
(RDBMS).
 The scope of SQL includes data insert, query, update and delete,
schema creation and modification, and data access control.
SQL INJECTION
1. A class of code-injection attacks, in which data provided by the
user is included in an SQL query in such a way that part of the
user’s input is treated as SQL code.
1. SQL injection is a technique to maliciously exploit applications
that use client-supplied data in SQL statements.
1. App sends form to user.
2. Attacker submits form with SQL exploit data.
3. Application builds string with exploit data.
4. Application sends SQL query to DB.
5. DB executes query, including exploit, sends data back to
application.
6. Application returns data to user.
DB Server
Firewall
User
Pass ‘ or 1=1--
Attacker
Web Server
SQL INJECTION EXAMPLE
SQL INJECTION ATTACK TYPES
 TYPES OF SQL ATTACKS
1)First Order Attack:-The attacker can simply enter a malicious string
and cause the modified code to be executed immediately.
2)Second Order Attack:-The attacker injects into persistent storage
(such as a table row) which is deemed as a trusted source. An attack is
subsequently executed by another activity.
3)Lateral Injection:-The attacker can manipulate the implicit
functionTo_Char() by changing the values of the environment
variables, NLS_Date_Format orNLS_Numeric_Characters.
INJECTION MECHANISM
Injection through user input First-order
Injection through cookies injection
Injection through server variables
Second-order injection 7
ATTACK INTENT
Determining database schema
Extracting data
Adding or modifying data
Bypassing authentication
STEPS FOR SQL INJECTION
 Step1- open techpanda.org page (any vulnerable site)
 Step2 – use following inputs for login
 Email id- xxx@xxx.xxx
 Password - xxx') OR 1 = 1 -- ]
MONOSEK DETECTION
STEP1-RUN MONOSEK SERVER
STEP2- CLIENT SIDE - EXPERIMENTAL PROGRAM –
expt_11_sqli program

Sql injection

  • 1.
  • 2.
    GOALS OF CYBERATTACK  Money  Power  Control  Publicity  Revenge  Crackers  Learning  Future protection/Penetration testing  Or Just to do it!
  • 3.
    CONTENT WHAT IS SQL WHATIS SQL INJECTION SQL INJECTION ATTACK TYPES
  • 4.
    INTRODUCTION TO SQL SQL is a special-purpose programming language designed for managing data held in a relational database management systems (RDBMS).  The scope of SQL includes data insert, query, update and delete, schema creation and modification, and data access control.
  • 5.
    SQL INJECTION 1. Aclass of code-injection attacks, in which data provided by the user is included in an SQL query in such a way that part of the user’s input is treated as SQL code. 1. SQL injection is a technique to maliciously exploit applications that use client-supplied data in SQL statements.
  • 6.
    1. App sendsform to user. 2. Attacker submits form with SQL exploit data. 3. Application builds string with exploit data. 4. Application sends SQL query to DB. 5. DB executes query, including exploit, sends data back to application. 6. Application returns data to user. DB Server Firewall User Pass ‘ or 1=1-- Attacker Web Server
  • 7.
  • 8.
    SQL INJECTION ATTACKTYPES  TYPES OF SQL ATTACKS 1)First Order Attack:-The attacker can simply enter a malicious string and cause the modified code to be executed immediately. 2)Second Order Attack:-The attacker injects into persistent storage (such as a table row) which is deemed as a trusted source. An attack is subsequently executed by another activity. 3)Lateral Injection:-The attacker can manipulate the implicit functionTo_Char() by changing the values of the environment variables, NLS_Date_Format orNLS_Numeric_Characters.
  • 9.
    INJECTION MECHANISM Injection throughuser input First-order Injection through cookies injection Injection through server variables Second-order injection 7
  • 10.
    ATTACK INTENT Determining databaseschema Extracting data Adding or modifying data Bypassing authentication
  • 11.
    STEPS FOR SQLINJECTION  Step1- open techpanda.org page (any vulnerable site)  Step2 – use following inputs for login  Email id- xxx@xxx.xxx  Password - xxx') OR 1 = 1 -- ]
  • 12.
    MONOSEK DETECTION STEP1-RUN MONOSEKSERVER STEP2- CLIENT SIDE - EXPERIMENTAL PROGRAM – expt_11_sqli program