有段时间需要采集Virus total的数据作安全厂商扫描器的评估,想着通过wget写了一个简单的perl的爬虫,来抓取Virustotal的数据。代码如下,如果对你有用,直接拿下。
#!/usr/bin/perl -w
# author : linux_feixue
# create time : 2012.9
use strict;
use warnings;
use myconfig;
use mydatabase;
BEGIN
{
my $path;
if ($^O eq 'MSWin32')
{
if ($0=~m/^(.+)\\/) { $path = $1; } else { $path = readpipe('cd'); chomp($path); }
unshift(@INC, $path);
}elsif ($^O eq 'linux')
{
if ($0=~m/^(.+)\//) { $path = $1; } else { $path = readpipe('pwd'); chomp($path); }
unshift(@INC, $path);
}else
{
die("Unkown system: $^O\n");
}
}
my $dbh;
my $total = 0; #总处理样本数量
my $vt_has_total = 0; #Vt上面有数据的数量
sub usage
{
print "Usage:\n";
print "\t--id=[specify the id of task]\n";