public void GenerateShortInfo(object value) { GoShape shape = this.Background as GoShape; if (value is string) { string obj = (string)value; Text = obj; Label.Multiline = false; Label.Bold = true; if (shape != null) { shape.FillHalfGradient(myNwoodsNamespaceColor); } } else if (value is Scan) { var obj = (Scan)value; Text = $"{obj.StartURL}{Environment.NewLine}[{obj.WebServer} {obj.Banner} {obj.Technologies}]"; Label.Multiline = true; Label.Bold = true; if (shape != null) { shape.FillHalfGradient(myClassPenColor); } } else if (value is SiteFile) { var obj = (SiteFile)value; Text = $"[{obj.Name}] {obj.URL}"; Label.Multiline = false; Label.Bold = false; if (shape != null) { shape.BrushColor = Color.DarkGray; } } else if (value is ReportItem) { var obj = (ReportItem)value; if (obj.CVEList.Count > 0) { Text = $"漏洞位置:[{obj.Affects}] 漏洞名称:{obj.Name}{Environment.NewLine}[{obj.Severity}] [{obj.Type}] CVE:{obj.CVEList[0].Id}"; } else { Text = $"[{obj.Severity}] [{obj.Type}] {obj.Name}"; } Label.Multiline = true; if (shape != null) { switch (obj.Severity) { case "high": shape.BrushColor = Color.Red; break; case "medium": shape.BrushColor = Color.Yellow; break; case "low": shape.BrushColor = Color.Blue; break; case "info": shape.BrushColor = Color.Green; break; } } } }
public void GenerateLongInfo(object value) { GoShape shape = this.Background as GoShape; if (value is string) { string obj = (string)value; Text = obj; Label.Multiline = false; Label.Bold = true; if (shape != null) { shape.FillHalfGradient(myNwoodsNamespaceColor); } } else if (value is Scan) { var obj = (Scan)value; Text = $"目标URL:{obj.StartURL}{Environment.NewLine} OS:{obj.Os} WebServer:{obj.WebServer} Banner:{obj.Banner} Technologies:{obj.Technologies}]{Environment.NewLine}"; Label.Multiline = true; Label.Bold = true; if (shape != null) { shape.FillHalfGradient(myClassPenColor); } } else if (value is SiteFile) { var obj = (SiteFile)value; Text = $"[{obj.Name}] {obj.URL}"; Label.Multiline = false; Label.Bold = false; if (shape != null) { shape.FillHalfGradient(mySystemNamespaceBrushColor); } } else if (value is ReportItem) { var obj = (ReportItem)value; if (obj.CVEList.Count > 0) { Text = $"漏洞位置:[{obj.Affects}] 漏洞名称:{obj.Name}{Environment.NewLine}[{obj.Severity}] [{obj.Type}] CVE:{obj.CVEList[0].Id}{Environment.NewLine} 请求:{obj.TechnicalDetails.Request}{Environment.NewLine}应答:{obj.TechnicalDetails.Response}"; } else { Text = $"[{obj.Severity}] [{obj.Type}] {obj.Name}{Environment.NewLine} 请求:{obj.TechnicalDetails.Request}{Environment.NewLine}应答:{obj.TechnicalDetails.Response}"; } Label.Multiline = true; if (shape != null) { switch (obj.Severity) { case "high": shape.FillHalfGradient(Color.Red); break; case "medium": shape.FillHalfGradient(Color.Yellow); break; case "low": shape.FillHalfGradient(Color.Blue); break; case "info": shape.FillHalfGradient(Color.Green); break; } } } }