| | 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
|
| |
|
| | for exploit_id in range(start_id, end_id + 1):
|
| | download_exploit(exploit_id, "exploit-analyzer/exploits")
|
| | time.sleep(delay)
|
| |
|