• 小白日记44:kali渗透测试之Web渗透-SqlMap自动注入(二)-sqlmap参数详解REQUEST


    Sqlmap自动注入(二)

     

    Request

     

    ###################################################

    #inurl:.php?id=

    1、 数据段:--data

    Get/post都使用

    【POST方法】Sqlmap -u “http://1.1.1.1/a.php” --data=”user=1&pass=2” –f

    #sqlmap可自动识别“&”

    【GET方法】Sqlmap –u “http://1.1.1.1/a.php” –-data=”user=1&pass=2”

     

     

    2、 变量分隔符:--param-del

    #大部分web application使用&作为变量之间的分隔符,但有些会使用”;”、“/”等。则需使用—param-del来指定

    Sqlmap –u “http://1.1.1.1/a.php” –data=”q=foo;id” –param-del=”;” –f

     

    3、 Cookie头(靶机:DVWA)

    Web应用需要基于cookie的身份认证

    还会检查cookie中的注入点(sqlmap自动测试)。

    #只有当level>=2时,才会去扫描cookie中是否存在注入点

     

    #当cookie信息更新了,sqlmap会自动检测新的http头,自动添加新的cookie。【可使用—drop-set-cookie暂停其功能】

    Sqlmap –u “http://1.1.1.1/a.php?id=1” –cookie=”a=1;b=2” –f

     

    4、 --user-agent

    Sqlmap/1.0-dev-xxxxxx(默认情况下为这样)

    --random-agent   【随机使用user-agent,user-agent字典文件】

     

    5、 APP/WAF/IPS/IDS 过滤异常user-gent报错

    [hh:mm:20] [ERROR] the target URL responded with an unknown HTTP

    status code, try to force the HTTP User-Agent header with option --user-

    agent or --random-agent

     

    6、 Host头:--host  【也有可能存在注入点,比较少见】

    前提:level=5

     

    7、 Referer:--referer   【理论上都有可能存在】

    当浏览器向WEB服务器发送请求的时候,一般会带上HTTP REFERER,告诉服务器我是从哪个页面链接过来的,服务器籍此可以获得一些信息用于处理。

    前提:level>=3

     

    8、 额外的header:--headers                  【开发者可能自定义http头】

    每个头单独一行(名称区分大小写)

    sqlmap -u “http://1.1.1.1/a.php?id=1” --headers="Host:www.a.com User-Agent:yqwr" 【 :用于换行;需注意大小写】

     

    ##默认情况下使用GET方法,若失败,再尝试POST方法

    --method=POST/GET

     

    9、 基于HTTP协议的身份验证

    Basic/Digest/NTLM          【身份认证类型https://technet.microsoft.com/zh-cn/library/ms191264(v=sql.105).aspx】

    Sqlmap –u “http://1.1.1.1/a.php?id=1” –auth-type Basic –auth-cred “user:pass”

     

    10、--auth-cert / --auth-file         【少见】

    基于客户端证书的身份认证

    --auth:file=”ca.PEM”

    含私钥(或包含PEM格式的证书链)的PEM格式证书文件

     

    11、 http(s)代理

    --proxy=”http://127.0.0.1:8087”

    --proxy-cred=”name:pass”

    --ignore-proxy

              忽略系统级代理设置,通常用于扫描本地网络目标

     

    Sqlmap –u ”http://1.1.1.1/a.php?id=1” –proxy=”http://127.0.0.1:8087” -f

    #命令规范【--命令=”参数”

     

    12、--delay

    每次http(s)请求之间延迟时间,浮点数,单位为秒,默认无延迟,以网络带宽,最大程度发包

     

    13、--timeout

    请求超时时间,浮点数,默认为30秒

     

    14、--retires

    http(s)连接超时重试次数,默认3次

     

    15、--randomize

    长度、类型与原始值保持一致的前提下,指定每次请求随机取值的参数名

    #如:sqlmap –u “http://1.1.1.1/a.php?id=100” –randomize=”id”

     

    16、--scope                          【作用:指定范围】

    过滤日志内容,通过正则表达式筛选扫描对象

    Sqlmap -l burp.log –scope=”(www)?.target.(com | net | org)”

    Sqlmap –l 2.log –scope=”(19)?.168.20.(1|10|100)” –level 3 –dbs

    User-agent中的注入点

       

    #使用靶场mutillidae,获得get/post请求

    0x00使用burpsuit记录日志信息

    0x01在mutillidae中进行手动爬网

     

    17、--safe-url / --sqfe-freq           

             检测和盲注截断会产生大量失败请求,服务器端可能因此销毁session

             每次发送--safe-freq(频率)次注入请求后,发送一次正常请求

     

    18、--skip-urlencode

    默认GET方法会对传输内容进行编码,某些WEB服务器不遵守RFC标准编码,而使用原始字符提交数据。【此为web application的特征,需在扫描前分析】

     

    19、--eval

    【典型使用场景:某些web application中找回密码的链接

    (sqlmap –u ”http://mailaddress&hash=wqd32ni5abvi7a” ---eval=”import haslib;hashlib.md5(id).hexdigest()”){其中hash值为邮箱地址的hash值;其他情况:hash值为时间}】

            

    每次请求前执行指定的python代码

    每次请求更改或增加新的参数值(时间依赖、其他参数值依赖)

     

     

     

  • 相关阅读:
    fatal: HttpRequestException encountered解决方法
    es进行聚合操作时提示Fielddata is disabled on text fields by default
    scrapy+mongodb报错 TypeError: name must be an instance of str
    运行scrapy保存图片,报错ValueError: Missing scheme in request url: h
    yii框架基本操作
    jQuery 获取屏幕高度、宽度
    ajax xmlhttprequest status
    php——composer 1、安装使用
    php 钩子函数原理 解析
    curl http_code状态码 含义
  • 原文地址:https://www.cnblogs.com/zixuanfy/p/6013709.html
Copyright © 2020-2023  润新知