TheGroundZero / openvasreporting

OpenVAS Reporting: Convert OpenVAS XML report files to reports
Other
131 stars 45 forks source link

Unique hosts on Affected Hosts on Vulnerability Summary #38

Closed EvilCookie25 closed 1 year ago

EvilCookie25 commented 1 year ago

Hello and thank you for the work done here.

I was trying to figure out how to change the "Total" column on "Affected Hosts" to show only the number of unique real hosts across all the Treat Levels instead of the sum of the Threat Levels.

I see a similar request was asked but I didn't find the option/code to change this value, so a few hours facing this problem with no solution for me, the last bullet I have its asking here so maybe anyone can help me.

Kind regards!

TheGroundZero commented 1 year ago

Hi @EvilCookie25

It's been a long while since I've looked at this code and it probably can use a few updates.

To get unique hosts, you would probably need to add a check in the code collecting the numbers to see if a host is already present in the list. Another option would be to use a dictionary with the host as key and then some metrics as value, such that counting the keys a.k.a. hosts would give you a count of unique hosts in the report.

EvilCookie25 commented 1 year ago

Thank you for your response. @TheGroundZero

Since I have 0 idea on python, I end up setting an output on a for loop identifying all host.ip of every .xml to a txt, then removing duplicates and setting the output on the D9 cell. Not the best solution of course but at least works for me.