Skip to content

Commit

Permalink
Fix path calculation on vulndbToCsv.py
Browse files Browse the repository at this point in the history
  • Loading branch information
montive committed Jun 15, 2018
1 parent 2cae1bc commit 21508ba
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions helpers/vulndbToCsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
'''
Copyright (C) 2016 Infobyte LLC (http://www.infobytesec.com/)
Author: Ezequiel Tavella
See the file 'doc/LICENSE' for the license information
This script generate a CSV file with information about the vulndb database.
CSV Format:
cwe,name,desc_summary,description,resolution,exploitation,references
'''
from subprocess import call
from os import walk
from os import walk, path
import json
import csv

Expand Down Expand Up @@ -100,18 +99,17 @@ def main():
for file_db in files:

print '[*]Parsing ' + file_db
with open(root + file_db, 'r') as file_object:
with open(path.join(root, file_db), 'r') as file_object:

csv_content = JsonToCsv(file_object)

result = (
csv_content.cwe,
csv_content.name,
csv_content.description,
csv_content.resolution,
'',
' '.join(csv_content.references),
csv_content.severity
csv_content.cwe,
csv_content.name,
csv_content.description,
csv_content.resolution,
'',
' '.join(csv_content.references or []),
csv_content.severity
)

writer.writerow(result)
Expand Down

0 comments on commit 21508ba

Please sign in to comment.