【问题标题】:Sending POST request with AJAX which is intercepted by Burp Suite使用 AJAX 发送 POST 请求,被 Burp Suite 拦截
【发布时间】:2019-06-02 19:40:36
【问题描述】:

我使用 Burp Suite 拦截了一个 POST 请求,我想通过 JavaScript Ajax 调用手动发送这个请求。

这是我的原始请求:

我尝试这样发送 POST 请求:

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$.ajax({
    type: 'POST',
    url: 'http://10.10.20.103/mutillidae/index.php?page=add-to-your-blog.php',
    data: {
        'csrf-token': '',
        'blog_entry': 'post from ajax',
        'add-to-your-blog-php-submit-button': 'Save+Blog+Entry'
    };
});
</script>
</head>
<body>
</body>
</html>

但我无法管理它。我的错误在哪里?或者,我该怎么做?如何将原始请求转换为 Ajax 请求?

谢谢!

【问题讨论】:

    标签: javascript ajax post csrf burp


    【解决方案1】:

    正确的解决方法是:

    <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script>
    $.ajax({
        method: 'POST',
        url: 'http://10.10.20.103/mutillidae/index.php?page=add-to-your-blog.php',
        data: {
            'csrf-token': '',
            'blog_entry': 'post from ajax',
            'add-to-your-blog-php-submit-button': 'Save+Blog+Entry'
        },
        xhrFields: {
           withCredentials: true
        }
    });
    </script>
    </head>
    <body>
    </body>
    </html>
    

    我忘记了数据字段的右花括号末尾的分号。另外,我必须添加 xhrFields 字段以绕过需要的 cookie。

    【讨论】:

      猜你喜欢
      • 2017-09-04
      • 1970-01-01
      • 1970-01-01
      • 2020-08-26
      • 1970-01-01
      • 1970-01-01
      • 2013-05-24
      • 1970-01-01
      • 2017-08-22
      相关资源
      最近更新 更多