SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
SQL Injection

      BY: Manish Bhandarkar
LAB Setup :-


   1) VM with Hack me Bank Installed
   http://ninja-sec.com/index.php/hacme-bank-prebuilt-vmware-image-ninja- sec-com/



   2) SQL-Map For Windows
   https://github.com/sqlmapproject/sqlmap/zipball/master



   3) SQL-Map For Unix
       It is there on Backtrack 5
OWASP TOP 10

 A1 : Injection

     Injection flaws, such as SQL, OS, and LDAP injection,
    occur when untrusted data is sent to an interpreter as
    part of a command or query. The attacker’s hostile data
    can trick the interpreter into executing unintended
    commands or accessing unauthorized data
Injections

 Common type of injections :
    SQL
    LDAP
    Xpath
    etc


 IMAPCT :
    As disastrous as handling the database over to the
   attacker

    Can also lead to OS level access
Definition

   Exploiting poorly filtered or in-correctly escaped SQL
  queries to execute data from user input


Types

     Error Based
     Blind Injections
     Boolean Injections
How They Are Work?

 Application presents a form to the attacker

 Attacker sends an attack in the form data

 Application forwards attack to the database in a SQL query

 Database runs query containing attack and sends encrypted
result back to application

 Application renders data as to the user
SQL MAP
SQL MAP INTRODUCTION


   Powerful command line utility to exploit SQL Injection
  vulnerability

   Support for following databases



       MySQL                          Firebird
      IBM DB2                         Microsoft SQL Server
      Oracle                          SAP MaxDB
      SQLite                          Sybase and
      PostgreSQL                      Microsoft Access
TECHNIQUES OF SQL INJECTION

    Boolean-based blind

    Time-based blind

    Error-based

    UNION query

    Stacked queries
SQL MAP OPTION KEYS
 o -u <URL>

 o -dbs (To enumerate databases)

 o -r (For request in .txt file)

 o -technique (SQL injection technique)

 o - dbms (Specify DBMS)

 o -D <database name> --tables

 o -T <table name> --columns

 o -C <column name> --dump

 o --cookie (Authentication)

 o --dump-all
SQL MAP FLOW

   Enumerate the database name

   Select database and enumerate tables

   Select tables and enumerate columns

   Select a column and enumerate rows(data)

   Choose whatever u want
WHY USED SQL MAP?

   Built in capabilities for cracking hashes

   Options of running user defined queries

   You could run OS level commands

   You could have an interactive OS shell

   Meterpreter shell with Metasploit
EXTRA USEFUL SQL MAP OPTION KEYS 1

    --os-cmd
       Run any OS level command

    --os-shell
       Starts an interactive shell

    --os-pwn
       Injects a Meterpreter shell

    --tamper
       Evading WAF
EXTRA USEFUL SQL MAP OPTION KEYS 2

   --tor: Use Tor anonymity network

   --tor-port: Set Tor proxy port other than default

   --tor-type: Set Tor proxy type (HTTP - default,
  SOCKS4 or SOCKS5)

   --check-payload: Offline WAF/IPS/IDS payload
  detection testing

   --check-waf: heck for existence of WAF/IPS/IDS
  protection

   --gpage: Use Google dork results from specified
  page number

   --tamper: custom scripts
U WANT TO EXPLORE MORE

   SQL MAP Usage Guide
  http://sqlmap.sourceforge.net/doc/README.html




   SQL MAP WITH TOR
  http://www.coresec.org/2011/04/24/sqlmap-with-tor/
THANK YOU


   BY: Manish Bhandarkar
   http://www.hackingforsecurity.blogspot.com

Contenu connexe

Tendances

Advanced sql injection
Advanced sql injectionAdvanced sql injection
Advanced sql injection
badhanbd
 

Tendances (20)

SQL injection exploitation internals
SQL injection exploitation internalsSQL injection exploitation internals
SQL injection exploitation internals
 
Advanced SQL injection to operating system full control (short version)
Advanced SQL injection to operating system full control (short version)Advanced SQL injection to operating system full control (short version)
Advanced SQL injection to operating system full control (short version)
 
Namespaces and Autoloading
Namespaces and AutoloadingNamespaces and Autoloading
Namespaces and Autoloading
 
SQL injection: Not only AND 1=1
SQL injection: Not only AND 1=1SQL injection: Not only AND 1=1
SQL injection: Not only AND 1=1
 
Mex help hay vai
Mex help hay vaiMex help hay vai
Mex help hay vai
 
Expanding the control over the operating system from the database
Expanding the control over the operating system from the databaseExpanding the control over the operating system from the database
Expanding the control over the operating system from the database
 
Advanced SQL injection to operating system full control (whitepaper)
Advanced SQL injection to operating system full control (whitepaper)Advanced SQL injection to operating system full control (whitepaper)
Advanced SQL injection to operating system full control (whitepaper)
 
Advanced SQL Injection
Advanced SQL InjectionAdvanced SQL Injection
Advanced SQL Injection
 
Advanced sql injection
Advanced sql injectionAdvanced sql injection
Advanced sql injection
 
Web application attack and audit framework (w3af)
Web application attack and audit framework (w3af)Web application attack and audit framework (w3af)
Web application attack and audit framework (w3af)
 
W3AF|null
W3AF|nullW3AF|null
W3AF|null
 
W3af
W3afW3af
W3af
 
W3af
W3afW3af
W3af
 
Not so blind SQL Injection
Not so blind SQL InjectionNot so blind SQL Injection
Not so blind SQL Injection
 
SQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developersSQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developers
 
PIE - The Programmable Infrastructure Environment
PIE - The Programmable Infrastructure EnvironmentPIE - The Programmable Infrastructure Environment
PIE - The Programmable Infrastructure Environment
 
Firebird
FirebirdFirebird
Firebird
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
Advanced SQL Injection: Attacks
Advanced SQL Injection: Attacks Advanced SQL Injection: Attacks
Advanced SQL Injection: Attacks
 
Data Retrieval over DNS in SQL Injection Attacks
Data Retrieval over DNS in SQL Injection AttacksData Retrieval over DNS in SQL Injection Attacks
Data Retrieval over DNS in SQL Injection Attacks
 

Similaire à Sql injection manish file

SQL Server Security - Attack
SQL Server Security - Attack SQL Server Security - Attack
SQL Server Security - Attack
webhostingguy
 
Hack your db before the hackers do
Hack your db before the hackers doHack your db before the hackers do
Hack your db before the hackers do
fangjiafu
 
Advanced_SQL_ISASasASasaASnjection (1).ppt
Advanced_SQL_ISASasASasaASnjection (1).pptAdvanced_SQL_ISASasASasaASnjection (1).ppt
Advanced_SQL_ISASasASasaASnjection (1).ppt
ssuserde23af
 
Vulnerabilities in data processing levels
Vulnerabilities in data processing levelsVulnerabilities in data processing levels
Vulnerabilities in data processing levels
beched
 

Similaire à Sql injection manish file (20)

SQL Server Security - Attack
SQL Server Security - Attack SQL Server Security - Attack
SQL Server Security - Attack
 
SQL Injection
SQL InjectionSQL Injection
SQL Injection
 
Sq linjection
Sq linjectionSq linjection
Sq linjection
 
Sqlmap
SqlmapSqlmap
Sqlmap
 
ShmooCON 2009 : Re-playing with (Blind) SQL Injection
ShmooCON 2009 : Re-playing with (Blind) SQL InjectionShmooCON 2009 : Re-playing with (Blind) SQL Injection
ShmooCON 2009 : Re-playing with (Blind) SQL Injection
 
Sql injection exploit
Sql injection exploitSql injection exploit
Sql injection exploit
 
Chapter 14 sql injection
Chapter 14 sql injectionChapter 14 sql injection
Chapter 14 sql injection
 
Hack your db before the hackers do
Hack your db before the hackers doHack your db before the hackers do
Hack your db before the hackers do
 
Asegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File DownloadingAsegúr@IT IV - Remote File Downloading
Asegúr@IT IV - Remote File Downloading
 
Sql injection
Sql injectionSql injection
Sql injection
 
Advanced sql injection 2
Advanced sql injection 2Advanced sql injection 2
Advanced sql injection 2
 
Understanding and preventing sql injection attacks
Understanding and preventing sql injection attacksUnderstanding and preventing sql injection attacks
Understanding and preventing sql injection attacks
 
Advanced_SQL_ISASasASasaASnjection (1).ppt
Advanced_SQL_ISASasASasaASnjection (1).pptAdvanced_SQL_ISASasASasaASnjection (1).ppt
Advanced_SQL_ISASasASasaASnjection (1).ppt
 
Sql injection
Sql injectionSql injection
Sql injection
 
Attques web
Attques webAttques web
Attques web
 
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory EnvironmentsTROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
 
Sql injection
Sql injectionSql injection
Sql injection
 
Full MSSQL Injection PWNage
Full MSSQL Injection PWNageFull MSSQL Injection PWNage
Full MSSQL Injection PWNage
 
Playing With (B)Sqli
Playing With (B)SqliPlaying With (B)Sqli
Playing With (B)Sqli
 
Vulnerabilities in data processing levels
Vulnerabilities in data processing levelsVulnerabilities in data processing levels
Vulnerabilities in data processing levels
 

Dernier

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 

Sql injection manish file

  • 1. SQL Injection BY: Manish Bhandarkar
  • 2. LAB Setup :- 1) VM with Hack me Bank Installed http://ninja-sec.com/index.php/hacme-bank-prebuilt-vmware-image-ninja- sec-com/ 2) SQL-Map For Windows https://github.com/sqlmapproject/sqlmap/zipball/master 3) SQL-Map For Unix It is there on Backtrack 5
  • 3. OWASP TOP 10  A1 : Injection  Injection flaws, such as SQL, OS, and LDAP injection, occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing unauthorized data
  • 4. Injections  Common type of injections :  SQL  LDAP  Xpath  etc  IMAPCT :  As disastrous as handling the database over to the attacker  Can also lead to OS level access
  • 5. Definition  Exploiting poorly filtered or in-correctly escaped SQL queries to execute data from user input Types  Error Based  Blind Injections  Boolean Injections
  • 6. How They Are Work?  Application presents a form to the attacker  Attacker sends an attack in the form data  Application forwards attack to the database in a SQL query  Database runs query containing attack and sends encrypted result back to application  Application renders data as to the user
  • 7.
  • 9. SQL MAP INTRODUCTION  Powerful command line utility to exploit SQL Injection vulnerability  Support for following databases  MySQL  Firebird IBM DB2  Microsoft SQL Server Oracle  SAP MaxDB SQLite  Sybase and PostgreSQL  Microsoft Access
  • 10. TECHNIQUES OF SQL INJECTION  Boolean-based blind  Time-based blind  Error-based  UNION query  Stacked queries
  • 11. SQL MAP OPTION KEYS o -u <URL> o -dbs (To enumerate databases) o -r (For request in .txt file) o -technique (SQL injection technique) o - dbms (Specify DBMS) o -D <database name> --tables o -T <table name> --columns o -C <column name> --dump o --cookie (Authentication) o --dump-all
  • 12. SQL MAP FLOW  Enumerate the database name  Select database and enumerate tables  Select tables and enumerate columns  Select a column and enumerate rows(data)  Choose whatever u want
  • 13. WHY USED SQL MAP?  Built in capabilities for cracking hashes  Options of running user defined queries  You could run OS level commands  You could have an interactive OS shell  Meterpreter shell with Metasploit
  • 14. EXTRA USEFUL SQL MAP OPTION KEYS 1  --os-cmd  Run any OS level command  --os-shell  Starts an interactive shell  --os-pwn  Injects a Meterpreter shell  --tamper  Evading WAF
  • 15. EXTRA USEFUL SQL MAP OPTION KEYS 2  --tor: Use Tor anonymity network  --tor-port: Set Tor proxy port other than default  --tor-type: Set Tor proxy type (HTTP - default, SOCKS4 or SOCKS5)  --check-payload: Offline WAF/IPS/IDS payload detection testing  --check-waf: heck for existence of WAF/IPS/IDS protection  --gpage: Use Google dork results from specified page number  --tamper: custom scripts
  • 16. U WANT TO EXPLORE MORE  SQL MAP Usage Guide http://sqlmap.sourceforge.net/doc/README.html  SQL MAP WITH TOR http://www.coresec.org/2011/04/24/sqlmap-with-tor/
  • 17. THANK YOU BY: Manish Bhandarkar http://www.hackingforsecurity.blogspot.com