<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Security Advancements at the Monastery &#187; Vulnerability</title>
	<atom:link href="http://blog.securitymonks.com/category/vulnerability/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.securitymonks.com</link>
	<description>Information about developments at the Monastery</description>
	<lastBuildDate>Fri, 03 Sep 2010 05:41:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google Visualization: An Example Graphing NVD CVE Data</title>
		<link>http://blog.securitymonks.com/2010/04/16/google-visualization-an-example-graphing-nvd-cve-data/</link>
		<comments>http://blog.securitymonks.com/2010/04/16/google-visualization-an-example-graphing-nvd-cve-data/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 15:54:42 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[CERT]]></category>
		<category><![CDATA[CVE]]></category>
		<category><![CDATA[CVSS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Metrics]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[NIST]]></category>
		<category><![CDATA[NVD]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SCAP]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=1825</guid>
		<description><![CDATA[Google visualization offers graphing abilities to any number of projects.  Why should security professionals care?  If you are going to have to collect and present security metrics, it is best to showcase them in the very best manner possible.  Andrew Jaquith in his article, &#8220;Creating meaningful information security metrics&#8221; states, &#8220;For 2010, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/googlevisualization.gif" align="left" width=100/>Google visualization offers graphing abilities to any number of projects.  Why should security professionals care?  If you are going to have to collect and present security metrics, it is best to showcase them in the very best manner possible.  Andrew Jaquith in his article, &#8220;<a href="http://searchsecurity.techtarget.com/magazineFeature/0,296894,sid14_gci1394672_mem1,00.html">Creating meaningful information security metrics</a>&#8221; states, &#8220;For 2010, Forrester Research expects that overall security budgets will rise less than 5 percent over 2009 &#8211;higher than in the previous year, but not by much.&#8221;  Andrew goes on to point out, &#8220;smart security managers, sensing sudden vulnerability in their budgets, seek better ways to measure and prove the value of what they do every day.&#8221;</p>
<p>
In today&#8217;s work environment there is a need to show changes, potential risks, improved performance, etc. in all areas of the company&#8217;s operations.  Security professionals need to be prepared to answer the basic question, &#8220;why should the CIO or CEO care about security?&#8221;  CSO Online has a great quote from the post, &#8220;<a href="http://www.csoonline.com/article/550413/From_the_CIO_Why_You_Didn_t_Get_the_CISO_Job">From the CIO: Why You Didn&#8217;t Get the CISO Job</a>&#8221; that challenges us to consider our views when it comes to security.  The post states, “laser focus on your speciality is great in middle management. It’s what we want. One of the really hard things about jumping from management to executive is a focus on the whole of the business. It’s a rare person who manages it quickly or easily.”  That is basically the problem with metrics.  It is a battle between generalization to the point of uselessness and details to the point of not being understandable or collectible.  At the end of the day, something needs to be done because the security industry is currently leaving upper management in the position of not understanding what is going on within their business.  That is a risk that not acceptable.
</p>
<p>
Andrew&#8217;s article discusses what kind of security metrics should be used.  Additional sources of information on security metrics can be found in a previous post entitled &#8220;<a href="http://blog.securitymonks.com/2007/04/29/security-metrics/">Security Metrics</a>.&#8221;  The post provides links to wonderful sources on security metric information.  You might also want to take a look at the <a href="http://cisecurity.org/en-us/?route=downloads.show.single.metrics.100">CIS Consensus Security Metrics v1.0.0</a> guide, NIST Special Publication (SP) <a href="http://csrc.nist.gov/publications/nistpubs/800-55-Rev1/SP800-55-rev1.pdf">800-55 Rev 1</a> &#8220;Security Metrics Guide for Information Technology Systems&#8221;, <a href="http://csrc.nist.gov/publications/nistir/ir7564/nistir-7564_metrics-research.pdf">NIST IR-7564</a> &#8220;Directions in Security Metrics Research&#8221;,  &#8220;<a href="http://www.gilligangroupinc.com/headlines/2009/feb-23-related/20090223-cag-draft1.0.pdf">Twenty Most Important Controls and Metrics for Effective Cyber Defense and Continuous FISMA Compliance</a>,&#8221; and &#8220;<a href="http://www.slideshare.net/ramsesgallego/metrics-measures-myths">Metrics, measures &#038; Myths</a>.&#8221;  Once you have start gathering metrics, you will want to present them in an easy to understand format.  This is where Google Visualization can help.
</p>
<p>
Today&#8217;s post walks through an example using the data from the National Institute of Standards and Technology (NIST) National Vulnerability Database (<a href="http://nvd.nist.gov/">NVD</a><a>) Common Vulnerabilities and Exposures (</a><a href="http://cve.mitre.org/">CVE</a>) database.  The purpose is to provide a working example from which you can learn and apply to the various metrics gathered at your organization.
</p>
<p><h3>Data Source</h3>
</p>
<p>
A previous post, &#8220;<a href="http://blog.securitymonks.com/2009/08/09/standardization-and-interoperability-in-security/">Standardization and Interoperability in Security</a>,&#8221; discussed how the Security Content Automation Protocol (<a href="http://scap.nist.gov/">SCAP</a>) is an attempt to help defenders by providing a collection of XML schemas/standards that allow technical security information to be exchanged between tools.  SCAP components consists of:</p>
<ul>
<li><a href="http://cce.mitre.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/cce.mitre.org');">Common Configuration Enumeration (CCE)</a>: provide unique identifiers to system configuration issues in order to facilitate fast and accurate correlation of configuration data across multiple information sources and tools.</li>
<li><a href="http://cpe.mitre.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/cpe.mitre.org');">Common Platform Enumeration (CPE)</a>:  a structured naming scheme for information technology systems, platforms, and packages.</li>
<li><a href="http://cve.mitre.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/cve.mitre.org');">Common Vulnerability Enumeration (CVE)</a>: a dictionary of publicly known information security vulnerabilities and exposures.</li>
<li><a href="http://www.first.org/cvss/" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.first.org');">Common Vulnerability Scoring System (CVSS)</a>: a vulnerability scoring system designed to provide an open and standardized method of rating IT vulnerabilities.  NIST has even provided a <a href="http://nvd.nist.gov/cvss.cfm?calculator&#038;adv&#038;version=2" onclick="javascript:pageTracker._trackPageview('/outbound/article/nvd.nist.gov');">calculator</a> for creating CVSS vulnerability severity scores. </li>
<li><a href="http://scap.nist.gov/specifications/xccdf/" onclick="javascript:pageTracker._trackPageview('/outbound/article/scap.nist.gov');">eXtensible Checklist Configuration Description Format (XCCDF)</a>: a specification language for writing security checklists, benchmarks, and related kinds of documents.  NIST has released the NIST Interagency Report 7275 Revision 3 &#8220;<a href="http://csrc.nist.gov/publications/nistir/ir7275r3/NISTIR-7275r3.pdf" onclick="javascript:pageTracker._trackPageview('/outbound/article/csrc.nist.gov');">Specification for Extensible Configuration Checklist Description Format (XCCDF) Version 1.1.4</a>.&#8221;</li>
<li><a href="http://oval.mitre.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/oval.mitre.org');">Open Vulnerability Assessment Language (OVAL)</a>: an information security community standard to promote open and publicly available security content, and to standardize the transfer of this information across security tools and services.</li>
</ul>
<p>
We are going to make use of the data from <a href="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-recent.xml">NVD/CVE XML feed</a> with the Common Vulnerability Scoring System (<a href="http://www.first.org/cvss/cvss-guide.html">CVSS</a>) mappings (version 2.0).  NIST documentation states:<br />
<blockquote>CVSS provides an open framework for communicating the characteristics and impacts of IT vulnerabilities. Its quantitative model ensures repeatable accurate measurement while enabling users to see the underlying vulnerability characteristics that were used to generate the scores. Thus, CVSS is well suited as a standard measurement system for industries, organizations, and governments that need accurate and consistent vulnerability impact scores. Two common uses of CVSS are prioritization of vulnerability remediation activities and in calculating the severity of vulnerabilities discovered on one&#8217;s systems. </p></blockquote>
<p>
NVD provides CVSS &#8216;<b>base scores</b>&#8216; representing the innate characteristics of each vulnerability.  &#8216;<b>Temporal scores</b>,&#8217; which change over time due to events external to the vulnerability, are not provided though NVD does provide a <a href="http://nvd.nist.gov/cvss.cfm?calculator">CVSS score calculator</a>.  This allows an organization to add temporal data and even factor in &#8216;<b>environmental scores</b>&#8216; customized to reflect the impact of the vulnerability on the organization.  Please refer to the <a href="http://www.first.org/cvss/cvss-guide.html">CVSS standards guide</a> and the <a herf="http://www.owasp.org/index.php/OWASP_Risk_Rating_Methodology">OWASP Risk Rating Methodology</a> concerning factors involved in estimating the severity of risks to your business.
</p>
<p><h4><b>NVD CVE XML Schema</b></h4>
</p>
<p>
For our example, we will be using the data feeds <a href="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2010.xml">nvdcve-2.0-2010.xml</a> and <a href="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2090.xml">nvdcve-2.0-2009.xml</a>.  Examining the <a href="http://nvd.nist.gov/schema/nvd-cve-feed_2.0.xsd">CVE XML 2.0 Schema</a>, we are particularly interested in certain vulnerability and CVSS scoring information.  For example, for CVE-2010-1228, we will parse and pull the following kind of information:
</p>
<p><pre><tt><b><font color="#3366FF">&lt;entry</font></b> <font color="#009900">id</font><font color="#990000">=</font><font color="#CC3333">"CVE-2010-1228"</font><b><font color="#3366FF">&gt;</font></b>
  <b><font color="#3366FF">&lt;vuln:cve-id&gt;</font></b>CVE-2010-1228<b><font color="#3366FF">&lt;/vuln:cve-id&gt;</font></b>
  <b><font color="#3366FF">&lt;vuln:published-datetime&gt;</font></b>2010-04-01T18:30:00.453-04:00
  <b><font color="#3366FF">&lt;/vuln:published-datetime&gt;</font></b>
  <b><font color="#3366FF">&lt;vuln:last-modified-datetime&gt;</font></b>2010-04-05T00:00:00.000-04:00
  <b><font color="#3366FF">&lt;/vuln:last-modified-datetime&gt;</font></b>
  <b><font color="#3366FF">&lt;vuln:cvss&gt;</font></b>
    <b><font color="#3366FF">&lt;cvss:base_metrics&gt;</font></b>
      <b><font color="#3366FF">&lt;cvss:score&gt;</font></b>10.0<b><font color="#3366FF">&lt;/cvss:score&gt;</font></b>
      <b><font color="#3366FF">&lt;cvss:access-vector&gt;</font></b>NETWORK<b><font color="#3366FF">&lt;/cvss:access-vector&gt;</font></b>
      <b><font color="#3366FF">&lt;cvss:access-complexity&gt;</font></b>LOW<b><font color="#3366FF">&lt;/cvss:access-complexity&gt;</font></b>
      <b><font color="#3366FF">&lt;cvss:authentication&gt;</font></b>NONE<b><font color="#3366FF">&lt;/cvss:authentication&gt;</font></b>
      <b><font color="#3366FF">&lt;cvss:confidentiality-impact&gt;</font></b>COMPLETE<b><font color="#3366FF">&lt;/cvss:confidentiality-impact&gt;</font></b>
      <b><font color="#3366FF">&lt;cvss:integrity-impact&gt;</font></b>COMPLETE<b><font color="#3366FF">&lt;/cvss:integrity-impact&gt;</font></b>
      <b><font color="#3366FF">&lt;cvss:availability-impact&gt;</font></b>COMPLETE<b><font color="#3366FF">&lt;/cvss:availability-impact&gt;</font></b>
      <b><font color="#3366FF">&lt;cvss:source&gt;</font></b>http://nvd.nist.gov<b><font color="#3366FF">&lt;/cvss:source&gt;</font></b>
    <b><font color="#3366FF">&lt;/cvss:base_metrics&gt;</font></b>
  <b><font color="#3366FF">&lt;/vuln:cvss&gt;</font></b>
<b><font color="#3366FF">&lt;/entry&gt;</font></b>
</tt></pre>
</p>
<p><h4><b>Using Perl to Retrieve the CVE File</b></h4>
</p>
<p>
Initially we will read the <a href="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2010.xml">nvdcve-2.0-2010.xml</a> and <a href="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-2090.xml">nvdcve-2.0-2009.xml</a> files.  If we start retrieving the file regularly, we would want to change this to <a href="http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-recent.xml">nvdcve-2.0-recent.xml</a>.  Of course, previous years can also be read in to provide a longer perspective on vulnerabilities.  A simple example of a Perl subroutine to read the NVD CVE file and save it locally would be:
</p>
<p><pre><tt><b><font color="#3366FF">sub</font></b> readpage <font color="#CC3333">{</font>
   <b><font color="#3366FF">my</font></b><font color="#990000">(</font><font color="#009900">$url</font><font color="#990000">,</font><font color="#009900">$nvd_file</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">@_</font><font color="#990000">;</font>
   <b><font color="#3366FF">my</font></b><font color="#990000">(</font><font color="#009900">$proxy</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#CC3333">"http://your-proxy-server:proxy-port"</font><font color="#990000">;</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$ua</font> <font color="#990000">=</font> new LWP<font color="#990000">::</font>UserAgent<font color="#990000">;</font>
   <font color="#009900">$ua</font><font color="#990000">-&gt;</font><b><font color="#000000">proxy</font></b><font color="#990000">(</font>http  <font color="#990000">=&gt;</font> <font color="#009900">$proxy</font><font color="#990000">);</font>
   <font color="#009900">$ua</font><font color="#990000">-&gt;</font><b><font color="#000000">proxy</font></b><font color="#990000">(</font>ftp <font color="#990000">=&gt;</font> <font color="#009900">$proxy</font><font color="#990000">);</font>
   <font color="#009900">$ua</font><font color="#990000">-&gt;</font><b><font color="#000000">proxy</font></b><font color="#990000">(</font>https <font color="#990000">=&gt;</font> <font color="#009900">$proxy</font><font color="#990000">);</font>
   <i><font color="#996633"># Go out and retrieve page</font></i>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$req</font> <font color="#990000">=</font> new HTTP<font color="#990000">::</font><b><font color="#000000">Request</font></b><font color="#990000">(</font><font color="#CC3333">'GET'</font><font color="#990000">,</font> <font color="#009900">$url</font><font color="#990000">);</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$res</font> <font color="#990000">=</font> <font color="#009900">$ua</font><font color="#990000">-&gt;</font><b><font color="#000000">request</font></b><font color="#990000">(</font><font color="#009900">$req</font><font color="#990000">);</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$pjstatus</font> <font color="#990000">=</font> <font color="#993399">1</font><font color="#990000">;</font>
   <i><font color="#996633"># Check if the requested webpage is there and return results</font></i>
   <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$res</font><font color="#990000">-&gt;</font>is_success<font color="#990000">)</font> <font color="#CC3333">{</font> <i><font color="#996633"># Request successful</font></i>
       <b><font color="#3366FF">open</font></b><font color="#990000">(</font>OUTFILE<font color="#990000">,</font><font color="#CC3333">"&gt;$nvd_file"</font><font color="#990000">)</font> <font color="#990000">||</font> <font color="#990000">(</font><font color="#009900">$pjstatus</font> <font color="#990000">=</font> <font color="#993399">0</font><font color="#990000">);</font>
       <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$pjstatus</font><font color="#990000">)</font> <font color="#CC3333">{</font>
          <b><font color="#3366FF">print</font></b> OUTFILE <font color="#009900">$res</font><font color="#990000">-&gt;</font>content<font color="#990000">;</font>
       <font color="#CC3333">}</font>
       <b><font color="#3366FF">close</font></b><font color="#990000">(</font>OUTFILE<font color="#990000">);</font>
   <font color="#CC3333">}</font>
   <b><font color="#3366FF">else</font></b> <font color="#CC3333">{</font>
      <font color="#009900">$pjstatus</font> <font color="#990000">=</font> <font color="#993399">0</font><font color="#990000">;</font>
   <font color="#CC3333">}</font>
   <b><font color="#3366FF">return</font></b><font color="#990000">(</font><font color="#009900">$pjstatus</font><font color="#990000">);</font>
<font color="#CC3333">}</font>
</tt></pre>
</p>
<p>
Please <b>substitute</b> &#8220;http://your-proxy-server:proxy-port&#8221; with your site&#8217;s proxy server and port, if applicable.
</p>
<p><h4><b>Creating a MYSQL Table to Hold the Data</b></h4>
</p>
<p>
There is a great deal of information in the NVD CVE file.  You will need to determine what information your organization will be interested in storing and graphing.  For better or worse, folks have come to expect vulnerabilities to have a &#8220;Low,&#8221; &#8220;Medium,&#8221; or &#8220;High&#8221; score.  NIST has stated concerning the NVD Vulnerability <b>Severity Ratings</b>:</p>
<blockquote><p>
NVD provides severity rankings of &#8220;Low,&#8221; &#8220;Medium,&#8221; and &#8220;High&#8221; in addition to the numeric CVSS scores but these qualitative rankings are simply mapped from the numeric CVSS scores:<br />
1. Vulnerabilities are labeled &#8220;Low&#8221; severity if they have a CVSS base score of 0.0-3.9.<br />
2. Vulnerabilities will be labeled &#8220;Medium&#8221; severity if they have a base CVSS score of 4.0-6.9.<br />
3. Vulnerabilities will be labeled &#8220;High&#8221; severity if they have a CVSS base score of 7.0-10.0.
</p></blockquote>
<p>
While preferring quantitative over qualitative values, for this example I would like to create a stacked column chart.  We will add a severity column which is based on the CVSS score.  An example table follows:
</p>
<p><pre><tt><b><font color="#3366FF">CREATE</font></b> <b><font color="#3366FF">DATABASE</font></b> vulnerabilities<font color="#990000">;</font>
<b><font color="#3366FF">USE</font></b> vulnerabilities<font color="#990000">;</font>
<b><font color="#3366FF">DROP</font></b> <b><font color="#3366FF">TABLE</font></b> <b><font color="#3366FF">IF</font></b> <b><font color="#3366FF">EXISTS</font></b> <font color="#CC3333">`nvdcve`</font><font color="#990000">;</font>
<b><font color="#3366FF">CREATE</font></b> <b><font color="#3366FF">TABLE</font></b> <font color="#CC3333">`nvdcve`</font> <font color="#990000">(</font>
  <font color="#CC3333">`cve_id`</font> <font color="#009900">varchar</font><font color="#990000">(</font><font color="#993399">13</font><font color="#990000">)</font> <b><font color="#3366FF">NOT</font></b> <b><font color="#3366FF">NULL</font></b><font color="#990000">,</font>
  <font color="#CC3333">`published`</font> <font color="#009900">datetime</font> <b><font color="#3366FF">default</font></b> <b><font color="#3366FF">NULL</font></b><font color="#990000">,</font>
  <font color="#CC3333">`modified`</font> <font color="#009900">datetime</font> <b><font color="#3366FF">default</font></b> <b><font color="#3366FF">NULL</font></b><font color="#990000">,</font>
  <font color="#CC3333">`score`</font> <font color="#009900">DECIMAL</font><font color="#990000">(</font><font color="#993399">5</font><font color="#990000">,</font><font color="#993399">2</font><font color="#990000">)</font> <b><font color="#3366FF">default</font></b> <font color="#CC3333">'0.0'</font><font color="#990000">,</font>
  <font color="#CC3333">`severity`</font> <font color="#009900">varchar</font><font color="#990000">(</font><font color="#993399">6</font><font color="#990000">)</font> <b><font color="#3366FF">default</font></b> <font color="#CC3333">'LOW'</font><font color="#990000">,</font>
  <font color="#CC3333">`vector`</font> <font color="#009900">varchar</font><font color="#990000">(</font><font color="#993399">25</font><font color="#990000">)</font> <b><font color="#3366FF">default</font></b> <b><font color="#3366FF">NULL</font></b><font color="#990000">,</font>
  <font color="#CC3333">`complexity`</font> <font color="#009900">varchar</font><font color="#990000">(</font><font color="#993399">25</font><font color="#990000">)</font> <b><font color="#3366FF">default</font></b> <b><font color="#3366FF">NULL</font></b><font color="#990000">,</font>
  <font color="#CC3333">`authentication`</font> <font color="#009900">varchar</font><font color="#990000">(</font><font color="#993399">25</font><font color="#990000">)</font> <b><font color="#3366FF">default</font></b> <b><font color="#3366FF">NULL</font></b><font color="#990000">,</font>
  <font color="#CC3333">`confidentiality`</font> <font color="#009900">varchar</font><font color="#990000">(</font><font color="#993399">25</font><font color="#990000">)</font> <b><font color="#3366FF">default</font></b> <font color="#CC3333">'NONE'</font><font color="#990000">,</font>
  <font color="#CC3333">`integrity`</font> <font color="#009900">varchar</font><font color="#990000">(</font><font color="#993399">25</font><font color="#990000">)</font> <b><font color="#3366FF">default</font></b> <font color="#CC3333">'NONE'</font><font color="#990000">,</font>
  <font color="#CC3333">`availability`</font> <font color="#009900">varchar</font><font color="#990000">(</font><font color="#993399">25</font><font color="#990000">)</font> <b><font color="#3366FF">default</font></b> <font color="#CC3333">'NONE'</font><font color="#990000">,</font>
  <font color="#CC3333">`summary`</font> <font color="#009900">varchar</font><font color="#990000">(</font><font color="#993399">512</font><font color="#990000">)</font> <b><font color="#3366FF">default</font></b> <b><font color="#3366FF">NULL</font></b><font color="#990000">,</font>
  <b><font color="#3366FF">PRIMARY</font></b> <b><font color="#3366FF">KEY</font></b>  <font color="#990000">(</font><font color="#CC3333">`cve_id`</font><font color="#990000">),</font>
  <b><font color="#3366FF">INDEX</font></b> <font color="#990000">(</font>score<font color="#990000">),</font>
  <b><font color="#3366FF">INDEX</font></b> <font color="#990000">(</font>vector<font color="#990000">)</font>
<font color="#990000">)</font>
</tt></pre>
</p>
<p><h4><b>Using Perl Populating the Database</b></h4>
</p>
<p>
Populating the database table is simply a matter of reading the file and adding the entries to the table.  An example Perl subroutine follows:
</p>
<p>
<!-- Generator: GNU source-highlight 3.1.3<br />
by Lorenzo Bettini</p>
<p>http://www.lorenzobettini.it</p>
<p>http://www.gnu.org/software/src-highlite --></p>
<pre><tt><b><font color="#3366FF">sub</font></b> readxml <font color="#CC3333">{</font>
   <b><font color="#3366FF">my</font></b><font color="#990000">(</font><font color="#009900">$nvd_file</font><font color="#990000">,</font> <font color="#009900">$dbh</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">@_</font><font color="#990000">;</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$parser</font> <font color="#990000">=</font> XML<font color="#990000">::</font>LibXML<font color="#990000">-&gt;</font> <b><font color="#000000">new</font></b><font color="#990000">();</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$doc</font>    <font color="#990000">=</font> <font color="#009900">$parser</font><font color="#990000">-&gt;</font> <b><font color="#000000">parse_file</font></b><font color="#990000">(</font><font color="#009900">$nvd_file</font><font color="#990000">);</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$xc</font>     <font color="#990000">=</font> XML<font color="#990000">::</font>LibXML<font color="#990000">::</font>XPathContext<font color="#990000">-&gt;</font> <b><font color="#000000">new</font></b><font color="#990000">(</font> <font color="#009900">$doc</font><font color="#990000">-&gt;</font><b><font color="#000000">documentElement</font></b><font color="#990000">()</font> <font color="#990000">);</font>
   <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">registerNs</font></b><font color="#990000">(</font>
      def  <font color="#990000">=&gt;</font> <font color="#CC3333">'http://scap.nist.gov/schema/feed/vulnerability/2.0'</font> <font color="#990000">);</font>
   <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">registerNs</font></b><font color="#990000">(</font>
     vuln <font color="#990000">=&gt;</font> <font color="#CC3333">'http://scap.nist.gov/schema/vulnerability/0.4'</font> <font color="#990000">);</font>
   <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">registerNs</font></b><font color="#990000">(</font> cvss <font color="#990000">=&gt;</font> <font color="#CC3333">'http://scap.nist.gov/schema/cvss-v2/0.2'</font> <font color="#990000">);</font>
   <b><font color="#3366FF">for</font></b> <b><font color="#3366FF">my</font></b> <font color="#009900">$entry</font> <font color="#990000">(</font><font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">findnodes</font></b><font color="#990000">(</font><font color="#CC3333">"/def:nvd/def:entry"</font><font color="#990000">))</font> <font color="#CC3333">{</font>
      <b><font color="#3366FF">my</font></b> <font color="#009900">$cve</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'vuln:cve-id'</font><font color="#990000">,</font><font color="#009900">$entry</font><font color="#990000">);</font>
      <b><font color="#3366FF">my</font></b> <font color="#009900">$published</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'vuln:published-datetime'</font><font color="#990000">,</font> <font color="#009900">$entry</font><font color="#990000">);</font>
      <b><font color="#3366FF">my</font></b> <font color="#009900">$modified</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'vuln:last-modified-datetime'</font><font color="#990000">,</font> <font color="#009900">$entry</font><font color="#990000">);</font>
      <b><font color="#3366FF">my</font></b> <font color="#009900">$summary</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'vuln:summary'</font><font color="#990000">,</font> <font color="#009900">$entry</font><font color="#990000">);</font>
      <b><font color="#3366FF">my</font></b> <font color="#009900">$skip</font> <font color="#990000">=</font> <font color="#993399">0</font><font color="#990000">;</font>
      <b><font color="#3366FF">my</font></b> <font color="#990000">(</font><font color="#009900">$metrics</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">findnodes</font></b><font color="#990000">(</font><font color="#CC3333">'vuln:cvss/cvss:base_metrics'</font><font color="#990000">,</font> <font color="#009900">$entry</font><font color="#990000">)</font> <b><font color="#000000">or</font></b> <font color="#990000">(</font><font color="#009900">$skip</font> <font color="#990000">=</font> <font color="#993399">1</font><font color="#990000">);</font>
      <b><font color="#3366FF">if</font></b> <font color="#990000">(!</font> <font color="#009900">$skip</font><font color="#990000">)</font> <font color="#CC3333">{</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$score</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'cvss:score'</font><font color="#990000">,</font> <font color="#009900">$metrics</font><font color="#990000">);</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$vector</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'cvss:access-vector'</font><font color="#990000">,</font> <font color="#009900">$metrics</font><font color="#990000">);</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$complexity</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'cvss:access-complexity'</font><font color="#990000">,</font> <font color="#009900">$metrics</font><font color="#990000">);</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$authentication</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'cvss:authentication'</font><font color="#990000">,</font> <font color="#009900">$metrics</font><font color="#990000">);</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$confidentiality</font> <font color="#990000">=</font>
            <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'cvss:confidentiality-impact'</font><font color="#990000">,</font> <font color="#009900">$metrics</font><font color="#990000">);</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$integrity</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'cvss:integrity-impact'</font><font color="#990000">,</font> <font color="#009900">$metrics</font><font color="#990000">);</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$availability</font> <font color="#990000">=</font> <font color="#009900">$xc</font><font color="#990000">-&gt;</font> <b><font color="#000000">find</font></b><font color="#990000">(</font><font color="#CC3333">'cvss:availability-impact'</font><font color="#990000">,</font> <font color="#009900">$metrics</font><font color="#990000">);</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$severity</font> <font color="#990000">=</font> <font color="#CC3333">"LOW"</font><font color="#990000">;</font>
         <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><b><font color="#3366FF">int</font></b><font color="#990000">(</font><font color="#009900">$score</font><font color="#990000">)</font> <font color="#990000">&gt;=</font> <font color="#993399">7</font><font color="#990000">)</font> <font color="#CC3333">{</font>
            <font color="#009900">$severity</font> <font color="#990000">=</font> <font color="#CC3333">"HIGH"</font><font color="#990000">;</font>
         <font color="#CC3333">}</font>
         <b><font color="#3366FF">elsif</font></b> <font color="#990000">(</font><b><font color="#3366FF">int</font></b><font color="#990000">(</font><font color="#009900">$score</font><font color="#990000">)</font> <font color="#990000">&gt;=</font> <font color="#993399">4</font><font color="#990000">)</font> <font color="#CC3333">{</font>
            <font color="#009900">$severity</font> <font color="#990000">=</font> <font color="#CC3333">"MEDIUM"</font><font color="#990000">;</font>
         <font color="#CC3333">}</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$sql</font> <font color="#990000">=</font> <b><font color="#3366FF">qq</font></b><font color="#CC3333">{ SELECT count(*) FROM nvdcve WHERE cve_id=? }</font><font color="#990000">;</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$sth</font> <font color="#990000">=</font> <font color="#009900">$dbh</font><font color="#990000">-&gt;</font><b><font color="#000000">prepare</font></b><font color="#990000">(</font> <font color="#009900">$sql</font> <font color="#990000">);</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$rc</font> <font color="#990000">=</font> <font color="#009900">$sth</font><font color="#990000">-&gt;</font><b><font color="#000000">execute</font></b><font color="#990000">(</font><font color="#009900">$cve</font><font color="#990000">);</font>
         <b><font color="#3366FF">if</font></b> <font color="#990000">(</font> <font color="#009900">$rc</font><font color="#990000">)</font> <font color="#CC3333">{</font>
            <b><font color="#3366FF">my</font></b><font color="#990000">(</font><font color="#009900">$exist</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">$sth</font><font color="#990000">-&gt;</font><b><font color="#000000">fetchrow_array</font></b><font color="#990000">();</font>
            <b><font color="#3366FF">if</font></b> <font color="#990000">(!</font> <font color="#009900">$exist</font><font color="#990000">)</font> <font color="#CC3333">{</font>
                <font color="#009900">$sql</font> <font color="#990000">=</font> <b><font color="#3366FF">qq</font></b><font color="#CC3333">{</font> INSERT INTO nvdcve SET cve_id<font color="#990000">=?,</font>
published<font color="#990000">=?,</font> modified<font color="#990000">=?,</font> score<font color="#990000">=?,</font> severity<font color="#990000">=?,</font> vector<font color="#990000">=?,</font> complexity<font color="#990000">=?,</font>
authentication<font color="#990000">=?,</font> confidentiality<font color="#990000">=?,</font> integrity<font color="#990000">=?,</font>availability<font color="#990000">=?,</font> summary<font color="#990000">=?</font> <font color="#CC3333">}</font><font color="#990000">;</font>
               <font color="#009900">$sth</font> <font color="#990000">=</font> <font color="#009900">$dbh</font><font color="#990000">-&gt;</font><b><font color="#000000">prepare</font></b><font color="#990000">(</font> <font color="#009900">$sql</font> <font color="#990000">);</font>
               <font color="#009900">$rc</font> <font color="#990000">=</font> <font color="#009900">$sth</font><font color="#990000">-&gt;</font><b><font color="#000000">execute</font></b><font color="#990000">(</font><font color="#009900">$cve</font><font color="#990000">,</font><font color="#009900">$published</font><font color="#990000">,</font><font color="#009900">$modified</font><font color="#990000">,</font><font color="#009900">$score</font><font color="#990000">,</font>
<font color="#009900">$severity</font><font color="#990000">,</font><font color="#009900">$vector</font><font color="#990000">,</font><font color="#009900">$complexity</font><font color="#990000">,</font><font color="#009900">$authentication</font><font color="#990000">,</font>
<font color="#009900">$confidentiality</font><font color="#990000">,</font><font color="#009900">$integrity</font><font color="#990000">,</font><font color="#009900">$availability</font><font color="#990000">,</font><font color="#009900">$summary</font><font color="#990000">);</font>
            <font color="#CC3333">}</font>
         <font color="#CC3333">}</font>
      <font color="#CC3333">}</font>
   <font color="#CC3333">}</font>
<font color="#CC3333">}</font>
</tt></pre>
</p>
<p><h4><b>The Perl Program to Pull It All Together</b></h4>
</p>
<p>
The above subroutines use the Perl modules <a href="http://search.cpan.org/~gaas/libwww-perl-5.834/lib/LWP/UserAgent.pm">LWP::UserAgent</a>, <a href="http://search.cpan.org/~pajas/XML-LibXML-1.70/LibXML.pod">XML::LibXML</a>, <a href="http://search.cpan.org/~pajas/XML-LibXML-XPathContext/">XML::LibXML::XPathContext</a>, and <a href="http://search.cpan.org/~timb/DBI-1.609/">DBI</a>. A sample Perl program that calls the above subroutines to pull down the NVD CVE data and load it into a MySQL table would be:
</p>
<p>
<!-- Generator: GNU source-highlight 3.1.3<br />
by Lorenzo Bettini</p>
<p>http://www.lorenzobettini.it</p>
<p>http://www.gnu.org/software/src-highlite --></p>
<pre><tt><i><font color="#996633">#!/usr/local/bin/perl -w</font></i>
<b><font color="#3366FF">use</font></b> LWP<font color="#990000">::</font>UserAgent<font color="#990000">;</font>
<b><font color="#3366FF">use</font></b> XML<font color="#990000">::</font>LibXML<font color="#990000">;</font>
<b><font color="#3366FF">use</font></b> XML<font color="#990000">::</font>LibXML<font color="#990000">::</font>XPathContext<font color="#990000">;</font>
<b><font color="#3366FF">use</font></b> DBI<font color="#990000">;</font>
BEGIN<font color="#CC3333">{</font><b><font color="#3366FF">push</font></b> <font color="#009900">@INC</font><font color="#990000">,</font> <font color="#CC3333">"/home/jgerber/projects/nvd/perl"</font><font color="#CC3333">}</font>
<b><font color="#3366FF">use</font></b> nvdsubs <b><font color="#3366FF">qw</font></b><font color="#990000">(</font><font color="#009900">$db_host</font> <font color="#009900">$db</font> <font color="#009900">$mysql_user</font> <font color="#009900">$mysql_passwd</font> <font color="#009900">$mysql</font><font color="#990000">.</font>sock
readpage readxml <font color="#990000">);</font>
<i><font color="#996633"># Main</font></i>
<b><font color="#3366FF">my</font></b> <font color="#009900">$datadir</font> <font color="#990000">=</font> <font color="#CC3333">"/home/johngerber/projects/nvd/data"</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">@timeData</font> <font color="#990000">=</font> <b><font color="#000000">localtime</font></b><font color="#990000">(</font>time<font color="#990000">);</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$year</font> <font color="#990000">=</font> <font color="#993399">1900</font> <font color="#990000">+</font> <font color="#009900">$timeData</font><font color="#990000">[</font><font color="#993399">5</font><font color="#990000">];</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$prev_year</font> <font color="#990000">=</font> <font color="#993399">1900</font> <font color="#990000">+</font> <font color="#009900">$timeData</font><font color="#990000">[</font><font color="#993399">5</font><font color="#990000">]</font> <font color="#990000">-</font> <font color="#993399">1</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$url</font> <font color="#990000">=</font> <font color="#CC3333">"http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-"</font> <font color="#990000">.</font>
    <font color="#009900">$year</font> <font color="#990000">.</font> <font color="#CC3333">".xml"</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$prev_url</font> <font color="#990000">=</font> <font color="#CC3333">"http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-"</font> <font color="#990000">.</font>
    <font color="#009900">$prev_year</font> <font color="#990000">.</font> <font color="#CC3333">".xml"</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$nvd_file</font> <font color="#990000">=</font> <font color="#009900">$datadir</font>  <font color="#990000">.</font> <font color="#CC3333">"/nvdcve-"</font><font color="#990000">.</font> <font color="#009900">$year</font> <font color="#990000">.</font> <font color="#CC3333">".xml"</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$prev_nvd_file</font> <font color="#990000">=</font> <font color="#009900">$datadir</font>  <font color="#990000">.</font> <font color="#CC3333">"/nvdcve-"</font><font color="#990000">.</font> <font color="#009900">$prev_year</font> <font color="#990000">.</font> <font color="#CC3333">".xml"</font><font color="#990000">;</font>
<font color="#009900">$db</font> <font color="#990000">=</font> <font color="#CC3333">"vulnerabilities"</font><font color="#990000">;</font>
<b><font color="#3366FF">local</font></b><font color="#990000">(</font><font color="#009900">$dbh</font><font color="#990000">)</font> <font color="#990000">=</font> DBI<font color="#990000">-&gt;</font><b><font color="#000000">connect</font></b><font color="#990000">(</font><font color="#CC3333">"DBI:mysql:mysql_socket=$mysql.sock;$db:$db_host"</font><font color="#990000">,</font>
<font color="#009900">$mysql_user</font><font color="#990000">,</font> <font color="#009900">$mysql_passwd</font><font color="#990000">)</font> <font color="#990000">||</font> <b><font color="#3366FF">die</font></b> <font color="#CC3333">"ERROR: Connecting: $DBI::errstr\n"</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#990000">(</font><font color="#009900">$pjstatus</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#990000">&amp;</font><b><font color="#000000">readpage</font></b><font color="#990000">(</font><font color="#009900">$prev_url</font><font color="#990000">,</font><font color="#009900">$prev_nvd_file</font><font color="#990000">);</font>
<b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$pjstatus</font><font color="#990000">)</font> <font color="#CC3333">{</font>
   <font color="#990000">&amp;</font><b><font color="#000000">readxml</font></b><font color="#990000">(</font><font color="#009900">$prev_nvd_file</font><font color="#990000">,</font><font color="#009900">$dbh</font><font color="#990000">);</font>
<font color="#CC3333">}</font>
<font color="#009900">$pjstatus</font> <font color="#990000">=</font> <font color="#990000">&amp;</font><b><font color="#000000">readpage</font></b><font color="#990000">(</font><font color="#009900">$url</font><font color="#990000">,</font><font color="#009900">$nvd_file</font><font color="#990000">);</font>
<b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$pjstatus</font><font color="#990000">)</font> <font color="#CC3333">{</font>
   <font color="#990000">&amp;</font><b><font color="#000000">readxml</font></b><font color="#990000">(</font><font color="#009900">$nvd_file</font><font color="#990000">,</font><font color="#009900">$dbh</font><font color="#990000">);</font>
<font color="#CC3333">}</font>
<b><font color="#3366FF">exit</font></b><font color="#990000">;</font>
</tt></pre>
</p>
<p>
The <b>nvdsubs.pm</b> file will not be included in this post.  The subroutines are defined and the only pieces missing are the MySQL database username and password.  You don&#8217;t need mine.  Add your own.  At this point, we have everything we need to finally use Google Visualization to create a graph.
</p>
<p><h3>Google Visualization</h3>
</p>
<p>
We are going to create a Perl program that will read our MySQL nvdcve table and generate the JavaScript that will render our charts on the client&#8217;s browser.  First, we want to define the JavaScript we want to produce.  Just to alleviate some concerns, with Google Visualization your data is only shared between your server and the client connecting.  This is unlike Google Charts where your data is sent to Google where it is made into a chart and the result is sent back.  Google states concerning the logging of chart data (via Google Charts), &#8220;The chart data included in the HTTP request is saved in temporary logs for no longer than two weeks for internal testing and debugging purposes.&#8221;  Every example in the Google Visualization Gallery will state the data policy.  For Google Charts, stated at the bottom of the page for each gadget description the data policy:
</p>
<p>
<img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/GoogleChartDataPolicy.png" />
</p>
<p>
While Google Visualization gadgets will have the following stated data policy:
</p>
<p>
<img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/GoogleVisDataPolicy.png" />
</p>
<p><h4><b>Loading Google Libraries</b></h4>
</p>
<p>
The first thing the JavaScript needs to do is load the required libraries.  This is accomplished with the lines:
</p>
<p><pre>
&lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
</pre>
</p>
<p><h4><b>Area Chart and Table</b></h4>
</p>
<p>
In this example we are going to create an <a href="http://code.google.com/apis/visualization/documentation/gallery/columnchart.html">column chart</a>. In a later section, &#8220;Other Charting Options&#8221; (see below) we define different Google Visualization charting options.
</p>
<p>
JavaScript code for a sample column chart would be:
</p>
<p>
<!-- Generator: GNU source-highlight 3.1.3<br />
by Lorenzo Bettini</p>
<p>http://www.lorenzobettini.it</p>
<p>http://www.gnu.org/software/src-highlite --></p>
<pre><tt>    <font color="#990000">&lt;</font>script type<font color="#990000">=</font><font color="#CC3333">'text/javascript'</font><font color="#990000">&gt;</font>
      google<font color="#990000">.</font><b><font color="#000000">load</font></b><font color="#990000">(</font><font color="#CC3333">'visualization'</font><font color="#990000">,</font> <font color="#CC3333">'1'</font><font color="#990000">,</font> <font color="#CC3333">{</font>packages<font color="#990000">:[</font><font color="#CC3333">'columnchart'</font><font color="#990000">]</font><font color="#CC3333">}</font><font color="#990000">);</font>
      google<font color="#990000">.</font><b><font color="#000000">setOnLoadCallback</font></b><font color="#990000">(</font>drawChart<font color="#990000">);</font>
      <b><font color="#008080">function</font></b> <b><font color="#000000">drawChart</font></b><font color="#990000">()</font> <font color="#CC3333">{</font>
        <b><font color="#008080">var</font></b> data <font color="#990000">=</font> <b><font color="#008080">new</font></b> google<font color="#990000">.</font>visualization<font color="#990000">.</font><b><font color="#000000">DataTable</font></b><font color="#990000">();</font>
        data<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'date'</font><font color="#990000">,</font> <font color="#CC3333">'Date'</font><font color="#990000">);</font>
        data<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'High'</font><font color="#990000">);</font>
        data<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'Medium'</font><font color="#990000">);</font>
        data<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'Low'</font><font color="#990000">);</font>
        data<font color="#990000">.</font><b><font color="#000000">addRows</font></b><font color="#990000">([</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">0</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font><font color="#993399">92</font><font color="#990000">,</font><font color="#993399">97</font><font color="#990000">,</font><font color="#993399">3</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">1</font><font color="#990000">,</font> <font color="#993399">27</font><font color="#990000">),</font><font color="#993399">168</font><font color="#990000">,</font><font color="#993399">142</font><font color="#990000">,</font><font color="#993399">25</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">2</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font><font color="#993399">141</font><font color="#990000">,</font><font color="#993399">165</font><font color="#990000">,</font><font color="#993399">9</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">3</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font><font color="#993399">132</font><font color="#990000">,</font><font color="#993399">203</font><font color="#990000">,</font><font color="#993399">12</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">4</font><font color="#990000">,</font> <font color="#993399">29</font><font color="#990000">),</font><font color="#993399">158</font><font color="#990000">,</font><font color="#993399">153</font><font color="#990000">,</font><font color="#993399">8</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">5</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font><font color="#993399">200</font><font color="#990000">,</font><font color="#993399">199</font><font color="#990000">,</font><font color="#993399">22</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">6</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font><font color="#993399">190</font><font color="#990000">,</font><font color="#993399">195</font><font color="#990000">,</font><font color="#993399">11</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">7</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font><font color="#993399">127</font><font color="#990000">,</font><font color="#993399">139</font><font color="#990000">,</font><font color="#993399">14</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">8</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font><font color="#993399">233</font><font color="#990000">,</font><font color="#993399">208</font><font color="#990000">,</font><font color="#993399">14</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">9</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font><font color="#993399">163</font><font color="#990000">,</font><font color="#993399">167</font><font color="#990000">,</font><font color="#993399">18</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">10</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font><font color="#993399">129</font><font color="#990000">,</font><font color="#993399">172</font><font color="#990000">,</font><font color="#993399">8</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">11</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font><font color="#993399">200</font><font color="#990000">,</font><font color="#993399">211</font><font color="#990000">,</font><font color="#993399">19</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2010</font><font color="#990000">,</font> <font color="#993399">0</font><font color="#990000">,</font> <font color="#993399">29</font><font color="#990000">),</font><font color="#993399">157</font><font color="#990000">,</font><font color="#993399">139</font><font color="#990000">,</font><font color="#993399">14</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2010</font><font color="#990000">,</font> <font color="#993399">1</font><font color="#990000">,</font> <font color="#993399">26</font><font color="#990000">),</font><font color="#993399">137</font><font color="#990000">,</font><font color="#993399">143</font><font color="#990000">,</font><font color="#993399">12</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2010</font><font color="#990000">,</font> <font color="#993399">2</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font><font color="#993399">252</font><font color="#990000">,</font><font color="#993399">242</font><font color="#990000">,</font><font color="#993399">18</font><font color="#990000">],</font>
           <font color="#990000">[</font><b><font color="#008080">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2010</font><font color="#990000">,</font> <font color="#993399">3</font><font color="#990000">,</font> <font color="#993399">13</font><font color="#990000">),</font><font color="#993399">92</font><font color="#990000">,</font><font color="#993399">118</font><font color="#990000">,</font><font color="#993399">17</font><font color="#990000">]</font>
        <font color="#990000">]);</font>
        <b><font color="#008080">var</font></b> chart <font color="#990000">=</font> <b><font color="#008080">new</font></b> google<font color="#990000">.</font>visualization<font color="#990000">.</font><b><font color="#000000">ColumnChart</font></b><font color="#990000">(</font>document<font color="#990000">.</font><b><font color="#000000">getElementById</font></b><font color="#990000">(</font><font color="#CC3333">'s4graph'</font><font color="#990000">));</font>
        chart<font color="#990000">.</font><b><font color="#000000">draw</font></b><font color="#990000">(</font>data<font color="#990000">,</font> <font color="#CC3333">{</font>displayAnnotations<font color="#990000">:</font><b><font color="#008080">true</font></b><font color="#990000">,</font> is3D<font color="#990000">:</font> <b><font color="#008080">true</font></b><font color="#990000">,</font> isStacked<font color="#990000">:</font> <b><font color="#008080">true</font></b><font color="#990000">,</font> min<font color="#990000">:</font> <font color="#993399">0</font><font color="#990000">,</font>
          allowHtml<font color="#990000">:</font> <b><font color="#008080">true</font></b><font color="#990000">,</font> colors<font color="#990000">:[</font><font color="#CC3333">{</font>color<font color="#990000">:</font><font color="#CC3333">'#E41B17'</font><font color="#990000">,</font> darker<font color="#990000">:</font><font color="#CC3333">'#C11B17'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#CC3333">{</font>color<font color="#990000">:</font><font color="#CC3333">'#FFA500'</font><font color="#990000">,</font> darker<font color="#990000">:</font><font color="#CC3333">'#E56717'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#CC3333">{</font>color<font color="#990000">:</font><font color="#CC3333">'#FFE87C'</font><font color="#990000">,</font> darker<font color="#990000">:</font><font color="#CC3333">'#C8B560'</font><font color="#CC3333">}</font><font color="#990000">]</font><font color="#CC3333">}</font><font color="#990000">);</font>
      <font color="#CC3333">}</font>
    <font color="#990000">&lt;/</font>script<font color="#990000">&gt;</font>
</tt></pre>
</p>
<p>
The resulting image would be the following column chart:
</p>
<p>
<img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/googlecolumn.png"  width=500 />
</p>
<p><h4><b>Rendering the Table</b></h4>
</p>
<p>
When providing qualitative results, I like to back them up with more accurate numeric values.  Let us include a table with links to the CVSS scores for each vulnerability.
</p>
<p>
<!-- Generator: GNU source-highlight 3.1.3<br />
by Lorenzo Bettini</p>
<p>http://www.lorenzobettini.it</p>
<p>http://www.gnu.org/software/src-highlite --></p>
<pre><tt>    <font color="#990000">&lt;</font>script type<font color="#990000">=</font><font color="#CC3333">'text/javascript'</font><font color="#990000">&gt;</font>
      google<font color="#990000">.</font><b><font color="#000000">load</font></b><font color="#990000">(</font><font color="#CC3333">'visualization'</font><font color="#990000">,</font> <font color="#CC3333">'1'</font><font color="#990000">,</font> <font color="#CC3333">{</font>packages<font color="#990000">:[</font><font color="#CC3333">'table'</font><font color="#990000">]</font><font color="#CC3333">}</font><font color="#990000">);</font>
      google<font color="#990000">.</font><b><font color="#000000">setOnLoadCallback</font></b><font color="#990000">(</font>drawChart<font color="#990000">);</font>
      <b><font color="#3366FF">function</font></b> <b><font color="#000000">drawChart</font></b><font color="#990000">()</font> <font color="#CC3333">{</font>
        <b><font color="#3366FF">var</font></b> data2 <font color="#990000">=</font> <b><font color="#3366FF">new</font></b> google<font color="#990000">.</font>visualization<font color="#990000">.</font><b><font color="#000000">DataTable</font></b><font color="#990000">();</font>
        data2<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'date'</font><font color="#990000">,</font> <font color="#CC3333">'Date'</font><font color="#990000">);</font>
        data2<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'High'</font><font color="#990000">);</font>
        data2<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'Medium'</font><font color="#990000">);</font>
        data2<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'Low'</font><font color="#990000">);</font>
        data2<font color="#990000">.</font><b><font color="#000000">addRows</font></b><font color="#990000">([</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">0</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-01"&gt;2009-01-30&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">92</font><font color="#990000">,</font><font color="#993399">97</font><font color="#990000">,</font><font color="#993399">3</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">1</font><font color="#990000">,</font> <font color="#993399">27</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-02"&gt;2009-02-27&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">168</font><font color="#990000">,</font><font color="#993399">142</font><font color="#990000">,</font><font color="#993399">25</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">2</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-03"&gt;2009-03-31&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">141</font><font color="#990000">,</font><font color="#993399">165</font><font color="#990000">,</font><font color="#993399">9</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">3</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-04"&gt;2009-04-30&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">132</font><font color="#990000">,</font><font color="#993399">203</font><font color="#990000">,</font><font color="#993399">12</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">4</font><font color="#990000">,</font> <font color="#993399">29</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-05"&gt;2009-05-29&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">158</font><font color="#990000">,</font><font color="#993399">153</font><font color="#990000">,</font><font color="#993399">8</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">5</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-06"&gt;2009-06-30&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">200</font><font color="#990000">,</font><font color="#993399">199</font><font color="#990000">,</font><font color="#993399">22</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">6</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-07"&gt;2009-07-31&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">190</font><font color="#990000">,</font><font color="#993399">195</font><font color="#990000">,</font><font color="#993399">11</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">7</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-08"&gt;2009-08-31&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">127</font><font color="#990000">,</font><font color="#993399">139</font><font color="#990000">,</font><font color="#993399">14</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">8</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-09"&gt;2009-09-30&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">233</font><font color="#990000">,</font><font color="#993399">208</font><font color="#990000">,</font><font color="#993399">14</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">9</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-10"&gt;2009-10-30&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">163</font><font color="#990000">,</font><font color="#993399">167</font><font color="#990000">,</font><font color="#993399">18</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">10</font><font color="#990000">,</font> <font color="#993399">30</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-11"&gt;2009-11-30&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">129</font><font color="#990000">,</font><font color="#993399">172</font><font color="#990000">,</font><font color="#993399">8</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2009</font><font color="#990000">,</font> <font color="#993399">11</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2009-12"&gt;2009-12-31&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">200</font><font color="#990000">,</font><font color="#993399">211</font><font color="#990000">,</font><font color="#993399">19</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2010</font><font color="#990000">,</font> <font color="#993399">0</font><font color="#990000">,</font> <font color="#993399">29</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2010-01"&gt;2010-01-29&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">157</font><font color="#990000">,</font><font color="#993399">139</font><font color="#990000">,</font><font color="#993399">14</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2010</font><font color="#990000">,</font> <font color="#993399">1</font><font color="#990000">,</font> <font color="#993399">26</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2010-02"&gt;2010-02-26&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">137</font><font color="#990000">,</font><font color="#993399">143</font><font color="#990000">,</font><font color="#993399">12</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2010</font><font color="#990000">,</font> <font color="#993399">2</font><font color="#990000">,</font> <font color="#993399">31</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2010-03"&gt;2010-03-31&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">252</font><font color="#990000">,</font><font color="#993399">242</font><font color="#990000">,</font><font color="#993399">18</font><font color="#990000">],</font>
           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font><b><font color="#3366FF">new</font></b> <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#993399">2010</font><font color="#990000">,</font> <font color="#993399">3</font><font color="#990000">,</font> <font color="#993399">13</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="/nvd/cvealerts.php?date=2010-04"&gt;2010-04-13&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#993399">92</font><font color="#990000">,</font><font color="#993399">118</font><font color="#990000">,</font><font color="#993399">17</font><font color="#990000">],</font>
        <font color="#990000">]);</font>
        <b><font color="#3366FF">var</font></b> table <font color="#990000">=</font> <b><font color="#3366FF">new</font></b> google<font color="#990000">.</font>visualization<font color="#990000">.</font><b><font color="#000000">Table</font></b><font color="#990000">(</font>document<font color="#990000">.</font><b><font color="#000000">getElementById</font></b><font color="#990000">(</font><font color="#CC3333">'s4graph_tab'</font><font color="#990000">));</font>
        table<font color="#990000">.</font><b><font color="#000000">draw</font></b><font color="#990000">(</font>data2<font color="#990000">,</font> <font color="#CC3333">{</font>showRowNumber<font color="#990000">:</font> <b><font color="#3366FF">true</font></b><font color="#990000">,</font> sortAscending<font color="#990000">:</font> <b><font color="#3366FF">false</font></b><font color="#990000">,</font> sortColumn<font color="#990000">:</font> <font color="#993399">0</font><font color="#990000">,</font> allowHtml<font color="#990000">:</font> <b><font color="#3366FF">true</font></b><font color="#CC3333">}</font><font color="#990000">);</font>
      <font color="#CC3333">}</font>
    <font color="#990000">&lt;/</font>script<font color="#990000">&gt;</font>
</tt></pre>
</p>
<p>
The JavaScript code assumes there is a PHP program called <b>cvealerts.php</b> under the <b>/nvd</b> directory on your web server.  Adjust to your environment.  A sample PHP program that could be used for cvealerts.php is provided below.  The resulting table chart would look like:
</p>
<p>
<img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/googletable.png" width=500 />
</p>
<p><h4><b>Handling Events: Interactions Between Graphs</b></h4>
</p>
<p>
We now have two different types of graphs representing the same data.  We want to add interaction between the graphs so the viewer can see the relationship.  With tables rows are selected when the user clicks, which correspond to the whole column of the stacked column chart.  It is not a perfect fit, but it does demonstrate nicely use of adding interactions.
</p>
<p>
<!-- Generator: GNU source-highlight 3.1.3<br />
by Lorenzo Bettini</p>
<p>http://www.lorenzobettini.it</p>
<p>http://www.gnu.org/software/src-highlite --></p>
<pre><tt>        <i><font color="#996633">// Set a 'select' event listener for the table.</font></i>
        <i><font color="#996633">// When the table is selected,</font></i>
        <i><font color="#996633">// we set the selection on the line graph.</font></i>
        google<font color="#990000">.</font>visualization<font color="#990000">.</font>events<font color="#990000">.</font><b><font color="#000000">addListener</font></b><font color="#990000">(</font>table<font color="#990000">,</font> <font color="#CC3333">'select'</font><font color="#990000">,</font> <b><font color="#3366FF">function</font></b><font color="#990000">()</font> <font color="#CC3333">{</font>
          chart<font color="#990000">.</font><b><font color="#000000">setSelection</font></b><font color="#990000">([</font><font color="#CC3333">{</font>row<font color="#990000">:</font> table<font color="#990000">.</font><b><font color="#000000">getSelection</font></b><font color="#990000">()[</font><font color="#993399">0</font><font color="#990000">].</font>row<font color="#990000">,</font> column<font color="#990000">:</font> <font color="#993399">1</font><font color="#CC3333">}</font><font color="#990000">]);</font>
         <font color="#CC3333">}</font><font color="#990000">);</font>
        <i><font color="#996633">// Set a 'select' event listener for the graph.</font></i>
        <i><font color="#996633">// When the graph is selected,</font></i>
        <i><font color="#996633">// we set the selection on the table.</font></i>
        google<font color="#990000">.</font>visualization<font color="#990000">.</font>events<font color="#990000">.</font><b><font color="#000000">addListener</font></b><font color="#990000">(</font>chart<font color="#990000">,</font> <font color="#CC3333">'select'</font><font color="#990000">,</font> <b><font color="#3366FF">function</font></b><font color="#990000">()</font> <font color="#CC3333">{</font>
           table<font color="#990000">.</font><b><font color="#000000">setSelection</font></b><font color="#990000">([</font><font color="#CC3333">{</font>row<font color="#990000">:</font> chart<font color="#990000">.</font><b><font color="#000000">getSelection</font></b><font color="#990000">()[</font><font color="#993399">0</font><font color="#990000">].</font>row<font color="#CC3333">}</font><font color="#990000">]);</font>
        <font color="#CC3333">}</font><font color="#990000">);</font>
</tt></pre>
</p>
<p><h4><b>Providing Detailed Information</b></h4>
</p>
<p>
When the table chart link is clicked, we would like to provide some detailed information about the vulnerability.  For this example, we will do this with a simple PHP program placed in the /nvd directory on the web server.  The program is called cvealerts.php.
</p>
<p>
<!-- Generator: GNU source-highlight 3.1.3<br />
by Lorenzo Bettini</p>
<p>http://www.lorenzobettini.it</p>
<p>http://www.gnu.org/software/src-highlite --></p>
<pre><tt><font color="#990000">&lt;?</font>
<b><font color="#000000">session_start</font></b><font color="#990000">();</font>
<b><font color="#3366FF">function</font></b> <b><font color="#000000">db_connect</font></b><font color="#990000">(</font><font color="#009900">$table</font><font color="#990000">)</font> <font color="#CC3333">{</font>
   <font color="#009900">$result</font> <font color="#990000">=</font> <b><font color="#000000">mysql_pconnect</font></b><font color="#990000">(</font><font color="#CC3333">"&lt;dbhost&gt;:&lt;dbport&gt;"</font><font color="#990000">,</font> <font color="#CC3333">"&lt;username&gt;"</font><font color="#990000">,</font> <font color="#CC3333">"&lt;password&gt;"</font><font color="#990000">);</font>
   <b><font color="#3366FF">if</font></b> <font color="#990000">(!</font><font color="#009900">$result</font><font color="#990000">)</font> <b><font color="#3366FF">return</font></b> false<font color="#990000">;</font>
   <b><font color="#3366FF">if</font></b> <font color="#990000">(!</font><b><font color="#000000">mysql_select_db</font></b><font color="#990000">(</font><font color="#009900">$table</font><font color="#990000">))</font> <b><font color="#3366FF">return</font></b> false<font color="#990000">;</font>
   <b><font color="#3366FF">return</font></b> <font color="#009900">$result</font><font color="#990000">;</font>
<font color="#CC3333">}</font>
<b><font color="#3366FF">function</font></b> <b><font color="#000000">do_html_header</font></b><font color="#990000">(</font><font color="#009900">$title</font><font color="#990000">,</font><font color="#009900">$checkuser</font><font color="#990000">,</font><font color="#009900">$logpage</font><font color="#990000">)</font> <font color="#CC3333">{</font>
<font color="#990000">?&gt;</font>
  <font color="#990000">&lt;</font>html<font color="#990000">&gt;</font> <font color="#990000">&lt;</font>head<font color="#990000">&gt;</font> <font color="#990000">&lt;</font>title<font color="#990000">&gt;&lt;?=</font><font color="#009900">$title</font><font color="#990000">?&gt;&lt;/</font>title<font color="#990000">&gt;&lt;/</font>head<font color="#990000">&gt;</font>
  <font color="#990000">&lt;</font>body bgcolor<font color="#990000">=</font><font color="#CC3333">"#FFFFFF"</font><font color="#990000">&gt;</font>
<font color="#990000">&lt;?</font>
<font color="#CC3333">}</font>
<b><font color="#3366FF">function</font></b> <b><font color="#000000">do_html_footer</font></b><font color="#990000">()</font> <font color="#CC3333">{</font>
<font color="#990000">?&gt;</font>
<font color="#990000">&lt;</font>table<font color="#990000">&gt;</font>
<font color="#990000">&lt;</font>tr<font color="#990000">&gt;&lt;</font>td ALIGN<font color="#990000">=</font>CENTER NOWRAP WIDTH<font color="#990000">=</font><font color="#CC3333">"590"</font><font color="#990000">&gt;&lt;/</font>font<font color="#990000">&gt;</font>
<font color="#990000">&lt;</font>font face<font color="#990000">=</font><font color="#CC3333">"Verdana, Arial, Helvetica"</font> size<font color="#990000">=-</font><font color="#993399">2</font><font color="#990000">&gt;</font>Notice to Users<font color="#990000">:</font> Use
of this system constitutes consent to security monitoring <b><font color="#3366FF">and</font></b> testing<font color="#990000">.</font>
<font color="#990000">&lt;</font>br<font color="#990000">&gt;</font>All activity is logged with your host name <b><font color="#3366FF">and</font></b> IP address<font color="#990000">.&lt;/</font>font<font color="#990000">&gt;</font>
<font color="#990000">&lt;/</font>td<font color="#990000">&gt;&lt;/</font>tr<font color="#990000">&gt;</font>
<font color="#990000">&lt;/</font>table<font color="#990000">&gt;</font>
<font color="#990000">&lt;/</font>body<font color="#990000">&gt;</font>
 <font color="#990000">&lt;/</font>html<font color="#990000">&gt;</font>
<font color="#990000">&lt;?</font>
<font color="#CC3333">}</font>
<i><font color="#996633">// Main</font></i>
<font color="#009900">$dates</font><font color="#990000">=</font> <b><font color="#3366FF">array</font></b><font color="#990000">();</font>
<font color="#009900">$stringlist</font> <font color="#990000">=</font> <font color="#CC3333">""</font><font color="#990000">;</font>
<b><font color="#3366FF">if</font></b> <font color="#990000">(</font><b><font color="#3366FF">isset</font></b><font color="#990000">(</font><font color="#009900">$_GET</font><font color="#990000">[</font><font color="#CC3333">'date'</font><font color="#990000">]))</font> <font color="#CC3333">{</font>
    <font color="#009900">$passdates</font> <font color="#990000">=</font> <b><font color="#000000">explode</font></b><font color="#990000">(</font><font color="#CC3333">","</font><font color="#990000">,</font><font color="#009900">$_GET</font><font color="#990000">[</font><font color="#CC3333">'date'</font><font color="#990000">]);</font>
    <b><font color="#3366FF">for</font></b> <font color="#990000">(</font><font color="#009900">$index</font><font color="#990000">=</font><font color="#993399">0</font><font color="#990000">;</font> <font color="#009900">$index</font><font color="#990000">&lt;</font><b><font color="#000000">count</font></b><font color="#990000">(</font><font color="#009900">$passdates</font><font color="#990000">);</font> <font color="#009900">$index</font><font color="#990000">++)</font> <font color="#CC3333">{</font>
       <b><font color="#000000">array_push</font></b><font color="#990000">(</font><font color="#009900">$dates</font><font color="#990000">,</font> <font color="#009900">$passdates</font><font color="#990000">[</font><font color="#009900">$index</font><font color="#990000">]);</font>
       <font color="#009900">$stringlist</font> <font color="#990000">.=</font> <font color="#009900">$passdates</font><font color="#990000">[</font><font color="#009900">$index</font><font color="#990000">]</font> <font color="#990000">.</font> <font color="#CC3333">" "</font><font color="#990000">;</font>
    <font color="#CC3333">}</font>
<font color="#CC3333">}</font>
<b><font color="#3366FF">else</font></b> <font color="#CC3333">{</font>
  <b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#CC3333">"Confusion over how you arrived at this page.&lt;P&gt;\n"</font><font color="#990000">);</font>
  <b><font color="#3366FF">exit</font></b><font color="#990000">;</font>
<font color="#CC3333">}</font>
<font color="#009900">$stringlist</font> <font color="#990000">=</font> <b><font color="#000000">preg_replace</font></b><font color="#990000">(</font><font color="#CC3333">"/ $/"</font><font color="#990000">,</font> <font color="#CC3333">""</font><font color="#990000">,</font><font color="#009900">$stringlist</font><font color="#990000">);</font>
<b><font color="#000000">do_html_header</font></b><font color="#990000">(</font><font color="#CC3333">"Review NVD CVE Announcements for Month Ending $stringlist"</font><font color="#990000">,</font><font color="#993399">1</font><font color="#990000">,</font><font color="#993399">1</font><font color="#990000">);</font>
<font color="#009900">$nvd_host</font> <font color="#990000">=</font> <font color="#CC3333">"http://web.nvd.nist.gov/view/vuln/detail?vulnId="</font><font color="#990000">;</font>
<font color="#009900">$conn</font> <font color="#990000">=</font> <b><font color="#000000">db_connect</font></b><font color="#990000">(</font><font color="#CC3333">"vulnerabilities"</font><font color="#990000">);</font>
<b><font color="#3366FF">if</font></b> <font color="#990000">(!</font><font color="#009900">$conn</font><font color="#990000">)</font>
   <b><font color="#000000">logit</font></b><font color="#990000">(</font><font color="#CC3333">"Could not connect to database vulnerabilities - please try later.\n"</font><font color="#990000">,</font><font color="#993399">1</font><font color="#990000">);</font>
<b><font color="#3366FF">for</font></b> <font color="#990000">(</font><font color="#009900">$index</font><font color="#990000">=</font><font color="#993399">0</font><font color="#990000">;</font> <font color="#009900">$index</font><font color="#990000">&lt;</font><b><font color="#000000">count</font></b><font color="#990000">(</font><font color="#009900">$dates</font><font color="#990000">);</font> <font color="#009900">$index</font><font color="#990000">++)</font> <font color="#CC3333">{</font>
   <font color="#009900">$rule</font> <font color="#990000">=</font> <font color="#009900">$dates</font><font color="#990000">[</font><font color="#009900">$index</font><font color="#990000">];</font>
   <font color="#009900">$sql</font> <font color="#990000">=</font> <font color="#CC3333">"SELECT cve_id,score,published,vector,severity,complexity,left(summary,50)</font>
<font color="#CC3333">    FROM vulnerabilities.nvdcve</font>
<font color="#CC3333">      WHERE date_format(published,'%Y-%m')='$rule'</font>
<font color="#CC3333">       ORDER BY (score+0)"</font><font color="#990000">;</font>
   <font color="#009900">$result</font> <font color="#990000">=</font> <b><font color="#000000">mysql_query</font></b><font color="#990000">(</font><font color="#009900">$sql</font><font color="#990000">,</font><font color="#009900">$conn</font><font color="#990000">);</font>
   <b><font color="#3366FF">if</font></b> <font color="#990000">(!</font><font color="#009900">$result</font><font color="#990000">)</font>
       <b><font color="#000000">logit</font></b><font color="#990000">(</font><font color="#CC3333">"Problem with $sql\n"</font><font color="#990000">,</font><font color="#993399">1</font><font color="#990000">);</font>
   <b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#CC3333">"&lt;table border=1&gt;&lt;tr&gt;&lt;td&gt;&lt;table border=0&gt;&lt;tr&gt;&lt;th bgcolor=\"#727D96\"&gt;</font>
<font color="#CC3333">&lt;font color=\"#ffffff\" face=\"arial,helvetica,sanserif\"&gt;Bulletin&lt;/font&gt;&lt;/th&gt;&lt;th bgcolor=\"#727D96\"&gt;</font>
<font color="#CC3333">&lt;font color=\"#ffffff\" face=\"arial,helvetica,sanserif\"&gt;Impact&lt;/font&gt;&lt;/th&gt;&lt;th bgcolor=\"#727D96\"&gt;</font>
<font color="#CC3333">&lt;font color=\"#ffffff\" face=\"arial,helvetica,sanserif\"&gt;Date&lt;/font&gt;&lt;/th&gt;&lt;th bgcolor=\"#727D96\"&gt;</font>
<font color="#CC3333">&lt;font color=\"#ffffff\" face=\"arial,helvetica,sanserif\"&gt;Vector&lt;/font&gt;&lt;/th&gt;&lt;th bgcolor=\"#727D96\"&gt;</font>
<font color="#CC3333">&lt;font color=\"#ffffff\" face=\"arial,helvetica,sanserif\"&gt;Severity&lt;/font&gt;&lt;/th&gt;&lt;th bgcolor=\"#727D96\"&gt;</font>
<font color="#CC3333">&lt;font color=\"#ffffff\" face=\"arial,helvetica,sanserif\"&gt;Complexity&lt;/font&gt;&lt;/th&gt;&lt;th bgcolor=\"#727D96\"&gt;</font>
<font color="#CC3333">&lt;font color=\"#ffffff\" face=\"arial,helvetica,sanserif\"&gt;Short Summary&lt;/font&gt;&lt;/th&gt;&lt;/tr&gt;\n"</font><font color="#990000">);</font>
   <b><font color="#3366FF">for</font></b> <font color="#990000">(</font><font color="#009900">$count</font> <font color="#990000">=</font> <font color="#993399">1</font><font color="#990000">;</font> <b><font color="#3366FF">list</font></b><font color="#990000">(</font><font color="#009900">$cve_id</font><font color="#990000">,</font> <font color="#009900">$score</font><font color="#990000">,</font> <font color="#009900">$date</font><font color="#990000">,</font> <font color="#009900">$vector</font><font color="#990000">,</font> <font color="#009900">$severity</font><font color="#990000">,</font><font color="#009900">$complexity</font><font color="#990000">,</font><font color="#009900">$shortsum</font><font color="#990000">)</font> <font color="#990000">=</font>
     <b><font color="#000000">mysql_fetch_array</font></b> <font color="#990000">(</font><font color="#009900">$result</font><font color="#990000">,</font> MYSQL_NUM<font color="#990000">);</font> <font color="#990000">++</font><font color="#009900">$count</font><font color="#990000">)</font> <font color="#CC3333">{</font>
<font color="#990000">?&gt;</font>
      <font color="#990000">&lt;</font>tr<font color="#990000">&gt;&lt;</font>td CLASS<font color="#990000">=</font><font color="#CC3333">"plfieldhdrleft"</font> WIDTH<font color="#990000">=</font><font color="#CC3333">"20%"</font> BGCOLOR<font color="#990000">=</font><font color="#CC3333">'#F0F5FF'</font><font color="#990000">&gt;</font>
      <font color="#990000">&lt;?</font>  <b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#CC3333">"&lt;a href=\"$nvd_host$cve_id\"&gt;$cve_id&lt;/a&gt;"</font><font color="#990000">);</font> <font color="#990000">?&gt;</font>
      <font color="#990000">&lt;/</font>td<font color="#990000">&gt;</font>
      <font color="#990000">&lt;</font>td CLASS<font color="#990000">=</font><font color="#CC3333">"plfieldhdrleft"</font> BGCOLOR<font color="#990000">=</font><font color="#CC3333">'#F9FCFF'</font><font color="#990000">&gt;</font>
      <font color="#990000">&lt;?</font>  <b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#009900">$score</font><font color="#990000">);</font> <font color="#990000">?&gt;</font>
      <font color="#990000">&lt;/</font>td<font color="#990000">&gt;</font>
      <font color="#990000">&lt;</font>td CLASS<font color="#990000">=</font><font color="#CC3333">"plfieldhdrleft"</font> BGCOLOR<font color="#990000">=</font><font color="#CC3333">'#F0F5FF'</font><font color="#990000">&gt;</font>
      <font color="#990000">&lt;?</font>  <b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#009900">$date</font><font color="#990000">);</font> <font color="#990000">?&gt;</font>
      <font color="#990000">&lt;/</font>td<font color="#990000">&gt;</font>
      <font color="#990000">&lt;</font>td CLASS<font color="#990000">=</font><font color="#CC3333">"plfieldhdrleft"</font> BGCOLOR<font color="#990000">=</font><font color="#CC3333">'#F9FCFF'</font><font color="#990000">&gt;</font>
      <font color="#990000">&lt;?</font>  <b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#009900">$vector</font><font color="#990000">);</font> <font color="#990000">?&gt;</font>
      <font color="#990000">&lt;/</font>td<font color="#990000">&gt;</font>
      <font color="#990000">&lt;</font>td CLASS<font color="#990000">=</font><font color="#CC3333">"plfieldhdrleft"</font> BGCOLOR<font color="#990000">=</font><font color="#CC3333">'#F0F5FF'</font><font color="#990000">&gt;</font>
      <font color="#990000">&lt;?</font>  <b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#009900">$severity</font><font color="#990000">);</font> <font color="#990000">?&gt;</font>
      <font color="#990000">&lt;/</font>td<font color="#990000">&gt;</font>
      <font color="#990000">&lt;</font>td CLASS<font color="#990000">=</font><font color="#CC3333">"plfieldhdrleft"</font> BGCOLOR<font color="#990000">=</font><font color="#CC3333">'#F9FCFF'</font><font color="#990000">&gt;</font>
      <font color="#990000">&lt;?</font>  <b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#009900">$complexity</font><font color="#990000">);</font> <font color="#990000">?&gt;</font>
      <font color="#990000">&lt;/</font>td<font color="#990000">&gt;</font>
      <font color="#990000">&lt;</font>td CLASS<font color="#990000">=</font><font color="#CC3333">"plfieldhdrleft"</font> BGCOLOR<font color="#990000">=</font><font color="#CC3333">'#F0F5FF'</font><font color="#990000">&gt;</font>
      <font color="#990000">&lt;?</font>  <b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#009900">$shortsum</font><font color="#990000">);</font> <font color="#990000">?&gt;</font>
      <font color="#990000">&lt;/</font>td<font color="#990000">&gt;</font>
      <font color="#990000">&lt;/</font>tr<font color="#990000">&gt;</font>
<font color="#990000">&lt;?</font>
   <font color="#CC3333">}</font>
<font color="#CC3333">}</font>
<b><font color="#3366FF">print</font></b><font color="#990000">(</font><font color="#CC3333">"&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;"</font><font color="#990000">);</font>
<b><font color="#000000">do_html_footer</font></b><font color="#990000">();</font>
</tt></pre>
</p>
<p>
The PHP program would generate a HTML table displaying the NVD CVE alerts for that month.  The table would look like:
</p>
<p>
<img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/googletable3.png" width=500 />
</p>
<p>
When the CVE link is clicked on, the user is taken to the NIST NVD site where additional information is available.
</p>
<p>
<img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/nvdsite.png" width=500 />
</p>
<p><h4><b>Using Perl to Create the JavaScript</b></h4>
</p>
<p>
The Perl code is rather simple now that we have the MySQL tables defined and the JavaScript we want to generate.  Much of the code consists of the JavaScript listed above.
</p>
<p>
<!-- Generator: GNU source-highlight 3.1.3<br />
by Lorenzo Bettini</p>
<p>http://www.lorenzobettini.it</p>
<p>http://www.gnu.org/software/src-highlite --></p>
<pre><tt><i><font color="#996633">#!/usr/local/bin/perl -w</font></i>
<b><font color="#3366FF">use</font></b> DBI<font color="#990000">;</font>
<b><font color="#3366FF">use</font></b> Time<font color="#990000">::</font>Local<font color="#990000">;</font>
<b><font color="#3366FF">use</font></b> POSIX <b><font color="#3366FF">qw</font></b><font color="#990000">(</font>strftime<font color="#990000">);</font>
<b><font color="#3366FF">use</font></b> LWP<font color="#990000">::</font>UserAgent<font color="#990000">;</font>
BEGIN<font color="#CC3333">{</font><b><font color="#3366FF">push</font></b> <font color="#009900">@INC</font><font color="#990000">,</font> <font color="#CC3333">"/home/jgerber/projects/nvd/perl"</font><font color="#CC3333">}</font>
<b><font color="#3366FF">use</font></b> ornl_feds <b><font color="#3366FF">qw</font></b><font color="#990000">(</font><font color="#009900">$db_host</font> <font color="#009900">$db</font> <font color="#009900">$mysql_user</font> <font color="#009900">$mysql_passwd</font> <font color="#990000">);</font>
<b><font color="#3366FF">sub</font></b> slide_nvd_alerts <font color="#CC3333">{</font>
  <b><font color="#3366FF">my</font></b><font color="#990000">(</font><font color="#009900">$min_date</font><font color="#990000">,</font><font color="#009900">$graph_name</font><font color="#990000">,</font><font color="#009900">$web_link</font><font color="#990000">,</font><font color="#009900">$dbh</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">@_</font><font color="#990000">;</font>
  <b><font color="#3366FF">my</font></b> <font color="#009900">$slide</font> <font color="#990000">=</font> <font color="#CC3333">""</font><font color="#990000">;</font>
  <b><font color="#3366FF">my</font></b> <font color="#009900">$slide_head</font> <font color="#990000">=</font> <b><font color="#3366FF">qq</font></b><font color="#990000">!</font>
    <font color="#CC3333">&lt;script type='text/javascript'&gt;</font>
      google<font color="#990000">.</font><b><font color="#000000">load</font></b><font color="#990000">(</font><font color="#CC3333">'visualization'</font><font color="#990000">,</font> <font color="#CC3333">'1'</font><font color="#990000">,</font> <font color="#CC3333">{</font>packages<font color="#990000">:[</font><font color="#CC3333">'columnchart,table'</font><font color="#990000">]</font><font color="#CC3333">}</font><font color="#990000">);</font>
      google<font color="#990000">.</font><b><font color="#000000">setOnLoadCallback</font></b><font color="#990000">(</font>drawChart<font color="#990000">);</font>
      function <b><font color="#000000">drawChart</font></b><font color="#990000">()</font> <font color="#CC3333">{</font>
        var data <font color="#990000">=</font> new google<font color="#990000">.</font>visualization<font color="#990000">.</font><b><font color="#000000">DataTable</font></b><font color="#990000">();</font>
        data<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'date'</font><font color="#990000">,</font> <font color="#CC3333">'Date'</font><font color="#990000">);</font>
        data<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'High'</font><font color="#990000">);</font>
        data<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'Medium'</font><font color="#990000">);</font>
        data<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'Low'</font><font color="#990000">);</font>
        data<font color="#990000">.</font><b><font color="#000000">addRows</font></b><font color="#990000">([</font>
<font color="#990000">!;</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$slide_head_table</font> <font color="#990000">=</font> <b><font color="#3366FF">qq</font></b><font color="#990000">!</font>
        var data2 <font color="#990000">=</font> new google<font color="#990000">.</font>visualization<font color="#990000">.</font><b><font color="#000000">DataTable</font></b><font color="#990000">();</font>
        data2<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'date'</font><font color="#990000">,</font> <font color="#CC3333">'Date'</font><font color="#990000">);</font>
        data2<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'High'</font><font color="#990000">);</font>
        data2<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'Medium'</font><font color="#990000">);</font>
        data2<font color="#990000">.</font><b><font color="#000000">addColumn</font></b><font color="#990000">(</font><font color="#CC3333">'number'</font><font color="#990000">,</font> <font color="#CC3333">'Low'</font><font color="#990000">);</font>
        data2<font color="#990000">.</font><b><font color="#000000">addRows</font></b><font color="#990000">([</font>
<font color="#990000">!;</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$table_div</font> <font color="#990000">=</font> <font color="#009900">$graph_name</font> <font color="#990000">.</font> <font color="#CC3333">"_tab"</font><font color="#990000">;</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$slide_tail</font> <font color="#990000">=</font> <b><font color="#3366FF">qq</font></b><font color="#990000">!</font>
        var chart <font color="#990000">=</font> new google<font color="#990000">.</font>visualization<font color="#990000">.</font><b><font color="#000000">ColumnChart</font></b><font color="#990000">(</font>document<font color="#990000">.</font><b><font color="#000000">getElementById</font></b><font color="#990000">(</font><font color="#CC3333">'$graph_name'</font><font color="#990000">));</font>
        chart<font color="#990000">.</font><b><font color="#000000">draw</font></b><font color="#990000">(</font>data<font color="#990000">,</font> <font color="#CC3333">{</font>displayAnnotations<font color="#990000">:</font>true<font color="#990000">,</font> is3D<font color="#990000">:</font> true<font color="#990000">,</font> isStacked<font color="#990000">:</font> true<font color="#990000">,</font> min<font color="#990000">:</font> <font color="#993399">0</font><font color="#990000">,</font> allowHtml<font color="#990000">:</font> true<font color="#990000">,</font>
 colors<font color="#990000">:[</font><font color="#CC3333">{</font>color<font color="#990000">:</font><font color="#CC3333">'#E41B17'</font><font color="#990000">,</font> darker<font color="#990000">:</font><font color="#CC3333">'#C11B17'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#CC3333">{</font>color<font color="#990000">:</font><font color="#CC3333">'#FFA500'</font><font color="#990000">,</font> darker<font color="#990000">:</font><font color="#CC3333">'#E56717'</font><font color="#CC3333">}</font><font color="#990000">,</font>
<font color="#CC3333">{</font>color<font color="#990000">:</font><font color="#CC3333">'#FFE87C'</font><font color="#990000">,</font> darker<font color="#990000">:</font><font color="#CC3333">'#C8B560'</font><font color="#CC3333">}</font><font color="#990000">]</font><font color="#CC3333">}</font><font color="#990000">);</font>
        var table <font color="#990000">=</font> new google<font color="#990000">.</font>visualization<font color="#990000">.</font><b><font color="#000000">Table</font></b><font color="#990000">(</font>document<font color="#990000">.</font><b><font color="#000000">getElementById</font></b><font color="#990000">(</font><font color="#CC3333">'$table_div'</font><font color="#990000">));</font>
        table<font color="#990000">.</font><b><font color="#000000">draw</font></b><font color="#990000">(</font>data2<font color="#990000">,</font> <font color="#CC3333">{</font>showRowNumber<font color="#990000">:</font> true<font color="#990000">,</font> sortAscending<font color="#990000">:</font> false<font color="#990000">,</font> sortColumn<font color="#990000">:</font> <font color="#993399">0</font><font color="#990000">,</font> allowHtml<font color="#990000">:</font> true<font color="#CC3333">}</font><font color="#990000">);</font>
            <font color="#CC3333">//</font> Set a <font color="#CC3333">'select'</font> event listener <b><font color="#3366FF">for</font></b> the table<font color="#990000">.</font>
        <font color="#CC3333">//</font> When the table is selected<font color="#990000">,</font>
        <font color="#CC3333">//</font> we set the selection on the line graph<font color="#990000">.</font>
        google<font color="#990000">.</font>visualization<font color="#990000">.</font>events<font color="#990000">.</font><b><font color="#000000">addListener</font></b><font color="#990000">(</font>table<font color="#990000">,</font> <font color="#CC3333">'select'</font><font color="#990000">,</font> <b><font color="#000000">function</font></b><font color="#990000">()</font> <font color="#CC3333">{</font>
          chart<font color="#990000">.</font><b><font color="#000000">setSelection</font></b><font color="#990000">([</font><font color="#CC3333">{</font>row<font color="#990000">:</font> table<font color="#990000">.</font><b><font color="#000000">getSelection</font></b><font color="#990000">()[</font><font color="#993399">0</font><font color="#990000">].</font>row<font color="#990000">,</font> column<font color="#990000">:</font> <font color="#993399">1</font><font color="#CC3333">}</font><font color="#990000">]);</font>
         <font color="#CC3333">}</font><font color="#990000">);</font>
      <font color="#CC3333">//</font> Set a <font color="#CC3333">'select'</font> event listener <b><font color="#3366FF">for</font></b> the graph<font color="#990000">.</font>
        <font color="#CC3333">//</font> When the graph is selected<font color="#990000">,</font>
        <font color="#CC3333">//</font> we set the selection on the table<font color="#990000">.</font>
        google<font color="#990000">.</font>visualization<font color="#990000">.</font>events<font color="#990000">.</font><b><font color="#000000">addListener</font></b><font color="#990000">(</font>chart<font color="#990000">,</font> <font color="#CC3333">'select'</font><font color="#990000">,</font> <b><font color="#000000">function</font></b><font color="#990000">()</font> <font color="#CC3333">{</font>
           table<font color="#990000">.</font><b><font color="#000000">setSelection</font></b><font color="#990000">([</font><font color="#CC3333">{</font>row<font color="#990000">:</font> chart<font color="#990000">.</font><b><font color="#000000">getSelection</font></b><font color="#990000">()[</font><font color="#993399">0</font><font color="#990000">].</font>row<font color="#CC3333">}</font><font color="#990000">]);</font>
        <font color="#CC3333">}</font><font color="#990000">);</font>
      <font color="#CC3333">}</font>
    <font color="#CC3333">&lt;/script&gt;</font>
<font color="#990000">!;</font>
   <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$min_date</font> <b><font color="#3366FF">eq</font></b> <font color="#CC3333">""</font><font color="#990000">)</font> <font color="#CC3333">{</font>
      <b><font color="#3366FF">my</font></b> <font color="#009900">$sql2</font> <font color="#990000">=</font> <b><font color="#3366FF">qq</font></b><font color="#CC3333">{ SELECT min(published) FROM vulnerabilities.nvdcve }</font><font color="#990000">;</font>
      <b><font color="#3366FF">my</font></b> <font color="#009900">$sth2</font> <font color="#990000">=</font> <font color="#009900">$dbh</font><font color="#990000">-&gt;</font><b><font color="#000000">prepare</font></b><font color="#990000">(</font> <font color="#009900">$sql2</font> <font color="#990000">);</font>
      <b><font color="#3366FF">my</font></b> <font color="#009900">$rc2</font> <font color="#990000">=</font> <font color="#009900">$sth2</font><font color="#990000">-&gt;</font><b><font color="#000000">execute</font></b><font color="#990000">();</font>
      <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$rc2</font><font color="#990000">)</font> <font color="#CC3333">{</font>
         <font color="#009900">$min_date</font> <font color="#990000">=</font> <font color="#009900">$sth2</font><font color="#990000">-&gt;</font><b><font color="#000000">fetchrow_array</font></b><font color="#990000">();</font>
      <font color="#CC3333">}</font>
   <font color="#CC3333">}</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$table_data</font> <font color="#990000">=</font> <font color="#CC3333">""</font><font color="#990000">;</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$graph_data</font> <font color="#990000">=</font> <font color="#CC3333">""</font><font color="#990000">;</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$sql2</font> <font color="#990000">=</font> <b><font color="#3366FF">qq</font></b><font color="#CC3333">{</font> <b><font color="#3366FF">select</font></b> <b><font color="#000000">date_format</font></b><font color="#990000">(</font>published<font color="#990000">,</font><font color="#CC3333">'%Y-%m'</font><font color="#990000">),</font>severity<font color="#990000">,</font><b><font color="#000000">count</font></b><font color="#990000">(</font>severity<font color="#990000">)</font>
      FROM vulnerabilities<font color="#990000">.</font>nvdcve where published <font color="#990000">&gt;=</font> <font color="#990000">?</font> group by <b><font color="#000000">date_format</font></b><font color="#990000">(</font>published<font color="#990000">,</font><font color="#CC3333">'%Y-%m'</font><font color="#990000">),</font>severity <font color="#CC3333">}</font><font color="#990000">;</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$sth2</font> <font color="#990000">=</font> <font color="#009900">$dbh</font><font color="#990000">-&gt;</font><b><font color="#000000">prepare</font></b><font color="#990000">(</font> <font color="#009900">$sql2</font> <font color="#990000">);</font>
   <b><font color="#3366FF">my</font></b> <font color="#009900">$rc2</font> <font color="#990000">=</font> <font color="#009900">$sth2</font><font color="#990000">-&gt;</font><b><font color="#000000">execute</font></b><font color="#990000">(</font><font color="#009900">$min_date</font><font color="#990000">);</font>
   <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$rc2</font><font color="#990000">)</font> <font color="#CC3333">{</font>
      <b><font color="#3366FF">my</font></b> <font color="#990000">(</font><font color="#009900">$change</font><font color="#990000">,</font><font color="#009900">$virgin</font><font color="#990000">,</font><font color="#009900">$ht</font><font color="#990000">,</font><font color="#009900">$mt</font><font color="#990000">,</font><font color="#009900">$lt</font><font color="#990000">,</font><font color="#009900">$mmax_date</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#990000">(</font><font color="#CC3333">""</font><font color="#990000">,</font><font color="#993399">1</font><font color="#990000">,</font><font color="#993399">0</font><font color="#990000">,</font><font color="#993399">0</font><font color="#990000">,</font><font color="#993399">0</font><font color="#990000">,</font><font color="#CC3333">""</font><font color="#990000">);</font>
      <b><font color="#3366FF">while</font></b> <font color="#990000">(</font><b><font color="#3366FF">my</font></b><font color="#990000">(</font><font color="#009900">$snapshot_date</font><font color="#990000">,</font> <font color="#009900">$severity</font><font color="#990000">,</font> <font color="#009900">$pcount</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">$sth2</font><font color="#990000">-&gt;</font><b><font color="#000000">fetchrow_array</font></b><font color="#990000">())</font> <font color="#CC3333">{</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$sql3</font> <font color="#990000">=</font> <b><font color="#3366FF">qq</font></b><font color="#CC3333">{</font> SELECT <b><font color="#000000">max</font></b><font color="#990000">(</font>published<font color="#990000">)</font> FROM vulnerabilities<font color="#990000">.</font>nvdcve where
<b><font color="#000000">date_format</font></b><font color="#990000">(</font>published<font color="#990000">,</font><font color="#CC3333">'%Y-%m'</font><font color="#990000">)=?</font> <font color="#CC3333">}</font><font color="#990000">;</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$sth3</font> <font color="#990000">=</font> <font color="#009900">$dbh</font><font color="#990000">-&gt;</font><b><font color="#000000">prepare</font></b><font color="#990000">(</font> <font color="#009900">$sql3</font> <font color="#990000">);</font>
         <b><font color="#3366FF">my</font></b> <font color="#009900">$rc3</font> <font color="#990000">=</font> <font color="#009900">$sth3</font><font color="#990000">-&gt;</font><b><font color="#000000">execute</font></b><font color="#990000">(</font><font color="#009900">$snapshot_date</font><font color="#990000">);</font>
         <font color="#009900">$max_date</font> <font color="#990000">=</font>  <font color="#009900">$sth3</font><font color="#990000">-&gt;</font><b><font color="#000000">fetchrow_array</font></b><font color="#990000">();</font>
         <font color="#009900">$max_date</font> <font color="#990000">=~</font> <b><font color="#3366FF">s</font></b><font color="#FF6600">/ \S+$//</font><font color="#990000">;</font>
         <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$change</font> ne <font color="#009900">$snapshot_date</font><font color="#990000">)</font> <font color="#CC3333">{</font>
            <b><font color="#3366FF">if</font></b> <font color="#990000">(!</font> <font color="#009900">$virgin</font><font color="#990000">)</font> <font color="#CC3333">{</font>
                <b><font color="#3366FF">my</font></b><font color="#990000">(</font><font color="#009900">$year</font><font color="#990000">,</font><font color="#009900">$month</font><font color="#990000">,</font><font color="#009900">$day</font><font color="#990000">)</font> <font color="#990000">=</font> <b><font color="#3366FF">split</font></b><font color="#990000">(</font><font color="#CC3333">"-"</font><font color="#990000">,</font><font color="#009900">$mmax_date</font><font color="#990000">);</font>
                <b><font color="#3366FF">my</font></b> <font color="#009900">$mmonth</font> <font color="#990000">=</font> <font color="#009900">$month</font><font color="#990000">;</font>
                <font color="#009900">$month</font><font color="#990000">--;</font>
                <font color="#009900">$graph_data</font> <font color="#990000">.=</font> <b><font color="#3366FF">qq</font></b><font color="#990000">!</font>           <font color="#990000">[</font>new <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#009900">$year</font><font color="#990000">,</font> <font color="#009900">$month</font><font color="#990000">,</font> <font color="#009900">$day</font><font color="#990000">),</font><font color="#009900">$ht</font><font color="#990000">,</font><font color="#009900">$mt</font><font color="#990000">,</font><font color="#009900">$lt</font><font color="#990000">],</font>
<font color="#990000">!;</font>
                <font color="#009900">$table_data</font> <font color="#990000">.=</font> <b><font color="#3366FF">qq</font></b><font color="#990000">!</font>           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font>new <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#009900">$year</font><font color="#990000">,</font> <font color="#009900">$month</font><font color="#990000">,</font> <font color="#009900">$day</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="$web_link/cvealerts.php?date=$year-$mmonth"&gt;$mmax_date&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#009900">$ht</font><font color="#990000">,</font><font color="#009900">$mt</font><font color="#990000">,</font><font color="#009900">$lt</font><font color="#990000">],</font>
<font color="#990000">!;</font>
                <font color="#990000">(</font><font color="#009900">$ht</font><font color="#990000">,</font><font color="#009900">$mt</font><font color="#990000">,</font><font color="#009900">$lt</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#990000">(</font><font color="#993399">0</font><font color="#990000">,</font><font color="#993399">0</font><font color="#990000">,</font><font color="#993399">0</font><font color="#990000">);</font>
             <font color="#CC3333">}</font>
             <font color="#009900">$change</font> <font color="#990000">=</font> <font color="#009900">$snapshot_date</font><font color="#990000">;</font>
          <font color="#CC3333">}</font>
          <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$severity</font> <b><font color="#3366FF">eq</font></b> <font color="#CC3333">"HIGH"</font><font color="#990000">)</font> <font color="#CC3333">{</font> <font color="#009900">$ht</font> <font color="#990000">=</font> <font color="#009900">$pcount</font><font color="#990000">;</font> <font color="#CC3333">}</font>
          <b><font color="#3366FF">elsif</font></b> <font color="#990000">(</font><font color="#009900">$severity</font> <b><font color="#3366FF">eq</font></b> <font color="#CC3333">"MEDIUM"</font><font color="#990000">)</font> <font color="#CC3333">{</font> <font color="#009900">$mt</font> <font color="#990000">=</font> <font color="#009900">$pcount</font><font color="#990000">;</font> <font color="#CC3333">}</font>
          <b><font color="#3366FF">elsif</font></b> <font color="#990000">(</font><font color="#009900">$severity</font> <b><font color="#3366FF">eq</font></b> <font color="#CC3333">"LOW"</font><font color="#990000">)</font> <font color="#CC3333">{</font> <font color="#009900">$lt</font> <font color="#990000">=</font> <font color="#009900">$pcount</font><font color="#990000">;</font> <font color="#CC3333">}</font>
          <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$mmax_date</font> <b><font color="#3366FF">eq</font></b> <font color="#CC3333">""</font><font color="#990000">)</font> <font color="#CC3333">{</font> <font color="#009900">$mmax_date</font> <font color="#990000">=</font> <font color="#009900">$max_date</font><font color="#990000">;</font> <font color="#CC3333">}</font>
          <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$mmax_date</font> lt <font color="#009900">$max_date</font><font color="#990000">)</font> <font color="#CC3333">{</font> <font color="#009900">$mmax_date</font> <font color="#990000">=</font> <font color="#009900">$max_date</font><font color="#990000">;</font> <font color="#CC3333">}</font>
          <font color="#009900">$virgin</font> <font color="#990000">=</font> <font color="#993399">0</font><font color="#990000">;</font>
      <font color="#CC3333">}</font>
      <b><font color="#3366FF">my</font></b><font color="#990000">(</font><font color="#009900">$year</font><font color="#990000">,</font><font color="#009900">$month</font><font color="#990000">,</font><font color="#009900">$day</font><font color="#990000">)</font> <font color="#990000">=</font> <b><font color="#3366FF">split</font></b><font color="#990000">(</font><font color="#CC3333">"-"</font><font color="#990000">,</font><font color="#009900">$mmax_date</font><font color="#990000">);</font>
      <b><font color="#3366FF">my</font></b> <font color="#009900">$mmonth</font> <font color="#990000">=</font> <font color="#009900">$month</font><font color="#990000">;</font>
      <font color="#009900">$month</font><font color="#990000">--;</font>
      <font color="#009900">$graph_data</font> <font color="#990000">.=</font> <b><font color="#3366FF">qq</font></b><font color="#990000">!</font>           <font color="#990000">[</font>new <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#009900">$year</font><font color="#990000">,</font> <font color="#009900">$month</font><font color="#990000">,</font> <font color="#009900">$day</font><font color="#990000">),</font><font color="#009900">$ht</font><font color="#990000">,</font><font color="#009900">$mt</font><font color="#990000">,</font><font color="#009900">$lt</font><font color="#990000">]</font>
<font color="#990000">!;</font>
     <font color="#009900">$table_data</font> <font color="#990000">.=</font> <b><font color="#3366FF">qq</font></b><font color="#990000">!</font>           <font color="#990000">[</font><font color="#CC3333">{</font>v<font color="#990000">:</font>new <b><font color="#000000">Date</font></b><font color="#990000">(</font><font color="#009900">$year</font><font color="#990000">,</font> <font color="#009900">$month</font><font color="#990000">,</font> <font color="#009900">$day</font><font color="#990000">),</font>
              f<font color="#990000">:</font><font color="#CC3333">'&lt;a href="$web_link/cvealerts.php?date=$year-$mmonth"&gt;$mmax_date&lt;/a&gt;'</font><font color="#CC3333">}</font><font color="#990000">,</font> <font color="#009900">$ht</font><font color="#990000">,</font><font color="#009900">$mt</font><font color="#990000">,</font><font color="#009900">$lt</font><font color="#990000">],</font>
<font color="#990000">!;</font>
   <font color="#CC3333">}</font>
   <font color="#009900">$table_data</font> <font color="#990000">.=</font> <font color="#CC3333">"        ]);\n"</font><font color="#990000">;</font>
   <font color="#009900">$graph_data</font> <font color="#990000">.=</font> <font color="#CC3333">"        ]);\n"</font><font color="#990000">;</font>
   <font color="#009900">$slide</font> <font color="#990000">=</font> <font color="#009900">$slide_head</font> <font color="#990000">.</font>  <font color="#009900">$graph_data</font> <font color="#990000">.</font> <font color="#009900">$slide_head_table</font> <font color="#990000">.</font> <font color="#009900">$table_data</font> <font color="#990000">.</font> <font color="#009900">$slide_tail</font><font color="#990000">;</font>
   <b><font color="#3366FF">return</font></b><font color="#990000">(</font><font color="#009900">$slide</font><font color="#990000">);</font>
<font color="#CC3333">}</font>
<b><font color="#3366FF">sub</font></b> slide_body <font color="#CC3333">{</font>
  <b><font color="#3366FF">my</font></b><font color="#990000">(</font><font color="#009900">$graph_name</font><font color="#990000">,</font><font color="#009900">$title</font><font color="#990000">,</font><font color="#009900">$style</font><font color="#990000">)</font> <font color="#990000">=</font> <font color="#009900">@_</font><font color="#990000">;</font>
  <b><font color="#3366FF">my</font></b> <font color="#009900">$table_name</font> <font color="#990000">=</font> <font color="#009900">$graph_name</font> <font color="#990000">.</font> <font color="#CC3333">"_tab"</font><font color="#990000">;</font>
  <b><font color="#3366FF">my</font></b> <font color="#009900">$table_text</font> <font color="#990000">=</font> <font color="#CC3333">"div id=\"$table_name\""</font><font color="#990000">;</font>
  <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$style</font> ne <font color="#CC3333">""</font><font color="#990000">)</font> <font color="#CC3333">{</font>
     <font color="#009900">$table_text</font> <font color="#990000">.=</font> <font color="#CC3333">" style=\'$style\'"</font><font color="#990000">;</font>
  <font color="#CC3333">}</font>
  <b><font color="#3366FF">my</font></b> <font color="#009900">$slide2</font> <font color="#990000">=</font> <font color="#CC3333">"&lt;h3&gt;$title&lt;/h3&gt;\n"</font><font color="#990000">;</font>
  <b><font color="#3366FF">my</font></b> <font color="#009900">$itext</font> <font color="#990000">=</font> <font color="#CC3333">"div id=\"$graph_name\""</font><font color="#990000">;</font>
  <b><font color="#3366FF">if</font></b> <font color="#990000">(</font><font color="#009900">$style</font> ne <font color="#CC3333">""</font><font color="#990000">)</font> <font color="#CC3333">{</font>
     <font color="#009900">$itext</font> <font color="#990000">.=</font> <font color="#CC3333">" style=\'$style\'"</font><font color="#990000">;</font>
  <font color="#CC3333">}</font>
  <font color="#009900">$slide2</font> <font color="#990000">.=</font> <b><font color="#3366FF">qq</font></b><font color="#CC3333">{</font>
    <font color="#CC3333">&lt;table&gt;&lt;tr&gt;</font>
    <font color="#CC3333">&lt;td valign="top"&gt;&lt;$itext&gt;&lt;/div&gt;&lt;/td&gt;</font>
    <font color="#CC3333">&lt;td valign="top"&gt;&lt;$table_text&gt;&lt;/div&gt;&lt;/td&gt;</font>
    <font color="#CC3333">&lt;td valign="top"&gt;</font>   <font color="#CC3333">&lt;/td&gt;</font>
    <font color="#CC3333">&lt;td valign="top"&gt;&lt;div id="labels"&gt;&lt;/div&gt;&lt;/td&gt;</font>
    <font color="#CC3333">&lt;/tr&gt;&lt;/table&gt;</font>
  <font color="#CC3333">}</font><font color="#990000">;</font>
  <b><font color="#3366FF">return</font></b><font color="#990000">(</font><font color="#009900">$slide2</font><font color="#990000">);</font>
<font color="#CC3333">}</font>
<i><font color="#996633"># Main</font></i>
<b><font color="#3366FF">my</font></b> <font color="#009900">$web_link</font> <font color="#990000">=</font> <font color="#CC3333">"/nvd"</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$results_dir</font> <font color="#990000">=</font> <font color="#CC3333">"/data/html"</font> <font color="#990000">.</font> <font color="#009900">$web_link</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$result_file</font> <font color="#990000">=</font> <font color="#009900">$results_dir</font> <font color="#990000">.</font> <font color="#CC3333">"/nvdcve_stats.html"</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$debug</font> <font color="#990000">=</font> <font color="#993399">1</font><font color="#990000">;</font>
<b><font color="#3366FF">my</font></b> <font color="#009900">$db</font> <font color="#990000">=</font> <font color="#CC3333">"vulnerabilities"</font><font color="#990000">;</font>
<b><font color="#3366FF">local</font></b><font color="#990000">(</font><font color="#009900">$dbh</font><font color="#990000">)</font> <font color="#990000">=</font> DBI<font color="#990000">-&gt;</font><b><font color="#000000">connect</font></b><font color="#990000">(</font><font color="#CC3333">"DBI:mysql:$db:$db_host"</font><font color="#990000">,</font> <font color="#009900">$mysql_user</font><font color="#990000">,</font> <font color="#009900">$mysql_passwd</font><font color="#990000">)</font> <font color="#990000">||</font>
   <b><font color="#3366FF">die</font></b> <font color="#CC3333">"ERROR: Connecting: $DBI::errstr\n"</font><font color="#990000">;</font>
<font color="#009900">$slides_data</font> <font color="#990000">.=</font> <font color="#990000">&amp;</font><b><font color="#000000">slide_body</font></b><font color="#990000">(</font><font color="#CC3333">"s4graph"</font><font color="#990000">,</font><font color="#CC3333">"NVD CVE Alerts"</font><font color="#990000">,</font><font color="#CC3333">"width:700px; height:400px;"</font><font color="#990000">);</font>
<font color="#009900">$slides_head</font> <font color="#990000">.=</font> <font color="#990000">&amp;</font><b><font color="#000000">slide_nvd_alerts</font></b><font color="#990000">(</font><font color="#CC3333">""</font><font color="#990000">,</font><font color="#CC3333">"s4graph"</font><font color="#990000">,</font><font color="#009900">$web_link</font><font color="#990000">,</font><font color="#009900">$dbh</font><font color="#990000">);</font>
<b><font color="#3366FF">open</font></b><font color="#990000">(</font>OUTFILE<font color="#990000">,</font><font color="#CC3333">"&gt;$result_file"</font><font color="#990000">);</font>
<b><font color="#3366FF">print</font></b> OUTFILE <font color="#CC3333">"&lt;HTML&gt;\n&lt;HEAD&gt;&lt;TITLE&gt;NVD CVE Statistics&lt;/TITLE&gt;\n"</font><font color="#990000">;</font>
<b><font color="#3366FF">print</font></b> OUTFILE <font color="#CC3333">"&lt;script type=\"text/javascript\" src=\"http://www.google.com/jsapi\"&gt;&lt;/script&gt;\n"</font><font color="#990000">;</font>
<b><font color="#3366FF">print</font></b> OUTFILE <font color="#009900">$slides_head</font><font color="#990000">;</font>
<b><font color="#3366FF">print</font></b> OUTFILE <font color="#CC3333">"&lt;/HEAD&gt;\n&lt;BODY&gt;\n"</font><font color="#990000">;</font>
<b><font color="#3366FF">print</font></b> OUTFILE <font color="#009900">$slides_data</font><font color="#990000">;</font>
<b><font color="#3366FF">print</font></b> OUTFILE <font color="#CC3333">"&lt;/BODY&gt;\n"</font><font color="#990000">;</font>
<b><font color="#3366FF">close</font></b><font color="#990000">(</font>OUTFILE<font color="#990000">);</font>
<b><font color="#3366FF">exit</font></b><font color="#990000">;</font>
</tt></pre>
</p>
<p><h3>Other Charting Options</h3>
</p>
<p>
Google, Google users, and other companies have <a href="http://code.google.com/apis/visualization/documentation/gallery.html">shared</a> some JavaScript visualizations built on the Google Visualization API to help you get started.  Below are some example:
</p>
<table class="gviz_gallery" id="gviz_gallery" cellpadding="2" cellspacing="0">
<tr class="gallery_filter_featured gallery_filter_charts gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-annotatedtimeline.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://blog.securitymonks.com/apis/visualization/documentation/gallery/annotatedtimeline.html">Annotated Time Line</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">An animated time series chart.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_charts gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/areachart.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-areachart.png" height="60" width="120" /></a></td>
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/areachart.html"  class="gallery_doc_title">Area Chart </a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">Interactive area chart.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_charts gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/barchart.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-barchart.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://blog.securitymonks.com/apis/visualization/documentation/gallery/barchart.html">Bar Chart</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">Interactive bar chart.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_charts gallery_filter_fun">
<td><a href="http://visapi-gadgets.googlecode.com/svn/trunk/barsofstuff/doc.html" onclick="return warn()"><br />
    <img src="http://visapi-gadgets.googlecode.com/svn/trunk/barsofstuff/icon.png" height="60" width="120" /></a></td>
<td><a href="http://visapi-gadgets.googlecode.com/svn/trunk/barsofstuff/doc.html" class="gallery_doc_title" onClick="return warn()">Bars of Stuff</a></p>
<p class="gallery_description">Fun bar charts using images of trains, chocolate, worms, and more.</p>
<p class="gallery_author">By: The visapi project</p>
</td>
</tr>
<tr class="gallery_filter_charts">
<td><a href="http://informatics.systemsbiology.net/visualizations/heatmap/bioheatmap.html" onclick="return warn()"><img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/bioheatmap_screenshot.png" height="60" width="120" /></a></td>
<td><a href="http://informatics.systemsbiology.net/visualizations/heatmap/bioheatmap.html" class="gallery_doc_title" onClick="return warn()">Bio Heat Map</a></p>
<p class="gallery_description">Heatmaps are a useful way to visualize matricies of data. Scientists often use green-black-red heatmaps to visualize gene expression data from microarrays. This visualization supports both three color heatmaps (ex: green to black to red) and two color heatmaps (ex: white to yellow).</p>
<p class="gallery_author">By: <a href="http://www.systemsbiology.org/">Institute for Systems Biology</a></p>
</td>
</tr>
<tr class="gallery_filter_charts gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/columnchart.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-columnchart.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/columnchart.html">Column Chart</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">Interactive column chart.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_project">
<td><a href="http://www.drasticdata.nl/DrasticTreemapGApi/index.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-drastictreemap.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://www.drasticdata.nl/DrasticTreemapGApi/index.html">Drastic Treemap</a></p>
<p class="gallery_description">A dynamic treemap in Flash.</p>
<p class="gallery_author">By: <a href="http://www.drasticdata.nl">DrasticData</a></p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_charts">
<td><a href="http://danvk.org/dygraphs/"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-dygraphs.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://danvk.org/dygraphs/">Dygraphs</a></p>
<p class="gallery_description">The dygraphs JavaScript library produces interactive, zoomable charts of time series.</p>
<p class="gallery_author">By: Dan Vanderkam</p>
</td>
</tr>
<tr class="gallery_filter_tables">
<td><a href="http://informatics.systemsbiology.net/visualizations/heatmap/FilterDataTableControl.html" onclick="return warn()"><img src="http://systemsbiology-visualizations.googlecode.com/svn/trunk/src/main/images/icon_filterDataTableControl.png" height="60" width="120" /></a></td>
<td><a href="http://informatics.systemsbiology.net/visualizations/heatmap/FilterDataTableControl.html" class="gallery_doc_title" onClick="return warn()">Filters </a></p>
<p class="gallery_description">A Visualization that acts as a control over other visualizations. It is rendered within the browser using HTML. This visualization offers the ability to select some criteria to filter the DataTable used by the controlled visualizations.</p>
<p class="gallery_author">By: <a href="http://www.systemsbiology.org/">Institute for Systems Biology</a></p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_charts gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/gauge.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04//icon-gauge.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/gauge.html">Gauge</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">Each numeric value is displayed as a gauge.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_maps gallery_filter_featured gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/geomap.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04//icon-geomap.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/geomap.html">Geo Map</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">A map of a country, continent, or region map, with colors and values assigned to specific regions. Values are displayed as a color scale, and you can specify optional hovertext for regions.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_maps gallery_filter_featured gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/intensitymap.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-intensitymap.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/intensitymap.html">Intensity Map</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">An intensity map that highlights regions or countries based on relative values.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_charts gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/linechart.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-linechart.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/linechart.html">Line Chart</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">Interactive line chart.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_charts gallery_filter_tables gallery_filter_analytics">
<td><a href="http://magic-table.googlecode.com/svn/trunk/magic-table/google_visualisation/example_1.html" onclick="return warn()"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/scatterplot_google_thumb.png" height="60" width="120" /></a></td>
<td><a href="http://magic-table.googlecode.com/svn/trunk/magic-table/google_visualisation/example_1.html" class="gallery_doc_title" onClick="return warn()">Magic-Table</a></p>
<p class="gallery_description">The Magic Table is a JavaScript library that allows you to see more in your data by applying some simple visual techniques to transform a table. The table is displayed in the browser by the canvas element. Internet Explorer is not supported.</p>
<p class="gallery_author">By: <a href="http://code.google.com/p/magic-table/">Greg Ross</a></p>
</td>
</tr>
<tr class="gallery_filter_maps gallery_filter_featured gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/map.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-map.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/map.html">Map</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">An interactive map that uses the <a href="http://code.google.com/apis/maps">Google Maps API</a>.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_charts gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/motionchart.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-motionchart.png" height="60" width="120" /></a></td>
<td>
<p><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/motionchart.html">Motion Chart</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">Motion Chart: A dynamic flash based chart to explore several indicators over time. Required columns: bubble name, time and 2 columns of numeric values. Optional columns: Numeric values or categories.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_google gallery_filter_project">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/orgchart.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-orgchart.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/orgchart.html">Organizational Chart</a></p>
<p class="gallery_description">A <a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a> simple organizational chart.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_charts">
<td><a href="http://parallel-coordinates.googlecode.com/svn/trunk/documentation/documentation.html" onclick="return warn()"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/parallelcords.jpg" height="60" width="120" /></a></td>
<td><a href="http://parallel-coordinates.googlecode.com/svn/trunk/documentation/documentation.html" class="gallery_doc_title" onClick="return warn()">Parallel Coordinates Chart</a></p>
<p class="gallery_description">Parallel Coordinates is a method of visualizing multivariate data. An n-dimensional space is represented as n parallel lines.  Works for browsers based on Gecko or Presto (does not work in IE). This is written in Javascript, no Flash required.</p>
<p class="gallery_author">By: <a href="http://sriharsha451.googlepages.com/">Sri Harsha Allamraju</a></p>
</td>
</tr>
<tr class="gallery_filter_charts gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/piechart.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-piechart.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/piechart.html">Pie Chart</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">Interactive pie chart.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_charts gallery_filter_fun">
<td><a href="http://visapi-gadgets.googlecode.com/svn/trunk/pilesofmoney/doc.html" onclick="return warn()"><br />
    <img src="http://visapi-gadgets.googlecode.com/svn/trunk/pilesofmoney/icon.png" height="60" width="120" /></a></td>
<td><a href="http://visapi-gadgets.googlecode.com/svn/trunk/pilesofmoney/doc.html" class="gallery_doc_title" onClick="return warn()">Piles of Money</a></p>
<p class="gallery_description">Column chart made of of money bills.</p>
<p class="gallery_author">By: The visapi project</p>
</td>
</tr>
<tr class="gallery_filter_charts gallery_filter_google">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/scatterchart.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-scatterchart.png" height="60" width="120" /></a></td>
<td><a class="gallery_doc_title" href="http://code.google.com/apis/visualization/documentation/gallery/scatterchart.html">Scatter Chart</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">Interactive scatter chart.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_google gallery_filter_tables">
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/table.html"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/icon-table.png" height="60" width="120" /></a></td>
<td><a href="http://code.google.com/apis/visualization/documentation/gallery/table.html"  class="gallery_doc_title">Table</a> (<a class="gallery_gwt_link" href="http://code.google.com/docreader/#p=gwt-google-apis&amp;s=gwt-google-apis&amp;t=Visualization">GWT Integrated</a>)</p>
<p class="gallery_description">A highly customizable table with sorting, paging and selection capabilities.</p>
<p class="gallery_author">By: Google</p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_text">
<td><a href="http://visapi-gadgets.googlecode.com/svn/trunk/termcloud/doc.html" onclick="return warn()"><br />
    <img src="http://visapi-gadgets.googlecode.com/svn/trunk/termcloud/icon.png" height="60" width="120" /></a></td>
<td><a href="http://visapi-gadgets.googlecode.com/svn/trunk/termcloud/doc.html" class="gallery_doc_title" onClick="return warn()">TermCloud</a></p>
<p class="gallery_description">A list of terms, where the size and color of each word is determined by a specified frequency value (typically the number of times it appears in some text).</p>
<p class="gallery_author">By: The visapi project</p>
</td>
</tr>
<tr class="gallery_filter_featured gallery_filter_maps">
<td><img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/thematicmapping.png" height="60" width="120" /></td>
<td><a href="http://thematicmapping.org/api/gvapi.php" class="gallery_doc_title" onClick="return warn()">Thematic Mapping API</a></p>
<p class="gallery_description">Enables visualization of data in Google Earth or other geobrowsers through the use of the Google Visualization API and KML.</p>
<p class="gallery_author"> By: <a href="http://thematicmapping.org/">Thematicmapping.org</a></p>
</td>
</tr>
<tr class="gallery_filter_text">
<td><a href="http://visapi-gadgets.googlecode.com/svn/trunk/wordcloud/doc.html" onclick="return warn()"><br />
    <img src="http://blog.securitymonks.com/wp-content/uploads/2010/04/worldcloud.png" height="60" width="120" /></a></td>
<td>
<p><a href="http://visapi-gadgets.googlecode.com/svn/trunk/wordcloud/doc.html" class="gallery_doc_title" onClick="return warn()">WordCloud</a>
      </p>
<p class="gallery_description">Displays all words in text with size and color based on the number of time each word appears.</p>
<p class="gallery_author">By: The visapi project</p>
</td>
</tr>
</table>
<p><h3>Additional Information</h3>
</p>
<p>
Below is the talk that Itai Raz, the lead engineer for the Visualization API product at Google, gave at <a href="http://code.google.com/events/io/2009/">Google I/O 2009</a> titled &#8220;Using the Visualization API with GWT:&#8221;
</p>
<p>
<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/5PV8OH-ML-Q&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/5PV8OH-ML-Q&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="385"></embed></object>
</p>
<p><h3>Additional Possibilities</h3>
</p>
<p>
The work above is meant only to serve as a starting point.  There is a great deal more information to expand upon.  For example, we began this post pulling some information from the XML schema for CVE-2010-1228.  One field we did not pull out from the XML file is:
</p>
<p><pre>    &lt;vuln:cwe id="CWE-362" /&gt;
</pre>
</p>
<p>
The Common Weakness Enumeration (CWE) represents vulnerability types and NIST provides a <a href="http://nvd.nist.gov/cwe.cfm#cwes">CWE Cross Section Mapped into by NVD</a> table.  In the above example, we see an entry:
</p>
<table Border="1">
<tr>
<th>Name</th>
<th width="66">CWE-ID</th>
<th>Description</th>
</tr>
<tr>
<td>
<a name="CWE-362"/>Race Conditions
</td>
<td width="66">
<a href = "http://cwe.mitre.org/data/definitions/362.html" target = "blank">CWE-362</a>
</td>
<td>The state of a resource can change between the time the resource is checked to when it is accessed.</td>
</tr>
</table>
<p>
Clicking on the link will take us to the MITRE site that provides a great deal more information on CWE entries.  It is easy enough to expand on the above program to harvest this information for a richer information database.
</p>
<p>
Another possibility is to expand the above program to pull additional information on the CVE entry.  In additional to the data in the NVD CVE XML file, we could pull information from the NVD site.  Using CVE-2010-1228 as an example, we could have the program pull down the page:
</p>
<p><pre>http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-1228</pre>
</p>
<p>
Notice the line:
</p>
<p>
<span class="label">CVSS v2 Base Score:</span><a href="http://nvd.nist.gov/cvss.cfm?version=2&amp;name=CVE-2010-1228&amp;vector=(AV%3AN/AC%3AL/Au%3AN/C%3AC/I%3AC/A%3AC)" target="_blank">10.0</a> (HIGH) <a href="http://nvd.nist.gov/cvss.cfm?version=2&amp;name=CVE-2010-1228&amp;vector=(AV%3AN/AC%3AL/Au%3AN/C%3AC/I%3AC/A%3AC)" target="_blank">(AV:N/AC:L/Au:N/C:C/I:C/A:C)</a> (<a href="http://nvd.nist.gov/cvss.cfm?vectorinfo&amp;version=2" target="_blank">legend</a>)
</p>
<p>
The <b>(AV:N/AC:L/Au:N/C:C/I:C/A:C)</b> provides values that were used in determining the base score.  If you follow the link, you will see the values used in the calculations:
</p>
<ul>
<li><strong>CVSS Base Score</strong>: 10
<ul>
<li><b>Impact Subscore</b>: 10</li>
<li><b>Exploitability Subscore</b>: 10</li>
</ul>
</li>
<li><b>CVSS Temporal Score</b>: Undefined</li>
<li><strong>CVSS Environmental Score</strong>: Undefined</li>
<li><strong>Overall CVSS Score</strong>: 10</li>
</ul>
<p>
NVD has made available <a href="http://nvd.nist.gov/cvsseq2.htm">the equations</a> used in calculating the CVSS base score, temporal score, and environmental score.
</p>
<p>
Three other pieces of information that might provide interesting groupings are:
</p>
<ul>
<li><b>Access Complexity</b>:  Low  **NOTE: Access Complexity scored Low due to insufficient information</li>
<li><b>Authentication</b>:  Not required to exploit</li>
<li><b>Impact Type</b>:  Allows unauthorized disclosure of information; Allows unauthorized modification; Allows disruption of service</li>
</ul>
<p>
What information is of interest and how it is used will be dependent on your organization.  There is a great deal of information available and many directions you start examining.
</p>
<p><h3>Final Thoughts</h3>
</p>
<p>
I am often reminded of the old phrase, “Trust us, we are from the government.”   No one really trusts anyone, especially when it comes to matters they do not understand.  Just because you are from the security group at your organization, is that reason enough for the CEO to give you unlimited money and authority to do what you see fit?  Of course not.  While management might trust you, they may not believe that you are capable of seeing the big picture.  That is after all their job.
</p>
<p>
Another great old saying is that “the devil is in the details.”  Those details will likely fall in the security domain.  In organization across the planet there is a tug of war between the details and the big picture with multiple groups adding in their opinions and views.  You need to make the details understandable to your higher management to effectively argue your view.  Finding effective metrics and finding clear representation is essential in today&#8217;s business.  Google Visualization can be a useful tool in accomplishing this task.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2010/04/16/google-visualization-an-example-graphing-nvd-cve-data/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Learning By Doing: Challenges, Data Sets, and Practice Sites</title>
		<link>http://blog.securitymonks.com/2009/08/23/learning-by-doing-hacker-challenges-and-practice-sites/</link>
		<comments>http://blog.securitymonks.com/2009/08/23/learning-by-doing-hacker-challenges-and-practice-sites/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 15:30:18 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Badstone]]></category>
		<category><![CDATA[Bright Shadows]]></category>
		<category><![CDATA[Challenges]]></category>
		<category><![CDATA[DVL]]></category>
		<category><![CDATA[DVWA]]></category>
		<category><![CDATA[Date Sets]]></category>
		<category><![CDATA[De-ICE]]></category>
		<category><![CDATA[Enigma]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[HBH]]></category>
		<category><![CDATA[HTS]]></category>
		<category><![CDATA[Hackerdemia]]></category>
		<category><![CDATA[ISC]]></category>
		<category><![CDATA[Moth]]></category>
		<category><![CDATA[Mutillidae]]></category>
		<category><![CDATA[Network Warfare]]></category>
		<category><![CDATA[OWASP]]></category>
		<category><![CDATA[OpenPacket.org]]></category>
		<category><![CDATA[OverTheWire]]></category>
		<category><![CDATA[StS]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[Wargames]]></category>
		<category><![CDATA[Web Application]]></category>
		<category><![CDATA[WebGoat]]></category>
		<category><![CDATA[pWnOS]]></category>
		<category><![CDATA[pcapr]]></category>
		<category><![CDATA[w3af]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=1320</guid>
		<description><![CDATA[Security training is very important for any organization. When developing a training program, do not forget about the security staff. I am all for sending people to SANS and other company&#8217;s security courses. Once your people come back, how will they practice what they have learned? Hopefully, everyday at work does not involve tracking inventive [...]]]></description>
			<content:encoded><![CDATA[<p><font color="white"><img src="http://blog.securitymonks.com/wp-content/uploads/2009/08/hacking_28.jpg" align="left" border="10" height="143" width="146" /></font>Security training is very important for any organization. When developing a training program, do not forget about the security staff. I am all for sending people to <a href="http://www.sans.org/">SANS</a> and other company&#8217;s security courses. Once your people come back, how will they practice what they have learned? Hopefully, everyday at work does not involve tracking inventive hackers through your network. Hands-on security is the best way to develop skills and stay sharp. This is where security challenges, practice sites, and examining attack data can be fun and of great benefit. It all provides an opportunity to test one&#8217;s knowledge along with the security tools used for discovering vulnerabilities and defending your organization.</p>
<h3>Challenges</h3>
<p><a href="http://jhamcorp.com/">Johnathan Ham</a> and Sherri Davidoff from SANS Internet Storm Center (ISC) and <a href="http://www.raulsiles.com/">Raul Siles</a> from <a href="http://www.inguardians.com/">InGuardians</a> have created two recent, still open, security challenges.  Sherri, co-author with Jonathan of the <a href="http://www.sans.org/training/description.php?mid=1227">SANS&#8217; Network Forensics course</a>, has posted &#8220;<a href="http://philosecurity.org/2009/08/14/network-forensics-puzzle-contest">Network Forensics Puzzle Contest!</a>&#8221; (8-14-2009). The most elegant solution wins a free SANS On-Demand class (worth up to $3500 depending on the course). Raul wrote a new hacking challenge on the Ethical Hacker Network site, titled &#8220;<a href="http://www.ethicalhacker.net/content/view/268/2/">Prison Break &#8211; Breaking, Entering &amp; Decoding</a>&#8221; (7-27-2009).  Three winners will be selected based on: the best technical answer, creativity (while also technically correct), and a random drawing. Winners will receive signed copies of Ed&#8217;s book, &#8220;Counter Hack Reloaded.&#8221;</p>
<p>
Ed Skoudis, of <strong></strong> <a target="_blank" href="http://www.amazon.com/exec/obidos/ASIN/0131481045/thedigitalcon-20?creative=327641&amp;camp=14573&amp;adid=0W0TMYWJ6BXR5RPTG9N8&amp;link_code=as1" class="undefined">Counter Hack Reloaded</a> fame along with various SAN&#8217;s hacking and penetration testing courses (see Ed in Virginia Beach teaching &#8220;<a href="https://www.sans.org/vabeach09/description.php?cid=5337">Network Penetration Testing: Planning, Scoping, and Recon</a>&#8221; August 30th &#8211; September 4th), is the host bringing monthly new challenges created and managed by the fine folks of InGuardians. The great thing about <a href="http://www.ethicalhacker.net/content/category/2/12/2/">past challenges</a> is that they allow you to try the problems and check your solutions immediately. Check out Ed&#8217;s <a href="http://www.counterhack.net/Counter_Hack/Challenges.html">Counter Hack Reloaded site</a> for a few additional, older challenges.
</p>
<p>
<font color="red">UPDATE:</font> For a challenge in the forensic&#8217;s realm, check out the <a href="https://blogs.sans.org/computer-forensics?s=FAT+trustedsignal&#038;searchsubmit=Find">series of posts</a> by <b>Dave Hull</b> (<a href="http://trustedsignal.com/">trustedsignal</a>) on the <a href="https://blogs.sans.org/computer-forensics">SANS Forensics Blog</a>.  This series discusses the FAT file system.  Dave provided the following description: &#8220;I&#8217;ve provided a copy of the disk image used during the series and have ended almost every post with a challenge question and have been giving away a forensics related title from the Syngress Publishing group. We&#8217;ve had a great time and the series is in the archives for anyone who wants to check it out.&#8221;  Dave is working on a series for NTFS, which he should start posting in the next few weeks.  The series is very informative and a great hands-on way to learn.
</p>
<h3>Data Sets</h3>
<p><a href="http://www.rumint.org/gregconti">Greg Conti</a>, author of <a href="http://nostarch.com/securityvisualization.htm">Security Data Visualization</a>, co-authored the paper, &#8220;<a href="http://www.usenix.org/events/cset09/tech/full_papers/sangster.pdf">Toward Instrumenting Network Warfare Competitions to Generate Labeled Datasets</a>.&#8221;  The paper was done for the <a href="http://www.usenix.org/event/cset09/tech">CSET &#8216;09</a> Worksop on Cyber Security Experimentation and Test. The authors demonstrates how the network warfare competitions can be instrumented to generate modern labeled data sets. They have made available the <a href="http://www.itoc.usma.edu/research/dataset/index.html">archived data capture and log files</a> from the <b>2009 Inter-Service Academy Cyber Defense Competition</b>. The annual competition pits the service academies, including West Point, against an actual National Security Agency Red Team. There is a great deal to be learned by examining this data. A <a href="http://datasetsfortheresearchcommunity.blogspot.com/">blog</a> has been setup to discuss the data.  They are hoping to do a few data captures of network warfare games, as well as, data captures of red-on-blue events at the US Military Academy at West Point.</p>
<p>
There are a few additional sites where you can obtain data captures.  JJC, from the &#8220;<a href="http://global-security.blogspot.com/2009/03/openpacketorg.html">Security &#8211; The Global Perspective</a>&#8221; blog, manages the <a href="https://www.openpacket.org/"><b>OpenPacket.org</b></a> site. The site&#8217;s mission is to &#8220;provide quality network traffic traces to researchers, analysts, and other members of the digital security community.&#8221;  The site <a href="http://www.pcapr.net"><b>pcapr</b></a>, powered by Mu Dynamics, calls itself a &#8220;social nOtworking site.&#8221; Go to the site to learn about networks and protocols from packet captures.
</p>
<p>
<font color="red">UPDATE:</font> The folks from pcapr wrote in and pointed out that they just made available the &#8220;<a href="http://www.pcapr.net/forensics">Collaborative Network Forensics</a>&#8221; area where they &#8220;took the recently published ITOC dataset and the CCTF captures from the Shmoo group, indexed them for real-time browsing and contextual search/extract.&#8221;  As they point out, &#8220;with over 15.0 GBytes and 26.3 million packets, this now represents the largest collection of indexed pcaps online.&#8221;  Really nice.
</p>
<p>
The VizSEC site maintains links to various <a href="http://www.vizsec.org/datasets">repositories of data sets</a>.  SourceForge, as part of the <a href="http://sourceforge.net/projects/networkminer/">NetworkMiner tool</a>, has links to <a href="http://sourceforge.net/apps/mediawiki/networkminer/index.php?title=Publicly_available_PCAP_files">publically available PCAP files</a>.  The wireshark site also has a few links and <a href="http://wiki.wireshark.org/SampleCaptures">sample PCAP files</a>.
</p>
<h3>Practicing</h3>
<p>Practice can be done by installing software, using disk images, or by going to sites/training grounds. Installing software will create a vulnerable site.  Make sure to do it onto a local machine inside your LAN which is used solely for testing.  For ISO images, make sure you set the VM to use the IP addresses that are only  available from the local host OS (NAT or Host-only). If you go to a site, take caution and remember the site could be hostile.  In other words, be properly paranoid. </p>
<h4><b>Software</b></h4>
<p>In my post &#8220;<a href="http://blog.securitymonks.com/2009/01/10/webgoat-lua-and-modsecurity-verses-password-guessing/" rel="bookmark" title="Permanent Link to WebGoat, Lua, and ModSecurity verses Password Guessing">WebGoat, Lua, and ModSecurity verses Password Guessing</a>,&#8221; I go through the steps of setting up <b>WebGoat</b>. <a href="http://www.owasp.org/index.php/Category:OWASP_WebGoat_Project">WebGoat</a> is a deliberately insecure J2EE web application maintained by OWASP and is intended to teach a structured approach to test and exploiting vulnerabilities within an application security assessment. WebGoat is written in Java and installs on any platform with a Java virtual machine. The <a href="http://yehg.org/">YGN Ethical Hacker Group</a> has made available a series of video on walking through WebGoat v5.2. There are currently over 30 lessons.</p>
<p>
<a href="http://www.ethicalhack3r.co.uk/damn-vulnerable-web-app/">Damn Vulnerable Web App</a> (<b>DVWA</b>) is a PHP/MySQL Web application that is light weight, easy to use and full of vulnerabilities to exploit. <a href="http://www.ethicalhack3r.co.uk">Ryan Dewhurst</a>, developer of DVWA, created a video <span class="description">showing the installation process</span>:
</p>
</p>
<div class="youtube-video"><object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/GzIj07jt8rM&amp;hl=en&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/GzIj07jt8rM&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"></embed></param></object></div>
<p>
If you prefer PHP scripts, <b>Mutillidae</b> is a set that implements the <a href="http://www.irongeek.com/i.php?page=security/mutillidae-deliberately-vulnerable-php-owasp-top-10">OWASP Top 10</a> vulnerabilities. Adrian Crenshaw posted the presentation he gave to the Louisville Chapter of  OWASP about the Mutillidae project titled &#8220;<a href="http://www.irongeek.com/i.php?page=videos/owasp-top-5-louisville">OWASP  Top 5 and Mutillidae: Intro to common web vulnerabilities like Cross Site  Scripting (XSS), SQL/Command Injection Flaws, Malicious File Execution/RFI,  Insecure Direct Object Reference and Cross Site Request Forgery (CSRF/XSRF)</a>.&#8221;
</p>
<p>
<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5238124&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5238124&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object></p>
<p><a href="http://vimeo.com/5238124">Owasp Louisville 2nd Meeting</a> from <a href="http://vimeo.com/user729137">Adrian Crenshaw</a> on <a href="http://vimeo.com">Vimeo</a>.
</p>
<h4><b>ISO Disk Images</b></h4>
<p>On the ISO disk image side, there are few interesting options. <a href="http://www.badstore.net"><b>Badstore</b></a> demo helps in the understanding of Web application vulnerabilities and shows how to reduce exposure. </p>
<p>
For full scaled lesson based environment, there is the Linux-based distribution <a href="http://www.damnvulnerablelinux.org">Damn Vulnerable Linux</a> (<b>DVL</b>). <a href="http://geekybodhi.net/" target="_blank">Mayank Sharma</a> writes in the article &#8220;<a href="http://www.linux.com/archive/articles/60267" target="_blank">Securing Linux by breaking it with Damn Vulnerable Linux</a>:&#8221;</p>
<blockquote><p>&#8220;<a href="http://www.damnvulnerablelinux.org/" target="_blank">Damn Vulnerable Linux</a> (DVL) is everything a good Linux distribution isn&#8217;t. Its developers have spent hours stuffing it with broken, ill-configured, outdated, and exploitable software that makes it vulnerable to attacks. DVL isn&#8217;t built to run on your desktop &#8212; it&#8217;s a learning tool for security students.&#8221;&nbsp; &#8220;The one thing that sets DVL apart the most,&#8221; Josh Sweeney says, &#8220;is the focus on buffer overflows and disassembly.&#8221; Disassembly, he says, is often talked about in conjunction with buffer overflows and reverse engineering. &#8220;Disassembling is when someone breaks down a program into the assembly language for further analysis. By doing this, users can analyze code at a very low level and look for security issues. There have been many excellent papers on the subject over the years, but these generally don&#8217;t come with learning tools in a self-contained, easy-to-use environment.&#8221;</p></blockquote>
<p><a href="http://www.de-ice.net/">Thomas Wilhelm</a> is the author of &#8220;<a href="http://www.elsevier.com/wps/find/bookdescription.cws_home/718483/description#description">Professional Penetration Testing: Creating and Operating a Formal Hacking Lab</a>&#8221; and the creator of both the <a href="http://heorot.net/hackerdemia/"><b>Hackerdemia</b> project</a> and the <a href="http://de-ice.hackerdemia.com/doku.php"><b>De-ICE.net</b> Pentest LiveCDs</a> project.  Hackerdemia is a LiveCD that containing several vulnerabilities, including un-patched software, mis-configured services, default passwords and a few other surprises. Paul Asadoorian posted &#8220;<a href="http://blog.tenablesecurity.com/2009/03/scanning-vulnerable-linux-distributions-with-nessus.html">Scanning Vulnerable Linux Distributions With Nessus</a>&#8221; where he walks through using Nessus to determine the vulnerabilities within Hackerdemia.  The De-ICE.net Pentest LiveCDs are disk images that are fully-functioning server.  The Security Aegis site has an <a href="http://www.securityaegis.com/?page_id=339">interview with Thomas</a> where he discusses these projects along with the Heorot.net pentest video training and his recently published book.
</p>
<p>
One more Linux VM intentionally configured with exploitable services <a href="http://code.google.com/p/pwnos/"><b>pWnOS</b></a>. It was created by Brady Bloxham, a.ka bond00.  Below is a nice introduction video.
</p>
<p><div class="youtube-video"><object id="veohFlashPlayer" name="veohFlashPlayer" height="341" width="410"><param name="movie" value="http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.4.2.23.1011&amp;permalinkId=v15119345SN6ax252&amp;player=videodetailsembedded&amp;videoAutoPlay=0&amp;id=anonymous"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"><embed src="http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.4.2.23.1011&amp;permalinkId=v15119345SN6ax252&amp;player=videodetailsembedded&amp;videoAutoPlay=0&amp;id=anonymous" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" id="veohFlashPlayerEmbed" name="veohFlashPlayerEmbed" height="341" width="410"></embed></param></object></div>
</p>
<p>The Web Application Attack and Audit Framework (<b>w3af</b>) project has created a VMware image, called <a href="http://www.bonsai-sec.com/blog/index.php/moth-vulnerable-vmware-image"><b>Moth</b></a>, which is a set of vulnerable Web Applications and scripts.  The w3af core and it&#8217;s plugins are fully written in Python, has more than 130 plugins checking for SQL injection, cross site scripting (xss), local and remote file inclusion, etc.  What is really interesting about Moth is that it allows for testing of web application scanners and learning how web application firewalls work by providing a way access web applications and vulnerable scripts directly, through mod_security, and through PHP-IDS. </p>
<p>On the system side, <b>LAMPSecurity</b> has been creating a series of capture the flag exercise that uses a full Linux virtual machine that is vulnerable to remote root compromise due to a number of vulnerabilities.  The most recent exercise is <a href="http://lampsecurity.org/capture-the-flag-6">Capture the Flag 6</a> and was released 7/17/2009.  The documentation will take you through the steps of the exercise.  </p>
<h4><b>Training Ground</b></h4>
<p>The <b>Mighty Seek Podcast</b> did a <a href="http://www.mightyseek.com/category/podcasts/hands-on-series/" target="_blank">Hands On Series</a> and setup the <a href="http://hackme.ntobjectives.com">NTO Hackme</a> Test site, which includes the podcasts with the opportunity to test what is discussed out. Dan Kuykendall did two episodes: &#8220;<a href="http://www.mightyseek.com/podcasts/hands-on-series-sql-injection">Episode #01 &#8211; SQL Injection Part 1 [Intro]</a>&#8221; and &#8220;<a href="http://www.mightyseek.com/podcasts/hands-on-series-cross-site-scripting-xss-part-1">Episode #02 &#8211; Cross Site Scripting (XSS) Part 1 [Intro]</a>.&#8221;</p>
<p>
<a href="http://www.hackthissite.org">Hack This Site</a> (<b>HTS</b>) is a website to test and expand one&#8217;s hacking skills. You will need to register with the site to access the hacker challenges.&nbsp; There are various lessons and missions.&nbsp; User cwade12c has posted the several video tutorial covering missions. Below is &#8220;<a href="http://www.youtube.com/watch?v=iTnTzc23SRQ">Hack This Site &#8211; Basic 1 Tutorial</a>&#8221; to give you an feel for the simplest of challenges:
</p>
<p><div class="youtube-video"><object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/iTnTzc23SRQ&amp;hl=en&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/iTnTzc23SRQ&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"></embed></param></object></div>
</p>
<p>
<a href="http://www.hellboundhackers.org">HellBound Hackers</a> (<b>HBH</b>) is another site offering a large resource consisting of challenges, articles, forums, etc.  The LifeofaHacker site has published some challenge <a href="http://www.lifeofahacker.org/hbhandhtsguides.htm">tutorials/walkthrough guides</a> for both Hack This Site (HTS) and HBH.
</p>
<p>
<a href="http://www.enigmagroup.org"><b>Enigma Group</b></a> is similar to HTS and HBH in terms of tutorials, articles, and hacker challenges.  There are some education and humorous short tutorial videos.
</p>
<p>
<a href="http://www.bright-shadows.net/"><b>The Bright Shadows site</b></a> also offers challenges on JavaScript, cyptography, cracking, steganography, Flash, Java, various programming exploits, etc. Registration is required. The challenges get voted on by the members in terms of difficulty, creativity, education, and presentation.
</p>
<p>
<a href="http://www.smashthestack.org">Smash The Stack (<b>StS</b>) Wargaming Network</a> has a progression of challenges where each challenge is dependent on the completion of the previous challenge.  The challenges are *nix based.  To get started you ssh into one one of the wargame servers on port 2224 using password &#8220;level1&#8243;, at which point you receive a message letting you know how to get started.  The password for the next level will be located in different placed, depending on the game.  Questions can be asked on their forums area.  <a href="http://www.overthewire.org/wargames/"><b>OverTheWire</b></a> offer similar wargame challenges.
</p>
<h3>A Few Final Thoughts</h3>
<p>The above list represents a few source I have experience with.  Duncan Alderson  on his site Webantix has done a great job of listing war games/hacking simulators in his post, “<a href="http://www.webantix.net/hacking/war-games-current-and-past-hacking-simulators-and-challanges/">War Games. Current and past hacking simulators and challenges.</a> The <a href="http://neworder.box.sk/link.php?currentgrp=38667">New Order site</a> also has a much more comprehensive list.</p>
<p>
Just remember, it is good to be paranoid. Even HTS, with a user base of over 1,300,000 can still have problems with disgruntled and past employees. We are talking very skilled, intelligent, and disgruntle employees.  In the last major attack, root-level access to the website was gained and HTS was taken down for months.
</p>
<p>
It is a dangerous world.  That is exactly why skilled ethical hackers are needed.  One of my college professors would always say, &#8220;Repetition is the key to learning.&#8221;  He repeated it so many time, I finally learned that lesson.  The above links help provide a challenging way to practice and learn.  Give them a try and have some fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2009/08/23/learning-by-doing-hacker-challenges-and-practice-sites/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Standardization and Interoperability in Security</title>
		<link>http://blog.securitymonks.com/2009/08/09/standardization-and-interoperability-in-security/</link>
		<comments>http://blog.securitymonks.com/2009/08/09/standardization-and-interoperability-in-security/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 00:23:10 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Aneesh Chopra]]></category>
		<category><![CDATA[CCE]]></category>
		<category><![CDATA[CPE]]></category>
		<category><![CDATA[CVE]]></category>
		<category><![CDATA[CVSS]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[IDS]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Metrics]]></category>
		<category><![CDATA[NCP]]></category>
		<category><![CDATA[NIST]]></category>
		<category><![CDATA[OVAL]]></category>
		<category><![CDATA[Policies]]></category>
		<category><![CDATA[Risk]]></category>
		<category><![CDATA[SCAP]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[XCCDF]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=1233</guid>
		<description><![CDATA[&#8220;While the NSA has a great red-team (think pen-test) capability, they had a major change of heart and realized, like the rest of the security world (*cough* Ranum *cough*), that while attacking is fun, it isn’t very productive at defending your systems – there is much more work to be done for the defenders, and [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;<i>While the NSA has a great red-team (think pen-test) capability, they had a major change of heart and realized, like the rest of the security world (<a href="http://www.ranum.com/security/computer_security/editorials/point-counterpoint/pentesting.html">*cough* Ranum *cough*</a>), that while attacking is fun, it isn’t very productive at defending your systems – there is much more work to be done for the defenders, and we need more clueful people doing that.</i>&#8221;  &#8212; <b><a href="http://www.guerilla-ciso.com/archives/author/admin">Rybolov</a></b> (aka Michael Smith, the Guerilla CISO).</p>
<p>
<a href="http://www.onr.navy.mil/innovate"><img src="http://www.onr.navy.mil/innovate/images/game_changing.jpg" align="left" width=120/></a><a href="http://scap.nist.gov/">The Security Content Automation Protocol (SCAP)</a> is an attempt to help defenders by providing a collection of XML schemas/standards that allow technical security information to be exchanged between tools.  For example, SCAP can help organizations looking for a way to respond appropriately to new vulnerabilities and threats by helping prioritize, allowing the most significant ones to be addressed sooner.  It can also benefit those looking to provide interoperability across system security tools.  There is even <a href="http://thinkingstring.com/2009/06/csc-cloud-strategy-coming/">an effort</a> to &#8220;encouraging the use of SCAP as a de-facto standard across the ICT industry for deploying trusted cloud computing services.&#8221;</p>
<h2>Background</h2>
<p>To help understand what exactly SCAP is, let us turn to the U.S. National Institute of Standards and Technology (NIST) Special Publications (SP) 800-117, &#8220;<a href="http://csrc.nist.gov/publications/PubsDrafts.html#SP-800-117">DRAFT Guide to Adopting and Using the Security Content Automation Protocol (SCAP)</a>:&#8221;<br />
<blockquote>SCAP comprises a suite of specifications for organizing and expressing security-related information in standardized ways, as well as related reference data, such as identifiers for software flaws and security configuration issues.  SCAP can be used for maintain the security of enterprise systems, such as automatically verifying the installation of patches, checking systems security configuration settings, and examining systems for signs of compromise.</p></blockquote>
<p>
NIST this month is looking for public comments on the first public draft of SP 800-126, &#8220;<a href="http://csrc.nist.gov/publications/drafts/sp800-126/Draft-SP800-126.pdf">The Technical Specification for the Security Content Automation Protocol (SCAP)</a>.&#8221;  Back in May, NIST released the draft for SP 800-117.
</p>
<p>
SCAP components consists of:</p>
<ul>
<li><a href="http://cce.mitre.org/">Common Configuration Enumeration (CCE)</a>: provide unique identifiers to system configuration issues in order to facilitate fast and accurate correlation of configuration data across multiple information sources and tools.</li>
<li><a href="http://cpe.mitre.org/">Common Platform Enumeration (CPE)</a>:  a structured naming scheme for information technology systems, platforms, and packages.</li>
<li><a href="http://cve.mitre.org/">Common Vulnerability Enumeration (CVE)</a>: a dictionary of publicly known information security vulnerabilities and exposures.</li>
<li><a href="http://www.first.org/cvss/">Common Vulnerability Scoring System (CVSS)</a>: a vulnerability scoring system designed to provide an open and standardized method of rating IT vulnerabilities.  NIST has even provided a <a href="http://nvd.nist.gov/cvss.cfm?calculator&#038;adv&#038;version=2">calculator</a> for creating CVSS vulnerability severity scores.</li>
<li><a href="http://scap.nist.gov/specifications/xccdf/">eXtensible Checklist Configuration Description Format (XCCDF)</a>: a specification language for writing security checklists, benchmarks, and related kinds of documents.  NIST has released the NIST Interagency Report 7275 Revision 3 &#8220;<a href="http://csrc.nist.gov/publications/nistir/ir7275r3/NISTIR-7275r3.pdf">Specification for Extensible Configuration Checklist Description Format (XCCDF) Version 1.1.4</a>.&#8221;</li>
<li><a href="http://oval.mitre.org/">Open Vulnerability Assessment Language (OVAL)</a>: an information security community standard to promote open and publicaly available security content, and to standardize the transfer of this information across security tools and services.</li>
</ul>
<p>
<a href="http://checklists.nist.gov">The National Checklist Program (NCP)</a>, outlined in <a href="http://csrc.nist.gov/publications/PubsSPs.html#SP-800-70-Rev.%201">NIST SP 800-70</a>, is the repository for SCAP-expressed checklists.  The checklists provide detailed low level guidance on setting the security configuration of operating systems and applications.
</p>
<p>
In June, MITRE hosted the Security Automation Developer Days conference, which focused on the U.S. National Institute of Standards and Technology’s (NIST) Security Content Automation Protocol (SCAP).  MITRE has made the <a href="http://makingsecuritymeasurable.mitre.org/participation/Security_Automation_Developer_Days_2009_Minutes.pdf">minutes</a> available, which includes discussion on NIST SP 800-126.  Michael Smith has provided some great highlights from the conference in his post, &#8220;<a href="http://www.guerilla-ciso.com/archives/1176">Security Automation Developers Conference Slides</a>.&#8221;  The problem with Michael is that it is difficult not to quote his whole blog, which is bad web etiquette.  Please follow the link for some real insight concerning the slides.  You can also view below Michael&#8217;s presentation, &#8220;Security Content Automation Protocol and Web Application Security:&#8221;</p>
<div style="width:425px;text-align:left" id="__ss_1828884"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/rybolov/security-content-automation-protocol-and-web-application-security" title="Security Content Automation Protocol and Web Application Security">Security Content Automation Protocol and Web Application Security</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=owaspdcscap08-05-09-090807152921-phpapp02&#038;stripped_title=security-content-automation-protocol-and-web-application-security" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=owaspdcscap08-05-09-090807152921-phpapp02&#038;stripped_title=security-content-automation-protocol-and-web-application-security" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/rybolov">Michael Smith</a>.</div>
</div>
<p>
Back in September 2008, NIST sponsored the Fourth Annual Security Automation Conference.  The <a href="http://nvd.nist.gov/2008-presentations.cfm">Presentations</a> are available.  <a href="http://www.guerilla-ciso.com/archives/author/ian99">Ian Charters</a> attended and posted his thoughts, &#8220;<a href="http://www.guerilla-ciso.com/archives/514">NIST and SCAP; Busting a cap on intruders Part 1<a />.&#8221;  The </a><a href="http://www.nist.gov/public_affairs/confpage/091026.htm">5th Annual IT Security Automation Conference</a> will be held October 26-30th, 2009 at the Baltimore Convention Center.
</p>
<p>
Make sure to check out below the OWASP video talk from <a href="http://www.owasp.org/index.php/Front_Range_OWASP_Conference_2009">SnowFROC 2009</a> by <a href="edbellis.com">Ed Bellis</a> (from Orbits) on vulnerability management titled &#8220;<a href="http://video.google.com/videoplay?docid=-8396241750899139680&#038;hl=en">Doing more with less?  Automate or die</a>.&#8221;
</p>
<p>
<embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=-8396241750899139680&#038;hl=en&#038;fs=true" style="width:400px;height:326px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"></embed></p>
<p>
Ed&#8217;s has also written an article for CSO Online, &#8220;<a href="http://www.csoonline.com/article/492213/How_SCAP_Brought_Sanity_to_Vulnerability_Management">How SCAP Brought Sanity to Vulnerability Management</a>.&#8221;
</p>
<p><h2>Possible Problems</h2>
<p>Some may argue that SCAP is overly complicated and people are better off relying solely on their vendor&#8217;s products and reports.  That assumes that a single vendor product is sufficient to meet tomorrow&#8217;s security needs.  Some organizations buy into the platform simplification model where basically they purchase a single vendor line of products in order to avoid interoperability problems.  The problems is that one vendor frequently only does a few things well.  The agility of the organization to adapt to changes in the security world becomes dependent solely on that single vendor.  After investing so much into that one vendor, organizations find that they are completely locked in.  Probably that is not the best position to be in when facing a very volatile IT environment.
</p>
<p>
Consider the below list where NIST outlines areas SCAP validation will cover (Source: NIST Interagency Report 7511 &#8220;<a href="http://csrc.nist.gov/publications/drafts/nistir-7511/Draft-NISTIR-7511.pdf">Security Content Automation Protocol (SCAP) Version 1.0 Validation Program Test Requirements (DRAFT))</a>:&#8221;</p>
<ul>
<li><b>FDCC Scanner</b>: the capability to audit and assess a target system to determine its compliance with the FDCC requirements.</li>
<li><b>Authenticated Configuration Scanner</b>: the capability to audit and assess a target system to determine its compliance with a defined set of configuration requirements using target system logon privileges.</li>
<li><b>Authenticated Vulnerability and Patch Scanner</b>: the capability to scan a target system to locate and identify the presence of known vulnerabilities and evaluate the software patch status to determine compliance with a defined patch policy using target system logon privileges.</li>
<li><b>Unauthenticated Vulnerability Scanner</b>: the capability of determining the presence of known vulnerabilities by evaluating the target system over the network.</li>
<li><b>Intrusion Detection and Prevention System (IDPS)</b>: the capability to monitor a system or network for unauthorized or malicious activities. An intrusion prevention system actively protects the target system or network against these activities.</li>
<li><b>Vulnerability Remediation</b>: the capability to install patches on a target system in compliance with a defined patching policy.</li>
<li><b>Misconfiguration Remediation</b>: the capability to alter the configuration of a target system to bring it into compliance with a defined set of configuration recommendations.</li>
<li><b>Asset Scanner</b>: the capability to actively discover, audit, and assess asset characteristics including: installed and licensed products; location within the world, a network or enterprise; ownership; and other related information on IT assets such as workstations, servers, and routers.</li>
<li><b>Asset Database</b>: the capability to store and report on asset characteristics including: installed and licensed products; location within the world, a network or enterprise; ownership; and other related information on IT assets such as workstations, servers, and routers.</li>
<li><b>Vulnerability Database</b>: a catalog of security-related software flaws labeled with CVEs where applicable. This data is made accessible to users through a search capability or data feed and contains descriptions of software flaws, references to additional information (e.g., links to patches or vulnerability advisories), and impact scores. The user-to-database interaction is provided independent of any scans, intrusion detection, or reporting activities. Thus, a product that only scans to find vulnerabilities and then stores the results in a database does not meet the requirements for an SCAP vulnerability database (such a product would map to a different SCAP capability). A product that presents the user general knowledge about vulnerabilities, independent of a particular environment, would meet the definition of an SCAP vulnerability database.</li>
<li><b>Misconfiguration Database</b>: a catalog of security-related configuration issues labeled with CCEs where applicable. This data is made accessible to users through a search capability or data feed and contains descriptions of configuration issues and references to additional information (e.g., configuration guidance, mandates, or other advisories). The user-to-database interaction is provided independent of any configuration scans or intrusion detection activities. Thus, a product that only scans to find misconfigurations and then stores the results in a database does not meet the requirements for an SCAP misconfiguration database (such a product would map to a different SCAP capability). A product that presents the user general knowledge about security-related configuration issues, independent of a particular environment, would meet the definition of an SCAP vulnerability database.</li>
<li><b>Malware Tool</b>: the capability to identify and report on the presence of viruses, worms, Trojan horses, spyware, or other malware on a target system.</li>
</ul>
<p>It is difficult to imagine a single security product that is capable of doing all the above services well.  There is a need to be able to share information between various systems performing these functions.
</p>
<p><h2>Game Changing Technology</h2>
<p><img src="http://media.bonnint.net/wtop/15/1540/154077.jpg" align="right" width=140/>Considering past statements by <a href="http://commerce.senate.gov/public/index.cfm?FuseAction=Hearings.Testimony&#038;Hearing_ID=fba30a2a-812e-4a37-aec2-d3ca7a8f6c11&#038;Witness_ID=f4879075-168c-4a3f-827b-dc8e9e3ed191">Aneesh Chopra</a>, the first Chief Technology Officer of the United States, does not SCAP sound like an area that will be getting additional support by the U.S. government?  ZDnet has posted a very interesting podcast of <a href="http://blogs.zdnet.com/BTL/?p=22292">Chopra talking at the Computer History Museum</a>.  Chopra wrote a few months back:<br />
<blockquote>If confirmed, I would emphasize a research program on &#8220;game-changing&#8221; ideas in cybersecurity, to find new ideas that might transform the nation’s information infrastructure to be more secure and simpler to understand and use.  The goal is to make it &#8220;easy to do the right thing, hard to do the wrong things and easy to recover when the wrong thing happens anyway.&#8221;</p></blockquote>
<p>Tim O&#8217;Reilly, one of the most insightful person around in respect to IT, wrote back in April &#8220;<a href="http://radar.oreilly.com/2009/04/aneesh-chopra-great-federal-cto.html">Why Aneesh Chopra is a Great Choice for Federal CTO</a>.&#8221;  Tim’s points out items that Chopra has accomplished in Virginia:</p>
<ol>
<li>the first officially-approved open source textbook in the country, the Physics Flexbook;</li>
<li>integrating iTunes U with Virginia’s state education assessment framework;</li>
<li>the Learning Apps Development Challenge, a competition for the best iPhone and iPod Touch applications for middle-school math teaching;</li>
<li>a Ning-based social network to connect clinicians working in small health care offices in remote locations;</li>
<li>a state-funded “venture capital fund” to allow government agencies to try out risky but promising new approaches to delivering their services or improving their productivity;</li>
<li>a lightweight approval and testing process that allows the government to try out new technologies before making a full, expensive commitment.</li>
</ol>
<p>
Back in April 2007, Chopra was behind Virginia&#8217;s 95 agencies opening up their databases to the Google search engine, in order to make them widely accessible to the public.  Chopra at that time stated the top priority of the state&#8217;s strategic plan for information technology, which was adopted last year, is increased access to government information.  A great thing to do, provided security is insuring only the information you want is being accessed in the manner intended.
</p>
<p>
John Dvorak offers a different opinion of Chopra in his post &#8220;<a href="http://www.dvorak.org/blog/2009/08/12/special-report-is-us-chief-information-officer-cio-vivek-kundra-a-phony/">Special Report: Is US Chief Information Officer (CIO) Vivek Kundra a Phony?</a>&#8221;  Dvorak states, &#8220;It would be logical to assume that Kundra managed to get his buddy Chopra the CTO job despite the fact that Chopra’s technology background is essentially nil.&#8221;  Whether O&#8217;Reilly or Dvorak is correct, Chopra needs to start reading the Guerilla CISO for great insight into security solutions.  Michael outlines a plan on fixing government patch and vulnerability management through SCAP in the post, &#8220;<a href="http://www.guerilla-ciso.com/archives/1197">Federated Vulnerability Management</a>.&#8221;  Here are a few of the ideas discussed in the post:</p>
<ul>
<li>Every IT asset reports into a patch management system of some sort.  Group the assets allowing for identification of who is responsible when something has a problem.</li>
<li>Do periodic network scanning.</li>
<li>The orchestrator will correlate network scans with patch management status and gives a ticketing/alert/whatever where unmanaged devices are identified.</li>
<li>The NVD feed is pushed down to the agencies/departments which are sent out as vulnerability alerts along with the checks to see if systems are vulnerable.</li>
<li>Hardening guides are pushed from the agencies/departments in SCAP form and audit information is pulled of IT assets.  Differences are automatically entered into a workflow and reporting system.</li>
</ul>
<p>Imagine the additional possibilities when intrusion detection/prevention systems, patch remediation, asset scanner, and malware tools start sharing information.
</p>
<p><h2>SCAP and the Cloud</h2>
<p>Aneesh Chopra should also read Christofer Hoff&#8217;s rational Survivability blog.  In Hoff&#8217;s post, &#8220;<a href="http://www.rationalsurvivability.com/blog/?p=1177">Extending the Concept: A Security API for Cloud Stacks</a>&#8220;, he considers building on the capabilities of SCAP to embed a &#8220;standardized and open API layer into each IaaS, PaaS and SaaS offering (see the API blocks in the diagram below) to provide not only a standardized way of scanning for network vulnerabilities, but also configuration management, asset management, patch remediation, compliance, etc.&#8221;  Hoff goes on to write, &#8220;Further (HT to @davidoberry who reminded me about my posts on the topic) we could use <a href="http://www.rationalsurvivability.com/blog/?p=78">TCG IF-MAP as a comms. protocol for telemetry</a>.&#8221;
</p>
<p>
<a href="http://www.rationalsurvivability.com/blog/wp-content/media/2009/07/mappingmetal_compliance.044.jpg"><img src="http://www.rationalsurvivability.com/blog/wp-content/media/2009/07/mappingmetal_compliance.044.jpg"/ width=450/></a>
</p>
<p>
Hoff is another person who is difficult to quote without including his complete post.  He makes the point that you gain &#8220;automated audit and security management capability for the customer/consumer and a a streamlined, cost effective, and responsive way of automating the validation of said controls in relation to compliance, SLA and legal requirements for service providers.&#8221;  By doing so, Hoff points out, you are &#8220;not reinventing the wheel and we have lots of technology and standardized solutions we can already use to engineer into the stack.&#8221;
</p>
<p>
<font color="red">Update:</font>  Hoff pointed out (see comments area) some of the excellent work done by Iron Frog (Ben) in not only his post &#8220;<a href="http://ironfog.blogspot.com/2009/08/some-thoughts-for-addressing-assurance.html">Some thoughts for addressing the Assurance component of A6</a>,&#8221; but also his series of post &#8220;Can we do the Security Stack API RESTfully? (parts <a href="http://ironfog.blogspot.com/2009/07/can-we-do-security-stack-api-restfully.html">1</a><a>, </a><a href="http://ironfog.blogspot.com/2009/07/can-we-do-security-stack-api-restfully_28.html">2</a>, <a href="http://ironfog.blogspot.com/2009/07/can-we-do-security-stack-api-restfully_29.html">3</a>, <a href="http://ironfog.blogspot.com/2009/07/can-we-do-security-stack-api-restfully_30.html">4</a>, and <a href="http://ironfog.blogspot.com/2009/07/can-we-do-security-stack-api-restfully_31.html">5</a>).&#8221;
</p>
<p>
<a href="http://www.zoominfo.com/people/Mell_Peter_30239499.aspx">Peter Mell</a>, who recently changed positions at NIST from the SCAP validation program manager to the leader of the agency&#8217;s Cloud computing project, will likely agree with Hoff&#8217;s points.  Expect NIST efforts in the Cloud to take SCAP into consideration.
</p>
<p><div style="width:425px;text-align:left" id="__ss_1407697"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/kvjacksn/nist-cloud-computing-standards" title="NIST Cloud Computing Standards">NIST Cloud Computing Standards</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cloud-computing-standardsispab-dec2008p-mell-090508165235-phpapp01&#038;stripped_title=nist-cloud-computing-standards" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cloud-computing-standardsispab-dec2008p-mell-090508165235-phpapp01&#038;stripped_title=nist-cloud-computing-standards" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/kvjacksn">Kevin Jackson</a>.</div>
</div>
<p><h2>Final Thoughts</h2>
<p>As Michael Smith points out, in the Cloud one faces the same problems as a managed service provider, mainly how to allow the auditing of systems and the underlying infrastructure.  An API could allow a managed services environment making security tasks much easier to customers.  To quote Michael Smith, &#8220;we have in SCAP is Common Platform Enumeration (CPE) which allows you to specify the hardware and software (ie, how the infrastructure that you don’t know about is built) and eXtensible Configuration Checklist Description (XCCDF) which specifies the audit/compliance checks. Package them together and you have a way of describing what the infrastructure looks like and the technical auditing standard to go along with it.&#8221;  Sounds like some game changing ideas that could transform the nation’s information infrastructure, helping it be more secure.  I hope you are listening, Aneesh Chopra.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2009/08/09/standardization-and-interoperability-in-security/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>TOTEM: Threat Observation, Tracking, and Evaluation Model</title>
		<link>http://blog.securitymonks.com/2009/06/06/totem-threat-observation-tracking-and-evaluation-model/</link>
		<comments>http://blog.securitymonks.com/2009/06/06/totem-threat-observation-tracking-and-evaluation-model/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 01:29:06 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[ANL Federated Model]]></category>
		<category><![CDATA[Bro]]></category>
		<category><![CDATA[CAMNEP]]></category>
		<category><![CDATA[CPP]]></category>
		<category><![CDATA[Defense in Depth]]></category>
		<category><![CDATA[IDS]]></category>
		<category><![CDATA[Reputation]]></category>
		<category><![CDATA[Risk]]></category>
		<category><![CDATA[SlideCasting]]></category>
		<category><![CDATA[SlideShare]]></category>
		<category><![CDATA[Snort]]></category>
		<category><![CDATA[TVA]]></category>
		<category><![CDATA[Trust Management]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[Vulnerability]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=1165</guid>
		<description><![CDATA[This week I had the pleasure of presenting two talks at the National Laboratories Information Technology (NLIT) 2009 Summit held in Oak Ridge, TN.  Everyone involved was great and I had a fun time.  Since the presentations have been posted to the NLIT site, I am free to post now.  

The original [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://imagecache2.allposters.com/images/pic/BRGPOD/203201~St-John-Chrystostomos-circa-347-407-Preaching-Before-the-Empress-Eudoxia-circa-404-circa-1880-Posters.jpg"><img src="http://imagecache2.allposters.com/images/pic/BRGPOD/203201~St-John-Chrystostomos-circa-347-407-Preaching-Before-the-Empress-Eudoxia-circa-404-circa-1880-Posters.jpg" alt="" align="left" width=150 /></a>This week I had the pleasure of presenting two talks at the <a href="http://www.fbcinc.com/nlit/default.aspx">National Laboratories Information Technology (NLIT)</a> 2009 Summit held in Oak Ridge, TN.  Everyone involved was great and I had a fun time.  Since the presentations have been <a href="http://info.ornl.gov/events/nlit09/Pages/Home.aspx">posted</a> to the NLIT site, I am free to post now.  </p>
<p>
The original slides made heavy use of the <a href="http://en.wikipedia.org/wiki/PowerPoint_animation">Microsoft PowerPoint animation</a> feature.  Unfortunately, SlideShare does not currently support animation.  You can download the presentation and the animations will work, but I ended up modifying the slides so they are more viewable online.  <a href="http://www.slideboom.com/">SlideBoom</a> will keep the animation, but it does it by creating a video of the presentation.  I decided to stick with SlideShare and spare you the resulting nine minute video.  While I should add audio and make a <a href="http://www.slideshare.net/jboutelle/slidecasting-101">SlideCast</a>, this post might never be completed if I wait until I have time to create a really nice web presentation.
</p>
<p>
<a href="http://www.merriam-webster.com/dictionary/totem">Merriam-Webster</a> defines a <strong>totem</strong> as any supposed entity that watches over or assists a group of people, such as a family, clan, or tribe.  In this presentation I focused on how TOTEM assists in watching over and evaluating the threat an IP represents.  The idea behind TOTEM is simple: compare threat information from sources such as watchlists (DShield, Emerging Threats, SenderBase, etc.) to activities with the organization (IDS/IPS, flow logs, etc.) and other locations (SANS ISC, DOE federated model, etc.).  As new threat information and activity sources are added, a better evaluation can be rendered.
</p>
<p><div style="width:425px;text-align:left" id="__ss_1543517"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/johngerber/totem-threat-observation-tracking-and-evaluation-model-1543517?type=powerpoint" title="TOTEM: Threat Observation, Tracking, and Evaluation Model">TOTEM: Threat Observation, Tracking, and Evaluation Model</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=totem-090606185822-phpapp02&#038;rel=0&#038;stripped_title=totem-threat-observation-tracking-and-evaluation-model-1543517" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=totem-090606185822-phpapp02&#038;rel=0&#038;stripped_title=totem-threat-observation-tracking-and-evaluation-model-1543517" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more presentations by <a style="text-decoration:underline;" href="http://www.slideshare.net/johngerber">John Gerber</a>.</div>
</div>
<p>
The purpose of this presentation has been to share the basic ideas behind TOTEM with the hope that others may provide helpful insight.  So far I have not disappointed.  I wanted to thank everyone for I have received some very intriguing ideas.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2009/06/06/totem-threat-observation-tracking-and-evaluation-model/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebGoat, Lua, and ModSecurity verses Password Guessing</title>
		<link>http://blog.securitymonks.com/2009/01/10/webgoat-lua-and-modsecurity-verses-password-guessing/</link>
		<comments>http://blog.securitymonks.com/2009/01/10/webgoat-lua-and-modsecurity-verses-password-guessing/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 00:54:52 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[ModSecurity]]></category>
		<category><![CDATA[OWASP]]></category>
		<category><![CDATA[Vulnerability]]></category>
		<category><![CDATA[Web Application]]></category>
		<category><![CDATA[WebGoat]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/?p=826</guid>
		<description><![CDATA[Happiness abandoned Twitter this week as it was revealed that an 18-year-old was able to use an automated password-guesser to break into an account.  Twitter allowed for an unlimited number of log-in attempts.  The hacker used a simple dictionary attack that revealed at 11:00am Monday the password of &#8220;happiness.&#8221;  Once the hacker [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://sensitivitytothings.com/wp-content/uploads/2008/03/roller-coaster-monks.jpg" alt="" align="left" width=150 />Happiness abandoned <a href="http://twitter.com/">Twitter</a> this week as it was revealed that an 18-year-old was able to use an automated password-guesser to break into an account.  Twitter allowed for an unlimited number of log-in attempts.  The hacker used a simple <a href="http://en.wikipedia.org/wiki/Dictionary_attack">dictionary attack</a> that revealed at 11:00am Monday the password of &#8220;<strong>happiness</strong>.&#8221;  Once the hacker had the Twitter staffer&#8217;s password, through the administrative panel it was possible to change the email address of any Twitter account and reset the holder&#8217;s password.  See Tom&#8217;s post &#8220;<a href="http://spylogic.net/item/398">Summary of the Twitter Security Incidents</a>&#8221; for more details on the incident.</p>
<p>
To deal with administrative accounts at Twitter, Adam O&#8217;Donnell provides some great advices to corporate CSOs in his article, &#8220;<a href="http://blogs.zdnet.com/security/?p=2359">A roadmap for the Twitter CSO</a>.&#8221;  Dave Goldsmith post, &#8220;<a href="http://www.matasano.com/log/1342/my-pentest-secret-password-guessing/">My Pentest Secret: Password Guessing</a>,&#8221; provides more advice to mitigate risk of password guessing attacks.
</p>
<p>
Today&#8217;s post focuses on Dave&#8217;s point:<br />
<blockquote><strong>FAILED LOGIN DELAYS</strong>. What to do when someone is grinding passwords on the same account? Account lockout is pretty unpopular as it can lead to a denial of service attack. Doing nothing is pretty unpopular because attackers can grind forever. Enter the exponentially increasing login delay. Every failed login on an account causes the system to delay more and more on that account until a reset on that counter after a reasonable period of time or a valid login.</p></blockquote>
<p>The Open Web Application Security Project (<a href="http://www.owasp.org/index.php/Main_Page">OWASP</a>) has begun a podcast focused on web application security.  The podcast is hosted by <a href="http://www.linkedin.com/in/jmanico">Jim Manico</a>, a Web Application Architect and Security Engineer for Aspect Security.  In <a href="http://www.owasp.org/index.php/Podcast_2">Podcast #2</a>, Stephen Craig Evans, an independent software security consultant, talks about <a href="http://www.lua.org/">Lua</a> and the OWASP Summer of Code project wiki, <a href="http://www.owasp.org/index.php/OWASP_Securing_WebGoat_using_ModSecurity_Project">Securing WebGoat using ModSecurity</a>.  The project  goes through the steps involved in securing WebGoat using the combination of ModSecurity and Lua.  To quote <a href="http://blog.modsecurity.org/2008/10/securing-webgoat-using-modsecurity.html">Ivan Ristic</a>, creator of ModSecurity, the project &#8220;stretched the boundaries of what ModSecurity could do.&#8221;
</p>
<p>
<center><a href="http://www.owasp.org/index.php/Image:WebGoat-Bypass-Access-Control-Lesson.JPG"><img src="https://www.owasp.org/images/thumb/f/f3/WebGoat-Bypass-Access-Control-Lesson.JPG/300px-WebGoat-Bypass-Access-Control-Lesson.JPG" /></a></center>
</p>
<p>
To help address the problem of dictionary attacks against your web server, today&#8217;s post will be using ModSecurity with the scripting language Lua.  First, let&#8217;s setup WebGoat for testing purposes.  </p>
<h2>WebGoat</h2>
<p>For those unfamiliar with <a href="http://www.owasp.org/index.php/Category:OWASP_WebGoat_Project">OWASP WebGoat project</a>, WebGoat is:<br />
<blockquote>WebGoat is a deliberately insecure J2EE web application maintained by OWASP designed to teach web application security lessons. In each lesson, users must demonstrate their understanding of a security issue by exploiting a real vulnerability in the WebGoat application. For example, in one of the lessons the user must use SQL injection to steal fake credit card numbers. The application is a realistic teaching environment, providing users with hints and code to further explain the lesson.</p>
<p>Why the name &#8220;WebGoat&#8221;? Developers should not feel bad about not knowing security. Even the best programmers make security errors. What they need is a scapegoat, right? Just blame it on the &#8216;Goat!</p></blockquote>
<p>WebGoat is intended to teach a structured approach to test and exploiting vulnerabilities within an application security assessment.  Also being developed is the <a href="http://www.owasp.org/index.php/OWASP_Testing_Project">OWASP Testing Project</a>, which provides a full application security assessment testing methodology.  Through WebGoat, companies have a way to teach web application security lessons to their developers.  There are over 30 lessons dealing with such issues as:
</p>
<table>
<tr>
<td valign="top">
<ul>
<li> <a href="http://blog.securitymonks.com/index.php/Cross-site_Scripting_%28XSS%29" title="Cross-site Scripting (XSS)">Cross-site Scripting (XSS)</a>
</li>
<li> Access Control
</li>
<li> <a href="http://blog.securitymonks.com/index.php/Race_condition_within_a_thread" title="Race condition within a thread">Thread Safety</a>
</li>
<li> <a href="http://blog.securitymonks.com/index.php/Unvalidated_Input" title="Unvalidated Input">Hidden Form Field Manipulation</a>
</li>
<li> Parameter Manipulation
</li>
<li> <a href="http://blog.securitymonks.com/index.php/Session_Management#Weak_Session_Cryptographic_Algorithms" title="Session Management">Weak Session Cookies</a>
</li>
<li> Blind <a href="http://blog.securitymonks.com/index.php/SQL_injection" title="SQL injection">SQL Injection</a>
</li>
</ul>
</td>
<td valign="top">
<ul>
<li> Numeric SQL Injection
</li>
<li> String SQL Injection
</li>
<li> <a href="http://blog.securitymonks.com/index.php/Web_Services" title="Web Services">Web Services</a>
</li>
<li> <a href="http://blog.securitymonks.com/index.php/Improper_Error_Handling" title="Improper Error Handling">Fail Open Authentication</a>
</li>
<li> Dangers of HTML Comments
</li>
<li> &#8230; and many more!
</li>
</ul>
</td>
</tr>
</table>
<p>
The <a href="http://yehg.org/">YGN Ethical Hacker Group</a> has made available a series of video on walking through WebGoat v5.2.  The videos consist of:</p>
<table>
<tr>
<td>
<ul>
<li><a href="http://yehg.org/lab/pr0js/files.php/webgoat_simulation_general.zip">General</a> </li>
<li><a href="http://yehg.org/lab/pr0js/files.php/webgoat_simulation_codequality.zip">Code Quality</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/files.php/webgoat_simulation_concurrency.zip">Concurrency</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/files.php/webgoat_simulation_unvalidatedparams.zip">Unvalidated Parameters</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/training/webgoat.php#">Access Control Flaws</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/training/webgoat.php#">Authentication Flaws</a>  </li>
<li>Session Management Flaws  </li>
<li><a href="http://yehg.org/lab/pr0js/training/webgoat.php#">Cross-Site Scripting (XSS)</a>  </li>
</ul>
</td>
<td>
<ul>
<li><a href="http://yehg.org/lab/pr0js/training/webgoat.php#">Buffer Overflows</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/training/webgoat.php#">Injection Flaws</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/files.php/webgoat_simulation_impropererrorhandling.zip">Improper Error Handling</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/files.php/webgoat_simulation_insecurestorage_encoding_basics.zip">Insecure Storage</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/files.php/webgoat_simulation_dos.zip">Denial of Service (DOS)</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/files.php/webgoat_simulation_insecurecofig.zip">Insecure Configuration</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/training/webgoat.php#">Web Services</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/training/webgoat.php#">AJAX Security</a>  </li>
<li><a href="http://yehg.org/lab/pr0js/training/webgoat.php#">Challenge</a>  </li>
</ul>
</td>
</tr>
</table>
<p>Please recognize that WebGoat is a vulnerable server and therefor you will want to set it up so no one but you can access the WebGoat server.  By default WebGoat only listens on the loopback address.  Below are the steps to pull down WebGoat and install it on a Linux server.  Since this is not a production system, we will be installing the WebGoat developer release.
</p>
<p><h2>Installing JDK</h2>
<p>WebGoat will require Sun JDK 6 to be installed.  Get the Sun JDK 6 from <a href="http://java.sun.com/javase/downloads/index.jsp">Sun&#8217;s website</a>.  Sun requires you to agree to terms, so you&#8217;ll need to go there and agree.  Run the installer which gets downloaded.  Agree again to the terms.  The installer will install a few rpms and jars.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
root# /bin/sh jdk-6u11-linux-i586-rpm.bin
root# ls -la /usr/java
default  jdk1.5.0_17  jdk1.6.0_11  latest
root# declare -x JAVA_HOME="/usr/java/latest"
root# declare -x PATH="${JAVA_HOME}/bin:${PATH}
root# java -version
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Server VM (build 11.0-b16, mixed mode)
</pre>
</td>
</table>
<p></p>
<h2>Running WebGoat Standard Release</h2>
<p>While the documentation for WebGoat says to install Tomcat, the WebGoat zip file will come with its own version of Tomcat.  Running WebGoat in this manner can prove to be the easiest path allowing the avoidence of Java software version problems.  We will go through both deployments.  First, installing WebGoat with Tomcat.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# cd /usr/local/src
/usr/local/src root# wget \

http://webgoat.googlecode.com/files/WebGoat-OWASP_Standard-5.2.zip

/usr/local/src root# /usr/bin/openssl sha1 WebGoat-OWASP_Standard-5.2.zip
SHA1(WebGoat-OWASP_Standard-5.2.zip)=
1e8950d8af0a1726ee1c4509cb64ee4ee6da7584
/usr/local/src root# unzip WebGoat-OWASP_Standard-5.2.zip
/usr/local/src root# cd WebGoat-5.2
</pre>
</td>
</table>
<p>
At this point, a slight modification needs to be made to webgoat.sh.  It checks if the java version is 1.5.  This is an odd check, since WebGoat was compiled under 1.6 and will not run under 1.5.  Find where <strong>webgoat.sh</strong> has <strong>grep &#8216;version \&#8221;1.5&#8242;</strong> and change 1.5 to 1.6.  At that point, you are read to start WebGoat.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/usr/local/src/WebGoat-5.2 root# /bin/sh webgoat.sh start8080
Using CATALINA_BASE:   ./tomcat
Using CATALINA_HOME:   ./tomcat
Using CATALINA_TMPDIR: ./tomcat/temp
Using JAVA_HOME:       /usr/java/latest

  Open http://127.0.0.1:8080/WebGoat/attack
  Username: guest
  Password: guest
  Or try http://guest:guest@127.0.0.1:8080/WebGoat/attack
</pre>
</td>
</table>
<p>
This is running WebGoat accessible only to 127.0.0.1.  From your web browser, go to http://127.0.0.1:8080/WebGoat/attack and log in with username guest and password guest.  At this point, WebGoat is running and you are set to start going through the lesson plans and exercise.</p>
<h2>Installing WebGoat.war</h2>
<p>If you have Tomcat on your server, you will want to install only the WebGoat.war file.  I am going to make this a little more complicated by going through the steps to install Tomcat.  In previous posts, I have stepped through installation of Apache and ModSecurity.  Walking through the installation of Tomcat will help get us on the same page as far as configuration and installation.
</p>
<p>
There is a known issue with the latest stable release of Tomcat, 6.0.18.  It requires <strong>JDK 5</strong> at the moment, due to incompatibilities introduced by Sun JDK 6.  Sun changed the JDBC spec in an incompatible fashion that was discovered after Tomcat 6 went out.  There are changes in the trunk to replace the DB connection pooling mechanism with one that isn&#8217;t impacted by the 1.6 change.  Unfortunately, WebGoat required JDK 6.  To get a round this problem, we will use the subversion release of Tomcat.
</p>
<p>
We first need to install <strong>Apache Ant</strong>, which is a software tool for automating software build processes.  It is similar to make but is implemented using the Java language.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
root# cd  /usr/local/src/
/usr/local/src root# wget http://www.uniontransit.com/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz
/usr/local/src root# md5sum apache-ant-1.7.1-bin.tar.gz
cc5777c57c4e8269be5f3d1dc515301c  apache-ant-1.7.1-bin.tar.gz
/usr/local/src root# tar xzf apache-ant-1.7.1-bin.tar.gz
/usr/local/src root# mv apache-ant-1.7.1 /work/software
/usr/local/src root# cd  /work/software
/work/software root# ln -s apache-ant-1.7.1 ant
/work/software root# declare -x ANT_HOME="/work/software/ant"
/work/software root# declare -x PATH="${PATH}:${ANT_HOME}/bin"
/work/software root# ant
Buildfile: build.xml does not exist!
Build failed
</pre>
</td>
</table>
<p>
</p>
<p>
The error above indicate that ant command is recognized by shell but it did not find build.xml file that needed to compile ant projects. So, it’s absolutely normal and the installation was successful.
</p>
<p>
We are now ready to download and build <strong>Tomcat</strong>.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
root# cd  /usr/local/src/
/usr/local/src root# svn checkout \
http://svn.apache.org/repos/asf/tomcat/trunk tomcat-7
/usr/local/src root# cd tomcat-7
/usr/local/src/tomcat-7 root# ant download
/usr/local/src/tomcat-7 root# ant
/usr/local/src/tomcat-7 root# cd output
/usr/local/src/tomcat-7/output root# mv build \
/work/software/tomcat-7
/usr/local/src/tomcat-7 root# cd /work/software/
/work/software root# ln -s tomcat-7 tomcat
/work/software root# declare -x CATALINA_HOME="/work/software/tomcat"
/work/software root# chmod u+x $CATALINA_HOME/bin/*
/work/software root# mkdir $CATALINA_HOME/logs
</pre>
</td>
</table>
<p></p>
<h2>Configuring and Using Tomcat</h2>
<p>The following modifications can be done to configuration Tomcat files that came down as part of WebGoat or the latest version from the Tomcat site.  If you make the modifications to the Tomcat under Webgoat, keep in mind:</p>
<ol>
<li>Set $CATALINA_HOME appropriately</li>
<li>Modify webgoat.sh, removing the line &#8220;cp -f $CATALINA_HOME/conf/server_8080.xml $CATALINA_HOME/conf/server.xml&#8221;.</li>
<li>Adjust paths based on where WebGoat is installed.</li>
<li>Add to the $CATALINA_HOME/conf/tomcat-users.xml file.  Do not replace content.</li>
<li>You can use $CATALINA_HOME/bin/shutdown.sh to shutdown Tomcat.</li>
<li>You can start with $CATALINA_HOME/bin/startup.sh instead of webgoat.sh, provided you have $PATH, $JAVA_HOME, and $CATALINA_HOME set.
</li>
</ol>
<p>Before starting, create a manager username and password.  This is set in the $CATALINA_HOME/conf/tomcat-users.xml file.  The following is an example only:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/work/software root# vi $CATALINA_HOME/conf/tomcat-users.xml
&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;tomcat-users&gt;
  &lt;role rolename="tomcat"/&gt;
  &lt;role rolename="manager"/&gt;
  &lt;user username="jerry" password="mousepower" roles="tomcat"/&gt;
  &lt;user username="tom" password="catpower" roles="manager"/&gt;
&lt;/tomcat-users&gt;
</pre>
</td>
</table>
<p>
We can setup secure web authentication through the use of digital certificates using SSL.  First step is to use the <a href="http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html">keytool utility</a>, which is included in the Sun Java Standard Edition JDK, to create a keystore file.  Use &#8220;changeit&#8221; as the password. (If you don&#8217;t use &#8220;<strong>changeit</strong>&#8221; you will have to state the password in with the keystorePass setting in server.xml).  For example:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/work/software root# mkdir /work/software/tomcat/keystore
/work/software root# cd /work/software/tomcat/keystore
/work/software/tomcat/keystore root# keytool -genkey -alias tomcat \
-keyalg RSA -keysize 2048 -keystore /work/software/tomcat/keystore/keystore
Enter keystore password:  <strong>changeit</strong>
What is your first and last name?
  [Unknown]:  John Gerber
What is the name of your organizational unit?
  [Unknown]:  SecurityMonks
What is the name of your organization?
  [Unknown]:  OrderOfUnix
What is the name of your City or Locality?
  [Unknown]:  Knoxville
What is the name of your State or Province?
  [Unknown]:  TN
What is the two-letter country code for this unit?
  [Unknown]:  US
Is CN=John Gerber, OU=SecurityMonks, O=OrderOfUnix, L=Knoxville, ST=TN, C=US correct?
  [no]:  yes

Enter key password for <tomcat>
        (RETURN if same as keystore password):
/work/software/tomcat/keystore root# ls  /work/software/tomcat/keystore
/work/software/tomcat/keystore root# keytool -list -keystore keystore
</tomcat></pre>
</td>
</table>
<p>
The keystore created will not be trusted by JVM until the certificate is imported into JVM’s trusted certificate keystore.  We will export the SSL certificate we just generated and import it into the JVM&#8217;s keystore.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/work/software/tomcat/keystore root# keytool -export \
-alias tomcat -keystore keystore -file tomcat.cer
/work/software/tomcat/keystore root# keytool -import \
-trustcacerts -keystore /usr/java/jdk1.5.0_17/jre/lib/security/cacerts  \
-alias tomcat -file /work/software/tomcat/keystore/tomcat.cer
/work/software/tomcat/keystore root# keytool -list -alias tomcat \
-keystore /usr/java/jdk1.5.0_17/jre/lib/security/cacerts
</pre>
</td>
</table>
<p>
Modify the <strong>$CATALINA_HOME/conf/server.xml</strong> section which defines a SSL HTTP/1.1 Connector on port 8443. It should go with the other connectors in the Service section and looks something like this: </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
    &lt;Connector port="8443" minSpareThreads="5" maxSpareThreads="75"
           enableLookups="true" disableUploadTimeout="true"
           acceptCount="100"  maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystore="/work/software/tomcat/keystore/keystore"  keypass="changeit"
           clientAuth="false" sslProtocol="TLS" /&gt;
</pre>
</td>
</table>
<p>
In order to require SSL on a specific site configure a security constrant for that app.  Do this by editing the <strong>$CATALINA_HOME/conf/web.xml</strong> file and adding the following section just before the ending &lt;/web-app&gt; tag:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
    &lt;security-constraint&gt;
    &lt;web-resource-collection&gt;
    &lt;web-resource-name&gt;Automatic SSL Forwarding&lt;/web-resource-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;/web-resource-collection&gt;
    &lt;user-data-constraint&gt;
    &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt;
    &lt;/user-data-constraint&gt;
    &lt;/security-constraint&gt;
</pre>
</td>
</table>
<p>
Now startup Tomcat.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
/work/software root# $CATALINA_HOME/bin/startup.sh
Using CATALINA_BASE:   /work/software/tomcat
Using CATALINA_HOME:   /work/software/tomcat
Using CATALINA_TMPDIR: /work/software/tomcat/temp
Using JRE_HOME:       /usr/java/jdk1.5.0_17
/work/software root# ps awx | grep tomcat
  783 pts/14   Sl     0:04 /usr/java/jdk1.5.0_17/bin/java
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=/work/software/tomcat/conf/logging.properties
-Djava.endorsed.dirs=/work/software/tomcat/endorsed
-classpath :/work/software/tomcat/bin/bootstrap.jar
-Dcatalina.base=/work/software/tomcat
-Dcatalina.home=/work/software/tomcat
-Djava.io.tmpdir=/work/software/tomcat/temp org.apache.catalina.startup.Bootstrap start
/work/software root# /usr/sbin/lsof -iTCP -n -P | grep java
java      6175   root   10u  IPv6 327556       TCP *:8080 (LISTEN)
java      6175   root   12u  IPv6 327557       TCP *:8443 (LISTEN)
java      6175   root   21u  IPv6 327562       TCP *:8009 (LISTEN)
java      6175   root   22u  IPv6 327565       TCP 127.0.0.1:8005 (LISTEN)
</pre>
</td>
</table>
<p>
Tomcat is now built and running.  You can access it by going to:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">

http://localhost:8080
</pre>
</td>
</table>
<p>
which will redirect you to:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">

https://localhost:8443
</pre>
</td>
</table>
<p>
When you goto https://localhost:8443 you will be asked to accept the certificate.  If you have problems, make sure to clear you browser&#8217;s cache.  Now that we have Tomcat server running, we are ready to download and setup our WebGoat server.  </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# $CATALINA_HOME/bin/shutdown.sh
 root# cd /usr/local/src
/usr/local/src root# wget http://webgoat.googlecode.com/files/WebGoat-5.2.war
/usr/local/src root# /usr/bin/openssl sha1 WebGoat-5.2.war
SHA1(WebGoat-5.2.war)= c5aab7c5496625777a3b9e21b9888cddee5b649c
/usr/local/src root# mv WebGoat-5.2.war /work/software/tomcat/webapps/WebGoat.war
/usr/local/src root# $CATALINA_HOME/bin/startup.sh
/usr/local/src root# ls -la /work/software/tomcat/webapps/WebGoat
/usr/local/src root# ls -la /work/software/tomcat/conf/tomcat-users.xml
</pre>
</td>
</table>
<p>
Add WebGoat users and roles to <strong>$CATALINA_HOME/conf/tomcat-users.xml</strong> file.  Start Tomcat back up.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
 root# $CATALINA_HOME/bin/shutdown.sh
 root# vi $CATALINA_HOME/conf/tomcat-users.xml
    &lt;tomcat-users&gt;
      &lt;role rolename=&quot;webgoat_basic&quot;/&gt;
      &lt;role rolename=&quot;webgoat_admin&quot;/&gt;
      &lt;role rolename=&quot;webgoat_user&quot;/&gt;
      &lt;role rolename=&quot;tomcat&quot;/&gt;
      &lt;user password=&quot;webgoat&quot; roles=&quot;webgoat_admin&quot; username=&quot;webgoat&quot;/&gt;
      &lt;user password=&quot;basic&quot; roles=&quot;webgoat_user,webgoat_basic&quot; username=&quot;basic&quot;/&gt;
      &lt;user password=&quot;tomcat&quot; roles=&quot;tomcat&quot; username=&quot;tomcat&quot;/&gt;
      &lt;user password=&quot;guest&quot; roles=&quot;webgoat_user&quot; username=&quot;guest&quot;/&gt;
    &lt;/tomcat-users&gt;
 root# $CATALINA_HOME/bin/startup.sh
</pre>
</td>
</table>
<p>
At this point, WebGoat should be running.  Pretend you are an 18-year hacker, and use your penetration skills to break into one of the accounts.  Check out the Access Control Flaws material and the Remote Admin Access section.  Being aware of what is possible, and that the threats are real, helps motivate a person to defend against them.
</p>
<p>
Now it is time to examine the work of OWASP Summer of Code project wiki, <a href="http://www.owasp.org/index.php/OWASP_Securing_WebGoat_using_ModSecurity_Project">Securing WebGoat using ModSecurity</a>.  With a vulnerable server to test out the vulnerabilities against, we will move on to the required software that will help defend against brute force password attacks.  First step, install Lua to use with ModSecurity.</p>
<h2>Lua</h2>
<p>The <a href="http://www.lua.org/">Lua</a> language combines &#8220;simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.&#8221;
</p>
<p>
For a complete discussion of the benefits of Lua, Soumya has written an article &#8220;<a href="http://blog.taragana.com/index.php/archive/10-reasons-why-you-should-make-lua-a-new-programming-language-your-coding-friend-a-detailed-review/">10 Reasons Why You Should Make Lua (A New Programming Language) Your Coding Friend &#8211; A Detailed Review</a>.&#8221;  Erik Wrenholt has also done an <a href="http://www.timestretch.com/FractalBenchmark.html">interesting benchmark</a> again popular languages to compute the Mandelbrot.  We are focusing on Lua is because it can be used with ModSecurity.  Plus, we want to take advantage of the work done by Stephen Craig Evans and others who worked on securing web applications.
</p>
<p>
To install Lua on a linux server by source:
</p>
<p><table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
root# cd  /usr/local/src/
/usr/local/src root# wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
/usr/local/src root# md5sum lua-5.1.4.tar.gz
d0870f2de55d59c1c8419f36e8fac150  lua-5.1.4.tar.gz
/usr/local/src root#tar xzf  lua-5.1.4.tar.gz
/usr/local/src root# cd lua-5.1.4
/usr/local/src/lua-5.1.4 root# make linux
/usr/local/src/lua-5.1.4 root# make install
/usr/local/src/lua-5.1.4 root# cd /usr/local/lib
/usr/local/lib root# gcc -shared -o liblua.5.1.4.so /usr/local/lib/liblua.a
/usr/local/lib root# ln -s liblua.5.1.4.so liblua.so
</pre>
</td>
</table>
<p>
</p>
<p><h2>ModSecurity</h2>
<p>If you are running a version of ModSecurity older than version 2.5, you will need to upgrade.  As of ModSecurity 2.5, Lua can be used:<br />
<blockquote>The new SecRuleScript directive allows for the execution of Lua scripts which provide an even more flexible and powerful interface into ModSecurity. When is Lua needed? ModSecurity chained rules can easily implement AND logic to create complex rules that evaluate that specific variables are present and have certain data, however they can not easily create proper OR logic. This is where Lua can help.</p></blockquote>
<p>A previous blog post, &#8220;<a href="http://blog.securitymonks.com/2008/07/31/implementing-a-web-application-firewall-with-modsecurity/">Implementing a Web Application Firewall with ModSecurity</a>,&#8221; goes through the step of installing ModSecurity with an Apache Web Server.  Following that post, your Apache httpd.conf configuration files should load the mod_security2.so module and include the modsecurity.conf file.  It is the <strong>modsecurity.conf</strong> file where the additional rules will be added.</p>
<h2>Problem with Usernames and Passwords</h2>
<p>WebGoat demonstrates a few security issues that need to be addressed.  From OWASP&#8217;s &#8220;<a href="http://www.owasp.org/index.php/OWASP_ModSecurity_Securing_WebGoat_Section4_Sublesson_04.2">OWASP ModSecurity Securing WebGoat Section4 Sublesson 04.2</a>&#8221; Forgot Password section, the following points are made:</p>
<ul>
<li>Attackers who are attempting to enumerate valid usernames. If you submit an invalid one the html response text includes info stating as such. We can track this.</li>
<li>Once a specific valid username is identified, the attacker then starts a targeted attack to guess answers to the password hint (favorite color).</li>
<li>Attackers can initiate reverse brute force attacks – this is when an attacker cycles through different valid user accounts and submits the same common answer to the question (submitting Blue as the answer to different usernames).</li>
</ul>
<p>The OWASP ModSecurity Securing WebGoat document does such a good job outlining the security issues along with possible solutions, I am going to leave it to the reader to decide what solutions are appropriate for their systems.  If I continued stepping through to a more secure implementation, I would end up copying everything in the document.  Playing around with the rules, testing the results, is great fun in a geeky security kind of way.  Do drop down and read the reviewer&#8217;s comments.  A very good job by Stephen Craig Evans and all who worked on OWASP Summer of Code project.  Of course, a special thank to Ivan Ristic, who gave us ModSecurity.
</p>
<p>
Recently, I listened to a<a href="http://itc.conversationsnetwork.org/shows/detail3776.html"> IT Conversation podcast</a>, from the O&#8217;Reilly Media Emerging Technology Conference.  Tim O&#8217;Reilly spoke about hackers.  Not the black hatters, but those folks who work tirelessly to bring about the kind of software and services that make the Internet possible.  While the Internet may be at times a dangerous place, thanks to the efforts of these hackers who work out of love for the challenge, often with little regard to financial factors, we have these great tools that go a long way towards helping people secure their applications.
</p>
<h2>Final Thoughts</h2>
<p><a href="http://despair.com/mis24x30prin.html"><img src="http://images.despair.com/products/demotivators/mistakes.jpg" alt="" width=300 align="right" /></a>In today&#8217;s post we examined a security breach that occurred involving a major player in the Internet community.  To help understand that problem, and others, we setup WebGoat.  Sun Tzu wrote in <a href="http://en.wikipedia.org/wiki/The_Art_of_War">The Art of War</a>, &#8220;So it is said that if you know your enemies and know yourself, you will fight without danger in battles.  If you only know yourself, but not your opponent, you may win or may lose.  If you know neither yourself nor your enemy, you will always endanger yourself.&#8221;  WebGoat helps us understand the attack vectors against web applications a little better.  Once identifying a possible problems, we walked through a solution that can help reduce the risk.</p>
<p>
It is easy to find humor in an employee with administrative access using the password &#8220;happiness.&#8221;  The reaction from the Internet community to Twitter&#8217;s problems might be a little schadenfreude at play.  <a href="http://plato.stanford.edu/entries/adorno/">Theodor Adorno</a>, philosopher and sociologist, defined <strong>schadenfreude</strong> as largely unanticipated delight in the suffering of another which is cognized as trivial and/or appropriate.  Or, maybe it is more like <a href="http://www.phrases.org.uk/bulletin_board/32/messages/352.html">whistling past the graveyard</a>, where folks are a bit cheerful or joyful in the face of a situation that doesn&#8217;t warrant it.
</p>
<p>
When very public security incidents occur, companies need to take a little stock.  Not all employees will take training seriously nor follow all policies.  That includes people with important roles.  Employees make mistakes and it is difficult to guard against every possible mistake that could occur.  That is why a layered approach to security is constantly preached.  While each layer cost money, security groups at organizations are in a constant battle to monitor and prevent intrusions in a cost effective way.  Fortunately, we have the work of many hackers (the good kind), helping us develop solutions to deal with daily new challenges.  There are no guarantees.  As Albert Einstein once said, &#8220;Anyone who has never made a mistake has never tried anything new.&#8221;  Wisdom comes when we learn from these mistakes.  CIOs need to ask themselves, &#8220;how safe is my company from being next week&#8217;s security headline?&#8221;  Security groups within an organization must be able to learn and adapt.  At the end of the day, the question is how different is your company from Twitter?  Insanity is doing the same thing and expecting different results.  I&#8217;ll close this post with the wise words of <a href="http://en.wikipedia.org/wiki/Sam_Levenson">Sam Levenson</a>, “You must learn from the mistakes of others. You can’t possibly live long enough to make them all yourself.”</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2009/01/10/webgoat-lua-and-modsecurity-verses-password-guessing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Scanner for Debian OpenSSL Vulnerability</title>
		<link>http://blog.securitymonks.com/2008/05/22/scanner-for-debian-openssl-vulnerability/</link>
		<comments>http://blog.securitymonks.com/2008/05/22/scanner-for-debian-openssl-vulnerability/#comments</comments>
		<pubDate>Thu, 22 May 2008 23:31:46 +0000</pubDate>
		<dc:creator>John Gerber</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Vulnerability]]></category>

		<guid isPermaLink="false">http://blog.securitymonks.com/2008/05/22/scanner-for-debian-openssl-vulnerability/</guid>
		<description><![CDATA[By now, you likely have heard about the Debian OpenSSL Vulnerability, found by Luciano Bello.  It was originally announced on May 13th.  What occurred is that code was removed because it caused the Valgrind and Purify tools to produce warnings about the use of uninitialized data in code that was linked to OpenSSL. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://images.eztools.com/?c=todas&#038;q=hackers"><img src="/images/hackers.jpg" alt="Vulnerability" width=150 align="left" /></a>By now, you likely have heard about the <a href="http://nvd.nist.gov/nvd.cfm?cvename=CVE-2008-0166">Debian OpenSSL Vulnerability</a>, found by Luciano Bello.  It was originally announced on May 13th.  What occurred is that code was removed because it caused the <a href="http://valgrind.org">Valgrind</a> and Purify tools to <a href="http://rt.openssl.org/Ticket/Display.html?id=521&#038;user=guest&#038;pass=guest">produce warnings</a> about the use of uninitialized data in code that was linked to OpenSSL.  This change caused only the current process ID to be used for the initial seed, crippling the seeding process for the OpenSSL <a href="http://statmath.wu-wien.ac.at/prng/">PRNG</a>.  To quote the <a href="http://nvd.nist.gov">National Vulnerability Database (NVD)</a>:<br />
<blockquote>OpenSSL 0.9.8c-1 up to 0.9.8g-9 on Debian-based operating systems uses a random number generator that generates predictable numbers, which makes it easier for remote attackers to conduct brute force guessing attacks against cryptographic keys.</p></blockquote>
<p>
Hubert Seiwert, Internet Security Specialist at Westpoint Ltd., released <a href="http://itsecurity.net/">debian_ssh_scan.py</a> on May 16th.  The code does remote check for weak Debian sshd host keys as identified in <a href="http://www.debian.org/security/2008/dsa-1571">CVE-2008-0166</a>.  The fingerprints are taken from keys generated by HD Moore&#8217;s <a href="http://metasploit.com/users/hdm/tools/debian-openssl/">common and uncommon keys</a>.  Mr. Seiwert also used Justin Azoff&#8217;s multi-threading code.  While it is not the only scanner, Mr. Seiwert did a very nice job.
</p>
<p>
For those who might be less familiar with <a href="http://www.python.org">Python</a>, I thought I would walk through getting debian_ssh_scan.py installed.  Most distributions of Linux and Unix have Python installed and with a few additional steps you will be ready to scan your hosts for vulnerabilities.</p>
<h3>Set HTTP_PROXY</h3>
<p>If you need to access the Internet through a proxy server, the HTTP_PROXY environment variables should be set.  This will allow <a href="http://www.gnu.org/software/wget/">wget</a>, Python’s <a href="http://www.python.org/doc/1.5.2p2/lib/module-urllib.html">urllib module</a>, and other applications (yum, apt-get etc) to use this environment variable to access http/https through the proxy server. </p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# export HTTP_PROXY="http://&lt;proxy-server-ip>:&lt;port>"
</pre>
</td>
</table>
<p>Replace &#8220;&lt;<em>proxy-server-ip</em>>&#8221; with your proxy server name/ip and &#8220;&lt;<em>port</em>>&#8221; with the proxy&#8217;s port.</p>
<h3>Install setuptools</h3>
<p>The <a href="http://pypi.python.org/pypi/setuptools">setuptools</a> module is a way to allow developers an easy way to build and distribute Python packages in a single-file archive called an &#8220;<a href="http://peak.telecommunity.com/DevCenter/PythonEggs">egg</a>.&#8221;   The steps to get setuptools installed are:</p>
<ol>
<li>Download the appropriate egg for your version of Python (e.g. setuptools-0.6c8-py2.3.egg). Do NOT rename it.</li>
<li>Run it. Setuptools will install itself using the matching version of Python (e.g. python2.3), and will place the easy_install executable in the default location for installing Python scripts (as determined by the standard distutils configuration files, or by the Python installation).</li>
</ol>
<p>To install:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# cd /home/ger/software
# wget http://pypi.python.org/packages/2.3/s/setuptools/setuptools-0.6c8-py2.3.egg
# sh setuptools-0.6c8-py2.3.egg
</pre>
</td>
</table>
<h3>Install paramiko</h3>
<p>The python module <a href="http://www.lag.net/paramiko/">paramiko</a> implements SSH2 protocol for secure (encrypted and authenticated) connections to remote machines.  Below, the <strong>easy_install</strong> executable is used.  The Python module easy_install is bundled with <strong>setuptools</strong> and allows for automatically download, build, install, and management of Python packages.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# cd /home/ger/software
# wget http://www.lag.net/paramiko/download/paramiko-1.7.3.tar.gz
# tar xzf paramiko-1.7.3.tar.gz
# cd paramiko-1.7.3
# easy_install ./
</pre>
</td>
</table>
<h3>Pull Down debian_ssh_scan_v4</h3>
<p>The python script debian_ssh_scan_v4 can now be installed.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# cd /home/ger/software
# wget http://itsecurity.net/debian_ssh_scan_v4.tar.bz2
# bzip2 -cd debian_ssh_scan_v4.tar.bz2 | tar xvf -
 # cd debian_ssh_scan_v4
</pre>
</td>
</table>
<h3>Start Scanning</h3>
<p>You are now ready to start scanning.  The below IP is used only for demonstration purposes.  Use your own site&#8217;s IPs.</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
#  ./debian_ssh_scan_v4.py 127.0.0.1:22
201691 fingerprints loaded.
127.0.0.1:22 sshd fingerprint 97382c98fe3d45fa779abd34bb65fb73 VULNERABLE (RSA 2048 bit key, pid 5214)
</pre>
</td>
</table>
<p>Modify  <strong>targets.txt</strong>, if you want to create a file of IPs.  Run the file of IPs through the scan program using the command:</p>
<table width="100%" cellpadding="0" cellspacing="1" border="1">
<td class="code-outline" BGCOLOR="#F5F5F5">
<pre class="displaycode">
# cat targets.txt | ./debian_ssh_scan_v4.py
</pre>
</td>
</table>
<h3>Final Words</h3>
<p>Debian has issued an update for OpenSSL. For affected systems, the software packages need to be updated and all cryptographic key material must be recreated.  Please see <a href="http://http://www.securityfocus.com/bid/29179/references">Security Focus references</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.securitymonks.com/2008/05/22/scanner-for-debian-openssl-vulnerability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

