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.
sqlmap是一个开源的渗透测试工具,它将检测和渗透脆弱数据库并接管数据库服务器的过程全部自动化。
实验环境:CentOS 7
一、创建容器
$ docker pull mysql:5.7.22
$ docker run --name sql-5 -e MYSQL_ROOT_PASSWORD=sql123 -d mysql:5.7.22
可用以下命令进入 MySQL,查看数据库
$ docker exec -it sql-5 mysql -uroot -psql123
二、测试工具 sqlslap 的使用
容器创建好后可直接使用 sqlslap
$ docker exec -it sql-5 mysqlslap -uroot -psql123 --delimiter=";" --create="CREATE TABLE a (b int);INSERT INTO a VALUES (23)" --query="SELECT * FROM a" --concurrency=50 --iterations=200
--concurrency=50
:单次 50 位用户同时查询
--iterations=200
:重复次数为 200 次
三、SQL 注入工具 sqlmap 的使用
1、安装
安装依赖
# yum install python-pip
# yum install MySQL-python
...
Installed:
MySQL-python.x86_64 0:1.2.5-1.el7
...
# pip install sqlalchemy==1.1.15
...
Successfully installed sqlalchemy-1.1.15
...
下载 Hack 工具
$ git clone https://github.com/sqlmap