有段時間需要採集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
else
unshift(@inc, $path);
}elsif ($^o eq 'linux')
else
unshift(@inc, $path);
}else
}my $dbh;
my $total = 0; #總處理樣本數量
my $vt_has_total = 0; #vt上面有資料的數量
sub usage
sub replace
sub print_erro
sub get_htmlpage_from_vt
';my $lines = join '', ;
my $vt_time ="";
if($lines =~m/$pattern1/)elsif(($count % 2) == 1)else
}$count++;
}$sql = $sql." where md5='$md5'";
my $ret = my_update($dbh,$sql);
if($ret == 0)
$vt_has_total++;
}} if($tag == 1)else
close(hlog);
system("del $id.txt");
}else
}sub pic_samples
}else
}sub clean_no_finished
sub main
else
}usage() if ($id eq '');
$dbh = connect_db();
clean_no_finished($id);
while(1)
$dbh->disconnect();
printf "processed:%-50s \n",$total;
printf "in virus total:%-50s \n",$vt_has_total;
}&main;
**中有些資料庫的操作,資料庫的**就不給出了,相當簡單。
Python爬蟲分享
一 python簡介 二 python爬蟲 三 python爬蟲例項 四 問答互動 python語言排行 github爬蟲排行 python為什麼這麼火?1989年,guido van rossum創立了python語言。現在,他在google工作。物件導向的高層語言 解釋性 強大的第三方庫 爬蟲,...
Virustotal 上傳樣本儲存掃瞄結果
使用場景 有惡意檔案的sha256,需要上傳到virustotal檢視掃瞄結果 語言 python 準備 sha256值的檔案psha.txt virustotal的api key 申請乙個賬戶,賬戶裡面有 my api key 注意 virustotol.com的訪問需要翻牆,我的chrome瀏覽...
分享爬蟲的簡單知識。附帶爬蟲案例。
用python寫乙個的爬蟲。對於python這個指令碼語言來說寫爬蟲不是一件很難的事情。在寫爬蟲之前我們先了解一些簡單的爬蟲知識。爬蟲分類 2.聚焦網路爬蟲 3.增量式網路爬蟲 4.深層頁面爬蟲 簡單爬蟲架構 1.url管理器 universal resource location 3.網頁解析器 ...