#!/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 '
'; print REPORT '| Name | Published | Modified | Severity | Description | References |
| ' . $e->{name} . ' | '; print REPORT '' . $e->{published} . ' | '; print REPORT '' . $e->{modified} . ' | '; print REPORT '' . $e->{severity} . ' | '; print REPORT '' . $e->{desc}->{descript}->{content} . ' | '; foreach $ref ( @{ $e->{refs}->{ref} } ) { print REPORT ''; print REPORT $ref->{source} . ' '; } } } print REPORT ' |
'; print REPORT '';