Closed zepernick03 closed 4 years ago
You may want to look at the CSV library.
Can I simply write my output to a text file? Using something like this? def main(): file = open("alerts.txt","w")
file.write("here is the query"
file.close()
if name== "main": main()
thats all up to you at that point.
Beginner using Pytenable: What is the next step to write this output to a CSV file? Is there a forum or community resource?
from tenable.sc import TenableSC import pprint import getpass
Tenable login info
username = 'name' p = getpass.getpass(prompt='Password:')
sc = TenableSC('URL') sc.login(username,p)
for vuln in sc.analysis.vulns(('pluginID','=','125063,125073,125060,125313'),tool='vulndetails'): print('{ip}:{pluginID}:{pluginName}:{severity}'.format(**vuln))
sc.logout()