2025-03-14 21:59:59 -06:00
|
|
|
# sqlmap
|
|
|
|
|
|
|
|
|
|
> Detect and exploit SQL injection flaws.
|
|
|
|
|
> More information: <https://sqlmap.org>.
|
|
|
|
|
|
|
|
|
|
- Run sqlmap against a single target URL:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`python sqlmap.py {{[-u|--url]}} "{{http://www.example.com/vuln.php?id=1}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Send data in a POST request (`--data` implies POST request):
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`python sqlmap.py {{[-u|--url]}} "{{http://www.example.com/vuln.php}}" --data="{{id=1}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Change the parameter delimiter (& is the default):
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`python sqlmap.py {{[-u|--url]}} "{{http://www.example.com/vuln.php}}" --data="{{query=foobar;id=1}}" --param-del="{{;}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Select a random `User-Agent` from `./txt/user-agents.txt` and use it:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`python sqlmap.py {{[-u|--url]}} "{{http://www.example.com/vuln.php}}" --random-agent`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Provide user credentials for HTTP protocol authentication:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`python sqlmap.py {{[-u|--url]}} "{{http://www.example.com/vuln.php}}" --auth-type {{Basic}} --auth-cred "{{testuser:testpass}}"`
|