Esempio n. 1
0
        /*
         * Kayıtlı olan ve bizim oluşturduğumuz Port Listeleri listelenir.All TCP, All TCP and Nmap 5.51 top 100 UDP ve C# Ports -- xxxx.xxxx.xxxx.xxxx
         *
         */
        public static void ListPorts(OpenVASManager manager)
        {
            int       i       = 0;
            XDocument configs = manager.GetPortLists();

            foreach (XElement node in configs.Descendants(XName.Get("name")))
            {
                if (node.Value != "" && node.Value != "admin" && node.Value != "Everything")
                {
                    Console.WriteLine(i + 1 + ") " + node.Value);
                    i += 1;
                }
            }
        }
Esempio n. 2
0
        /*
         * Seçilen Port List'in ID döndürülür. (Key, Terminal ekranında 'İlgili Port için ID girmeniz yeterlidir:' kısmında girilen değerdir.)
         *
         */
        public static string GetPortID(OpenVASManager manager, int key)
        {
            string    portListGuid = "";
            int       counter      = 0;
            XDocument configs      = manager.GetPortLists();

            foreach (XElement node in configs.Descendants(XName.Get("name")))
            {
                if (node.Value != "" && node.Value != "admin" && node.Value != "Everything")
                {
                    if (counter == key - 1)
                    {
                        portListGuid = node.Parent.Attribute("id").Value;
                        return(portListGuid);
                    }
                    else
                    {
                        counter += 1;
                    }
                }
            }
            return(null);
        }