Пример #1
0
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
Пример #2
0
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) '
vfeed = vFeedApi.vFeed(cve)


print '[invoking] the checkCVE() method '
# invoking the checkCVE method
cveInfo = vfeed.checkCVE()

if cveInfo:

# returned data is a dictionary with 3 keys.
    print 'description: ' , cveInfo['cveDescription']
    print 'published date: ', cveInfo['publishedDate']
    print 'modified date: ', cveInfo['modifiedDate']


# invoking the checkCVSS method
Пример #3
0
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) '
vfeed = vFeedApi.vFeed(cve)

print '[invoking] the checkCVE() method '
# invoking the checkCVE method
cveInfo = vfeed.checkCVE()

if cveInfo:

    # returned data is a dictionary with 3 keys.
    print 'description: ', cveInfo['cveDescription']
    print 'published date: ', cveInfo['publishedDate']
    print 'modified date: ', cveInfo['modifiedDate']

# invoking the checkCVSS method

print '[invoking] the checkCVSS() method '
Пример #4
0
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