Skip to content

Sheet as index of vulnerability  #1

@fiorenzi

Description

@fiorenzi

Hi, I have used the output of openvas_to_reporto to add new sheet called Vulnerability Index with follow colums: impact:critical, high, medium; title, number of host involved, worksheet name; ordered by impact, and inside each impact voice, oredered by number of host involved.
this can help sysop to select which systems to start to work on.
I have made it with vba (i am not a vba programmer) but could be better do inside the tool in python.
here the bad vba I have used

Sub sintesi()
Sheets("indice").Select
Sheets("indice").Range(Cells(2, 1).End(xlDown), Cells(2, 1).End(xlToRight)).ClearContents
Worksheets("indice").Range("A1:E1").Columns.AutoFit
Dim riga As Integer
Dim nhost As Integer
Cells(1, 1) = "WorkSheet"
Cells(1, 2) = "Impact"
Cells(1, 3) = "Title"
Cells(1, 4) = "Nr. Host Affected"
riga = 3
For X = 3 To Worksheets.Count
If Worksheets(X).Range("C6") = "Critical" Then
Cells(riga, 1) = Worksheets(X).Name
Cells(riga, 2) = "CRITICAL"
Set mys = Sheets(Sheets("indice").Cells(riga, 1).Value)
For Each cella In mys.Range("C2")
cella.Copy Destination:=Sheets("indice").Cells(riga, 1).End(xlToRight).Offset(0, 1)
Next
nhost = Sheets(Worksheets(X).Name).Range("C65000").End(xlUp).Row
Cells(riga, 4) = nhost - 9
riga = riga + 1
End If
Next X
riga = riga + 2

For X = 3 To Worksheets.Count
If Worksheets(X).Range("C6") = "High" Then
Cells(riga, 1) = Worksheets(X).Name
Cells(riga, 2) = "High"
Set mys = Sheets(Sheets("indice").Cells(riga, 1).Value)
For Each cella In mys.Range("C2")
cella.Copy Destination:=Sheets("indice").Cells(riga, 1).End(xlToRight).Offset(0, 1)
Next
nhost = Sheets(Worksheets(X).Name).Range("C65000").End(xlUp).Row
Cells(riga, 4) = nhost - 9
riga = riga + 1
End If
Next X

riga = riga + 2

For X = 3 To Worksheets.Count
If Worksheets(X).Range("C6") = "Medium" Then
Cells(riga, 1) = Worksheets(X).Name
Cells(riga, 2) = "Medium"
Set mys = Sheets(Sheets("indice").Cells(riga, 1).Value)
For Each cella In mys.Range("C2")
cella.Copy Destination:=Sheets("indice").Cells(riga, 1).End(xlToRight).Offset(0, 1)
Next
nhost = Sheets(Worksheets(X).Name).Range("C65000").End(xlUp).Row
Cells(riga, 4) = nhost - 9
riga = riga + 1
End If
Next X

Application.CutCopyMode = False
End Sub

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions