ESET mirror update 2.0

PHP skripty
User avatar
Ashus
Administrátor
Posts: 417
Joined: 07. 07. 2007 10:51
Location: Ostrava - Polanka nad Odrou
Contact:

ESET mirror update 2.0

Postby Ashus » 19. 03. 2010 17:07

This is a tool to create and keep your own ESET mirror update server up to date. You can use a valid purchased key and password or use a function to retrieve credentials automatically. This is an original work completely written by me.

Requirements:
PHP 5.4+/7, mod_curl, php_rar v2+ or unrar-free.

Installation:
  • Download and install php pecl module rar v2 or higher -or- linux executable unrar-free (Debian package name is unrar-free; it should be compatible with other distributions as well though).
  • Download the source, adjust the config, use chmod +x esetupdate.php getFreshCredentials.php and test the script.
  • Configure the webserver to access the mirror update directory at certain path, .htpasswd can be set up to protect the mirror.
  • Add the script execution hourly to crontab (ex. 15 * * * * root /root/scripts/esetupdate.php >> /var/log/esetupdate.log &).
  • Configure ESET update server on client computers to use local mirror.
Features include:
  • downloading update mirrors for ESET versions 3/4/5 or 9
  • cleaning old and unreferenced update files
  • extra function to retrieve fresh update credentials if you do not set your own or current don't work anymore
  • extensive info in logfile, counting download sizes
  • better security while using mod_rar and having exec function blocked
  • improved detection of incompletely downloaded files
  • forcing full check on next run if some files look suspicious (ensures quality, updating from server works fine on unstable connections)
  • automatic selecting of eset servers, 3 tries further harden stability
  • can be set up on Linux or even Windows (with some effort)

Current version is ready for download from here: https://github.com/Ashus/eset-mirror-update

Bash version is also available (but contains less features and isn't kept up to date).
Image
Coffee phreak!
Azadi

Re: NOD32 linux mirror update 1.0

Postby Azadi » 30. 03. 2010 16:20

first of all, great work :)

but it seems that ESET changed recently something in the update procedure, from March 26 on, the clients don't accept any updates any more from your script (both bash and php). Ok, they changed the URLs of the servers (e.g. from u18.eset.com to um18.eset.com) but obviously not only that...
User avatar
Ashus
Administrátor
Posts: 417
Joined: 07. 07. 2007 10:51
Location: Ostrava - Polanka nad Odrou
Contact:

Re: NOD32 linux mirror update 1.1

Postby Ashus » 01. 04. 2010 23:43

I'm using the PHP script successfully without any changes for the last half of a year. Apart from the URLs only thing they could have changed is checking for user agent or other HTTP headers / behaviour. It is always nicely debuggable with tcpdump/wireshark.

Edit: Okay I looked at the packets, try downloading the new version.
Image
Coffee phreak!
Crown

Re: NOD32 linux mirror update 1.1

Postby Crown » 14. 04. 2010 19:05

Hi there,
Huge Thank you for your work and support

Strange, but i'm having a little problem with your script...
Fatal error: Call to undefined function curl_init() in /home/crown/Desktop/eset3/nodupdate.php on line 95 ??? what a hell is this >? :)
Please advice...
User avatar
Ashus
Administrátor
Posts: 417
Joined: 07. 07. 2007 10:51
Location: Ostrava - Polanka nad Odrou
Contact:

Re: NOD32 linux mirror update 1.1

Postby Ashus » 14. 04. 2010 19:58

Crown: Enable curl module in your php config.
http://www.php.net/manual/en/curl.setup.php
Image
Coffee phreak!
crown
Posts: 2
Joined: 20. 04. 2010 19:13

Re: NOD32 linux mirror update 1.1

Postby crown » 20. 04. 2010 20:05

Enabling curl_modules solved the problem...
With a help of this PHP or bash script a got a lot of files (~ 320 MB) in my local dir. what files do i really need ?

Before that I was using a php script without ID/PASS support, so the only way to update was donwloading files from unofficial update server, like http://www.zubikit.com/nod32/eset_upd.

Discription: I have a direct admin managed web page eset.hostingas.in. I've made a /alio dir for nod32 update source and using httaccess redirect to centralize nod32 update. I just need to enter http://eset.hostingas.in/alio to be ably update clients.. and its worked fine... It worked, actually it is works, but only for v3 updates, v4 have some update header check so old way does not work :(

Sooo, other method was found ,with a help of google :D a php script (http://www.4shared.com/account/file/qd9F6WMk/list.html) than can download from unofficial servers update files. i put it to alio3 dir. but the way it downloads files is messy and buggy, so every 2-5 time it mess all files so solution was to use alio2 dir for update with a cron job taking files from alio3 dir. (i need to be sure of alio3 files consistence before files really was transfered to alio2, couse sometimes alio3 was epmty so alio2 files as untouched, hopefully...)

So after using your script i got a lot of files on my computer, but i don't want every time make a synchronization/uploading to my web page alio2 dir. and even if i would want , i dont know which files to upload and where, because before "my old" script was automatically downloading this kind of list to alio2 dir:http://www.4shared.com/file/qd9F6WMk/list.html

With a help of this php or bash script a got a lot of files in my local dir. what files do i really need ?


QUESTION
I thin there is no way to handle this with directadmin, but maybe you can tell /advice me which variable to use for one dir local files storage that i can than resync with a help of ftp or sync software... to minimize upload traffic... and minimize human interaction in it.
JCMilleniuM

Re: NOD32 linux mirror update 1.1

Postby JCMilleniuM » 02. 05. 2010 00:30

you rule! Thanks for this terrific script, Im running it right now on clearos (centos mod), I'll tell you if something goes wrong.
:lol:
crown
Posts: 2
Joined: 20. 04. 2010 19:13

Re: NOD32 linux mirror update 1.1

Postby crown » 02. 05. 2010 13:47

JCMilleniuM wrote:you rule! Thanks for this terrific script, Im running it right now on clearos (centos mod), I'll tell you if something goes wrong.
:lol:
Hmm, it working for me ether, but i got ~320 MB of files, which files do i really need ?????? 25-30 mb is enough for update.
Last edited by crown on 03. 05. 2010 08:21, edited 1 time in total.
User avatar
Ashus
Administrátor
Posts: 417
Joined: 07. 07. 2007 10:51
Location: Ostrava - Polanka nad Odrou
Contact:

Re: NOD32 linux mirror update 1.1

Postby Ashus » 02. 05. 2010 14:11

Don't ask me what files are necessary, I just download the whole, so all kinds of clients (ESS, EAV 4, EAV 3) are happy.
Image
Coffee phreak!
johan

Re: NOD32 linux mirror update 1.1

Postby johan » 06. 01. 2011 21:23

Hi there!

Got Centos 4.8 with PHP 5.1.6. With some modifications I got your script working(almost)
Firstly I had to change the shell exec from

Code: Select all

unrar-free -x /tmp/file.rar /tmp/
to

Code: Select all

unrar x /tmp/file.rar /tmp/
After that I discovered that curl didn't return any size information from curl_exec($ch);, so I used curl_getinfo($ch) instead and thereby don't have to mess around with preg_match().

Code: Select all

curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // resets direct FILE output
curl_setopt($ch, CURLOPT_URL, 'http://'.$eset_server.$upd_file);
$data = curl_exec($ch);
$info = curl_getinfo($ch);//get info

$time_modified = $info['filetime'];//file time
$size = $info['download_content_length'];//file lenght
The only problem left for me right now is that size_real is 0 for every file downloaded. Down in this case is $info['download_content_length'], and Real is the size on disk via php.

Code: Select all

Launched: 2011-01-06 21:14:41
 - trying to download http://89.202.157.227/eset_upd/update.ver
Successfully connected to server 89.202.157.227.
 - downloading: /download/engine3/em000_32_l0.nup
0Warning: Filesize of /download/engine3/em000_32_l0.nup is different than expected, will be retried on next run. Down: 6865 Real: 0
 - downloading: /download/engine3/em001_32_l0.nup
0Warning: Filesize of /download/engine3/em001_32_l0.nup is different than expected, will be retried on next run. Down: 6865 Real: 0
 - downloading: /download/engine3/em001_32_l1.nup
0Warning: Filesize of /download/engine3/em001_32_l1.nup is different than expected, will be retried on next run. Down: 6865 Real: 0
 - downloading: /download/engine3/em001_32_l2.nup
0Warning: Filesize of /download/engine3/em001_32_l2.nup is different than expected, will be retried on next run. Down: 6865 Real: 0
 - downloading: /download/engine3/em001_32_n1.nup
0Warning: Filesize of /download/engine3/em001_32_n1.nup is different than expected, will be retried on next run. Down: 6865 Real: 0
 - downloading: /download/engine3/em001_32_n2.nup


Any idea?

Who is online

Users browsing this forum: No registered users and 1 guest

cron