def __init__(self, host='192.168.74.128', port='8834'): self.host = host self.port = port self.headers = {"Content-type":"application/x-www-form-urlencoded",\ "Accept":"text/plain",\ "Referer": "https://10.0.0.7:8834/NessusClient.swf"} conn = connector() self.scan = Scan(conn) self.report = Report(conn)
"""this method will download report of scan with specified uuid""" chaptersList = self.report.chapter_list() chapters = ';'.join(chaptersList['chapters']) file = self.report.chapter(uuid, chapters, format) self.report.fileXsltDownload(file) def savetofile(file_path, content): """save content to file """ f = open(file_path, "wb") print(content) f.write(content) f.close() if __name__ == '__main__': """ I wrote this project for practise python. author: Lu Yun Fei email: [email protected] """ conn = connector() policy = Policy(conn) #ret = policy.list() policy.file_upload() #print(ET.tostring()) # #for member in ret: # ret = policy.download(member['policyID']) # print(ret) #nessus = Nessus() #nessus.run() print('End.')