| Category: | MISC |
| Author/Contact Info | David Kyger |
| Description: | This script is used to pull the latest high severity CVE entries published by NIST. The end result is a populated html table that can be used for reporting or other purposes. Hopefully someone will find it useful. Comments and suggestions for improvement (code, presentation or otherwise) are very welcome. cheers. |
#!/usr/bin/perl
#
# NIST NVD Feed Parser
# David Kyger 7-6-07
# License - GNU GPL
use XML::Simple qw(:strict);
use Data::Dumper;
use POSIX qw(strftime);
my $report = "report.html";
open(REPORT,">$report");
my $url = 'http://nvd.nist.gov/download/nvdcve-recent.xml';
`/usr/local/bin/wget -q $url`;
my $file = "nvdcve-recent.xml";
my $today = strftime( "%Y-%m-%d", localtime );
my $yesterday = strftime( "%Y-%m-%d", localtime(time-86400));
$xml = new XML::Simple;
$data = $xml->XMLin(
"nvdcve-recent.xml",
KeyAttr => { cve => 'entry' },
ForceArray => [ 'cve', 'ref' ]
);
my $e;
print REPORT '<html><body>';
print REPORT
'<table style="text-align: left;" border="1" cellpadding="2" cellspaci
+ng="2"><tbody>';
print REPORT
'<tr><td><b>Name</b></td><td><b>Published</b></td><td><b>Modified</b><
+/td><td><b>Severity</b></td><td><b>Description</b></td><td><b>Referen
+ces</b></td></tr>'
;
foreach $e ( @{ $data->{entry} } ) {
if ( $e->{severity} =~ /High/ && $e->{modified} =~ /($today|$yeste
+rday)/ ) {
;
print REPORT '<tr><td>' . $e->{name} . '</td>';
print REPORT '<td>' . $e->{published} . '</td>';
print REPORT '<td>' . $e->{modified} . '</td>';
print REPORT '<td>' . $e->{severity} . '</td>';
print REPORT '<td>'
. $e->{desc}->{descript}->{content}
. '</td><td><br>';
foreach $ref ( @{ $e->{refs}->{ref} } ) {
print REPORT '<a href="' . $ref->{url} . '" target="_blank
+">';
print REPORT $ref->{source} . '</a><br>';
}
}
}
print REPORT '</td></tr>';
print REPORT '</table><p>';
print REPORT '</html></body>';
|
|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: NIST NVD Feed Parser
by cjcollier (Novice) on Dec 08, 2015 at 23:07 UTC | |
|
Re: NIST NVD Feed Parser
by Anonymous Monk on Jul 07, 2007 at 11:47 UTC | |
|
Re: NIST NVD Feed Parser
by attiamx (Initiate) on Jul 09, 2014 at 06:52 UTC |