vFeed es una herramienta muy interesante de ToolsWatch que recolecta información sobre vulnerabilidades utilizando multitud de fuentes; entre otras:


  • Estándares de seguridad, como CVE, CWE, CPE, OVAL, CAPEC, CVSS, etc.
  • Herramientas de explotación y auditoría de vulnerabilidades, como Nessus, NMap, Metasploit, etc., así como páginas web y bases de datos de seguridad ofensiva, como milw0rm o Exploit-DB
  • Alertas de fabricantes: Red Hat, Microsoft, Cisco, Debian, etc.
  • Firmas de sistemas IDS, como Snort o Suricata


El resultado es una base de datos SQLite que agrega y relaciona toda esta información a través del identificador CVE de una vulnerabilidad determinada, de modo que contando, por ejemplo, con el identificador de un script de la herramienta Nessus, es posible obtener toda la información disponible en el resto de fuentes de información: exploits disponibles en Metasploit o Exploit-DB, alertas de fabricantes relacionadas con la vulnerabilidad en cuestión, posibles firmas de sistemas IDS que nos permitan detectar un intento de explotación de la misma, etc.

Esta base de datos es gratuita, y puede descargarse y consultarse a través de una API en Python, disponible en GitHub:

Código:
$ wget https://github.com/toolswatch/vFeed/archive/master.zip

$ unzip master.zip 
Archive:  master.zip
4992a98cb8fb8b95c69e1387bc51554722802bca
   creating: vFeed-master/
  inflating: vFeed-master/.gitignore  
  inflating: vFeed-master/CHANGELOG.rst  
  inflating: vFeed-master/LICENSE    
  inflating: vFeed-master/README.rst  
   creating: vFeed-master/docs/
 extracting: vFeed-master/docs/read.me  
  inflating: vFeed-master/docs/vFeedApi User Guide - beta release.pdf  
   creating: vFeed-master/vfeed/
  inflating: vFeed-master/vfeed/__init__.py  
  inflating: vFeed-master/vfeed/api.py  
  inflating: vFeed-master/vfeed/config.py  
  inflating: vFeed-master/vfeed/exportxml.py  
  inflating: vFeed-master/vfeed/info.py  
  inflating: vFeed-master/vfeed/search.py  
  inflating: vFeed-master/vfeed/stats.py  
  inflating: vFeed-master/vfeed/update.py  
  inflating: vFeed-master/vfeed_calls_samples.py  
  inflating: vFeed-master/vfeedcli.py  

$ cd vFeed-master/
El script vfeedcli.py facilita el acceso a la misma funcionalidad disponible a través de la API directamente desde la línea de comandos:
Código:
$ ./vfeedcli.py 

-----------------------------------------------------------------------------
vFeed - Open Source Cross-linked and Aggregated Local Vulnerability Database
                                                               version 0.5.0
                                         https://github.com/toolswatch/vFeed
-----------------------------------------------------------------------------

[usage 1]: python ./vfeedcli.py  
[info] Available vFeed methods:
Information  ==> get_cve | get_cpe | get_cwe | get_capec | get_category
References   ==> get_refs | get_scip | get_osvdb | get_certvn | get_bid | get_iavm
Risk         ==> get_risk | get_cvss
Patchs 1/2   ==> get_ms | get_kb | get_aixapar | get_redhat | get_suse | get_debian | get_hp
Patchs 2/2   ==> get_mandriva | get_cisco | get_ubuntu | get_gentoo | get_fedora | get_vmware
Assessment   ==> get_oval | get_nmap | get_nessus | get_openvas 
Defense      ==> get_snort | get_suricata
Exploitation ==> get_milw0rm | get_edb | get_saint | get_msf | get_d2

----------
[usage 2]: python ./vfeedcli.py export 
[info]: This method will export the CVE as vFeed XML format

----------
[usage 3]: python ./vfeedcli.py search  | 
[info]: This method searches for CVE or CPE. It returns useful information that will help 
        you dig deeper.

----------
[usage 4]: python ./vfeedcli.py stats or latest_cve
[info]: Available stats methods
Global statistics   ==> get_stats
Latest Added CVEs   ==> get_latest 

----------
[Update]: python ./vfeedcli.py update
[info]: This method will update the SQLite vfeed database to its latest release
Los nombres de las opciones se corresponden con cada uno de los métodos de la API. Para descargar la base de datos SQLite, se utiliza la opción update:
Código:
$ ./vfeedcli.py update
[install] getting fresh copy of vfeed.db. It may take a while ...
[progress 100 %] receiving 45324199 out of 45324199 Bytes of vfeed.db.tgz 
[info] decompressing vfeed.db.tgz ...
[info] Cleaning compressed database and update file
La base de datos, una vez descargada y descomprimida, pesa unos 223 MB a fecha del presente.
Código:
$ file vfeed.db 
vfeed.db: SQLite 3.x database

$ du -h vfeed.db 
223M    vfeed.db
Para hacernos una idea de toda la información contenida en la misma, podemos utilizar el métodoget_stats:
Código:
$ ./vfeedcli.py get_stats
---------------------------------------------------------------
vFeed.db Statistics
Distinct values of CVEs and associated third party references
Database build (latest update date): 7162015
---------------------------------------------------------------

[+] Vulnerability Information and References
    [-] Common Vulnerability Enumeration (CVE): 71016
    [-] Affected Products or Common Platform Enumeration (CPE): 175873
    [-] Common Weakness Enumeration (CWE) types: 496
    [-] Common Attack Pattern Enumeration and Classification (CAPEC) types: 226
    [-] SecurityFocus BID: 32980
    [-] OSVDB - Open Source Vulnerability Database advisories: 22370
    [-] CERT.org Vulnerability Notes: 4184
    [-] DOD-CERT Information Assurance Vulnerability Alert (IAVA): 1168
    [-] Scip AG Security Advisories: 72941

[+] Third Party Vendors Patches and Advisories
    [-] IBM AIX APARs Patches Advisories: 1996
    [-] Suse Patches Advisories: 2154
    [-] Ubuntu Patches Advisories: 1826
    [-] VMware Patches Advisories: 84
    [-] Cisco Patches Advisories: 716
    [-] Debian Patches Advisories: 2949
    [-] Fedora Patches Advisories: 2714
    [-] Gentoo Patches Advisories: 1410
    [-] HP (Hewlett Packard) Patches Advisories: 1969
    [-] Mandriva Patches Advisories: 1697
    [-] Microsoft Bulletins Advisories: 1321
    [-] Microsoft KB Advisories: 2132
    [-] Redhat Patches Advisories: 4306
    [-] Redhat Bugzilla Advisories: 12464

[+] Exploits and Proof of Concepts
    [-] Exploit-DB Proof of Concepts and exploits: 2886
    [-] Metasploit Exploits or Modules: 1360
    [-] Milw0rm Proof of Concepts and exploits: 5560
    [-] Saint Corporation Proof of Concepts and exploits: 944
    [-] D2 Elliot Web Exploitation Framework: 34

[+] Third Party Security Scanners Scripts
    [-] Nessus Security Scripts: 49679
    [-] OpenVAS Security Scripts: 27101
    [-] Nmap NSE scripts: 34
    [-] Open Vulnerability Assessment Language (OVAL) definitions: 26127

[+] Open Source Intrusion Detection Rules
    [-] Snort Detection Rules: 1333
    [-] Suricata Detection Rules: 5020
Como se observa, la cantidad de información recogida es ingente, y toda relacionada entre sí a través del identificador CVE de las vulnerabilidades.
Por ejemplo, para la vulnerabilidad de Flash CVE-2015-3113, podríamos obtener una descripción básica y fechas de publicación y modificación:
Código:
$ ./vfeedcli.py get_cve CVE-2015-3113
[cve_description]: Heap-based buffer overflow in Adobe Flash Player before 13.0.
0.296 and 14.x through 18.x before 18.0.0.194 on Windows and OS X and before 11.
2.202.468 on Linux allows remote attackers to execute arbitrary code via unspeci
fied vectors, as exploited in the wild in June 2015.
[cve_published]: 2015-06-23T17:59:01.960-04:00
[cve_modified]: 2015-06-24T14:58:37.283-04:00
Enlaces o referencias de interés relacionadas con la vulnerabilidad:
Código:
$ ./vfeedcli.py get_refs CVE-2015-3113
 ------- 
[reference_id]: CONFIRM
[reference_link] https://helpx.adobe.com/security/products/flash-player/apsb15-14.html

[stats] 1 Reference(s)
Reglas para Snort o Suricata (en este caso la BD sólo tiene referencias a una regla de Suricata, pero tratándose de una regla ET está también disponible para Snort:
Código:
$ ./vfeedcli.py get_snort CVE-2015-3113

[stats] 0 Snort Rule(s)

$ ./vfeedcli.py get_suricata CVE-2015-3113
 ------- 
[suricata_id]: sid:2021364
[suricata_signature]: ET CURRENT_EVENTS Magnitude CVE-2015-3113 Jun 29 2015 M1
[suricata_classtype]: trojan-activity

[stats] 1 Suricata Rule(s)
También podemos obtener los scripts de Nessus, y exploits para Metasploit o de otras fuentes:
Código:
$ ./vfeedcli.py get_nessus CVE-2015-3113
 ------- 
[nessus_id]: 84365
[nessus_name]: Adobe Flash Player <= 18.0.0.161 RCE (APSB15-14)
 [nessus_file]: flash_player_apsb15-14.nasl
 [nessus_family]: Windows
  ------- 
 [nessus_id]: 84383
 [nessus_name]: FreeBSD : Adobe Flash Player -- critical vulnerabilities (d02f6b0
 1-1a3f-11e5-8bd6-c485083ca99c)
 [nessus_file]: freebsd_pkg_d02f6b011a3f11e58bd6c485083ca99c.nasl
 [nessus_family]: FreeBSD Local Security Checks
  ------- 
 [...]
 [stats] 8 Nessus testing script(s)
 
 $ ./vfeedcli.py get_msf CVE-2015-3113
  ------- 
 [msf_id]: adobe_flash_nellymoser_bof.rb
 [msf_title]: Adobe Flash Player Nellymoser Audio Decoding Buffer Overflow
 [msf_file]: metasploit-framework/modules/exploits/multi/browser/adobe_flash_nellymoser_bof.rb
 
 [stats] 1 Metasploit Exploits/Plugins
 
 $ ./vfeedcli.py get_edb CVE-2015-3113
  ------- 
 [edb_id]: 37536
 [edb_file]: platforms/multiple/remote/37536.rb
 [edb_link]: http://www.exploit-db.com/exploits/37536
 
 [stats] 1 ExploitDB id(s)
 
Red Hat habría publicado un boletín de seguridad, el RHSA-2015:1184, relacionado con esta vulnerabilidad, así como un parche disponible en su Bugzilla:
Código:
$ ./vfeedcli.py get_redhat CVE-2015-3113
 ------- 
[redhat_id]: RHSA-2015:1184
[redhat_patch_title]: RHSA-2015:1184: flash-plugin security update (Critical)
[redhat_oval_id]: oval:com.redhat.rhsa:def:20151184

[stats] 1 Redhat id(s)
 ------- 
[redhat_bugzilla_issued]: 2015-06-24
[redhat_bugzilla_id]: 1235036
[redhat_bugzilla_title]: CVE-2015-3113 flash-plugin: code execution issue fixed in APSB15-14

[stats] 1 Bugzilla id(s)
Como último ejemplo, también sería posible obtener métricas CVSS sobre el riesgo asociado a la vulnerabilidad:
Código:
$ ./vfeedcli.py get_risk CVE-2015-3113
Severity: High
Top vulnerablity: True
    [cvss_base]: 10.0
    [cvss_impact]: 10.0
    [cvss_exploit]: 10.0
PCI compliance: Failed
is Top alert: 

$ ./vfeedcli.py get_cvss CVE-2015-3113
[cvss_base]: 10.0
[cvss_impact]: 10.0
[cvss_exploit]: 10.0
[AV (access vector)]: network
[AC (access complexity)]: low
[Au (authentication)]: none
[C (confidentiality impact)]: complete
[I (integrity impact)]: complete
[A (availability impact)]: complete
Una de las ventajas de vFeed con respecto a otras bases de datos es que es descargable al completo, por lo que todas las consultas se pueden realizar offline (lo cuál puede venir bien por ejemplo en un pentest).
Como se ha mencionado, el uso de la API en Python es análogo a las opciones de la herramienta CLI. Basta con obtener una instancia de la clase vFeed, asociándola a una vulnerabilidad concreta a través del identificador CVE, y ya es posible realizar todas las consultas anteriores, con la ventaja de que los resultados ya vienen devueltos como estructuras de datos de Python, lo que permite procesarlos cómodamente. Por ejemplo, para la vulnerabilidad GHOST:
Código:
$ python
Python S.2.g
Type "help", "copyright", "credits" or "license" for more information.

>>> from vfeed import vFeed

>>> vfeed = vFeed("CVE-2015-0235")

>>> vfeed.get_cve()
{'published': '2015-01-28T14:59:00.063-05:00', 'modified':
'2015-07-05T21:59:37.363-04:00', 'summary': 'Heap-based buffer
overflow in the __nss_hostname_digits_dots function in glibc 2.2,
and other 2.x versions before 2.18, allows context-dependent
attackers to execute arbitrary code via vectors related to
the (1) gethostbyname or (2) gethostbyname2 function, aka "GHOST."'}

>>> vfeed.get_snort()
{}

>>> vfeed.get_suricata()
{0: {'classtype': 'attempted-admin', 'id': 'sid:2020325',
'signature': 'ET EXPLOIT CVE-2015-0235 Exim Buffer Overflow
Attempt (HELO)'}, 1: {'classtype': 'attempted-admin',
'id': 'sid:2020326', 'signature': 'ET EXPLOIT CVE-2015-0235
Exim Buffer Overflow Attempt (EHLO)'}}

>>> vfeed.get_msf()
{0: {'id': 'wordpress_ghost_scanner.rb', 'file':
'metasploit-framework/modules/auxiliary/scanner/http/
wordpress_ghost_scanner.rb', 'title': 'CP Multi-View
Calendar Unauthenticated SQL Injection Scanner'},
1: {'id': 'exim_gethostbyname_bof.rb', 'file':
'metasploit-framework/modules/exploits/linux/smtp/
exim_gethostbyname_bof.rb', 'title':
'Exim and Dovecot Insecure Configuration Command
Injection'}}

>>> vfeed.get_nessus()
{0: {'family': 'Amazon Linux Local Security Checks', 'id': '81024',
'file': 'ala_ALAS-2015-473.nasl', 'name': 'Amazon Linux AMI :
glibc (ALAS-2015-473)'}, 1: {'family': 'Amazon Linux Local
Security Checks', 'id': '81829', 'file': 'ala_ALAS-2015-493.nasl',
'name': 'Amazon Linux AMI : php54 (ALAS-2015-493)'}, 2: {'family':
'Amazon Linux Local Security Checks', 'id': '82043', 'file':
'ala_ALAS-2015-494.nasl', 'name': 'Amazon Linux AMI : php55
(ALAS-2015-494)'}, 3: {'family': 'CentOS Local Security Checks',
'id': '81025', 'file': 'centos_RHSA-2015-0090.nasl'
[...]
Otra opción extremadamente potente es realizar las consultas directamente sobre la base de datos SQLite. Por ejemplo, podría interesarnos obtener todas las correspondencias entre plugins de Nessus y SID de Snort o Suricata, para implementar una vulnerability / intrusion detection crosscorrelation en nuestro correlador o nuestro SIEM. Lo tendríamos hecho con una simple consulta:
Código:
echo 'select nvd_db.cveid, map_cve_suricata.suricata_id,
    map_cve_nessus.nessus_script_id from nvd_db join
    map_cve_suricata on nvd_db.cveid = map_cve_suricata.cveid
    join map_cve_nessus on map_cve_suricata.cveid =
    map_cve_nessus.cveid;' | sqlite3.db > suricata-nessus-xcorrelation.txt

$ head suricata-nessus-xcorrelation.txt 
CVE-2003-0813|sid:2494|12206
CVE-2003-0813|sid:2494|21655
CVE-2003-0352|sid:2352|11790
CVE-2003-0352|sid:2352|11808
CVE-2003-0352|sid:2351|11790
CVE-2003-0352|sid:2351|11808
CVE-2003-0813|sid:2495|12206
CVE-2003-0813|sid:2495|21655
CVE-2003-0813|sid:2492|12206
CVE-2003-0813|sid:2492|21655

$ wc -l suricata-nessus-xcorrelation.txt 
12816 suricata-nessus-xcorrelation.txt
Algo así nos permitiría dar prioridad a las alertas IDS detectadas contra un activo que sabemos que es vulnerable (funcionalidad habitual en los SIEM y correladores). Aunque hay muchos otros métodos de obtener este tipo de correspondencias IDS/vulnerabilidades, contar con una fuente adicional para enriquecer la información, vFeed en este caso, siempre viene bien.
Otra cosa muy interesante que puede hacerse con vFeed es explotar la información de la CPE (Common Platform Enumeration), que también viene relacionada con las vulnerabilidades a través de los correspondientes identificadores CVE. Esto posibilita, por ejemplo, estudiar tendencias sobre determinadas plataformas o tecnologías.
Código:
sqlite> select count(distinct cpeid) from cve_cpe where cpeid
like '%:microsoft:%';
2348

sqlite> select count(distinct cpeid) from cve_cpe where cpeid
like '%:redhat:%'; 
1702

sqlite> select count(distinct cpeid) from cve_cpe where cpeid
like '%:adobe:flash_player:%';
316

sqlite> select count(*) from cve_cpe where cpeid
like '%:adobe:flash_player:%';
25787
Por ejemplo, podríamos obtener la cantidad de vulnerabilidades de Flash publicadas cada mes:
Código:
$ echo 'select strftime("%Y-%m", date_published) as day_month,
    count(distinct cve_cpe.cveid) from cve_cpe, nvd_db
    where cve_cpe.cveid = nvd_db.cveid and cpeid
    like "%:adobe:flash_player:%"
    group by day_month order by day_month;' | sqlite3 vfeed.db 
2005-12|1
2006-07|2
2006-09|2
2006-10|1
[...]

O para Java JRE:
Código:
$ echo 'select strftime("%Y-%m", date_published) as day_month,
    count(distinct cve_cpe.cveid) from cve_cpe, nvd_db
    where cve_cpe.cveid = nvd_db.cveid and
    (cpeid like "%:sun:jre:%" or cpeid like "%:oracle:jre:%")
    group by day_month order by day_month;' | sqlite3 vfeed.db
2001-08|1
2001-12|1
2002-03|2
2002-12|1
2003-11|1
[...]

Por ejemplo, en septiembre y octubre de 2014 se observa un pico en la cantidad de vulnerabilidades (en general, de cualquier tecnología) publicadas:
Código:
$ echo 'select strftime("%Y-%m", date_published) as day_month,
    count(distinct cveid) from nvd_db where
    date_published > "2008-01-01"
    group by day_month order by day_month;' | sqlite3

Se podría hacer un estudio similar sobre cualquier área de interés. Por ejemplo... ¿Vulnerabilidades asociadas a fabricantes de sistemas de control industrial?
vFeed puede ser útil también en pentests (complementando la información que Metasploit o Nessus ya agregan en conjunto), a la hora de redactar nuestros informes (para ampliar la información de cada vulnerabilidad con el resto de los datos obtenidos de las demás fuentes presentes en la base de datos), y un sinfín más...

Pablo M. @ http://www.securityartwork.es/2015/07/21/vfeed-una-bd-de-vulnerabilidades/