File size: 1,230 Bytes
497f2f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import requests
import os
import time

def download_exploit(exploit_id, save_dir):
    url = f"https://www.exploit-db.com/raw/{exploit_id}"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
    }
    try:
        response = requests.get(url, headers=headers)
        if response.status_code == 200:
            with open(os.path.join(save_dir, f"exploit_{exploit_id}.txt"), 'w', encoding='utf-8') as f:
                f.write(response.text)
            print(f"[SUCCESS] Exploit {exploit_id} downloaded successfully.")
        else:
            print(f"[FAILED] Exploit {exploit_id}: HTTP {response.status_code}")
    except Exception as e:
        print(f"[ERROR] An error occurred while downloading exploit {exploit_id}: {e}")

if __name__ == "__main__":
    os.makedirs("exploit-analyzer/exploits", exist_ok=True)
    start_id = 1
    end_id = 10000
    delay = 1  # Delay em segundos entre downloads para evitar bloqueio

    for exploit_id in range(start_id, end_id + 1):
        download_exploit(exploit_id, "exploit-analyzer/exploits")
        time.sleep(delay)  # Pausa entre requisições