Example #1
0
        public List <NessusPluginFamily> GetPluginFamilies(bool getPlugins)
        {
            XmlDocument familiesXml = base.ListPluginFamilies();

            List <NessusPluginFamily> families = new List <NessusPluginFamily>();

            foreach (XmlNode child in familiesXml.LastChild.ChildNodes)             //first child is XmlDeclaration
            {
                if (child.Name == "contents")
                {
                    foreach (XmlNode familyChild in child.FirstChild.ChildNodes)
                    {
                        NessusPluginFamily family = new NessusPluginFamily(familyChild);

                        if (getPlugins)
                        {
                            family.ChildPlugins = new List <NessusPlugin>();

                            XmlDocument familyPlugins = base.ListPluginsByFamily(family.Name);

                            foreach (XmlNode node in familyPlugins.LastChild.ChildNodes)
                            {
                                if (node.Name == "contents")
                                {
                                    foreach (XmlNode plugin in node.FirstChild.ChildNodes)
                                    {
                                        family.ChildPlugins.Add(new NessusPlugin(plugin)
                                        {
                                            Family = family
                                        });
                                    }
                                }
                            }
                        }

                        families.Add(family);
                    }
                }
            }

            return(families);
        }
Example #2
0
        public List<NessusPluginFamily> GetPluginFamilies(bool getPlugins)
        {
            XmlDocument familiesXml = base.ListPluginFamilies();

            List<NessusPluginFamily> families = new List<NessusPluginFamily>();

            foreach (XmlNode child in familiesXml.LastChild.ChildNodes) //first child is XmlDeclaration
            {
                if (child.Name == "contents")
                {
                    foreach (XmlNode familyChild in child.FirstChild.ChildNodes)
                    {
                        NessusPluginFamily family = new NessusPluginFamily(familyChild);

                        if (getPlugins)
                        {
                            family.ChildPlugins = new List<NessusPlugin>();

                            XmlDocument familyPlugins = base.ListPluginsByFamily(family.Name);

                            foreach (XmlNode node in familyPlugins.LastChild.ChildNodes)
                            {
                                if (node.Name == "contents")
                                {
                                    foreach (XmlNode plugin in node.FirstChild.ChildNodes)
                                        family.ChildPlugins.Add(new NessusPlugin(plugin) { Family = family });
                                }
                            }

                        }

                        families.Add(family);
                    }
                }
            }

            return families;
        }