4 ## AV Scanners (Debian version)
9 # ### http://www.vanja.com/tools/sophie/
11 # \&ask_daemon, ["{}/\n", '/var/run/sophie'],
12 # qr/(?x)^ 0+ ( : | [\000\r\n]* $)/, qr/(?x)^ 1 ( : | [\000\r\n]* $)/,
13 # qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/ ],
15 # ### http://www.csupomona.edu/~henson/www/projects/SAVI-Perl/
16 # ['Sophos SAVI', \&sophos_savi ],
18 ### http://www.clamav.net/
20 \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.ctl"],
21 qr/\bOK$/, qr/\bFOUND$/,
22 qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
23 # NOTE: remember to add the clamav user to the amavis group, and
24 # to properly set clamd to init supplementary groups
25 # When running chrooted one may prefer: ["CONTSCAN {}\n","$MYHOME/clamd"],
27 # ### http://www.clamav.net/ and CPAN (memory-hungry! clamd is preferred)
28 # ['Mail::ClamAV', \&ask_clamav, "*", [0], [1], qr/^INFECTED: (.+)/],
30 # ### http://www.openantivirus.org/
31 # ['OpenAntiVirus ScannerDaemon (OAV)',
32 # \&ask_daemon, ["SCAN {}\n", '127.0.0.1:8127'],
33 # qr/^OK/, qr/^FOUND: /, qr/^FOUND: (.+)/ ],
35 # ### http://www.vanja.com/tools/trophie/
37 # \&ask_daemon, ["{}/\n", '/var/run/trophie'],
38 # qr/(?x)^ 0+ ( : | [\000\r\n]* $)/, qr/(?x)^ 1 ( : | [\000\r\n]* $)/,
39 # qr/(?x)^ [-+]? \d+ : (.*?) [\000\r\n]* $/ ],
41 # ### http://www.grisoft.com/
43 # \&ask_daemon, ["SCAN {}\n", '127.0.0.1:55555'],
44 # qr/^200/, qr/^403/, qr/^403 .*?: ([^\r\n]+)/ ],
46 # ### http://www.f-prot.com/
47 # ['FRISK F-Prot Daemon',
49 # ["GET {}/*?-dumb%20-archive%20-packed HTTP/1.0\r\n\r\n",
50 # ['127.0.0.1:10200','127.0.0.1:10201','127.0.0.1:10202',
51 # '127.0.0.1:10203','127.0.0.1:10204'] ],
52 # qr/(?i)<summary[^>]*>clean<\/summary>/,
53 # qr/(?i)<summary[^>]*>infected<\/summary>/,
54 # qr/(?i)<name>(.+)<\/name>/ ],
56 # ### http://www.sald.com/, http://www.dials.ru/english/, http://www.drweb.ru/
57 # ['DrWebD', \&ask_daemon, # DrWebD 4.31 or later
58 # [pack('N',1). # DRWEBD_SCAN_CMD
59 # pack('N',0x00280001). # DONT_CHANGEMAIL, IS_MAIL, RETURN_VIRUSES
60 # pack('N', # path length
61 # length("$TEMPBASE/amavis-yyyymmddTHHMMSS-xxxxx/parts/pxxx")).
63 # pack('N',0). # content size
65 # '/var/drweb/run/drwebd.sock',
66 # # '/var/amavis/var/run/drwebd.sock', # suitable for chroot
67 # # '/usr/local/drweb/run/drwebd.sock', # FreeBSD drweb ports default
68 # # '127.0.0.1:3000', # or over an inet socket
70 # qr/\A\x00[\x10\x11][\x00\x10]\x00/s, # IS_CLEAN,EVAL_KEY; SKIPPED
71 # qr/\A\x00[\x00\x01][\x00\x10][\x20\x40\x80]/s, # KNOWN_V,UNKNOWN_V,V._MODIF
72 # qr/\A.{12}(?:infected with )?([^\x00]+)\x00/s,
74 # # NOTE: If using amavis-milter, change length to:
75 # # length("$TEMPBASE/amavis-milter-xxxxxxxxxxxxxx/parts/pxxx").
77 ### http://www.kaspersky.com/ (kav4mailservers)
78 ['KasperskyLab AVP - aveclient',
79 ['/usr/local/kav/bin/aveclient','/usr/local/share/kav/bin/aveclient',
80 '/opt/kav/bin/aveclient','aveclient'],
81 '-p /var/run/aveserver -s {}/*', [0,3,6,8], qr/\b(INFECTED|SUSPICION)\b/,
82 qr/(?:INFECTED|SUSPICION) (.+)/,
85 ### http://www.kaspersky.com/
86 ['KasperskyLab AntiViral Toolkit Pro (AVP)', ['avp'],
87 '-* -P -B -Y -O- {}', [0,3,6,8], [2,4], # any use for -A -K ?
89 sub {chdir('/opt/AVP') or die "Can't chdir to AVP: $!"},
90 sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"},
93 ### The kavdaemon and AVPDaemonClient have been removed from Kasperky
94 ### products and replaced by aveserver and aveclient
95 ['KasperskyLab AVPDaemonClient',
96 [ '/opt/AVP/kavdaemon', 'kavdaemon',
97 '/opt/AVP/AvpDaemonClient', 'AvpDaemonClient',
98 '/opt/AVP/AvpTeamDream', 'AvpTeamDream',
99 '/opt/AVP/avpdc', 'avpdc' ],
100 "-f=$TEMPBASE {}", [0,8], [3,4,5,6], qr/infected: ([^\r\n]+)/ ],
101 # change the startup-script in /etc/init.d/kavd to:
102 # DPARMS="-* -Y -dl -f=/var/amavis /var/amavis"
103 # (or perhaps: DPARMS="-I0 -Y -* /var/amavis" )
104 # adjusting /var/amavis above to match your $TEMPBASE.
105 # The '-f=/var/amavis' is needed if not running it as root, so it
106 # can find, read, and write its pid file, etc., see 'man kavdaemon'.
107 # defUnix.prf: there must be an entry "*/var/amavis" (or whatever
108 # directory $TEMPBASE specifies) in the 'Names=' section.
109 # cd /opt/AVP/DaemonClients; configure; cd Sample; make
110 # cp AvpDaemonClient /opt/AVP/
111 # su - vscan -c "${PREFIX}/kavdaemon ${DPARMS}"
113 ### http://www.hbedv.com/ or http://www.centralcommand.com/
114 ['H+BEDV AntiVir or CentralCommand Vexira Antivirus',
115 ['antivir','vexira'],
116 '--allfiles -noboot -nombr -rs -s -z {}', [0], qr/ALERT:|VIRUS:/,
117 qr/(?x)^\s* (?: ALERT: \s* (?: \[ | [^']* ' ) |
118 (?i) VIRUS:\ .*?\ virus\ '?) ( [^\]\s']+ )/ ],
119 # NOTE: if you only have a demo version, remove -z and add 214, as in:
120 # '--allfiles -noboot -nombr -rs -s {}', [0,214], qr/ALERT:|VIRUS:/,
121 # According to the documentations, the new version of Vexira has
122 # reasonable defaults, one may consider: "--timeout=60 --temp=$TEMPBASE {}"
124 ### http://www.commandsoftware.com/
125 ['Command AntiVirus for Linux', 'csav',
126 '-all -archive -packed {}', [50], [51,52,53],
127 qr/Infection: (.+)/ ],
129 ### http://www.symantec.com/
130 ['Symantec CarrierScan via Symantec CommandLineScanner',
131 'cscmdline', '-a scan -i 1 -v -s 127.0.0.1:7777 {}',
132 qr/^Files Infected:\s+0$/, qr/^Infected\b/,
133 qr/^(?:Info|Virus Name):\s+(.+)/ ],
135 ### http://www.symantec.com/
136 ['Symantec AntiVirus Scan Engine',
137 'savsecls', '-server 127.0.0.1:7777 -mode scanrepair -details -verbose {}',
138 [0], qr/^Infected\b/,
139 qr/^(?:Info|Virus Name):\s+(.+)/ ],
140 # NOTE: check options and patterns to see which entry better applies
142 ### http://www.f-secure.com/products/anti-virus/
143 ['F-Secure Antivirus', 'fsav',
144 '--dumb --mime --archive {}', [0], [3,8],
145 qr/(?:infection|Infected|Suspected): (.+)/ ],
147 # ### http://www.avast.com/
148 # ['avast! Antivirus daemon',
149 # \&ask_daemon, # greets with 220, terminate with QUIT
150 # ["SCAN {}\015\012QUIT\015\012", '/var/run/avast4/mailscanner.sock'],
151 # qr/\t\[\+\]/, qr/\t\[L\]\t/, qr/\t\[L\]\t([^[ \t\015\012]+)/ ],
153 # ### http://www.avast.com/
154 # ['avast! Antivirus - Client/Server Version', 'avastlite',
155 # '-a /var/run/avast4/mailscanner.sock -n {}', [0], [1],
156 # qr/\t\[L\]\t([^[ \t\015\012]+)/ ],
158 ['CAI InoculateIT', 'inocucmd', # retired product
159 '-sec -nex {}', [0], [100],
160 qr/was infected by virus (.+)/ ],
161 # see: http://www.flatmtn.com/computer/Linux-Antivirus_CAI.html
163 ### http://www3.ca.com/Solutions/Product.asp?ID=156 (ex InoculateIT)
164 ['CAI eTrust Antivirus', 'etrust-wrapper',
165 '-arc -nex -spm h {}', [0], [101],
166 qr/is infected by virus: (.+)/ ],
167 # NOTE: requires suid wrapper around inocmd32; consider flag: -mod reviewer
168 # see http://marc.theaimsgroup.com/?l=amavis-user&m=109229779912783
170 ### http://mks.com.pl/english.html
171 ['MkS_Vir for Linux (beta)', ['mks32','mks'],
172 '-s {}/*', [0], [1,2],
175 ### http://mks.com.pl/english.html
176 ['MkS_Vir daemon', 'mksscan',
177 '-s -q {}', [0], [1..7],
180 ### http://www.nod32.com/
181 ['ESET Software NOD32 Command Line Interface v 2.51', 'nod32cli',
182 '--subdir {}', [0,3], [1,2], qr/virus="([^"]+)"/ ],
184 # ### http://www.nod32.com/ old
185 # ['ESET Software NOD32 - Client/Server Version', 'nod32cli',
186 # '-a -r -d recurse --heur standard {}', [0], [10,11],
187 # qr/^\S+\s+infected:\s+(.+)/ ],
189 # ### http://www.nod32.com/ old
190 # ['ESET Software NOD32', 'nod32',
191 # '--arch --mail {}', [0], [1,10], qr/^object=.*, virus="(.*?)",/ ],
193 # Experimental, based on posting from Rado Dibarbora (Dibo) on 2002-05-31
194 # ['ESET Software NOD32 Client/Server (NOD32SS)',
195 # \&ask_daemon2, # greets with 200, persistent, terminate with QUIT
196 # ["SCAN {}/*\r\n", '127.0.0.1:8448' ],
197 # qr/^200 File OK/, qr/^201 /, qr/^201 (.+)/ ],
199 ### http://www.norman.com/products_nvc.shtml
200 ['Norman Virus Control v5 / Linux', 'nvcc',
201 '-c -l:0 -s -u -temp:$TEMPBASE {}', [0,10,11], [1,2,14],
202 qr/(?i).* virus in .* -> \'(.+)\'/ ],
204 ### http://www.pandasoftware.com/
205 ['Panda Antivirus for Linux', ['pavcl'],
206 '-aut -aex -heu -cmp -nbr -nor -nso -eng {}',
207 qr/Number of files infected[ .]*: 0+(?!\d)/,
208 qr/Number of files infected[ .]*: 0*[1-9]/,
209 qr/Found virus :\s*(\S+)/ ],
211 # ### http://www.pandasoftware.com/
212 # ['Panda Antivirus for Linux', ['pavcl'],
213 # '-TSR -aut -aex -heu -cmp -nbr -nor -nso -eng {}',
214 # [0], [0x10, 0x30, 0x50, 0x70, 0x90, 0xB0, 0xD0, 0xF0],
215 # qr/Found virus :\s*(\S+)/ ],
217 # GeCAD AV technology is acquired by Microsoft; RAV has been discontinued.
218 # Check your RAV license terms before fiddling with the following two lines!
219 # ['GeCAD RAV AntiVirus 8', 'ravav',
220 # '--all --archive --mail {}', [1], [2,3,4,5], qr/Infected: (.+)/ ],
221 # # NOTE: the command line switches changed with scan engine 8.5 !
222 # # (btw, assigning stdin to /dev/null causes RAV to fail)
224 ### http://www.nai.com/
225 ['NAI McAfee AntiVirus (uvscan)', 'uvscan',
226 '--secure -rv --mime --summary --noboot - {}', [0], [13],
228 \ the\ (.+)\ (?:virus|trojan) |
229 \ (?:virus|trojan)\ or\ variant\ (.+?)\s*! |
230 :\ (.+)\ NOT\ a\ virus)/,
231 # sub {$ENV{LD_PRELOAD}='/lib/libc.so.6'},
232 # sub {delete $ENV{LD_PRELOAD}},
234 # NOTE1: with RH9: force the dynamic linker to look at /lib/libc.so.6 before
235 # anything else by setting environment variable LD_PRELOAD=/lib/libc.so.6
236 # and then clear it when finished to avoid confusing anything else.
237 # NOTE2: to treat encrypted files as viruses replace the [13] with:
238 # qr/^\s{5,}(Found|is password-protected|.*(virus|trojan))/
240 ### http://www.virusbuster.hu/en/
241 ['VirusBuster', ['vbuster', 'vbengcl'],
242 # VirusBuster Ltd. does not support the daemon version for the workstation
243 # engine (vbuster-eng-1.12-linux-i386-libc6.tgz) any longer. The names of
244 # binaries, some parameters AND return codes have changed (from 3 to 1).
245 "{} -ss -i '*' -log=$MYHOME/vbuster.log", [0], [1],
246 qr/: '(.*)' - Virus/ ],
248 # ### http://www.virusbuster.hu/en/
249 # ['VirusBuster (Client + Daemon)', 'vbengd',
250 # # HINT: for an infected file it always returns 3,
251 # # although the man-page tells a different story
252 # '-f -log scandir {}', [0], [3],
253 # qr/Virus found = (.*);/ ],
255 ### http://www.cyber.com/
256 ['CyberSoft VFind', 'vfind',
257 '--vexit {}/*', [0], [23], qr/##==>>>> VIRUS ID: CVDL (.+)/,
258 # sub {$ENV{VSTK_HOME}='/usr/lib/vstk'},
261 ### http://www.avast.com/
262 ['avast! Antivirus', ['/usr/bin/avastcmd','avastcmd'],
263 '-a -i -n -t=A {}', [0], [1], qr/\binfected by:\s+([^ \t\n\[\]]+)/ ],
265 ### http://www.ikarus-software.com/
266 ['Ikarus AntiVirus for Linux', 'ikarus',
267 '{}', [0], [40], qr/Signature (.+) found/ ],
269 ### http://www.bitdefender.com/
270 ['BitDefender', 'bdc',
271 '--arc --mail {}', qr/^Infected files *:0+(?!\d)/,
272 qr/^(?:Infected files|Identified viruses|Suspect files) *:0*[1-9]/,
273 qr/(?:suspected|infected): (.*)(?:\033|$)/ ],
274 # consider also: --all --nowarn --alev=15 --flev=15. The --all argument may
275 # not apply to your version of bdc, check documentation and see 'bdc --help'
277 # ['File::Scan', sub {Amavis::AV::ask_av(sub{
278 # use File::Scan; my($fn)=@_;
279 # my($f)=File::Scan->new(max_txt_size=>0, max_bin_size=>0);
280 # my($vname) = $f->scan($fn);
281 # $f->error ? (2,"Error: ".$f->error)
282 # : ($vname ne '') ? (1,"$vname FOUND") : (0,"Clean")}, @_) },
283 # ["{}/*"], [0], [1], qr/^(.*) FOUND$/ ],
285 ### example: fully-fledged checker for JPEG marker segments of invalid length
287 sub { use JpegTester (); Amavis::AV::ask_av(\&JpegTester::test_jpeg, @_) },
288 ["{}/*"], undef, [1], qr/^(bad jpeg: .*)$/ ],
289 # NOTE: place file JpegTester.pm somewhere where Perl can find it,
290 # for example in /usr/local/lib/perl5/site_perl
295 @av_scanners_backup = (
297 ### http://www.clamav.net/ - backs up clamd or Mail::ClamAV
298 ['ClamAV-clamscan', 'clamscan',
299 "--stdout --disable-summary -r --tempdir=$TEMPBASE {}",
300 [0], qr/:.*\sFOUND$/, qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
302 ### http://www.f-prot.com/ - backs up F-Prot Daemon
303 ['FRISK F-Prot Antivirus', ['f-prot','f-prot.sh'],
304 '-dumb -archive -packed {}', [0,8], [3,6],
305 qr/Infection: (.+)/ ],
307 ### http://www.trendmicro.com/ - backs up Trophie
308 ['Trend Micro FileScanner', ['/etc/iscan/vscan','vscan'],
309 '-za -a {}', [0], qr/Found virus/, qr/Found virus (.+) in/ ],
311 ### http://www.sald.com/, http://drweb.imshop.de/ - backs up DrWebD
312 ['drweb - DrWeb Antivirus',
313 ['/usr/local/drweb/drweb', '/opt/drweb/drweb', 'drweb'],
314 '-path={} -al -go -ot -cn -upn -ok-',
315 [0,32], [1,9,33], qr' infected (?:with|by)(?: virus)? (.*)$'],
317 ['KasperskyLab kavscanner', ['/opt/kav/bin/kavscanner','kavscanner'],
318 '-i1 -xp {}', [0,10,15], [5,20,21,25],
319 qr/(?:CURED|INFECTED|CUREFAILED|WARNING|SUSPICION) (.*)/ ,
320 sub {chdir('/opt/kav/bin') or die "Can't chdir to kav: $!"},
321 sub {chdir($TEMPBASE) or die "Can't chdir back to $TEMPBASE $!"},
324 # Commented out because the name 'sweep' clashes with Debian and FreeBSD
325 # package/port of an audio editor. Make sure the correct 'sweep' is found
326 # in the path when enabling.
328 # ### http://www.sophos.com/ - backs up Sophie or SAVI-Perl
329 # ['Sophos Anti Virus (sweep)', 'sweep',
330 # '-nb -f -all -rec -ss -sc -archive -cab -tnef --no-reset-atime {}',
331 # [0,2], qr/Virus .*? found/,
332 # qr/^>>> Virus(?: fragment)? '?(.*?)'? found/,
334 # # other options to consider: -mime -oe -idedir=/usr/local/sav
336 # always succeeds (uncomment to consider mail clean if all other scanners fail)
337 # ['always-clean', sub {0}],
342 1; # ensure a defined return