Exemple #1
0
def main():

    if len(sys.argv) == 3:
        myCVE = sys.argv[2]
        apiMethod = sys.argv[1]
        
        if apiMethod == "export":
            vfeed = vFeedXML(myCVE)
            vfeed.export()
            exit(0)
    
        vfeed = vFeed(myCVE)
        try:
            globals()['call_%s' % apiMethod](vfeed)
        except:
            print'[error] the method %s is not implemented' % apiMethod
        else:
            exit(0)
   
    elif len(sys.argv) == 2:
        apiMethod = sys.argv[1]
        if apiMethod == "update":
            db = vFeedUpdate()
            db.update()
            exit(0)
        else:
           get_help()
    else:
        get_help() 
Exemple #2
0
def main():

    if len(sys.argv) == 3:
        myinput = sys.argv[2]
        apiMethod = sys.argv[1]
        
        if apiMethod == "search":
            search = vFeedSearch(myinput)
            search.search()
            exit(0)

        if apiMethod == "export":
            vfeed = vFeedXML(myinput)
            vfeed.export()
            exit(0)
    
        vfeed = vFeed(myinput)
        try:
            globals()['call_%s' % apiMethod](vfeed)
        except:
            print'[error] the method %s is not implemented' % apiMethod
        else:
            exit(0)
   
    elif len(sys.argv) == 2:
        apiMethod = sys.argv[1]
        
        if apiMethod == "update":
            db = vFeedUpdate()
            db.update()
            exit(0)
        
        if apiMethod == "get_stats":
            stat = vFeedStats()
            stat.get_stats()
            exit(0)           
            
        if apiMethod == "get_latest":
            stat = vFeedStats()
            stat.get_latest()
            exit(0)    
        
        else:
           get_help()
    else:
        get_help() 
Exemple #3
0
def main():

    info = 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 '                                         ' + info.get_owner()['website']
        print '-----------------------------------------------------------------------------'
        print ''
        print '[usage]: ' + str(sys.argv[0]) + ' <API Method> <CVE id>'
        print ''
        print '[info] Available vFeed methods:'
        print 'Information  ==> get_cve | get_cpe | get_cwe | get_capec | get_category | get_iavm'
        print 'References   ==> get_refs | get_scip | get_osvdb | get_certvn'
        print 'Risk         ==> get_risk | get_cvss'
        print 'Patchs       ==> get_ms | get_kb | get_aixapar | get_redhat | get_suse | get_debian'
        print 'Patchs       ==> get_mandriva | get_cisco | get_ubuntu | get_gentoo | get_fedora | get_vmware'
        print 'Assessment   ==> get_oval | get_nessus | get_openvas '
        print 'Defense      ==> get_snort | get_suricata'
        print 'Exploitation ==> get_milw0rm | get_edb | get_saint | get_msf'
        print ''
        print 'Hint: Type ./vfeedcmd.py export CVE-XXXX-XXXX to export the CVE as vFeed XML format'
        print ''
        exit(0)

    vfeed = vFeed(myCVE)

    if apiMethod == "export":
        
        vfeed = vFeedXML(myCVE)
        vfeed.export()
        exit(0)

    try:
        globals()['call_%s' % apiMethod](vfeed)
    except:
        print'[error] the method %s is not implemented' % apiMethod
    else:
        exit(0)
Exemple #4
0
def main():

    info = 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 '                                         ' + info.get_owner()['website']
        print '-----------------------------------------------------------------------------'
        print ''
        print '[usage]: ' + str(sys.argv[0]) + ' <API Method> <CVE id>'
        print ''
        print '[info] Available vFeed methods:'
        print 'Information  ==> get_cve | get_cpe | get_cwe | get_capec | get_category | get_iavm'
        print 'References   ==> get_refs | get_scip | get_osvdb | get_certvn'
        print 'Risk         ==> get_risk | get_cvss'
        print 'Patchs       ==> get_ms | get_kb | get_aixapar | get_redhat | get_suse | get_debian'
        print 'Patchs       ==> get_mandriva | get_cisco | get_ubuntu | get_gentoo | get_fedora'
        print 'Assessment   ==> get_oval | get_nessus | get_openvas '
        print 'Defense      ==> get_snort'
        print 'Exploitation ==> get_milw0rm | get_edb | get_saint | get_msf'
        print ''
        print 'Hint: Type ./vfeedcmd.py export CVE-XXXX-XXXX to export the CVE as vFeed XML format'
        print ''
        exit(0)

    vfeed = vFeed(myCVE)

    if apiMethod == "export":
        
        vfeed = vFeedXML(myCVE)
        vfeed.export()
        exit(0)

    try:
        globals()['call_%s' % apiMethod](vfeed)
    except:
        print'[error] the method %s is not implemented' % apiMethod
    else:
        exit(0)
Exemple #5
0
def main():

    if len(sys.argv) == 3:
        myinput = sys.argv[2]
        apiMethod = sys.argv[1]

        if apiMethod == "search":
            search = vFeedSearch(myinput)
            search.search()
            exit(0)

        if apiMethod == "export":
            vfeed = vFeedXML(myinput)
            vfeed.export()
            exit(0)

        vfeed = vFeed(myinput)
        try:
            globals()['call_%s' % apiMethod](vfeed)
        except:
            print '[error] the method %s is not implemented' % apiMethod
        else:
            exit(0)

    elif len(sys.argv) == 2:
        apiMethod = sys.argv[1]

        if apiMethod == "update":
            db = vFeedUpdate()
            db.update()
            exit(0)

        if apiMethod == "get_stats":
            stat = vFeedStats()
            stat.get_stats()
            exit(0)

        if apiMethod == "get_latest":
            stat = vFeedStats()
            stat.get_latest()
            exit(0)

        else:
            get_help()
    else:
        get_help()
Exemple #6
0
def main():

    info = 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 = vFeed(myCVE)

    if apiMethod == "exportXML":
        vfeed.exportXML()
        exit(0)

    try:
        globals()['call_%s' % apiMethod](vfeed)
    except:
        print '[error] the method %s is not implemented' % apiMethod
    else:
        exit(0)
def main():

    info = 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 = vFeed(myCVE)

    if apiMethod == "exportXML":
        vfeed.exportXML()
        exit(0)

    try:
        globals()['call_%s' % apiMethod](vfeed)
    except:
        print'[error] the method %s is not implemented' % apiMethod
    else:
        exit(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-2014-0160"
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 = vFeed(cve)


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

if cveInfo:

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


# invoking the get_cvss method
Exemple #9
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-2014-0160"
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 = vFeed(cve)

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

if cveInfo:

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

# invoking the get_cvss method

print '[invoking] the get_cvss() method '