Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sheet as index of vulnerability #1

Open
fiorenzi opened this issue Aug 20, 2015 · 0 comments
Open

Sheet as index of vulnerability #1

fiorenzi opened this issue Aug 20, 2015 · 0 comments

Comments

@fiorenzi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant