const { connect } = require("puppeteer-real-browser"); const http2 = require("http2"); const tls = require("tls"); const cluster = require("cluster"); const crypto = require("crypto"); const defaultCiphers = crypto.constants.defaultCoreCipherList.split(":"); const ciphers = "GREASE:" + [ defaultCiphers[2], defaultCiphers[1], defaultCiphers[0], ...defaultCiphers.slice(3) ].join(":"); const sigalgs = [ "ecdsa_secp256r1_sha256", "rsa_pss_rsae_sha256", "rsa_pkcs1_sha256", "ecdsa_secp384r1_sha384", "rsa_pss_rsae_sha384", "rsa_pkcs1_sha384", "rsa_pss_rsae_sha512", "rsa_pkcs1_sha512" ]; 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_SESSION_RESUMPTION_ON_RENEGOTIATION; const secureProtocol = "TLS_method"; const secureContext = tls.createSecureContext({ ciphers: ciphers, sigalgs: sigalgs.join(':'), honorCipherOrder: true, secureOptions: secureOptions, secureProtocol: secureProtocol }); const accept_header = [ "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,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8" ]; const cache_header = [ 'no-cache', 'max-age=0', 'no-cache, no-store, must-revalidate', 'no-store', 'no-cache, no-store, private, max-age=0' ]; const language_header = [ 'en-US,en;q=0.9', 'vi-VN,vi;q=0.9,en-US;q=0.8,en;q=0.7', 'en-GB,en;q=0.9' ]; if (process.argv.length < 6) { console.log("\x1b[31mUsage: node uam.js