Add support for IPCOP – Advanced Proxy – Update Accelerator to cache Antivirus ESET Nod32 update files

I’ve been digging and foraging for infos about this one. The author of this ipcop great plugin, stated in the FAQ that it is possible to add custom rules for Update Accelerator, but can’t seem to find the guide anywhere.

Here are my findings so far :

Simply edit this file in your IPCOP box:

/usr/sbin/updxlrator

and you will find these lines :

while (<>) {

    $request=$_;

    @tmp=split(/ /,$request);
    chomp(@tmp);

    $source_url = $tmp[0];
    $hostaddr   = $tmp[1]; while ($hostaddr =~ /.*\/$/) { chop $hostaddr; }
    $username   = $tmp[2]; if ($username eq ”) { $username=’-‘; };
    $method     = $tmp[3];

    $xlrator_url = $source_url;

    if (($method eq ‘GET’) || ($method eq ‘HEAD’))
    {

    # ———————————————————–
    #  Section: Windows Update / Windows Downloads
    # ———————————————————–

    if (
        (($source_url =~ m@^http://[^/]*\.microsoft\.com/.*\.(exe|psf|msi|msp|cab)$@i) ||
         ($source_url =~ m@^http://[^/]*\.windowsupdate\.com/.*\.(exe|psf|msi|msp|cab)$@i))
    &&   ($source_url !~ m@^http://[^/]*\.microsoft\.com/.*(/autoupd|selfupdate/).*\.cab@i)
    &&   ($source_url !~ m@\&@)
       )
    {
        $xlrator_url = &check_cache($source_url,$hostaddr,$username,”Microsoft”,$unique);
    }

    # ———————————————————–
    #  Section: Adobe Downloads
    # ———————————————————–

    if (
        ($source_url =~ m@^http://(ar)?download\.adobe\.com/.*\.(exe|msi|bin|dmg|idx|gz)$@i) ||
        ($source_url =~ m@^http://swupdl\.adobe\.com/updates/.*\.(exe|msi|bin|dmg|idx|gz|[a-z][a-z]_[A-Z][A-Z])$@i) ||
        ($source_url =~ m@^http://swupmf\.adobe\.com/manifest/.*\.upd$@i)
       )
    {
        $xlrator_url = &check_cache($source_url,$hostaddr,$username,”Adobe”,$unique);
    }

    # ———————————————————–
    #  Section: Linux Downloads
    # ———————————————————–

    if ($source_url =~ m@^[h|f]t?tp://[^?]+\.(deb|rpm)$@i)
    {
        $xlrator_url = &check_cache($source_url,$hostaddr,$username,”Linux”,$mirror);
    }

    # ———————————————————–
    #  Section: Trend Micro Downloads
    # ———————————————————–

    if (
        ($source_url =~ m@^http://[^/]*\.trendmicro\.com/activeupdate/.*@i) &&
        ($source_url !~ m@.*/tmnotify\.dat$@i) &&
        ($source_url !~ m@.*/ini_xml\.zip$@i) &&
        ($source_url !~ m@.*/server\.ini$@i)
       )
    {
        $xlrator_url = &check_cache($source_url,$hostaddr,$username,”TrendMicro”,$mirror);
    }

    # ———————————————————–
    #  Section: Symantec Downloads
    # ———————————————————–

    if ($source_url =~ m@^[h|f]tt?p://[^/]*\.symantec(liveupdate)?\.com/.*\.(exe|zip|vdb|xdb)$@i)
    {
        $xlrator_url = &check_cache($source_url,$hostaddr,$username,”Symantec”,$unique);
    }

    # ———————————————————–
    #  Section: Apple Downloads
    # ———————————————————–

    if (
        (($source_url =~ m@^http://swcdn\.apple\.com/content/downloads/.*\.(tar)$@i) ||
         ($source_url =~ m@^http://appldnld\.apple\.com\.edgesuite\.net/.*\.(exe|dmg)$@i) ||
         ($source_url =~ m@^http://.*\.g.akamai.net/.*/3093/1/.*\.(tar|pkg|dmg|exe)$@i))
       )
    {
        $xlrator_url = &check_cache($source_url,$hostaddr,$username,”Apple”,$unique);
    }

    # ———————————————————–
    #  Section: Avast Downloads
    # ———————————————————–

    if ($source_url =~ m@^http://download[\d]+\.avast\.com/.*\.(exe|vpu)$@i)
    {
        $xlrator_url = &check_cache($source_url,$hostaddr,$username,”Avast”,$mirror);
    }
   

    # ———————————————————–

    }

Simply add these lines, just below the Avast section:

    # ———————————————————–

    #  Section: NOD Downloads

    # ———————————————————–

    if ($source_url =~ m@^[h|f]t?tp://[^?]+\.(nup|ver|)$@i)

    {

        $xlrator_url = &check_cache($source_url,$hostaddr,$username,”Other”,$mirror);

    }

I’m using the Linux section as the template, which is the easiest template compare to others. What do those line mean?

$source_url =~ m@^[h|f]t?tp://[^?]+\.(nup|ver|)$@i)

translate: UA should cache  nup and ver files…

$source_url =~ m@^[h|f]t?tp://[^?]+\.(nup|ver|)$@i)

translate: and the URLS could be anywhere

$source_url =~ m@^[h|f]t?tp://[^?]+\.(nup|ver|)$@i)

translate: and it doesn’t matter whether it is http or ftp

Pay attention to this:

$xlrator_url = &check_cache($source_url,$hostaddr,$username,”Other“,$mirror);

It’s vendorid flag, which indicated that these NUP and VER files should use Other flag in the UA web interface. If you want to mess around and add your own image/category, edit this file

/home/httpd/cgi-bin/updatexlrator.cgi

find these line :

print “\t\t “;
            if ($vendorid =~ /^Adobe$/i)
            {
                print “Adobe \n”;
            } elsif ($vendorid =~ /^Microsoft$/i)
            {
                print “Microsoft \n”;
            } elsif ($vendorid =~ /^Symantec$/i)
            {
                print “Symantec \n”;
            } elsif ($vendorid =~ /^Linux$/i)
            {
                print “Linux \n”;
            } elsif ($vendorid =~ /^TrendMicro$/i)
            {
                print “Trend Micro \n”;
            } elsif ($vendorid =~ /^Apple$/i)
            {
                print “Apple \n”;
            } elsif ($vendorid =~ /^Avast$/i)
            {
                print “Avast \n”;
            } else
            {
                if (-e “/home/httpd/html/images/updxl-src-” . $vendorid . “.gif”)
                {
                    print “" . ucfirst $vendorid . " \n”;
                } else {
                    print “" . ucfirst $vendorid . " \n”;
                }
            }

Maybe there are other files or lines that should be edited as well, I don’t know yet.
Technorati Tags: ,

6 Responses

  1. i had difficulty update for my avg free edition. i must disable proxy before update my antivirus. it seems antivirus take update from the cache. even i was used the update accelerator. can u help me to solve the problem

  2. I concated the author to add AVG support (was happy to pay) he sent me a custom file that had the AVG code in it, but it was looking at AVG’s old servers and not caching anything, when i emailed him with the correct server details he never got back to me😦

    so a standard edition does not cache AVG, so unless you have setup some odd rules it should work without problems directly from grisofts servers.

  3. I try…but thank’s…

  4. i igot some problem with
    can somebody help the problem

  5. I added support for AVG, CA, and Malwarebytes using someone else’s guide for ideas by adding this:
    (I forget where I saw the guide, it’s been awhile. Anyway all due credit,, etc, etc.)

    # ———————————————————–
    # Section: CA Downloads
    # ———————————————————–

    if ($source_url =~ m@^http://.*\.ca\.com/.*\.(exe|bin|pkg|tar|zip)$@i)
    {
    $xlrator_url = &check_cache($source_url,$hostaddr,$username,”CA”,$mirror);
    }

    # ———————————————————–
    # Section: AVG Downloads
    # ———————————————————–

    if ($source_url =~ m@^http://.*\.avg\.com/.*\.(exe|bin|ctf)$@i)
    {
    $xlrator_url = &check_cache($source_url,$hostaddr,$username,”Avg”,$mirror);
    }

    # ———————————————————–
    # Section: Malwarebytes Downloads
    # ———————————————————–

    if ($source_url =~ m@^http://.*\.*\.com/.*\.(ref)$@i)
    {
    $xlrator_url = &check_cache($source_url,$hostaddr,$username,”Malwarebytes”,$mirror);
    }

    # ———————————————————–

    The malwarebytes section actually downloads any file with a .ref extension, but I personally haven’t run across that extension anywhere else.

    I also added jpgs for each of those by editing /home/httpd/cgi-bin. There are a few sections that must be edited:

    print “\t\t “;
    if ($vendorid =~ /^Adobe$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Microsoft$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Symantec$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Linux$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^TrendMicro$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Apple$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Avast$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^CA$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^AVG$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Malwarebytes$/i)
    {
    print ” \n”;
    } else

    {
    if (-e “/home/httpd/html/images/updxl-src-” . $vendorid . “.gif”)
    {
    print ” \n”;
    } else {
    print ” \n”;
    }
    }

    another……………………….

    if ($vendorid =~ /^Adobe$/i)
    {
    print ” \n”;
    print ” Adobe \n”;
    } elsif ($vendorid =~ /^Microsoft$/i)
    {
    print ” \n”;
    print ” Microsoft \n”;
    } elsif ($vendorid =~ /^Symantec$/i)
    {
    print ” \n”;
    print ” Symantec \n”;
    } elsif ($vendorid =~ /^Linux$/i)
    {
    print ” \n”;
    print ” Linux \n”;
    } elsif ($vendorid =~ /^TrendMicro$/i)
    {
    print ” \n”;
    print ” Trend Micro \n”;
    } elsif ($vendorid =~ /^Apple$/i)
    {
    print ” \n”;
    print ” Apple \n”;
    } elsif ($vendorid =~ /^Avast$/i)
    {
    print ” \n”;
    print ” Avast \n”;
    } elsif ($vendorid =~ /^CA$/i)
    {
    print ” \n”;
    print ” ca \n”;
    } elsif ($vendorid =~ /^AVG$/i)
    {
    print ” \n”;
    print ” AVG \n”;
    } elsif ($vendorid =~ /^Malwarebytes$/i)
    {
    print ” \n”;
    print ” Malwarebytes \n”;
    } else

    another………….

    {
    print ” \n”;
    } elsif ($vendorid =~ /^Microsoft$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Symantec$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Linux$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^TrendMicro$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Apple$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Avast$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^CA$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^AVG$/i)
    {
    print ” \n”;
    } elsif ($vendorid =~ /^Malwarebytes$/i)
    {
    print ” \n”;
    } else

    another………………………

    # ——————————————————————-

    sub printlegendsource
    {
    print <<END

      $Lang::tr{‘updxlrtr source’}:
     

    Adobe
     

    Apple
     

    Avast
     

    Linux
     

    CA
     

    AVG

     
     

    Microsoft
     

    Symantec
     

    Trend Micro
     

    Malwarebytes
     

    $Lang::tr{‘updxlrtr other’}

    END
    ;
    }

    # ——————————————————————-

    I then added the jpgs to /home/httpd/html/images after resizing them to match the sizes of the existing jpgs.

    Good luck!

  6. Well, ignore most of the code I just posted. My clipboard failed me. I also forgot to mention the file in /home/httpd/cgi-bin is updatexlrator.cgi .

    Hopefully it still helps someone……

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: