print(""+Fore.WHITE+"CAUTION: "+Fore.YELLOW+"For the tool to work correctly, use the RouterOS configuration from using the"+Fore.WHITE+" export verbose"+Fore.YELLOW+" command\n")
discovery_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}Discovery protocols are enabled on all interfaces{Style.RESET_ALL}")
dns_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Consider closing this port from the internet to avoid unwanted traffic{Style.RESET_ALL}")
dns_found=True
ifdns_found:
print(f"{Fore.CYAN}"+"-"*30+Style.RESET_ALL)
print(f"{Fore.CYAN}[+] DNS Settings:{Style.RESET_ALL}")
upnp_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}UPnP is enabled{Style.RESET_ALL}")
upnp_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}Potential unauthorized port forwarding and security risks{Style.RESET_ALL}")
ddns_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}Dynamic DNS is enabled{Style.RESET_ALL}")
ddns_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}Exposure to dynamic IP changes and potential unauthorized access{Style.RESET_ALL}")
ssh_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Enable strong crypto (strong-crypto=yes) for enhanced security. This will use stronger encryption, HMAC algorithms, larger DH primes, and disallow weaker ones{Style.RESET_ALL}")
socks_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}SOCKS proxy is enabled{Style.RESET_ALL}")
socks_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}Potential unauthorized access and misuse of network resources{Style.RESET_ALL}")
socks_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Disable SOCKS proxy or ensure it is properly secured. SOCKS can be used maliciously if RouterOS is compromised.{Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}Telnet service is enabled {Style.BRIGHT+Fore.WHITE}(disabled=no){Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}Insecure management panel, potential data interception during MITM attack{Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Disable Telnet to secure the router{Style.RESET_ALL}")
ip_service_found=True
ifservice=="ftp":
ip_service_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}FTP service is enabled {Style.BRIGHT+Fore.WHITE}(disabled=no){Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}Insecure management panel; potential data interception during MITM attack{Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Disable FTP to secure the router{Style.RESET_ALL}")
ip_service_found=True
ifservice=="api":
ip_service_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}API service is enabled {Style.BRIGHT+Fore.WHITE}(disabled=no){Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}Potential brute force attack{Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Disable API or secure it properly to prevent brute force attacks{Style.RESET_ALL}")
ip_service_found=True
ifservice=="api-ssl":
ip_service_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}API-SSL service is enabled {Style.BRIGHT+Fore.WHITE}(disabled=no){Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}Potential brute force attack{Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Disable API-SSL or secure it properly to prevent brute force attacks{Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}Service has unrestricted access{Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}Management interfaces are accessible from any subnet{Style.RESET_ALL}")
ip_service_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Restrict access to trusted subnets{Style.RESET_ALL}")
romon_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}ROMON is enabled{Style.RESET_ALL}")
romon_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}ROMON can be a jump point to other MikroTik devices and should be monitored carefully{Style.RESET_ALL}")
romon_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Monitor ROMON activities and ensure proper security measures are in place{Style.RESET_ALL}")
mac_server_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}MAC Telnet server is active on all interfaces{Style.RESET_ALL}")
mac_server_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}This reduces the security of the Winbox interface. Filter access{Style.RESET_ALL}")
mac_server_found=True
ifmac_server_found:
print(f"{Fore.CYAN}"+"-"*30+Style.RESET_ALL)
print(f"{Fore.CYAN}[+] MAC Server Settings:{Style.RESET_ALL}")
mac_winbox_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}MAC Winbox Server is accessible on all interfaces{Style.RESET_ALL}")
mac_winbox_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}This reduces the security of the Winbox interface. Filter access{Style.RESET_ALL}")
mac_winbox_found=True
ifmac_winbox_found:
print(f"{Fore.CYAN}"+"-"*30+Style.RESET_ALL)
print(f"{Fore.CYAN}[+] MAC Winbox Server Settings:{Style.RESET_ALL}")
vrrp_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}VRRP is running without authentication "+Fore.WHITE+"(authentication=none)")
vrrp_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}Lack of authentication allows an attacker to perform MITM (VRRP Spoofing){Style.RESET_ALL}")
snmp_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Change the community name to something more secure{Style.RESET_ALL}")
snmp_found=True
ifprivate_match:
snmp_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}SNMP community 'private' is in use{Style.RESET_ALL}")
snmp_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Change the community name to something more secure{Style.RESET_ALL}")
ospf_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}No passive interfaces in OSPF configuration{Style.RESET_ALL}")
ospf_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}This allows an attacker to connect to the OSPF domain{Style.RESET_ALL}")
ospf_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.YELLOW}Configure passive interfaces to enhance security{Style.RESET_ALL}")
ospf_found=True
ifnotauth_match:
ospf_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}No authentication in OSPF configuration{Style.RESET_ALL}")
ospf_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}This allows unauthorized access to the OSPF domain{Style.RESET_ALL}")
ospf_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.YELLOW}Configure authentication for OSPF to enhance security{Style.RESET_ALL}")
poe_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}PoE is set to auto-on{Style.RESET_ALL}")
poe_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}There is a risk of damaging connected devices by unexpectedly supplying power to the port{Style.RESET_ALL}")
poe_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.YELLOW}Review and set PoE settings appropriately{Style.RESET_ALL}")
poe_found=True
ifpoe_forced_on_match:
poe_info.append(f"{Style.BRIGHT+Fore.RED}[!] Warning: {Style.BRIGHT+Fore.YELLOW}PoE is set to forced-on{Style.RESET_ALL}")
poe_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Impact: {Style.BRIGHT+Fore.YELLOW}There is a significant risk of damaging connected devices by unexpectedly supplying power to the port{Style.RESET_ALL}")
poe_info.append(f"{Style.BRIGHT+Fore.GREEN}[*] Recommendation: {Style.BRIGHT+Fore.YELLOW}Review and set PoE settings appropriately{Style.RESET_ALL}")
smb_info.append(f"{Style.BRIGHT+Fore.WHITE}[*] Recommendation: {Style.BRIGHT+Fore.GREEN}Are you sure you want SMB? If you don't need it, turn it off. Be careful{Style.RESET_ALL}")