New vulnerabities list
This commit is contained in:
parent
3d0796b92d
commit
2ae6cbb52f
2 changed files with 720 additions and 66 deletions
|
@ -40,17 +40,18 @@ $mech->add_handler("response_redirect" => sub { print '#'x80,"\nREDIRECT RESPONS
|
||||||
my $url = 'http://cve.mitre.org/data/downloads/allitems.csv';
|
my $url = 'http://cve.mitre.org/data/downloads/allitems.csv';
|
||||||
my $resp;
|
my $resp;
|
||||||
|
|
||||||
unlink ('cve.csv') if (-f 'cve.csv');
|
unless (-f 'cve.csv') {
|
||||||
|
$resp=$mech->get($url);
|
||||||
|
$mech->save_content( "cve.csv" );
|
||||||
|
}
|
||||||
|
my $f=File::Util->new( readlimit => 152428800);
|
||||||
|
File::Util->flock_rules( qw/ IGNORE/ );
|
||||||
|
|
||||||
$resp=$mech->get($url);
|
|
||||||
$mech->save_content( "cve.csv" );
|
|
||||||
|
|
||||||
my $f=File::Util->new('readlimit' => 100000000, 'use_flock'=>'false');
|
|
||||||
my(@lines) = $f->load_file('cve.csv', '--as-lines');
|
|
||||||
my @versions;
|
my @versions;
|
||||||
my $temp;
|
my $temp;
|
||||||
unlink '../vulnerabilities.csv' if -f '../vulnerabilities.csv';
|
unlink '../vulnerabilities.csv' if -f '../vulnerabilities.csv';
|
||||||
foreach my $line (@lines) {
|
open(CVE, 'cve.csv') or die("Could not open file.");
|
||||||
|
foreach my $line (<CVE>) {
|
||||||
if ($line =~ /(mysql|mariadb)/i
|
if ($line =~ /(mysql|mariadb)/i
|
||||||
and $line =~ /server/i
|
and $line =~ /server/i
|
||||||
and $line =~ /CANDIDATE/i
|
and $line =~ /CANDIDATE/i
|
||||||
|
@ -72,7 +73,7 @@ foreach my $line (@lines) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close(CVE);
|
||||||
unlink ('cve.csv') if (-f 'cve.csv');
|
#unlink ('cve.csv') if (-f 'cve.csv');
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue