2018-10-24 06:18:16 +01:00
|
|
|
# sqlmap
|
|
|
|
|
|
|
|
> Detect and exploit SQL injection flaws.
|
2019-05-23 11:56:50 +01:00
|
|
|
> More information: <https://sqlmap.org>.
|
2018-10-24 06:18:16 +01:00
|
|
|
|
|
|
|
- Run sqlmap against a single target URL:
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`python sqlmap.py -u "{{http://www.target.com/vuln.php?id=1}}"`
|
2018-10-24 06:18:16 +01:00
|
|
|
|
|
|
|
- Send data in a POST request (`--data` implies POST request):
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`python sqlmap.py -u "{{http://www.target.com/vuln.php}}" --data="{{id=1}}"`
|
2018-10-24 06:18:16 +01:00
|
|
|
|
|
|
|
- Change the parameter delimiter (& is the default):
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`python sqlmap.py -u "{{http://www.target.com/vuln.php}}" --data="{{query=foobar;id=1}}" --param-del="{{;}}"`
|
2018-10-24 06:18:16 +01:00
|
|
|
|
|
|
|
- Select a random `User-Agent` from `./txt/user-agents.txt` and use it:
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`python sqlmap.py -u "{{http://www.target.com/vuln.php}}" --random-agent`
|
2018-10-24 06:18:16 +01:00
|
|
|
|
|
|
|
- Provide user credentials for HTTP protocol authentication:
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`python sqlmap.py -u "{{http://www.target.com/vuln.php}}" --auth-type {{Basic}} --auth-cred "{{testuser:testpass}}"`
|