├── .gitignore ├── README.md ├── id.txt ├── main.js ├── package.json ├── proxy.txt ├── setup.js └── user.txt /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | user.txt 3 | proxy.txt 4 | package-lock.json 5 | id.txt 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Blockless Bless Network Bot 2 | 3 | ## Description 4 | This script automates network or node operations for Blockless Bless Network Bot. 5 | 6 | ## Update 7 | 8 | - if you already generated pubkey using sc before just retire it 9 | - must generate pubkey manually at extension bless network 10 | - hardwareId is can generate from sc, or just paste from extension bless network 11 | - input manually `id.txt` with your pubkey and hardwareid 12 | 13 | ## Features 14 | - **Automated node interaction** 15 | - **Multi NodeID** 16 | - **Proxy support** 17 | 18 | ## Prerequisites 19 | - [Node.js](https://nodejs.org/) 20 | 21 | ## Installation 22 | 23 | 1. Clone the repository to your local machine: 24 | ```bash 25 | git clone https://github.com/Zlkcyber/bless-bot.git 26 | ``` 27 | 2. Navigate to the project directory: 28 | ```bash 29 | cd bless-bot 30 | ``` 31 | 3. Install the necessary dependencies: 32 | ```bash 33 | npm install 34 | ``` 35 | 36 | ## Usage 37 | 1. Register to blockless bless network account first, if you dont have you can register [https://bless.network/](https://bless.network/dashboard?ref=FZABS8). 38 | 2. Set and Modify `user.txt`. Below how to setup this file, put your B7S_AUTH_TOKEN in the text file, example below: 39 | ``` 40 | eyJhbGcixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 41 | ``` 42 | To get your token, follow this step: 43 | - Login to your blockless account in [https://bless.network/](https://bless.network/dashboard?ref=FZABS8), 44 | - Go to inspect element, press F12 or right-click then pick inspect element in your browser 45 | - Go to application tab - look for Local Storage in storage list -> click `https://bless.network` and you will see your B7S_AUTH_TOKEN. 46 | - or you can go Console tab and paste this 47 | ```bash 48 | localStorage.getItem('B7S_AUTH_TOKEN') 49 | ``` 50 | 3. Create hardware id 51 | - you can automatically create it with this command 52 | ``` 53 | node setup.js 54 | ``` 55 | put in `id.txt`. in the text file with this format `nodeid(pubkey):hardwareid`, example below: 56 | ``` 57 | 12D3Koxxxxxxxxxxxx3ws:e938610xxxxxxxxxxxx 58 | 12D3Koxxxxxxxxxxxx58o:221610xxxxxxxxxxxxx 59 | ``` 60 | 4. put your pubkey you get from extension 61 | ```bash 62 | nano id.txt 63 | ``` 64 | 65 | 5. If you want to use `proxy`, edit `proxy.txt` and add your proxy in there. Make sure total proxy is same with your total `nodeid(pubkey):hardwareid` that you put in `id.txt` 66 | 6. Run the script: 67 | ```bash 68 | node main.js 69 | ``` 70 | **NOTE: The total time is refreshed every 10minute connection, One account only can have 5 nodeid max and can't be deleted, I recomended to save your Nodeid(pubkey) and hardwareid of your account** 71 | -------------------------------------------------------------------------------- /id.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zlkcyber/bless-bot/10eccddb84bf9587a2a5efceb37f91073b71e0d2/id.txt -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs').promises; 2 | const { HttpsProxyAgent } = require('https-proxy-agent'); 3 | const readline = require('readline'); 4 | 5 | const apiBaseUrl = "https://gateway-run.bls.dev/api/v1"; 6 | const ipServiceUrl = "https://ipinfo.io/json"; 7 | let useProxy; 8 | 9 | async function loadFetch() { 10 | const fetch = await import('node-fetch').then(module => module.default); 11 | return fetch; 12 | } 13 | 14 | async function readProxies() { 15 | const data = await fs.readFile('proxy.txt', 'utf-8'); 16 | const proxies = data.trim().split('\n').filter(proxy => proxy); 17 | return proxies; 18 | } 19 | 20 | async function readNodeAndHardwareIds() { 21 | const data = await fs.readFile('id.txt', 'utf-8'); 22 | const ids = data.trim().split('\n').filter(id => id).map(id => { 23 | const [nodeId, hardwareId] = id.split(':'); 24 | return { nodeId, hardwareId }; 25 | }); 26 | return ids; 27 | } 28 | 29 | async function readAuthToken() { 30 | const data = await fs.readFile('user.txt', 'utf-8'); 31 | return data.trim(); 32 | } 33 | 34 | async function promptUseProxy() { 35 | const rl = readline.createInterface({ 36 | input: process.stdin, 37 | output: process.stdout 38 | }); 39 | 40 | return new Promise(resolve => { 41 | rl.question('Do you want to use a proxy? (y/n): ', answer => { 42 | rl.close(); 43 | resolve(answer.toLowerCase() === 'y'); 44 | }); 45 | }); 46 | } 47 | 48 | async function fetchIpAddress(fetch, agent) { 49 | const response = await fetch(ipServiceUrl, { 50 | headers: { 51 | Accept: "application/json", 52 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36", 53 | }, 54 | agent, 55 | }); 56 | const data = await response.json(); 57 | console.log(`[${new Date().toISOString()}] IP fetch response:`, data?.ip); 58 | return data?.ip || '0.0.0.0'; 59 | } 60 | function getRandomElement(arr) { 61 | return arr[Math.floor(Math.random() * arr.length)]; 62 | } 63 | 64 | function generateRandomHardwareInfo() { 65 | const cpuArchitectures = ["x86_64", "ARM64", "x86"]; 66 | const cpuModels = [ 67 | "Intel Core i7-10700K CPU @ 3.80GHz", 68 | "AMD Ryzen 5 5600G with Radeon Graphics", 69 | "Intel Core i5-10600K CPU @ 4.10GHz", 70 | "AMD Ryzen 7 5800X", 71 | "Intel Core i9-10900K CPU @ 3.70GHz", 72 | "AMD Ryzen 9 5900X", 73 | "Intel Core i3-10100 CPU @ 3.60GHz", 74 | "AMD Ryzen 3 3300X", 75 | "Intel Core i7-9700K CPU @ 3.60GHz", 76 | ]; 77 | const cpuFeatures = ["mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", "avx", "avx2", "fma"]; 78 | const numProcessors = [4, 6, 8, 12, 16]; 79 | const memorySizes = [8 * 1024 ** 3, 16 * 1024 ** 3, 32 * 1024 ** 3, 64 * 1024 ** 3]; 80 | 81 | const randomCpuFeatures = Array.from({ length: Math.floor(Math.random() * cpuFeatures.length) + 1 }, () => 82 | getRandomElement(cpuFeatures) 83 | ); 84 | 85 | return { 86 | cpuArchitecture: getRandomElement(cpuArchitectures), 87 | cpuModel: getRandomElement(cpuModels), 88 | cpuFeatures: [...new Set(randomCpuFeatures)], 89 | numOfProcessors: getRandomElement(numProcessors), 90 | totalMemory: getRandomElement(memorySizes), 91 | extensionVersions: "0.1.7" 92 | }; 93 | } 94 | 95 | 96 | async function registerNode(nodeId, hardwareId, ipAddress, proxy) { 97 | const fetch = await loadFetch(); 98 | const authToken = await readAuthToken(); 99 | let agent; 100 | 101 | if (proxy) { 102 | agent = new HttpsProxyAgent(proxy); 103 | } 104 | 105 | const registerUrl = `${apiBaseUrl}/nodes/${nodeId}`; 106 | console.log(`[${new Date().toISOString()}] Registering node with IP: ${ipAddress}, Hardware ID: ${hardwareId}`); 107 | 108 | const response = await fetch(registerUrl, { 109 | method: "POST", 110 | headers: { 111 | "Content-Type": "application/json", 112 | Authorization: `Bearer ${authToken}`, 113 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36", 114 | "origin": "chrome-extension://pljbjcehnhcnofmkdbjolghdcjnmekia", 115 | "x-extension-version": "0.1.7" 116 | }, 117 | body: JSON.stringify({ 118 | ipAddress, 119 | hardwareId, 120 | hardwareInfo: generateRandomHardwareInfo(), 121 | extensionVersion: "0.1.7" 122 | }), 123 | agent 124 | }); 125 | 126 | let data; 127 | try { 128 | data = await response.json(); 129 | } catch (error) { 130 | const text = await response.text(); 131 | console.error(`[${new Date().toISOString()}] Failed to parse JSON. Response text:`, text); 132 | throw error; 133 | } 134 | 135 | console.log(`[${new Date().toISOString()}] Registration response:`, data); 136 | return data; 137 | } 138 | 139 | async function startSession(nodeId, proxy) { 140 | const fetch = await loadFetch(); 141 | const authToken = await readAuthToken(); 142 | let agent; 143 | 144 | if (proxy) { 145 | agent = new HttpsProxyAgent(proxy); 146 | } 147 | 148 | const startSessionUrl = `${apiBaseUrl}/nodes/${nodeId}/start-session`; 149 | console.log(`[${new Date().toISOString()}] Starting session for node ${nodeId}, it might take a while...`); 150 | const response = await fetch(startSessionUrl, { 151 | method: "POST", 152 | headers: { 153 | Accept: "*/*", 154 | Authorization: `Bearer ${authToken}`, 155 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36", 156 | "origin": "chrome-extension://pljbjcehnhcnofmkdbjolghdcjnmekia", 157 | "x-extension-version": "0.1.7" 158 | 159 | }, 160 | agent 161 | }); 162 | const data = await response.json(); 163 | console.log(`[${new Date().toISOString()}] Start session response:`, data); 164 | return data; 165 | } 166 | async function stopSession(nodeId, proxy) { 167 | const fetch = await loadFetch(); 168 | const authToken = await readAuthToken(); 169 | let agent; 170 | 171 | if (proxy) { 172 | agent = new HttpsProxyAgent(proxy); 173 | } 174 | 175 | const stopSessionUrl = `${apiBaseUrl}/nodes/${nodeId}/stop-session`; 176 | console.log(`[${new Date().toISOString()}] stoping session for node ${nodeId}, it might take a while...`); 177 | const response = await fetch(stopSessionUrl, { 178 | method: "POST", 179 | headers: { 180 | Accept: "*/*", 181 | Authorization: `Bearer ${authToken}`, 182 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36", 183 | "origin": "chrome-extension://pljbjcehnhcnofmkdbjolghdcjnmekia", 184 | "x-extension-version": "0.1.7" 185 | 186 | }, 187 | agent 188 | }); 189 | const data = await response.json(); 190 | console.log(`[${new Date().toISOString()}] stop session response:`, data); 191 | return data; 192 | } 193 | async function pingNode(nodeId, proxy, ipAddress, isB7SConnected) { 194 | const fetch = await loadFetch(); 195 | const chalk = await import('chalk'); 196 | const authToken = await readAuthToken(); 197 | let agent; 198 | 199 | if (proxy) { 200 | agent = new HttpsProxyAgent(proxy); 201 | } 202 | 203 | const pingUrl = `${apiBaseUrl}/nodes/${nodeId}/ping`; 204 | console.log(`[${new Date().toISOString()}] Pinging node ${nodeId} using proxy ${proxy}`); 205 | const response = await fetch(pingUrl, { 206 | method: "POST", 207 | headers: { 208 | Accept: "*/*", 209 | Authorization: `Bearer ${authToken}`, 210 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36", 211 | "origin": "chrome-extension://pljbjcehnhcnofmkdbjolghdcjnmekia", 212 | "x-extension-version": "0.1.7" 213 | }, 214 | body: JSON.stringify({ isB7SConnected }), 215 | agent 216 | }); 217 | const data = await response.json(); 218 | 219 | const logMessage = `[${new Date().toISOString()}] Ping response, NodeID: ${chalk.default.green(nodeId)}, Status: ${chalk.default.yellow(data.status)}, Proxy: ${proxy}, IP: ${ipAddress}`; 220 | console.log(logMessage); 221 | 222 | return data; 223 | } 224 | 225 | async function checkNode(nodeId, proxy) { 226 | 227 | const fetch = await loadFetch(); 228 | const chalk = await import('chalk'); 229 | const authToken = await readAuthToken(); 230 | let agent; 231 | 232 | if (proxy) { 233 | agent = new HttpsProxyAgent(proxy); 234 | } 235 | const checkNodeUrl = `${apiBaseUrl}/nodes/${nodeId}`; 236 | console.log(`[${new Date().toISOString()}] Checking node ${nodeId} using proxy ${proxy}`); 237 | 238 | const response = await fetch(checkNodeUrl, { 239 | method: "GET", 240 | headers: { 241 | Authorization: `Bearer ${authToken}`, 242 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36", 243 | "origin": "chrome-extension://pljbjcehnhcnofmkdbjolghdcjnmekia", 244 | "x-extension-version": "0.1.7" 245 | }, 246 | agent, 247 | }); 248 | const data = await response.json(); 249 | const todayReward = data?.todayReward || 0; 250 | const isConnected = data?.isConnected || false; 251 | const logMessage = `[${new Date().toISOString()}] node Check response, NodeID: ${chalk.default.green(nodeId)}, Today Rewards: ${chalk.default.yellow(todayReward)}, is Connected: ${isConnected}`; 252 | console.log(logMessage); 253 | return isConnected; 254 | } 255 | 256 | async function heathCheck(nodeId, proxy) { 257 | 258 | const fetch = await loadFetch(); 259 | const chalk = await import('chalk'); 260 | const authToken = await readAuthToken(); 261 | let agent; 262 | 263 | if (proxy) { 264 | agent = new HttpsProxyAgent(proxy); 265 | } 266 | const checkUrl = `https://gateway-run.bls.dev/health`;; 267 | console.log(`[${new Date().toISOString()}] Checking Health node ${nodeId} using proxy ${proxy}`); 268 | 269 | const response = await fetch(checkUrl, { 270 | method: "GET", 271 | headers: { 272 | Authorization: `Bearer ${authToken}`, 273 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36", 274 | "origin": "chrome-extension://pljbjcehnhcnofmkdbjolghdcjnmekia", 275 | "x-extension-version": "0.1.7" 276 | }, 277 | agent, 278 | }); 279 | const data = await response.json(); 280 | const logMessage = `[${new Date().toISOString()}] Health Check response, NodeID: ${chalk.default.green(nodeId)}, Status: ${chalk.default.yellow(data.status)}, Proxy: ${proxy}`; 281 | console.log(logMessage); 282 | return data; 283 | } 284 | async function displayHeader() { 285 | 286 | console.log(""); 287 | console.log(`███████╗██╗ ██╗ ██╗ ██████╗██╗ ██╗██████╗ ███████╗██████╗ `) 288 | console.log(`╚══███╔╝██║ ██║ ██╔╝ ██╔════╝╚██╗ ██╔╝██╔══██╗██╔════╝██╔══██╗`) 289 | console.log(` ███╔╝ ██║ █████╔╝ ██║ ╚████╔╝ ██████╔╝█████╗ ██████╔╝`) 290 | console.log(` ███╔╝ ██║ ██╔═██╗ ██║ ╚██╔╝ ██╔══██╗██╔══╝ ██╔══██╗`) 291 | console.log(`███████╗███████╗██║ ██╗ ╚██████╗ ██║ ██████╔╝███████╗██║ ██║`) 292 | console.log(`╚══════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝`) 293 | console.log(` Running Blockless Node BETA CLI Version `) 294 | console.log(` t.me/zlkcyber *** github.com/zlkcyber `) 295 | console.log(""); 296 | } 297 | 298 | let activeNodes = []; 299 | 300 | process.on('SIGINT', async () => { 301 | console.log(`[${new Date().toISOString()}] Graceful shutdown initiated.`); 302 | await shutdownAllNodes(); 303 | process.exit(0); 304 | }); 305 | 306 | process.on('SIGTERM', async () => { 307 | console.log(`[${new Date().toISOString()}] SIGTERM received. Shutting down.`); 308 | await shutdownAllNodes(); 309 | process.exit(0); 310 | }); 311 | 312 | async function shutdownAllNodes() { 313 | const promises = activeNodes.map(async ({ nodeId, proxy }) => { 314 | try { 315 | const stopSessionResponse = await stopSession(nodeId, proxy); 316 | console.log(`[${new Date().toISOString()}] Session stopped for nodeId: ${nodeId}. Response:`, stopSessionResponse); 317 | } catch (error) { 318 | console.error(`[${new Date().toISOString()}] Error stopping session for nodeId: ${nodeId}. Error:`, error.message); 319 | } 320 | }); 321 | 322 | await Promise.all(promises); 323 | } 324 | 325 | async function processNode(nodeId, hardwareId, proxy, ipAddress) { 326 | activeNodes.push({ nodeId, proxy }); 327 | let isConnected = false; 328 | 329 | try { 330 | console.log(`[${new Date().toISOString()}] Processing nodeId: ${nodeId}, hardwareId: ${hardwareId}, IP: ${ipAddress}`); 331 | isConnected = await checkNode(nodeId, proxy); 332 | if (!isConnected) { 333 | console.log(`[${new Date().toISOString()}] Node nodeId: ${nodeId} is not connected.`); 334 | try { 335 | console.log(`[${new Date().toISOString()}] Starting session for nodeId: ${nodeId}`); 336 | await registerNode(nodeId, hardwareId, ipAddress, proxy); 337 | await startSession(nodeId, proxy); 338 | } catch (error) { 339 | console.error(`[${new Date().toISOString()}] Error Starting session for nodeId: ${nodeId}. Error:`, error.message); 340 | } 341 | } 342 | console.log(`[${new Date().toISOString()}] Sending initial ping for nodeId: ${nodeId}`); 343 | await pingNode(nodeId, proxy, ipAddress, isConnected); 344 | 345 | setInterval(async () => { 346 | try { 347 | console.log(`[${new Date().toISOString()}] Sending ping for nodeId: ${nodeId}`); 348 | isConnected = await checkNode(nodeId, proxy); 349 | await pingNode(nodeId, proxy, ipAddress, isConnected); 350 | } catch (error) { 351 | console.error(`[${new Date().toISOString()}] Error during ping for nodeId: ${nodeId}: ${error.message}`); 352 | } 353 | }, 10 * 60 * 1000); 354 | 355 | setInterval(async () => { 356 | try { 357 | console.log(`[${new Date().toISOString()}] Sending Health Check for nodeId: ${nodeId}`); 358 | await heathCheck(nodeId, proxy); 359 | 360 | console.log(`[${new Date().toISOString()}] Checking connection status for nodeId: ${nodeId}`); 361 | isConnected = await checkNode(nodeId, proxy); 362 | 363 | if (!isConnected) { 364 | console.log(`[${new Date().toISOString()}] Node nodeId: ${nodeId} is not connected.`); 365 | try { 366 | await stopSession(nodeId, proxy); 367 | console.log(`[${new Date().toISOString()}] Restarting session for nodeId: ${nodeId}`); 368 | await registerNode(nodeId, hardwareId, ipAddress, proxy); 369 | await startSession(nodeId, proxy); 370 | } catch (error) { 371 | console.error(`[${new Date().toISOString()}] Error Restarting session for nodeId: ${nodeId}. Error:`, error.message); 372 | } 373 | } 374 | } catch (error) { 375 | console.error(`[${new Date().toISOString()}] Error during Health Check for nodeId: ${nodeId}: ${error.message}`); 376 | } 377 | }, 60 * 1000); 378 | 379 | } catch (error) { 380 | console.error(`[${new Date().toISOString()}] Error occurred for nodeId: ${nodeId}, restarting process: ${error.message}`); 381 | } 382 | } 383 | 384 | // 385 | async function runAll(initialRun = true) { 386 | try { 387 | if (initialRun) { 388 | await displayHeader(); 389 | useProxy = await promptUseProxy(); 390 | } 391 | 392 | const ids = await readNodeAndHardwareIds(); 393 | const proxies = await readProxies(); 394 | 395 | if (useProxy && proxies.length < ids.length) { 396 | throw new Error((await import('chalk')).default.yellow(`Number of proxies (${proxies.length}) does not match number of nodeId:hardwareId pairs (${ids.length})`)); 397 | } 398 | 399 | for (let i = 0; i < ids.length; i++) { 400 | const { nodeId, hardwareId } = ids[i]; 401 | const proxy = useProxy ? proxies[i] : null; 402 | const ipAddress = useProxy ? await fetchIpAddress(await loadFetch(), proxy ? new HttpsProxyAgent(proxy) : null) : null; 403 | 404 | await processNode(nodeId, hardwareId, proxy, ipAddress); 405 | } 406 | } catch (error) { 407 | const chalk = await import('chalk'); 408 | console.error(chalk.default.yellow(`[${new Date().toISOString()}] An error occurred: ${error.message}`)); 409 | } 410 | } 411 | // run 412 | runAll(); 413 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blockless-bot", 3 | "version": "1.0.1", 4 | "description": "This script automates network or node operations for Blockless Bless Network Bot.", 5 | "main": "main.js", 6 | "scripts": { 7 | "start": "node main.js" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/Zlkcyber/bless-bot.git" 12 | }, 13 | "keywords": [ 14 | "blockless", 15 | "bless", 16 | "bot" 17 | ], 18 | "dependencies": { 19 | "chalk": "^5.3.0", 20 | "https-proxy-agent": "^7.0.5", 21 | "node-fetch": "^3.3.2" 22 | }, 23 | "author": "@zlkcyber", 24 | "license": "ISC", 25 | "bugs": { 26 | "url": "https://github.com/Zlkcyber/bless-bot/issues" 27 | }, 28 | "homepage": "https://github.com/Zlkcyber/bless-bot#readme" 29 | } 30 | -------------------------------------------------------------------------------- /proxy.txt: -------------------------------------------------------------------------------- 1 | your proxy here -------------------------------------------------------------------------------- /setup.js: -------------------------------------------------------------------------------- 1 | const crypto = require('crypto'); 2 | const fs = require('fs'); 3 | const readline = require('readline'); 4 | // 5 | function getRandomHardwareIdentifier() { 6 | const randomCpuArchitecture = Math.random() > 0.5 ? 'x64' : 'x86'; 7 | const randomCpuModel = `Fake CPU Model ${Math.floor(Math.random() * 1000)}`; 8 | const randomNumOfProcessors = Math.floor(Math.random() * 8) + 1; 9 | const randomTotalMemory = Math.floor(Math.random() * 16 + 1) * 1024 * 1024 * 1024; 10 | 11 | const cpuInfo = { 12 | cpuArchitecture: randomCpuArchitecture, 13 | cpuModel: randomCpuModel, 14 | numOfProcessors: randomNumOfProcessors, 15 | totalMemory: randomTotalMemory 16 | }; 17 | 18 | return Buffer.from(JSON.stringify(cpuInfo)).toString('base64'); 19 | } 20 | 21 | async function generateDeviceIdentifier() { 22 | const hardwareIdentifier = getRandomHardwareIdentifier(); 23 | const deviceInfo = JSON.stringify({ hardware: hardwareIdentifier }); 24 | const hash = crypto.createHash('sha256'); 25 | hash.update(deviceInfo); 26 | return hash.digest('hex'); 27 | } 28 | 29 | const rl = readline.createInterface({ 30 | input: process.stdin, 31 | output: process.stdout 32 | }); 33 | 34 | async function main() { 35 | const chalk = (await import('chalk')).default; 36 | 37 | console.log(chalk.red.bold('This is only for testing purposes, I do not recommend using it')); 38 | 39 | rl.question(chalk.cyan('How many identifiers do you want to generate? '), async (answer) => { 40 | const total = parseInt(answer); 41 | let output = ''; 42 | 43 | for (let i = 0; i < total; i++) { 44 | const deviceIdentifier = await generateDeviceIdentifier(); 45 | 46 | const logEntry = `Device Identifier ${i + 1}: ${chalk.green(deviceIdentifier)}\n`; 47 | const formattedEntry = `input-publicKey-from-extension:${deviceIdentifier}\n`; 48 | output += formattedEntry; 49 | console.log(logEntry); 50 | } 51 | 52 | fs.writeFileSync('id.txt', output); 53 | console.log(chalk.yellow('Data saved to id.txt')); 54 | 55 | rl.close(); 56 | }); 57 | } 58 | 59 | main(); -------------------------------------------------------------------------------- /user.txt: -------------------------------------------------------------------------------- 1 | usertoken 2 | --------------------------------------------------------------------------------