def main(): global vfeed info = vFeedApi.vFeedInfo() if len(sys.argv) == 3: myCVE = sys.argv[2] apiMethod = sys.argv[1] else: print '' print '-----------------------------------------------------------' print info.get_version()['title'] print ' version ' + info.get_version()['build'] print '-----------------------------------------------------------' print '' print '[usage]: ' + str(sys.argv[0]) + ' <API Method> <CVE id>' print '' print '[info] available API methods:' print 'checkCVE | checkCPE | checkCVSS | checkCWE | checkREF | checkRISK' print 'checkOVAL | checkNESSUS | checkEDB | checkSAINT' print 'checkMS | checkKB | checkAIXAPAR | checkREDHAT | checkSUSE | checkDEBIAN | checkMANDRIVA' print 'exportXML (for exporting the vFeed XML file)' exit(0) vfeed = vFeedApi.vFeed(myCVE) if apiMethod == "checkCVE": call_checkCVE() exit(0) if apiMethod == "checkCVSS": call_checkCVSS() exit(0) if apiMethod == "checkREF": call_checkREF() exit(0) if apiMethod == "checkCWE": call_checkCWE() exit(0) if apiMethod == "checkCPE": call_checkCPE() exit(0) if apiMethod == "checkOVAL": call_checkOVAL() exit(0) if apiMethod == "checkNESSUS": call_checkNESSUS() exit(0) if apiMethod == "checkEDB": call_checkEDB() exit(0) if apiMethod == "checkSAINT": call_checkSAINT() exit(0) if apiMethod == "checkMS": call_checkMS() exit(0) if apiMethod == "checkKB": call_checkKB() exit(0) if apiMethod == "checkAIXAPAR": call_checkAIXAPAR() exit(0) if apiMethod == "checkREDHAT": call_checkREDHAT() exit(0) if apiMethod == "checkDEBIAN": call_checkDEBIAN() exit(0) if apiMethod == "checkMANDRIVA": call_checkMANDRIVA() exit(0) if apiMethod == "checkSUSE": call_checkSUSE() exit(0) if apiMethod == "checkRISK": call_checkRISK() exit(0) if apiMethod == "exportXML": vfeed.exportXML() exit(0) else: print'[error] the method %s is not implemented' % apiMethod
#!/usr/bin/env python from lib import vFeedApi from lib import config as config ''' vFeedAPI_calls_1.py - Sample script to call methods from your programs ''' # create an instance of the class vFeedInfo print '[instance] creating an instance with vFeedApi.vFeedInfo() ' info = vFeedApi.vFeedInfo() print '[invoking] the get_version() method ' print 'version: ', info.get_version()['build'] print '[invoking] the get_owner() method ' print 'author (if you want to get in touch and say hello):', info.get_owner()['author'] print '[invoking] the get_config() method (note that the values are returned in dict. You can then read any key value you need ..' print 'vFeed global config returned as dict:', info.get_config()['primary'] # Invoking the vFeed class #cve = "CVE-2008-1447" cve = "CVE-2013-3238" print '[setting] using cve ', cve
#!/usr/bin/env python from lib import vFeedApi from lib import config as config ''' vFeedAPI_calls_1.py - Sample script to call methods from your programs ''' # create an instance of the class vFeedInfo print '[instance] creating an instance with vFeedApi.vFeedInfo() ' info = vFeedApi.vFeedInfo() print '[invoking] the get_version() method ' print 'version: ', info.get_version()['build'] print '[invoking] the get_owner() method ' print 'author (if you want to get in touch and say hello):', info.get_owner( )['author'] print '[invoking] the get_config() method (note that the values are returned in dict. You can then read any key value you need ..' print 'vFeed global config returned as dict:', info.get_config()['primary'] # Invoking the vFeed class #cve = "CVE-2008-1447" cve = "CVE-2013-3238" print '[setting] using cve ', cve # create an instance of the class vFeed and pass the CVE print '[instance] creating an instance with vFeedApi.vFeed(cve) '
def main(): global vfeed info = vFeedApi.vFeedInfo() if len(sys.argv) == 3: myCVE = sys.argv[2] apiMethod = sys.argv[1] else: print '' print '-----------------------------------------------------------' print info.get_version()['title'] print ' version ' + info.get_version( )['build'] print '-----------------------------------------------------------' print '' print '[usage]: ' + str(sys.argv[0]) + ' <API Method> <CVE id>' print '' print '[info] available API methods:' print 'checkCVE | checkCPE | checkCVSS | checkCWE | checkREF | checkRISK' print 'checkOVAL | checkNESSUS | checkEDB | checkSAINT' print 'checkMS | checkKB | checkAIXAPAR | checkREDHAT | checkSUSE | checkDEBIAN | checkMANDRIVA' print 'exportXML (for exporting the vFeed XML file)' exit(0) vfeed = vFeedApi.vFeed(myCVE) if apiMethod == "checkCVE": call_checkCVE() exit(0) if apiMethod == "checkCVSS": call_checkCVSS() exit(0) if apiMethod == "checkREF": call_checkREF() exit(0) if apiMethod == "checkCWE": call_checkCWE() exit(0) if apiMethod == "checkCPE": call_checkCPE() exit(0) if apiMethod == "checkOVAL": call_checkOVAL() exit(0) if apiMethod == "checkNESSUS": call_checkNESSUS() exit(0) if apiMethod == "checkEDB": call_checkEDB() exit(0) if apiMethod == "checkSAINT": call_checkSAINT() exit(0) if apiMethod == "checkMS": call_checkMS() exit(0) if apiMethod == "checkKB": call_checkKB() exit(0) if apiMethod == "checkAIXAPAR": call_checkAIXAPAR() exit(0) if apiMethod == "checkREDHAT": call_checkREDHAT() exit(0) if apiMethod == "checkDEBIAN": call_checkDEBIAN() exit(0) if apiMethod == "checkMANDRIVA": call_checkMANDRIVA() exit(0) if apiMethod == "checkSUSE": call_checkSUSE() exit(0) if apiMethod == "checkRISK": call_checkRISK() exit(0) if apiMethod == "exportXML": vfeed.exportXML() exit(0) else: print '[error] the method %s is not implemented' % apiMethod