blindy: automate brutforcing blind sql injection vulnerabilities
Blindy
Simple script for running brute-force blind MySql injection
Note: this script was created for fun, helpful in some ctf challenges đ
Description
- The script will run through queries listed in sets in provided file and try to brute-force any place where { } placeholder is found.
- GET & POST http methods are supported
- Http HEADERS are supported in the same way as other parameters
- In default mode, script looks for negative pattern (text that is not visible when injection succeeds)
- With âpositive flag one can switch to looking for expected response
Download
Usage
$ python3 blindy.py âhelp
usage: blindy.py [-h] [-X HTTP_METHOD] -p PARAMETER [-H HTTP_HEADER]
[-f FILENAME] -r PATTERN [âpositive] [-s QUERY_SET] [-e]
[-v]
urlRun blind sql injection using brute force
positional arguments:
url Target urloptional arguments:
-h, âhelp show this help message and exit
-X HTTP_METHOD, âhttp-method HTTP_METHOD
Http method: (GET (default), POST)
-p PARAMETER, âparameter PARAMETER
Parameter, e.g. name=value, name={}
-H HTTP_HEADER, âhttp-header HTTP_HEADER
Http headers, e.g. X-Custom_header:value,
X-Custom_header:{}
-f FILENAME, âfilename FILENAME
File with commands in json, default queries.json
-r PATTERN, âpattern PATTERN
Regular expression
âpositive Injection was successfull if pattern IS PRESENT in
response
-s QUERY_SET, âquery-set QUERY_SET
Json key for query set, default to [âloginâ]
-e, âencode Url encode payload
-v, âverbose Print full info whatâs going on==================== [example usage] ===================
Bruteforce POST `query_param` parameter:
$ python3 blindy.py http://localhost/index.php -X POST -p query_param={} -p submit=1 -r âWrong paramâ -s â[âblindâ]âBruteforce POST `query_param` parameter part:
$ python3 blindy.py http://localhost/index.php -X POST -p âquery_param=login {}â -p submit=1 -H âCookie: PHPSESSID=sdfsdgvdvsdvsâ -r âWrong paramâ -s â[âblindâ]âBruteforce `X-Custom-Header` in GET request â use single query from set:
$ python3 blindy.py http://localhost/index.php -X GET -p admin=1 -H âX-Custom_header: {}â -r âWrong paramâ -s â[âblindâ][0]âSimple check a list of queries against `username` parameter (negative pattern):
$ python3 blindy.py http://localhost/login.php -X POST -p username={} -p submit=1 -r âWrong usernameâ -s â[âloginâ]âSimple check a list of queries against `username` parameter (positive pattern):
$ python3 blindy.py http://localhost/login.php -X POST -p username={} -p submit=1 -r âWelcome back, adminâ âpositive -s â[âloginâ]â