热文科学上网

一段代码刷Cloudflare warp邀请流量

CloudFlare出了个免费翻墙app,分享链接给朋友安装就会获得1GB流量,大佬发了个nodejs版和python版刷流量代码

流量跟随APP,卸载app流量会消失!

去APP里获取ID

点击APP右上角菜单 => 拉到下面点 More settings=> 点Diagnostics=> 在CLIENT CONFIGURATION栏中查看ID

复制ID去下列代码中

const referrer = "ID 复制到此处"
循环次数可以修改,一次不要改太多!默认是10

// Fake register for referrer to get warp plus bandwidth
const referrer = "AFF ID复制到这里"; 
const timesToLoop = 10; // 循环次数
const retryTimes = 5; // 重试次数

const https = require("https");
const zlib = require("zlib");

async function init() {
  for (let i = 0; i < timesToLoop; i++) {
    if (await run()) {
      console.log(i + 1, "OK");
    } else {
      console.log(i + 1, "Error");
      for (let r = 0; r < retryTimes; r++) {
        if (await run()) {
          console.log(i + 1, "Retry #" + (r + 1), "OK");
          break;
        } else {
          console.log(i + 1, "Retry #" + (r + 1), "Error");
          if (r === retryTimes - 1) {
            return;
          }
        }
      }
    }
  }
}

async function run() {
  return new Promise(resolve => {
    const install_id = genString(11);
    const postData = JSON.stringify({
      key: `${genString(43)}=`,
      install_id: install_id,
      fcm_token: `${install_id}:APA91b${genString(134)}`,
      referrer: referrer,
      warp_enabled: false,
      tos: new Date().toISOString().replace("Z", "+07:00"),
      type: "Android",
      locale: "zh_CN"
    });

    const options = {
      hostname: "api.cloudflareclient.com",
      port: 443,
      path: "/v0a745/reg",
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Host: "api.cloudflareclient.com",
        Connection: "Keep-Alive",
        "Accept-Encoding": "gzip",
        "User-Agent": "okhttp/3.12.1",
        "Content-Length": postData.length
      }
    };

    const req = https.request(options, res => {
      const gzip = zlib.createGunzip();
      // const buffer = [];
      res.pipe(gzip);
      gzip
        .on("data", function(data) {
          // buffer.push(data.toString());
        })
        .on("end", function() {
          // console.dir(JSON.parse(buffer.join("")));
          resolve(true);
        })
        .on("error", function(e) {
          // console.error(e);
          resolve(false);
        });
    });

    req.on("error", error => {
      // console.error(error);
      resolve(false);
    });

    req.write(postData);
    req.end();
  });
}

function genString(length) {
  // https://gist.github.com/6174/6062387#gistcomment-2651745
  return [...Array(length)]
    .map(i => (~~(Math.random() * 36)).toString(36))
    .join("");
}

init();

运行nodejs代码

打开在线nodejs网站: https://repl.it/languages/nodejs

点击run运行运行以上代码右侧会出现OK会发现APP已经增加了流量

CFWnodejs

https://www.hostloc.com/thread-590354-1-1.html
https://github.com/yyuueexxiinngg/some-scripts/tree/master/cloudflare

本文来自投稿,不代表本站立场,如若转载,请注明出处:https://www.tok9.com/archives/504/
二年级上学期数学【你会给应用题减肥吗?】
« 上一篇 09-24
WireGuard使用CloudFlare Warp的key生成配置文件全平台运行(Windows,Mac,IOS和安卓)
下一篇 » 09-28

发表评论

作者信息

热门文章

标签TAG

热评文章