发信人: soff (庄脚囝仔...无卡输), 信区: PHP
标 题: [code]NOD32 病毒库镜像脚本 NOD32.php
发信站: 水木社区 (Mon Apr 3 01:42:41 2006), 站内
PHP代码
- <?
- // author: soff
- $LOCALDIR = 'c:\\www';
- $UPDATEDIR = 'c:\\www\\nod_upd';
- $WGET = 'c:\\cygwin\\bin\\wget.exe';
- $UNRAR = '"c:\Program Files\WinRAR\UnRAR.exe"';
- $UPDATE_SERVER = 'http://u3.eset.com/';
- $USER = 'AV-2631376';
- $PASS = '8yoi8b38ax';
- $ignore = array('cz.nup', 'fr.nup', 'ge.nup', 'it.nup', 'jp.nup', 'pl.nup
- ', 'pt.nup', 'sk.nup', 'sp.nup', 'hr.nup', 'hu.nup', 'nl.nup');
- if (!is_dir($LOCALDIR))
- mkdir($LOCALDIR);
- if (!is_dir($UPDATEDIR))
- mkdir($UPDATEDIR);
- exec("$WGET -t 9 -T 9 -N -nH -nd -P $UPDATEDIR {$UPDATE_SERVER}nod_upd/update
- .ver", $output, $ret);
- if ($ret > 0) {
- echo 'Failed while downloading update.ver.';
- exit;
- }
- exec("$UNRAR x -o+ {$UPDATEDIR}\update.ver", $output, $ret);
- if ($ret > 0) {
- echo 'Failed while extracting update.ver.';
- exit;
- }
- $content = file_get_contents('update.ver');
- preg_match_all("/file=(.+?)\n/ie", $content, $matches);
- $list = '';
- foreach($matches[1] as $match) {
- $match = trim($match);
- $last = substr($match, -6);
- if (!in_array($last, $ignore))
- $list .= "{$UPDATE_SERVER}$match\r\n";
- }
- file_put_contents('list.txt', $list);
- exec("$WGET --http-user=$USER --http-passwd=$PASS -t 9 -T 9 -m -nH -P $LOCALDIR
- -i list.txt", $output, $ret);
- if ($ret > 0) {
- echo 'Failed while downloading files.';
- exit;
- }
- echo 'Updated successfully.';
- ?>








