override protected void pushContent(string content)
 {
     if (elementStack.Count != 0)
     {
         if (elementStack.Peek().CompareTo("HostName") == 0)
         {
             tempIpList += content;
         }
         else
         {
             if (elementStack.Peek().CompareTo("solution") == 0)
             {
                 this.tempRecommendation += content;
             }
             else if (elementStack.Peek().CompareTo("risk_factor") == 0)
             {
                 this.tempRiskFactor = RiskFactorFunction.getEnum(content);
             }
             else if (elementStack.Peek().CompareTo("description") == 0)
             {
                 this.tempImpact += content;
             }
             else if (elementStack.Peek().CompareTo("synopsis") == 0)
             {
                 this.tempDescription += content;
             }
             else if (elementStack.Peek().CompareTo("cve") == 0)
             {
                 this.tempCve += content;
             }
             else if (elementStack.Peek().CompareTo("bid") == 0)
             {
                 this.tempBid += content;
             }
             else if (elementStack.Peek().CompareTo("osvdb") == 0)
             {
                 this.tempOsvdb += content;
             }
         }
     }
 }
Beispiel #2
0
 override protected void pushContent(string content)
 {
     if (elementStack.Count != 0)
     {
         if (elementStack.Peek().CompareTo("HostName") == 0)
         {
             hostName += content;
         }
         else
         {
             if (elementStack.Peek().CompareTo("solution") == 0)
             {
                 this.recommendation += content;
             }
             else if (elementStack.Peek().CompareTo("risk_factor") == 0)
             {
                 this.defaultRiskFactor = RiskFactorFunction.getEnum(content);
             }
             else if (elementStack.Peek().CompareTo("description") == 0)
             {
                 this.impact += content;
             }
             else if (elementStack.Peek().CompareTo("synopsis") == 0)
             {
                 this.description += content;
             }
             else if (elementStack.Peek().CompareTo("cve") == 0)
             {
                 this.tempCve += content;
             }
             else if (elementStack.Peek().CompareTo("bid") == 0)
             {
                 this.tempBid += content;
             }
             else if (elementStack.Peek().CompareTo("xref") == 0)
             {
                 this.tempXref += content;
             }
         }
     }
 }
 /// <summary>
 /// This is the pushContent method.
 /// It is used to handle the content between start tag and end tag from the XML file.
 /// </summary>
 /// <param name="content">the content between start tag an end tag from the XML file</param>
 override protected void pushContent(string content)
 {
     if (elementStack.Count != 0)
     {
         if (elementStack.Peek().CompareTo("HostName") == 0)
         {
             tempIpList += content;
         }
         else
         {
             if (elementStack.Peek().CompareTo("solution") == 0)
             {
                 this.tempRecommendation += content;
             }
             else if (elementStack.Peek().CompareTo("risk_factor") == 0)
             {
                 this.tempRiskFactor = RiskFactorFunction.getEnum(content);
             }
             else if (elementStack.Peek().CompareTo("description") == 0)
             {
                 this.tempImpact += content;
             }
             else if (elementStack.Peek().CompareTo("synopsis") == 0)
             {
                 this.tempDescription += content;
             }
             else if (elementStack.Peek().CompareTo("cve") == 0)
             {
                 this.tempCve += content;
             }
             else if (elementStack.Peek().CompareTo("bid") == 0)
             {
                 this.tempBid += content;
             }
             else if (elementStack.Peek().CompareTo("xref") == 0)
             {
                 this.tempOsvdb += content;
             }
             else if (elementStack.Peek().CompareTo("plugin_publication_date") == 0)
             {
                 this.tempPlugin_publication_date += content;
             }
             else if (elementStack.Peek().CompareTo("plugin_modification_date") == 0)
             {
                 this.tempPlugin_modification_date += content;
             }
             else if (elementStack.Peek().CompareTo("cvss_vector") == 0)
             {
                 this.tempCvss_vector += content;
             }
             else if (elementStack.Peek().CompareTo("cvss_base_score") == 0)
             {
                 this.tempCvss_base_score += content;
             }
             else if (elementStack.Peek().CompareTo("plugin_output") == 0)
             {
                 this.tempPlugin_output += content;
             }
             else if (elementStack.Peek().CompareTo("plugin_version") == 0)
             {
                 this.tempPlugin_version += content;
             }
             else if (elementStack.Peek().CompareTo("see_also") == 0)
             {
                 this.tempSee_also += content;
             }
         }
     }
 }
Beispiel #4
0
        public Record.Record getRecord()
        {
            // Create
            sqlite_conn = new SQLiteConnection("Data source=" + path + ";Version=3;New=True;Compress=True;");

            // Open
            sqlite_conn.Open();

            // Create command
            sqlite_cmd = sqlite_conn.CreateCommand();

            Record.Record tempRecord = new Record.Record();
            sqlite_cmd.CommandText = "SELECT * " +
                                     "FROM Record AS R " +
                                     "WHERE (R.revisionNo = (SELECT MAX(R2.revisionNo) " +
                                     "FROM Record AS R2 " +
                                     "WHERE R.originalId = R2.originalId)" +
                                     ") OR " +
                                     "R.revisionNo = 1;";

            SQLiteDataReader sqlite_datareader = sqlite_cmd.ExecuteReader();

            while (sqlite_datareader.Read())
            {
                // get the content of the text field
                List <String> cveList   = sqlite_datareader["cvelist"].ToString().Split(',').ToList <String>();
                List <String> bidList   = sqlite_datareader["bidlist"].ToString().Split(',').ToList <String>();
                List <String> osvdbList = sqlite_datareader["osvdblist"].ToString().Split(',').ToList <String>();

                for (int i = 0; i < cveList.Count; i++)
                {
                    String tempString = "";
                    foreach (char c in cveList[i])
                    {
                        if (c != ' ')
                        {
                            tempString += c;
                        }
                    }
                    cveList[i] = tempString;
                }

                for (int i = 0; i < bidList.Count; i++)
                {
                    String tempString = "";
                    foreach (char c in bidList[i])
                    {
                        if (c != ' ')
                        {
                            tempString += c;
                        }
                    }
                    bidList[i] = tempString;
                }

                for (int i = 0; i < osvdbList.Count; i++)
                {
                    String tempString = "";
                    foreach (char c in osvdbList[i])
                    {
                        if (c != ' ')
                        {
                            tempString += c;
                        }
                    }
                    osvdbList[i] = tempString;
                }

                tempRecord.guiAddEntry(new NessusDataEntry(sqlite_datareader["pluginName"].ToString(),
                                                           sqlite_datareader["ipList"].ToString(),
                                                           sqlite_datareader["description"].ToString(),
                                                           sqlite_datareader["impact"].ToString(),
                                                           (int)RiskFactorFunction.getEnum(sqlite_datareader["riskfactor"].ToString()),
                                                           RiskFactorFunction.getEnum(sqlite_datareader["riskfactor"].ToString()),
                                                           sqlite_datareader["recommendation"].ToString(),
                                                           cveList,
                                                           bidList,
                                                           osvdbList,
                                                           sqlite_datareader["referenceLink"].ToString()));
            }

            sqlite_conn.Close();
            return(tempRecord);
        }
        private DataEntry rowToDataEntry(DataGridViewRow row)
        {
            List <String> cveList = null;

            if (row.Cells[(int)ColumnIndex.CVE].Value == null)
            {
                cveList = new List <string>();
            }
            else
            {
                cveList = row.Cells[(int)ColumnIndex.CVE].Value.ToString().Split(',').ToList <String>();
            }

            List <String> bidList = null;

            if (row.Cells[(int)ColumnIndex.BID].Value == null)
            {
                bidList = new List <string>();
            }
            else
            {
                bidList = row.Cells[(int)ColumnIndex.BID].Value.ToString().Split(',').ToList <String>();
            }

            List <String> osvdbList = null;

            if (row.Cells[(int)ColumnIndex.OSVDB].Value == null)
            {
                osvdbList = new List <string>();
            }
            else
            {
                osvdbList = row.Cells[(int)ColumnIndex.OSVDB].Value.ToString().Split(',').ToList <String>();
            }

            for (int i = 0; i < cveList.Count; i++)
            {
                String tempString = "";
                foreach (char c in cveList[i])
                {
                    if (c != ' ')
                    {
                        tempString += c;
                    }
                }
                cveList[i] = tempString;
            }

            for (int i = 0; i < bidList.Count; i++)
            {
                String tempString = "";
                foreach (char c in bidList[i])
                {
                    if (c != ' ')
                    {
                        tempString += c;
                    }
                }
                bidList[i] = tempString;
            }

            for (int i = 0; i < osvdbList.Count; i++)
            {
                String tempString = "";
                foreach (char c in osvdbList[i])
                {
                    if (c != ' ')
                    {
                        tempString += c;
                    }
                }
                osvdbList[i] = tempString;
            }

            return(new NessusDataEntry(row.Cells[(int)ColumnIndex.PLUGINNAME].Value.ToString(),
                                       row.Cells[(int)ColumnIndex.IPLIST].Value.ToString(),
                                       row.Cells[(int)ColumnIndex.DESCRIPTION].Value.ToString(),
                                       row.Cells[(int)ColumnIndex.IMPACT].Value.ToString(),
                                       (int)RiskFactorFunction.getEnum(row.Cells[(int)ColumnIndex.RISKFACTOR].Value.ToString()),
                                       RiskFactorFunction.getEnum(row.Cells[(int)ColumnIndex.RISKFACTOR].Value.ToString()),
                                       row.Cells[(int)ColumnIndex.RECOMMENDATION].Value.ToString(),
                                       cveList,
                                       bidList,
                                       osvdbList,
                                       row.Cells[(int)ColumnIndex.REFERENCELINK].Value.ToString()));
        }
Beispiel #6
0
        /// <summary>
        /// This is the processData method.
        /// It is used to process each line on the text file.
        /// </summary>
        /// <param name="content"></param>
        protected override void processData(string content)
        {
            if (!String.IsNullOrEmpty(content))
            {
                //if (startHardCodeLineCount)
                //    hardCodeLineCount++;
                // in here, only content start with "Host" and contains "is up"
                // would trigger the action to get the host list
                if (content.Contains("Scan of http://"))
                {
                    int e     = content.IndexOf("Scan of http://");
                    int start = e + 15;
                    int end   = content.IndexOf(":80/", start);
                    if (start < content.Length && end < content.Length)
                    {
                        tempIpList = content.Substring(start, end - start);
                        while (tempIpList.Length > 0 && tempIpList[tempIpList.Length - 1] == ' ')
                        {
                            tempIpList = tempIpList.Substring(0, tempIpList.Length - 1);
                        }
                    }
                }
                else if (content.Contains("Alert details"))
                {
                    startReadEntry = true;
                }
                else if (startReadEntry == true && !finishReadPluginName && content.Contains(pluginNameKey))
                {
                    int start = content.IndexOf(pluginNameKey) + pluginNameKey.Length;
                    int end   = content.IndexOf("</td>", start);
                    tempPluginName       = content.Substring(start, end - start);
                    finishReadPluginName = true;
                }
                //else if (startReadEntry == true && !finishReadPluginName && content.Contains(pluginNameKeyType2))
                //{
                //    int start = pluginNameKeyType2.Length;
                //    int end = content.IndexOf("</td>", start);
                //    tempPluginName = content.Substring(start, end - start);
                //    finishReadPluginName = true;
                //}
                else if (startReadEntry == true && content.Contains(severityKey))
                {
                    int    start = content.IndexOf(severityContentKey) + severityContentKey.Length;
                    int    end   = content.IndexOf("</td>", start);
                    string temp  = content.Substring(start, end - start);
                    tempRiskFactor = RiskFactorFunction.getEnum(temp);    // get risk factor
                }
                else if (startReadEntry == true && content.Contains(descriptionKey))
                {
                    startReadDescription = true;
                }
                else if (startReadEntry == true && startReadDescription == true && content.Contains(descriptionContentKey))
                {
                    int start = content.IndexOf(descriptionContentKey) + descriptionContentKey.Length;
                    int end   = content.IndexOf("</td>", start);
                    tempDescription = content.Substring(start, end - start);
                }
                else if (startReadEntry == true && content.Contains(impactKey))
                {
                    startReadDescription = false;
                    startReadImpact      = true;
                }
                else if (startReadEntry == true && startReadImpact == true && content.Contains(impactContentKey))
                {
                    int start = content.IndexOf(impactContentKey) + impactContentKey.Length;
                    int end   = content.IndexOf("</td>", start);
                    tempImpact = content.Substring(start, end - start);
                }
                else if (startReadEntry == true && content.Contains(recommendationKey))
                {
                    startReadImpact         = false;
                    startReadRecommendation = true;
                }
                else if (startReadEntry == true && startReadRecommendation == true && finishReadRecommendation == false && content.Contains(recommendationContentKey))
                {
                    int start = content.IndexOf(recommendationContentKey) + recommendationContentKey.Length;
                    int end   = content.IndexOf("</td>", start);
                    tempRecommendation = content.Substring(start, end - start);
                }
                else if (startReadEntry == true && content.Contains(affectedItemKey))
                {
                    startReadRecommendation  = false;
                    finishReadRecommendation = true;
                    tempAffectedItemList     = new List <AffectedItem>();
                    startReadAffectedItem    = true;
                }
                else if (startReadEntry == true && startReadAffectedItem == true && content.Contains(affectedItemContentKey))
                {
                    int    start    = content.IndexOf(affectedItemContentKey) + affectedItemContentKey.Length;
                    int    end      = content.IndexOf("</td>", start);
                    String tempName = content.Substring(start, end - start);
                    tempAffectedItem = new AffectedItem(tempName);
                    tempAffectedItemList.Add(tempAffectedItem);
                    startFindAffectedItemDetail = true;

                    //hardCodeLineCount = 0;
                    //startHardCodeLineCount = false;
                }
                else if (startReadEntry == true && startFindAffectedItemDetail == true && content.Contains(affectedItemDetailKey))
                {
                    //startReadAffectedItem = false;
                    startFindAffectedItemDetail = false;
                    startReadAffectedItemDetail = true;
                }
                else if (startReadEntry == true && startReadAffectedItemDetail == true && content.Contains(affectedItemDetailContentKey))
                {
                    int    start      = content.IndexOf(affectedItemDetailContentKey) + affectedItemDetailContentKey.Length;
                    int    end        = content.IndexOf("</td>", start);
                    String tempDetail = content.Substring(start, end - start);
                    tempAffectedItem.addDetail(tempDetail);

                    startFindAffectedItemRequest = true;
                    startFindEndTag = true;
                    //startHardCodeLineCount = true;
                }
                else if (startReadEntry == true && startFindAffectedItemRequest == true && content.Contains(affectedItemRequestKey))
                {
                    startReadAffectedItemDetail  = false;
                    startFindAffectedItemRequest = false;
                    startReadAffectedItemRequest = true;
                }
                else if (startReadEntry == true && startReadAffectedItemRequest == true && content.Contains(affectedItemRequestContentKey))
                {
                    int    start       = content.IndexOf(affectedItemRequestContentKey) + affectedItemRequestContentKey.Length;
                    int    end         = content.IndexOf("</td>", start);
                    String tempRequest = content.Substring(start, end - start);
                    tempAffectedItem.addRequest(tempRequest);

                    startFindAffectedItemResponse = true;
                }
                else if (startReadEntry == true && startFindAffectedItemResponse == true && content.Contains(affectedItemResponseKey))
                {
                    startReadAffectedItemRequest  = false;
                    startFindAffectedItemResponse = false;
                    startReadAffectedItemResponse = true;
                }
                else if (startReadEntry == true && startReadAffectedItemResponse == true && content.Contains(affectedItemResponseContentKey))
                {
                    int    start        = content.IndexOf(affectedItemRequestContentKey) + affectedItemRequestContentKey.Length;
                    int    end          = content.IndexOf("</td>", start);
                    String tempResponse = content.Substring(start, end - start);
                    tempAffectedItem.addResponse(tempResponse);
                }
                else if (startReadEntry == true && startFindEndTag == true && (content.Contains("<tr style=\"height:5px\">") || content.Contains("</body></html>") || content.Contains("<tr style=\"height:13px\">")))
                {
                    AcunetixDataEntry entry = new AcunetixDataEntry(tempPluginName,
                                                                    tempIpList,
                                                                    tempDescription,
                                                                    tempImpact,
                                                                    tempRiskFactor,
                                                                    tempRecommendation,
                                                                    tempFileName,
                                                                    tempAffectedItemList,
                                                                    "",
                                                                    "",
                                                                    "",
                                                                    "",
                                                                    "",
                                                                    "",
                                                                    "",
                                                                    null);
                    this.tempRecord.acunetixAddEntry(entry);

                    tempPluginName       = "";
                    tempDescription      = "";
                    tempImpact           = "";
                    tempRiskFactor       = RiskFactor.NULL;
                    tempRecommendation   = "";
                    tempAffectedItem     = null;
                    tempAffectedItemList = null;

                    //hardCodeLineCount = 0;
                    //startHardCodeLineCount = false;

                    startReadDescription        = false;
                    startReadImpact             = false;
                    startReadRecommendation     = false;
                    finishReadRecommendation    = false;
                    startReadAffectedItem       = false;
                    startFindAffectedItemDetail = false;
                    startReadAffectedItemDetail = false;
                    finishReadPluginName        = false;

                    startFindAffectedItemRequest  = false;
                    startReadAffectedItemRequest  = false;
                    startFindAffectedItemResponse = false;
                    startReadAffectedItemResponse = false;

                    startFindEndTag = false;
                }
            }
        }
        //private int tempCounter = 0;
        #endregion

        protected override void startTag(string tag, Dictionary <string, string> attributes)
        {
            if (tag.CompareTo("SecScan") == 0)
            {
                this.tempIpList = attributes["IP"];
                elementStack.Push(tag);
            }
            else if (tag.CompareTo("Check") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("SecScan") == 0)
                {
                    if (attributes.ContainsKey("Grade") && attributes.ContainsKey("Name"))
                    {
                        this.tempRiskFactor = RiskFactorFunction.getEnum(scoreLookup[int.Parse(attributes["Grade"])]);

                        if (this.tempRiskFactor != RiskFactor.NULL && this.tempRiskFactor != RiskFactor.NA)
                        {
                            this.tempPluginName = attributes["Name"];
                            elementStack.Push(tag);
                        }
                        else
                        {
                            this.tempRiskFactor = RiskFactor.NULL;
                        }
                    }
                }
            }
            else if (tag.CompareTo("Advice") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Check") == 0)
                {
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("Detail") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Check") == 0)
                {
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("UpdateData") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Detail") == 0)
                {
                    if (attributes.ContainsKey("IsInstalled") &&
                        attributes.ContainsKey("RestartRequired") &&
                        attributes.ContainsKey("Severity"))
                    {
                        this.tempRiskFactor = RiskFactor.NULL;
                        elementStack.Push(tag);

                        if (attributes["IsInstalled"] == "false" ||
                            attributes["RestartRequired"] == "true")
                        {
                            this.tempRiskFactor = RiskFactorFunction.getEnum(severityLookup[int.Parse(attributes["Severity"])]);

                            if (tempRiskFactor != RiskFactor.NA)
                            {
                                tempPluginId = attributes["ID"];

                                if (String.IsNullOrEmpty(tempPluginName))
                                {
                                    tempPluginName = tempPluginId;
                                }
                                else
                                {
                                    tempPluginName = tempPluginId;
                                }

                                if (attributes["IsInstalled"] == "false")
                                {
                                    tempDescription = "The software update was not installed.";
                                }
                                else
                                {
                                    tempDescription = "Installation of the software update was not completed. You must restart your computer to finish the installation";
                                }
                            }
                        }
                    }
                }
            }
            else if (tag.CompareTo("Title") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("UpdateData") == 0)
                {
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("References") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("UpdateData") == 0)
                {
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("BulletinURL") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("References") == 0)
                {
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("Head") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Detail") == 0)
                {
                    tableHeader.Clear();
                    tableColCounter = 0;
                    isTableHeader   = true;
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("Row") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Detail") == 0)
                {
                    if (attributes.ContainsKey("Grade"))
                    {
                        RiskFactor tempRF = RiskFactorFunction.getEnum(scoreLookup[int.Parse(attributes["Grade"])]);

                        if (tempRiskFactor != RiskFactor.NULL &&
                            tempRiskFactor != RiskFactor.NA)
                        {
                            this.tempRiskFactor = tempRF;
                            tableColCounter     = 0;
                            isTableHeader       = false;
                            elementStack.Push(tag);
                        }
                    }
                }
            }
            else if (tag.CompareTo("Col") == 0)
            {
                if (elementStack.Count != 0 &&
                    tempRiskFactor != RiskFactor.NULL &&
                    tempRiskFactor != RiskFactor.NA &&
                    (elementStack.Peek().CompareTo("Row") == 0 ||
                     elementStack.Peek().CompareTo("Head") == 0))
                {
                    string tempTag = elementStack.Pop();
                    if (elementStack.Peek().CompareTo("Detail") == 0)
                    {
                        elementStack.Push(tempTag);
                        elementStack.Push(tag);
                    }
                    else
                    {
                        elementStack.Push(tempTag);
                    }
                }
            }
            else if (tag.CompareTo("SETTINGS") == 0)
            {
                elementStack.Push(tag);
            }
            else if (tag.CompareTo("OtherIDs") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("UpdateData") == 0)
                {
                    //Console.WriteLine(tag);
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("OtherID") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("OtherIDs") == 0)
                {
                    if (attributes.ContainsKey("Type"))
                    {
                        switch (attributes["Type"])
                        {
                        case "CVE":
                            tempType = "CVE";
                            //Console.WriteLine(tag);
                            elementStack.Push(tag);
                            break;

                        case "BID":
                            tempType = "BID";
                            //Console.WriteLine(tag);
                            elementStack.Push(tag);
                            break;

                        case "OSVDB":
                            tempType = "OSVDB";
                            //Console.WriteLine(tag);
                            elementStack.Push(tag);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
        }
 override protected void pushContent(string content)
 {
     if (elementStack.Count != 0)
     {
         if (elementStack.Peek().CompareTo("StartURL") == 0)
         {
             if (content.Contains("http://"))
             {
                 content = content.Substring(content.IndexOf("http://") + "http://".Length);
             }
             if (content.Contains(":80/"))
             {
                 content = content.Substring(0, content.IndexOf(":80/"));
             }
             tempIpList = content;
         }
         else if (elementStack.Peek().CompareTo("Name") == 0)
         {
             tempPluginName = content;
         }
         else if (elementStack.Peek().CompareTo("Details") == 0)
         {
             if (tempAffectedItem != null)
             {
                 tempAffectedItem.addDetail(content);
             }
         }
         else if (elementStack.Peek().CompareTo("Affects") == 0)
         {
             if (tempAffectedItem != null)
             {
                 tempAffectedItem.setNameANDSubDirectory(content);
             }
         }
         else if (elementStack.Peek().CompareTo("Severity") == 0)
         {
             tempRiskFactor = RiskFactorFunction.getEnum(content);
         }
         else if (elementStack.Peek().CompareTo("Impact") == 0)
         {
             tempImpact = content;
         }
         else if (elementStack.Peek().CompareTo("Description") == 0)
         {
             tempDescription = content;
         }
         else if (elementStack.Peek().CompareTo("Recommendation") == 0)
         {
             tempRecommendation = content;
         }
         else if (elementStack.Peek().CompareTo("Request") == 0)
         {
             if (tempAffectedItem != null)
             {
                 tempAffectedItem.addRequest(content);
             }
         }
         else if (elementStack.Peek().CompareTo("Response") == 0)
         {
             if (tempAffectedItem != null)
             {
                 tempAffectedItem.addResponse(content);
             }
         }
         else if (elementStack.Peek().CompareTo("ModuleName") == 0)
         {
             tempModuleName = content;
         }
         else if (elementStack.Peek().CompareTo("IsFalsePositive") == 0)
         {
             tempIsFalsePositive = content;
         }
         else if (elementStack.Peek().CompareTo("AOP_SourceFile") == 0)
         {
             tempAOP_SourceFile = content;
         }
         else if (elementStack.Peek().CompareTo("AOP_SourceLine") == 0)
         {
             tempAOP_SourceLine = content;
         }
         else if (elementStack.Peek().CompareTo("AOP_Additional") == 0)
         {
             tempAOP_Additional = content;
         }
         else if (elementStack.Peek().CompareTo("Type") == 0)
         {
             tempType = content;
         }
         else if (elementStack.Peek().CompareTo("DetailedInformation") == 0)
         {
             tempDetailedInformation = content;
         }
         else if (elementStack.Peek().CompareTo("Database") == 0)
         {
             if (tempAcunetixReference != null)
             {
                 tempAcunetixReference.setDatabases(content);
             }
         }
         else if (elementStack.Peek().CompareTo("URL") == 0)
         {
             if (tempAcunetixReference != null)
             {
                 tempAcunetixReference.setUrl(content);
             }
         }
     }
 }
        /// <summary>
        /// This is the startTag method.
        /// It is used to handle the start tag/self closed tag from the XML file.
        /// </summary>
        /// <param name="tag">xml start tag name</param>
        /// <param name="attributes">xml tag's attributes</param>
        protected override void startTag(string tag, Dictionary <string, string> attributes)
        {
            if (tag.CompareTo("SecScan") == 0)
            {
                this.tempIpList = attributes["IP"];
                elementStack.Push(tag);
            }
            else if (tag.CompareTo("Check") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("SecScan") == 0)
                {
                    if (attributes.ContainsKey("Grade") && attributes.ContainsKey("Name"))
                    {
                        tempCheckGrade      = attributes["Grade"];
                        this.tempRiskFactor = RiskFactorFunction.getEnum(scoreLookup[int.Parse(attributes["Grade"])]);

                        this.tempPluginName = attributes["Name"];
                        this.tempCheckName  = attributes["Name"];
                        elementStack.Push(tag);
                        if (this.tempRiskFactor != RiskFactor.NULL && this.tempRiskFactor != RiskFactor.NA)
                        {
                        }
                        else
                        {
                            this.tempRiskFactor = RiskFactor.NULL;
                        }
                    }
                    if (attributes.ContainsKey("ID"))
                    {
                        this.tempCheckID = attributes["ID"];
                    }
                    if (attributes.ContainsKey("Type"))
                    {
                        this.tempCheckType = attributes["Type"];
                    }
                    if (attributes.ContainsKey("Cat"))
                    {
                        this.tempCheckCat = attributes["Cat"];
                    }
                    if (attributes.ContainsKey("Rank"))
                    {
                        this.tempCheckRank = attributes["Rank"];
                    }
                    //if (attributes.ContainsKey("Name"))
                    //    this.tempCheckID = attributes["Name"];
                    if (attributes.ContainsKey("URL1"))
                    {
                        this.tempCheckURL1 = attributes["URL1"];
                    }
                    if (attributes.ContainsKey("URL2"))
                    {
                        this.tempCheckURL2 = attributes["URL2"];
                    }
                    if (attributes.ContainsKey("GroupID"))
                    {
                        this.tempCheckGroupID = attributes["GroupID"];
                    }
                    if (attributes.ContainsKey("GroupName"))
                    {
                        this.tempCheckGroupName = attributes["GroupName"];
                    }
                }
            }
            else if (tag.CompareTo("Advice") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Check") == 0)
                {
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("Detail") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Check") == 0)
                {
                    //if (attributes.ContainsKey("text"))
                    //    tempDetailText = attributes["text"];
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("UpdateData") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Detail") == 0)
                {
                    if (attributes.ContainsKey("IsInstalled") &&
                        attributes.ContainsKey("RestartRequired") &&
                        attributes.ContainsKey("Severity"))
                    {
                        this.tempRiskFactor = RiskFactor.NULL;
                        elementStack.Push(tag);

                        if (attributes["IsInstalled"] == "false" ||
                            attributes["RestartRequired"] == "true")
                        {
                            this.tempUpdateDataIsInstalled     = attributes["IsInstalled"];
                            this.tempUpdateDataRestartRequired = attributes["RestartRequired"];
                            this.tempUpdateDataSeverity        = int.Parse(attributes["Severity"]);

                            this.tempRiskFactor = RiskFactorFunction.getEnum(severityLookup[int.Parse(attributes["Severity"])]);

                            if (tempRiskFactor != RiskFactor.NA)
                            {
                                tempPluginId = attributes["ID"];

                                //if (String.IsNullOrEmpty(tempPluginName)) {
                                //    tempPluginName = tempPluginId;
                                //}
                                //else {
                                //    tempPluginName = tempPluginId;
                                //}
                                tempPluginName = tempPluginId;
                                if (attributes["IsInstalled"] == "false")
                                {
                                    tempDescription = "The software update was not installed.";
                                }
                                else
                                {
                                    tempDescription = "Installation of the software update was not completed. You must restart your computer to finish the installation";
                                }
                            }
                        }
                    }

                    if (attributes.ContainsKey("ID"))
                    {
                        this.tempUpdateDataID = attributes["ID"];
                    }
                    if (attributes.ContainsKey("GUID"))
                    {
                        this.tempUpdateDataGUID = attributes["GUID"];
                    }
                    if (attributes.ContainsKey("BulletinID"))
                    {
                        this.tempUpdateDataBulletinID = attributes["BulletinID"];
                    }
                    if (attributes.ContainsKey("KBID"))
                    {
                        this.tempUpdateDataKBID = attributes["KBID"];
                    }
                    if (attributes.ContainsKey("Type"))
                    {
                        this.tempUpdateDataType = attributes["Type"];
                    }
                }
            }
            else if (tag.CompareTo("Title") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("UpdateData") == 0)
                {
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("References") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("UpdateData") == 0)
                {
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("BulletinURL") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("References") == 0)
                {
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("Head") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Detail") == 0)
                {
                    tableHeader     = new Dictionary <int, string>();
                    tableColCounter = 0;
                    isTableHeader   = true;
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("Row") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("Detail") == 0)
                {
                    if (attributes.ContainsKey("Grade"))
                    {
                        //RiskFactor tempRF = RiskFactorFunction.getEnum(scoreLookup[int.Parse(attributes["Grade"])]);

                        //if (tempRiskFactor != RiskFactor.NULL &&
                        //    tempRiskFactor != RiskFactor.NA) {

                        //this.tempRiskFactor = tempRF;tableColCounter = 0;
                        if (tableRowData == null)
                        {
                            tableRowData = new Dictionary <int, MBSARow>();
                        }
                        tableRowDataCounter++;
                        tableRowData[tableRowDataCounter] = new MBSARow();
                        tableRowData[tableRowDataCounter].setGrade(attributes["Grade"]);

                        tableColCounter = 0;
                        isTableHeader   = false;
                        elementStack.Push(tag);
                        //}
                    }
                }
            }
            else if (tag.CompareTo("Col") == 0)
            {
                if (elementStack.Count != 0 &&
                    //tempRiskFactor != RiskFactor.NULL &&
                    //tempRiskFactor != RiskFactor.NA &&
                    (elementStack.Peek().CompareTo("Row") == 0 ||
                     elementStack.Peek().CompareTo("Head") == 0))
                {
                    string tempTag = elementStack.Pop();
                    if (elementStack.Peek().CompareTo("Detail") == 0)
                    {
                        elementStack.Push(tempTag);
                        elementStack.Push(tag);
                    }
                    else
                    {
                        elementStack.Push(tempTag);
                    }
                }
            }
            else if (tag.CompareTo("SETTINGS") == 0)
            {
                elementStack.Push(tag);
            }
            else if (tag.CompareTo("OtherIDs") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("UpdateData") == 0)
                {
                    //Console.WriteLine(tag);
                    elementStack.Push(tag);
                }
            }
            else if (tag.CompareTo("OtherID") == 0)
            {
                if (elementStack.Count != 0 &&
                    elementStack.Peek().CompareTo("OtherIDs") == 0)
                {
                    if (attributes.ContainsKey("Type"))
                    {
                        switch (attributes["Type"])
                        {
                        case "CVE":
                            tempType = "CVE";
                            //Console.WriteLine(tag);
                            elementStack.Push(tag);
                            break;

                        case "BID":
                            tempType = "BID";
                            //Console.WriteLine(tag);
                            elementStack.Push(tag);
                            break;

                        case "OSVDB":
                            tempType = "OSVDB";
                            //Console.WriteLine(tag);
                            elementStack.Push(tag);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
        }