Download scripts/download_exploits.py from lilbool/vuln-code-analysis: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/lilbool/vuln-code-analysis/resolve/main/scripts/download_exploits.py
- Command line
-
hf download hf://lilbool/vuln-code-analysis/scripts/download_exploits.py
-
curl -L -o download_exploits.py https://huggingface.co/lilbool/vuln-code-analysis/resolve/main/scripts/download_exploits.py
1.23 kB
| 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 | |