[null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "https://4.bp.blogspot.com/-E4fTbqBuPOA/Vy6gW70HMmI/AAAAAAAACP4/AH3Kc5Q_ZYck6aMwLEwaYyHEgC0hxbFFQCLcB/s200/vFeed.png", "src": "https://4.bp.blogspot.com/-E4fTbqBuPOA/Vy6gW70HMmI/AAAAAAAACP4/AH3Kc5Q_ZYck6aMwLEwaYyHEgC0hxbFFQCLcB/s200/vFeed.png", "formatted_filename": "vFeed", "rendered_width": 200, "rendered_height": 151}, null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "https://1.bp.blogspot.com/-Pfof38aCym0/Vy73D5E0P5I/AAAAAAAACQI/AuIblZ3Pgf4xtjBxsoQXmub0R-jw9osiwCLcB/s320/get_cve.png", "src": "https://1.bp.blogspot.com/-Pfof38aCym0/Vy73D5E0P5I/AAAAAAAACQI/AuIblZ3Pgf4xtjBxsoQXmub0R-jw9osiwCLcB/s320/get_cve.png", "formatted_filename": "get cve", "rendered_width": 320, "rendered_height": 81}, null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "https://1.bp.blogspot.com/-QzL5CyPrmTs/Vy74h0tsb6I/AAAAAAAACQU/BtrsawaxsOotqnzK8NITz4SttXZaeojpgCLcB/s320/get_cwe.png", "src": "https://1.bp.blogspot.com/-QzL5CyPrmTs/Vy74h0tsb6I/AAAAAAAACQU/BtrsawaxsOotqnzK8NITz4SttXZaeojpgCLcB/s320/get_cwe.png", "formatted_filename": "get cwe", "rendered_width": 320, "rendered_height": 38}, null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "https://3.bp.blogspot.com/-MDBxxoNoDp4/Vy78IQ9mJkI/AAAAAAAACQg/TdiVVUMLtMYEdP6cst48Upw6GjuB_9drACKgB/s1600/get_cvss.png", "src": "https://3.bp.blogspot.com/-MDBxxoNoDp4/Vy78IQ9mJkI/AAAAAAAACQg/TdiVVUMLtMYEdP6cst48Upw6GjuB_9drACKgB/s1600/get_cvss.png", "formatted_filename": "get cvss"}, null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "https://4.bp.blogspot.com/-IYGmZyRZsCo/Vy78rUaLN5I/AAAAAAAACQo/aF1AOY7_2nQb3RlDjoPJcfSHRCz8CpqsQCLcB/s320/get_refs.png", "src": "https://4.bp.blogspot.com/-IYGmZyRZsCo/Vy78rUaLN5I/AAAAAAAACQo/aF1AOY7_2nQb3RlDjoPJcfSHRCz8CpqsQCLcB/s320/get_refs.png", "formatted_filename": "get refs", "rendered_width": 320, "rendered_height": 120}, null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "https://2.bp.blogspot.com/-LLp5i_qfCY0/Vy-IEeQmNLI/AAAAAAAACQ4/MK3G1hQMQv0Ftk5UrVAw8y3h1GcPoyodACLcB/s320/vFeedViewer1.png", "src": "https://2.bp.blogspot.com/-LLp5i_qfCY0/Vy-IEeQmNLI/AAAAAAAACQ4/MK3G1hQMQv0Ftk5UrVAw8y3h1GcPoyodACLcB/s320/vFeedViewer1.png", "formatted_filename": "vFeedViewer", "rendered_width": 320, "rendered_height": 138}, null, null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "https://1.bp.blogspot.com/-KT1IiGExv0I/Vy-LQkdz41I/AAAAAAAACRQ/HC-6CvuPUkEtwY12FJpOzQcWhfPFaONWACLcB/s320/vFeedViewer3.png", "src": "https://1.bp.blogspot.com/-KT1IiGExv0I/Vy-LQkdz41I/AAAAAAAACRQ/HC-6CvuPUkEtwY12FJpOzQcWhfPFaONWACLcB/s320/vFeedViewer3.png", "formatted_filename": "vFeedViewer", "rendered_width": 320, "rendered_height": 129}, null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "https://2.bp.blogspot.com/-yAB3Wrs-fxs/Vy-MmJ2cEzI/AAAAAAAACRY/bis48P_PNysI8o_TMgB50TbYW52XgmwowCLcB/s320/vFeedViewer4.png", "src": "https://2.bp.blogspot.com/-yAB3Wrs-fxs/Vy-MmJ2cEzI/AAAAAAAACRY/bis48P_PNysI8o_TMgB50TbYW52XgmwowCLcB/s320/vFeedViewer4.png", "formatted_filename": "vFeedViewer", "rendered_width": 320, "rendered_height": 127}, null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "https://4.bp.blogspot.com/-OokVovpXZtA/Vy-NoHYnJWI/AAAAAAAACRg/jMD0eF8O5dMLt8RgGLeOL_hXGIDr98V5ACLcB/s320/vFeedViewer5.png", "src": "https://4.bp.blogspot.com/-OokVovpXZtA/Vy-NoHYnJWI/AAAAAAAACRg/jMD0eF8O5dMLt8RgGLeOL_hXGIDr98V5ACLcB/s320/vFeedViewer5.png", "formatted_filename": "vFeedViewer", "rendered_width": 320, "rendered_height": 114}, null, null, null, null, null, null, null, null, null, null, {"document_url": "http://holisticinfosec.blogspot.com/2016/05/", "unformatted_src": "http://4.bp.blogspot.com/-3oDu_bQerx8/VW4lOpHRlJI/AAAAAAAAB5E/01PLdTNsMfE/s300/asja_awards-prize_winning_article_small.png", "src": "http://4.bp.blogspot.com/-3oDu_bQerx8/VW4lOpHRlJI/AAAAAAAAB5E/01PLdTNsMfE/s300/asja_awards-prize_winning_article_small.png", "formatted_filename": "asja awards prize winning article small", "alt_text": "ASJA Awards Prize Winning Article", "rendered_width": 175, "rendered_height": 175}, null, null, null, null, null, null, null, null, null, null]
Sunday, May 08, 2016

toolsmith #116: vFeed & vFeed Viewer In case you haven't guessed by now, I am an unadulterated tools nerd. Hopefully, ten years of toolsmith have helped you come to that conclusion on your own. I rejoice when I find like-minded souls, I found one in Nabil (NJ) Ouchn (@toolswatch), he of Black Hat Arsenal and toolswatch.org fame. In addition to those valued and well-executed community services, NJ also spends a good deal of time developing and maintaining vFeed. vFeed included a Python API and the vFeed SQLite database, now with support for Mongo. It is, for all intents and purposes a correlated community vulnerability and threat database. I've been using vFeed for quite a while now having learned about it when writing about FruityWifi a couple of years ago.
NJ fed me some great updates on this constantly maturing product.
Having achieved compatibility certifications (CVE, CWE and OVAL) from MITRE, the vFeed Framework (API and Database) has started to gain more than a little gratitude from the information security community and users, CERTs and penetration testers. NJ draws strength from this to add more features now and in the future. The actual vFeed roadmap is huge. It varies from adding new sources such as security advisories from industrial control system (ICS) vendors, to supporting other standards such as STIX, to importing/enriching scan results from 3rd party vulnerability and threat scanners such as Nessus, Qualys, and OpenVAS.
There have a number of articles highlighting impressive vFeed uses cases of vFeed such as:
Needless to say, some fellow security hackers and developers have included vFeed in their toolkit, including Faraday (March 2015 toolsmith), Kali Linux, and more (FruityWifi as mentioned above).

The upcoming version vFeed will introduce support for CPE 2.3, CVSS 3, and new reference sources. A proof of concept to access the vFeed database via a RESTFul API is in testing as well. NJ is fine-tuning his Flask skills before releasing it. :) NJ, does not consider himself a Python programmer and considers himself unskilled (humble but unwarranted). Luckily Python is the ideal programming language for someone like him to express his creativity.
I'll show you all about woeful programming here in a bit when we discuss the vFeed Viewer I've written in R.

First, a bit more about vFeed, from its Github page:
The vFeed Framework is CVE, CWE and OVAL compatible and provides structured, detailed third-party references and technical details for CVE entries via an extensible XML/JSON schema. It also improves the reliability of CVEs by providing a flexible and comprehensive vocabulary for describing the relationship with other standards and security references.
vFeed utilizes XML-based and  JSON-based formatted output to describe vulnerabilities in detail. This output can be leveraged as input by security researchers, practitioners and tools as part of their vulnerability analysis practice in a standard syntax easily interpreted by both human and machine.
The associated vFeed.db (The Correlated Vulnerability and Threat Database) is a detective and preventive security information repository useful for gathering vulnerability and mitigation data from scattered internet sources into an unified database.
vFeed's documentation is now well populated in its Github wiki, and should be read in its entirety:
vFeed features include:

vFeed installation and usage

Installing vFeed is easy, just download the ZIP archive from Github and unpack it in your preferred directory or, assuming you've got Git installed, run git clone https://github.com/toolswatch/vFeed.git.
You'll need a Python interpreter installed, the latest instance of 2.7 is preferred. From the directory in which you installed vFeed, just run python vfeedcli.py -h followed by python vfeedcli.py -u to confirm all is updated and in good working order; you're ready to roll.

You've now read section 2 (Usage) on the wiki, so you don't need a total usage rehash here. We'll instead walk through a few options with one of my favorite CVEs: CVE-2008-0793.

If we invoke python vfeedcli.py -m get_cve CVE-2008-0793, we immediately learn that it refers to a Tendenci CMS cross-site scripting vulnerability. The -m parameter lets you define the preferred method, in this case, get_cve. Groovy, is there an associated CWE for CVE-2008-0793? But of course. Using the get_cwe method we learn that CWE-79 or "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')" is our match. If you want to quickly learn all the available methods, just run python vfeedcli.py --list.
Perhaps you'd like to determine what the CVSS score is, or what references are available, via the vFeed API? Easy, if you run...

from lib.core.methods.risk import CveRisk
cve = "CVE-2014-0160"
cvss = CveRisk(cve).get_cvss()
print cvss

You'll retrieve... For reference material...

from lib.core.methods.ref import CveRef
cve = "CVE-2008-0793"
ref = CveRef(cve).get_refs()
print ref And now you know...the rest of the story. CVE-2008-0793 is one of my favorites because a) I discovered it, and b) the vendor was one of the best of many hundreds I've worked with to fix vulnerabilities.

vFeed Viewer

If NJ thinks his Python skills are rough, wait until he sees this. :-)
I thought I'd get started on a user interface for vFeed using R and Shiny, appropriately name vFeed Viewer and found on Github here. This first version does not allow direct queries of the vFeed database as I'm working on SQL injection prevention, but it does allow very granular filtering of key vFeed tables. Once I work out safe queries and sanitization, I'll build the same full correlation features you enjoy from NJ's Python vFeed client.
You'll need a bit of familiarity with R to make use of this viewer.
First install R, and RStudio.  From the RStudio console, to ensure all dependencies are met, run install.packages(c("shinydashboard","RSQLite","ggplot2","reshape2")).
Download and install the vFeed Viewer in the root vFeed directory such that app.R and the www directory are side by side with vfeedcli.py, etc. This ensures that it can read vfeed.db as the viewer calls it directly with dbConnect and dbReadTable, part of the RSQLite package.
Open app.R with RStudio then, click the Run App button. Alternatively, from the command-line, assuming R is in your path, you can run R -e "shiny::runApp('~/shinyapp')" where ~/shinyapp is the path to where app.R resides. In my case, on Windows, I ran R -e "shiny::runApp('c:\\tools\\vfeed\\app.R')". Then browser to the localhost address Shiny is listening on. You'll probably find the RStudio process easier and faster.
One important note about R, it's not known for performance, and this app takes about thirty seconds to load. If you use Microsoft (Revolution) R with the MKL library, you can take advantage of multiple cores, but be patient, it all runs in memory. Its fast as heck once it's loaded though.
The UI is simple, including an overview. At present, I've incorporated NVD and CWE search mechanisms that allow very granular filtering. As an example, using our favorite CVE-2008-0793, we can zoom in via the search field or the CVE ID drop down menu. Results are returned instantly from 76,123 total NVD entries at present. From the CWE search you can opt to filter by keywords, such as XSS for this scenario, to find related entries. If you drop cross-site scripting in the search field, you can then filter further via the cwetitle filter field at the bottom of the UI. This is universal to this use of Shiny, and allows really granular results. You can also get an idea of the number of vFeed entries per vulnerability category entities. I did drop CPEs as their number throws the chart off terribly and results in a bad visualization. I'll keep working on the vFeed Viewer so it becomes more useful and helps serve the vFeed community. It's definitely a work in progress but I feel as if there's some potential here.


Thanks to NJ for vFeed and all his work with the infosec tools community, if you're going to Black Hat be certain to stop by Arsenal. Make use of vFeed as part of your vulnerability management practice and remember to check for updates regularly. It's a great tool, and getting better all the time.
Ping me via email or Twitter if you have questions (russ at holisticinfosec dot org or @holisticinfosec).
Cheers…until next month.


Nabil (NJ) Ouchn (@toolswatch)

at May 08, 2016 No comments: Links to this post Labels: R, RStudio, shiny, shinydashboard, vFeed
