18 class VirusTotalDomainReportDialog(QDialog, Ui_VirusTotalDomainReportDialog): |
18 class VirusTotalDomainReportDialog(QDialog, Ui_VirusTotalDomainReportDialog): |
19 """ |
19 """ |
20 Class implementing a dialog to show the VirusTotal domain report. |
20 Class implementing a dialog to show the VirusTotal domain report. |
21 """ |
21 """ |
22 def __init__(self, domain, resolutions, urls, subdomains, |
22 def __init__(self, domain, resolutions, urls, subdomains, |
23 bdCategory, tmCategory, wtsCategory, whois, parent=None): |
23 categories, whois, parent=None): |
24 """ |
24 """ |
25 Constructor |
25 Constructor |
26 |
26 |
27 @param domain domain name |
27 @param domain domain name |
28 @type str |
28 @type str |
30 @type list of dict |
30 @type list of dict |
31 @param urls list of detected URLs |
31 @param urls list of detected URLs |
32 @type list of dict |
32 @type list of dict |
33 @param subdomains list of subdomains |
33 @param subdomains list of subdomains |
34 @type list of str |
34 @type list of str |
35 @param bdCategory BitDefender categorization |
35 @param categories dictionary with various categorizations with keys |
36 @type str |
36 'bitdefender', 'sophos', 'valkyrie', 'alpha', 'forcepoint' |
37 @param tmCategory TrendMicro categorization |
37 @type dict |
38 @type str |
|
39 @param wtsCategory Websense ThreatSeeker categorization |
|
40 @type str |
|
41 @param whois whois information |
38 @param whois whois information |
42 @type str |
39 @type str |
43 @param parent reference to the parent widget |
40 @param parent reference to the parent widget |
44 @type QWidget |
41 @type QWidget |
45 """ |
42 """ |
60 ) |
57 ) |
61 self.resolutionsList.resizeColumnToContents(0) |
58 self.resolutionsList.resizeColumnToContents(0) |
62 self.resolutionsList.resizeColumnToContents(1) |
59 self.resolutionsList.resizeColumnToContents(1) |
63 self.resolutionsList.sortByColumn(0, Qt.SortOrder.AscendingOrder) |
60 self.resolutionsList.sortByColumn(0, Qt.SortOrder.AscendingOrder) |
64 |
61 |
65 if not urls: |
|
66 self.detectedUrlsGroup.setVisible(False) |
|
67 for url in urls: |
62 for url in urls: |
68 QTreeWidgetItem( |
63 QTreeWidgetItem( |
69 self.urlsList, |
64 self.urlsList, |
70 [url["url"], |
65 [url["url"], |
71 self.tr("{0}/{1}", "positives / total").format( |
66 self.tr("{0}/{1}", "positives / total").format( |
75 self.urlsList.resizeColumnToContents(0) |
70 self.urlsList.resizeColumnToContents(0) |
76 self.urlsList.resizeColumnToContents(1) |
71 self.urlsList.resizeColumnToContents(1) |
77 self.urlsList.resizeColumnToContents(2) |
72 self.urlsList.resizeColumnToContents(2) |
78 self.urlsList.sortByColumn(0, Qt.SortOrder.AscendingOrder) |
73 self.urlsList.sortByColumn(0, Qt.SortOrder.AscendingOrder) |
79 |
74 |
80 if not subdomains: |
75 if subdomains: |
81 self.subdomainsGroup.setVisible(False) |
|
82 else: |
|
83 self.subdomainsList.addItems(subdomains) |
76 self.subdomainsList.addItems(subdomains) |
84 self.subdomainsList.sortItems() |
77 self.subdomainsList.sortItems() |
85 |
78 |
86 self.bdLabel.setText(bdCategory) |
79 self.bdLabel.setText(categories["bitdefender"]) |
87 self.tmLabel.setText(tmCategory) |
80 self.soLabel.setText(categories["sophos"]) |
88 self.wtsLabel.setText(wtsCategory) |
81 self.vvLabel.setText(categories["valkyrie"]) |
|
82 self.amLabel.setText(categories["alpha"]) |
|
83 self.ftsLabel.setText(categories["forcepoint"]) |
89 |
84 |
90 self.__whois = whois |
85 self.__whois = whois |
91 self.__whoisDomain = domain |
86 self.__whoisDomain = domain |
92 self.whoisButton.setEnabled(bool(whois)) |
87 self.whoisButton.setEnabled(bool(whois)) |
93 |
88 |