perl筛选wvs批量扫描结果
之前用wvs_console进行批量扫描生成了大量html报告,下面写了一个perl脚本来帅选出有高危漏洞的站点。[*] #!/usr/bin/perl -w
[*]
[*]use strict;
[*]use warnings;
[*]use Cwd;
[*]use File::Copy;
[*]
[*]my $dir = getcwd();
[*]my $dstdir = "/lab/report/xss/";
[*]my $count = 0;
[*]opendir(D,$dir) or die "Cannot open dir: $!";
[*]my @lists = readdir(D);
[*]foreach my $list(@lists){
[*] count($list);
[*]}
[*]closedir(D);
[*]
[*]sub count
[*]{
[*]my($file, $site, $content) = @_;
[*]if ($file =~ /.*@\d+-\d+-\d+_(.*)\.html/) {
[*] $site = $1;
[*] }
[*]open(F, $file) or die "Cannot open report file: $!";
[*]while () {
[*] chomp;
[*] $content = $_;
[*] if ($content =~ /.*High(\d+)/) {
[*] if ($1 > 0) {
[*] # print $file."\n".$dstdir.$file."\n";
[*] copy($dir."/".$file, $dstdir.$file) or die "Copy failed: $!";
[*] print $site ." Found ". $1." alert(s)\n";
[*] last;
[*] }
[*] }
[*]}
[*]close(F);
[*]}
页:
[1]