SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
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
 

Último (20)

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
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
 
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
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.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
 
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
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
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.
 
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
 

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