This should be simple, but being a newbie the syntax escapes me...
I have two files, the first, "vuln_cvd_map" is just a csv file that contains an integer id number, then a CVE id number.
The second is just another two column csv file that contains a CVE Id number and a summary description of the vulnerability.
The input is the integer id number which I find in the first file, return the CVE id, and look that up in the second file, finally return the summary description.
As always, thanks for your patience...
Scott
#!/usr/bin/perl -w
use Getopt::Std;
open(MAP, "./vuln_cve_map.csv") or die("cant open mapping file</body><
+/html>");
open(SUMMARY, "./CVE_summary.csv") or die("cant open CVE Summary file<
+/body></html>");
if ($#ARGV == 0) {
my @desc = ();
my $desc = [];
my $summ = [];
while (<MAP>) {
/^(\d+),(.*)/;
if ($1 == $ARGV[0]) {
foreach (<SUMMARY>){
if ($_=~ m/"$2"/) {
my @vuln= split(/,/, $desc);
print $vuln[1];
}
}
};
};
}
close (SUMMARY);
close (MAP);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.