Add WIP script for getting CVE numbers for Solus Thunderbird changelogs
This commit is contained in:
parent
0290749cee
commit
005a042263
1 changed files with 41 additions and 0 deletions
41
solus_utility/get_thunderbird_cve_nums.pl
Normal file
41
solus_utility/get_thunderbird_cve_nums.pl
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
use Modern::Perl;
|
||||||
|
|
||||||
|
use FindBin;
|
||||||
|
use lib "$FindBin::RealBin/lib";
|
||||||
|
|
||||||
|
use Getopt::Long;
|
||||||
|
use Pod::Usage;
|
||||||
|
use WWW::Mechanize;
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
|
my $successful_parse = GetOptions(
|
||||||
|
'help|?' => \ my $help,
|
||||||
|
man => \ my $man,
|
||||||
|
'url=s' => \ my $url
|
||||||
|
)
|
||||||
|
or pod2usage(2);
|
||||||
|
|
||||||
|
if ( !$successful_parse || ( @ARGV > 1 ) ) {
|
||||||
|
die qq{Usage: $0 [ --url]\n};
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !defined $url ) {
|
||||||
|
die qq{Usage: $0 [ --url]\n};
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get url from input param
|
||||||
|
# https://www.mozilla.org/en-US/security/advisories/mfsa2024-07/
|
||||||
|
|
||||||
|
my $mechanize = WWW::Mechanize->new(autocheck => 1);
|
||||||
|
$mechanize->get($url);
|
||||||
|
my $page = $mechanize->content;
|
||||||
|
|
||||||
|
# Get text from each level-heading class
|
||||||
|
# ex
|
||||||
|
# <h4 id="CVE-2024-1546" class="level-heading">
|
||||||
|
# And then Metacpan had a 502 so I couldn't find docs on how to get this X|
|
||||||
|
|
||||||
|
|
||||||
|
# Get CVEs in form of CVE-2024-1546
|
||||||
Loading…
Add table
Add a link
Reference in a new issue