#!/usr/bin/python3 import xml.etree.ElementTree as ET # Parse the XML file tree = ET.parse('sken.xml') root = tree.getroot() # Create a list to store VNC server IP:PORT combinations vnc_servers = [] # Iterate through the XML structure and find VNC info with no authentication for host in root.findall(".//host"): ip = None for address in host.findall(".//address"): if address.get("addrtype") == "ipv4": ip = address.get("addr") # Search for ports related to VNC services for port in host.findall(".//ports/port"): service = port.find(".//service") if service is not None and "vnc" in service.get("name", "").lower(): vnc_info = port.find(".//script[@id='vnc-info']") if vnc_info is not None: security_types = vnc_info.find(".//table[@key='Security types']") if security_types is not None: for security in security_types.findall("table"): security_name = security.find("elem[@key='name']") if security_name is not None and security_name.text == "None": port_id = port.get("portid") if ip: # Only append if IP is available vnc_servers.append(f"{ip}:{port_id}") # Output the found VNC servers with no authentication for server in vnc_servers: print(f"{server}")