Back to Course

The Practical Guide to sqlmap for SQL Injection

0% Complete
0/0 Steps
  1. About the Course

    About the course
  2. About the course author
  3. Pre-requisites
  4. Setting up our lab environment
    Creating a home lab environment
  5. Downloading the latest sqlmap (optional)
  6. sqlmap Overview
    What is sqlmap?
  7. sqlmap: An introduction
  8. Techniques used by sqlmap
  9. Features and usage
  10. Understanding the source code
  11. Knowledge check
    1 Quiz
  12. sqlmap Options Deep Dive
    Navigating the options sections
  13. Using vulnserver.py
  14. Main Options
    Options
  15. Target
  16. Practical Knowledge Check
  17. Requests Options
    HTTP headers, methods, and data
  18. Cookies
  19. HTTP authentication
  20. Proxies and using sqlmap anonymously
  21. CSRF tokens
  22. General Options
  23. Eval
  24. Practical Knowledge Check
  25. Optimizations Options
    Optimization
  26. Injections Options
    Injection part 1
  27. Injection part 2
  28. Tamper scripts
  29. Detection Options
    Detection
  30. Practical Knowledge Check
  31. Techniques Options
    Techniques part 1
  32. Techniques part 2
  33. Fingerprinting Options
    Fingerprinting
  34. Practical Knowledge Check
  35. Enumeration Options
    Enumeration part 1
  36. Enumeration part 2
  37. Enumeration part 3
  38. Practical Knowledge Check
  39. Brute Force Options
    Brute force
  40. UDF Options
    User-defined function injection
  41. File, OS, and Windows registry access
    File system access
  42. Operating system access
  43. Windows registry access
  44. Practical knowledge check
  45. General & Miscellaneous
    General part 1
  46. General part 2
  47. General part 3
  48. Miscellaneous
  49. Practical Knowledge Check
  50. sqlmap in action
    Information gathering
  51. Finding an SQL injection vulnerability
  52. Exploiting an SQL injection vulnerability to extract data
  53. Cracking extracted password hashes
  54. Bypassing WAFs
    WAFs overview
  55. WAF identification
  56. Manual WAF bypass
  57. WAF bypass with sqlmap
  58. Running sqlmap as an API
    Why run sqlmap as an API?
  59. How to run sqlmap as an API
  60. Conclusion
    Additional resources
  61. What now?
Lesson 5 of 61
In Progress

Downloading the latest sqlmap (optional)

Christophe June 14, 2021

By default, sqlmap comes pre-installed with Kali Linux, so as long as you followed the steps in the prior lesson and downloaded the latest Kali image, then you should have a very up-to-date sqlmap installation. This means that technically you can skip this lesson since you don’t have to have the latest version in order to complete this course. In fact, I’ll personally be using the #stable version of sqlmap (the one pre-installed on Kali) instead of the latest #dev version. I just wanted to show you how to download the #dev version and explain the difference in case you ever want to use that one.

With that said, usually the version pre-installed in Kali is not going to be the latest version of sqlmap. As you can see here, our version of sqlmap is 1.4.11#stable. The term stable can mean a few different things when it comes to software and is up to the developers to define its meaning, but it typically means that the version has ironed out most of the major bugs and issues, and so it is the intended version to be used by most users. So this is a good version to use.

But again, we can check and see if there are newer versions by going to the project’s GitHub repository and checking releases.

We can see that there is a newer release with a version bump to 1.5.

Let’s go ahead and download this version to our Kali installation!

We can use a few different methods to download the latest version, including by downloading archives, or by cloning the Git repository.

git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-devCode language: PHP (php)

A benefit of cloning the repository is that you can easily update your version by pulling changes through git at a later time, versus if you download an archive, that archive is “stuck in time” so to speak. You’d have to regularly go back out and download the latest archive to update.

So it’s up to you, but we have git installed on this machine so I’ll go ahead and use that method.

As you can see though by the ending of our command, this should be treaded as a -dev (development) version of sqlmap, meaning that it’s the cutting edge and there may be some unknown or known bugs. But it also means that you get the latest features.

So it’s a tradeoff to be aware of, and the version that you choose to use is up to you!

Going into our new directory:

cd sqlmap-dev

We can run this version by typing python3 sqlmap.py and we will see version 1.5.4.5#dev (you might see something slightly different depending on when you’re taking the course).

For this course, we will stick to the default installation of sqlmap to minimize the risk of bugs and issues along the way, but feel free to try using this latest version instead – just be aware that there may be some differences.

So now that we’ve verified that we have a working installation of sqlmap, and we’ve learned how to download the latest version, let’s complete this lesson and move on to the next where we will use sqlmap for the first time!

Responses

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.