📜 ⬆️ ⬇️

Monitoring ESET NOD32

Suppose you have a lot of offices, each of which is ESET NOD32 and there is OpenVPN for communication. In addition, each office will have one computer on which a license will be installed and which will download updates, the rest of antiviruses will download updates from it. After installing the license, an update via HTTP becomes available (in our case, we specify port 8081 in the settings).

The method consists in downloading the update.ver file of the NOD32 antivirus.
through the built-in HTTP server for distribution of updates. The implementation is written
on php + gd. In case of an error, an error decoding is displayed.

In any case, check out what ESET Remote Administrator ( ERA ) is - sometimes it's still better to use ready-made solutions (albeit for money).

')
I used the font terminal6.gdf, which you can easily find on the Internet. And one more important note, the ESET HTTP Server service must be running.

In the folder on the web server we need the following files:
index.php:
<?php if (isset($_GET['host'])) $host = $_GET['host']; $url = "/update.ver"; $text = ""; if ($fp = fsockopen($host, 8081, $errno, $errstr, 20)) { //  ,   $out = "GET $url HTTP/1.0\r\n"; $out .= "Host: $host\r\n"; $out .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)\r\n"; $out .= "Accept: */*:\r\n"; $out .= "Pragma: no-cache\r\n"; $out .= "Cache-Control: no-cache\r\n"; $out .= "Connection: close\r\n\r\n"; fputs($fp, $out); //     $content = ''; while(!feof($fp)) { stream_set_timeout($fp, 10); $content .= fgets($fp, 4096); $status = socket_get_status($fp); if ($status['timed_out']) break; } fclose($fp); //    // \d    $pattern = '/version=(\\d\\d\\d\\d)\ \((\\d\\d\\d\\d\\d\\d\\d\\d)\)/'; preg_match_all($pattern, $content, $matches, PREG_OFFSET_CAPTURE); $count = count($matches[0]); if (!$count) { //     -    $pattern = '/versionid=(\\d\\d)(\\d\\d)/'; preg_match_all($pattern, $content, $matches, PREG_OFFSET_CAPTURE); $count =count($matches[0]); } //       $ar = array(); for ($i=0;$i<$count;$i++) $ar[$i] = strval($matches[1][$i][0])."-".strval($matches[2][$i][0]); //    ,     rsort($ar); $text = $ar[0]; } else $text= "$errstr ($errno)"; //  ,     $font = imageloadfont('fonts/terminal6.gdf'); $fontWidth = imagefontwidth($font); $fontHeight = imagefontheight($font); $im = imagecreate(strlen($text) * $fontWidth, $fontHeight); $bgColor = imagecolorallocate($im, 255, 255, 255); $fgColor = imagecolorallocate($im, 0, 0, 255); imagestring($im, $font, 0, 0, $text, $fgColor); header('Content-Type: image/png'); imagepng($im); imagedestroy($im); ?> 


.htaccess
AddHandler application/x-httpd-php .png


ufa.png:
 <? $host="192.168.2.250"; require_once "index.php"; ?> 


krasnodar.png:
 <? $host="192.168.93.250"; require_once "index.php"; ?> 


and other .png files for regions

For myself, I made another file (which, by the way, can be stored on another server) in which I simply inserted HTML for the images, added the license expiration date and the number of licenses. Looks very nice.

Source: https://habr.com/ru/post/108273/


All Articles