Home

Clam AntiVirus 0.94 User Manual

image

Contents

1. 18 6 244 Documents og dsd ce Sak AA E RUN EO 19 06 23 OIBGIS4 2 4 ood Vx Daw Yo a ox 19 X OT TTC 19 O20 Header fl so lt w4 dei ARA Ux RIP Xv Xu x xU 19 6 3 2 Database loading estara a 19 6 3 3 Error handling 25 245445445 445454465 RR XC 20 p34 Engine structure s s se esas aaneen pi nat ER 21 6 4 Database reloading lt a Roe ra Xo ok x wuR E XO e 21 641 Data scan functions 25 45 ao rar aS Sa oe SH ES 22 64 2 MENO a ss di a 24 6 4 3 erklaeren 6 ous ob ole AR 24 6 4 4 clamav config AIN 25 64 5 E TEEN 25 6 3 o ae ohn Sods EE Sh EE Ae BG te 25 5 0 CODICIDUIOR s lt aeos iow 464 hee bb E be RUE Ab ed BUE eh 26 6 7 DONOS sortear EO LIE IRR Ro EURO E 36 6S E III III 42 62 penADU VIS se ss ciar RU xg dux OSE ge r 42 7 Core Team 42 ClamAV User Manual c 2007 2008 Sourcefire Inc c 2002 2007 Tomasz Kojm This document is distributed under the terms of the GNU General Public License v2 Clam AntiVirus is free software you can redistribute it and or modify it under the terms of the GNU General Public License as published by the Free Software Foundation either version 2 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should hav
2. UPX FSG Petite PeSpin NsPack wwpack32 MEW Upack YOda Cryptor e Supports almost all mail file formats e Support for other special files formats includes HTML RTF PDF Files encrypted with CryptFF and ScrEnc uuencode TNEF winmail dat e Advanced database updater with support for scripted updates digital signatures and DNS based database version queries 1 2 Mailing lists and IRC channel If you have a trouble installing or using ClamAV try asking on our mailing lists There are four lists available e clamav announce lists clamav net info about new versions moderated e clamav users lists clamav net user questions e clamav devel lists clamav net technical discussions e clamav virusdb lists clamav net database update announcements moderated Subscribers are not allowed to post to the mailing list 2 Base package S You can subscribe and search the mailing list archives at http www clamav net support ml Alternatively you can try asking on the clamav IRC channel launch your favourite irc client and type server irc freenode net join clamav 1 3 Virus submitting If you have got a virus which is not detected by your ClamAV with the latest databases please submit the sample at our website http www clamav net sendvirus 2 Base package 2 1 Supported platforms Most popular UNIX operating systems are supported Clam Anti
3. limit memory usage for some unpackers Ir The last argument options configures the scan engine and supports the following flags that can be combined using bit operators LibClamAV EJ e CL SCAN STDOPT This is an alias for a recommended set of scan options You should use it to make your software ready for new features in the future versions of libclamav e CLSCAN RAW Use it alone if you want to disable support for special files e CLSCAN ARCHIVE This flag enables transparent scanning of various archive formats e CL SCAN BLOCKENCRYPTED With this flag the library will mark encrypted archives as viruses Encrypted Zip Encrypted RAR e CL SCAN MAIL Enable support for mail files e CL SCAN MAILURL The mail scanner will download and scan URLs listed in a mail body This flag should not be used on loaded servers Due to potential problems please do not enable it by default but make it optional e CL SCAN OLE2 Enables support for OLE2 containers used by MS Office and msi files e CL SCAN PDF Enables scanning within PDF files e CL SCAN PE This flag enables deep scanning of Portable Executable files and allows libclamav to unpack executables compressed with run time unpackers e CL SCAN ELF Enable support for ELF files e CL SCAN BLOCKBROKEN libclamav will try to detect broken executables and mark them as Broken Executable e CL SCAN HTML This flag enables HTML normalisation including ScrEnc decryp
4. ma welocal host tmp clamscan malware zip lware zi ip Worm Mydoom U FOUND TIP You can force clamscan to list all infected files in an archive using no archive this option disables transparent decompressors built into libclamav and enabling ex ternal decompressors unzip unrar zolw Archive inf inf inf tmp c tmp cl tmp cl localhost tmp clamscan no archive unzip malware zip tmp malware zip lating testl exe lating test2 exe lating test3 exe lamav 7TeTbfdbb2d3872b testl exe Worm Mydoom U FOUND lamav 77e7bfdbb2d3872b test2 exe Trojan Taskkill A FOUND lamav 77e7bfdbb2d3872b test3 exe Worm Nyxem D FOUND tmo malware zip Infected Archive FOUND 5 4 2 clamd The output format of clamd is very similar to clamscan zolw localhost telnet localhost 3310 Trying 127 0 0 1 Connected to localhost Escape character is SCAN home zolw test home zolw test clam exe ClamAV Test File FOUND Connection closed by foreign host In the SCAN mode it closes the connection when the first virus is found 6 LibClamAV SCAN home zolw test clam zip home zolw test clam zip ClamAV Test File FOUND CONTSCAN and MULTISCAN don t stop scanning in case a virus is found Error messages are printed in the following format SCAN no such file no such file Can t stat the file ERROR 6 LibClamAV Libclamav provides an easy and effective way to add a vi
5. Clam AntiVirus 0 94 User Manual Contents Contents 1 Introduction Ld Features si vox RC oe EE EE DAR 1 2 Mailing lists and IRC channel lens 1 3 TE axo v oe ae aaa dra 2 Base package 21 Supported platos i 564 oos B E ERROR US cd 2 2 Bitlaty DICEAPPS A Ar 24 5 6 da oder ood Ro Eo pO Eod d 3 Installation AL Reg irements ses pue gde dele 809 3 Y 3 936 EE ee HS 3 2 Installing on shell account 2 4 249 o 3 xe X Ses 3 3 Adding new system user and group 2 44 46 24 805 825 34 3 4 Compilation of base package 3 5 Compilation with clamav milterenabled 3 6 Running unit tests ir eer doro Ae OH X RR XM XU X xs 3 7 Reporting a unit test failure bug cra ad 4 Configuration 4i cla IT vc 4 1 1 On access scanning ve do ou E A POE od 42 clamayv milter 2 ccoa 29 264 9 84 684 EE Ad ESE x dek go deg eR e MES SY ACE Tuv Ca ee ee E 4 4 Setting up auto updating l les 44 1 Closest mirror es 5 Usage 5 1 Clamdaemon 32 ClamidSCan ori aa E yc eds Yo3 d a do CAMU ida Oo aro da 29b Output e e skes segde eurer RE Ea en en E i Dial TE EE S42 elad ee A amp Glace Rede RU EUR he PSN Se a eed 6 LibClamAV A ona he 9 1 49 9 2 9 9 ee Sa Oo ee AC 56 2 Supported TOS ue oa ox a Ra ELE RU Ry on 6 2 1 Executables a a A A Ch Ch A Contents 3 9 2 2 Mal fles uou ue qe uk E A E EC CE e rA 18 6 2 3 Archives and compressed files
6. e Durval Menezes http www durval com br e Micro Logic Systems http www mls nc e Midcoast Internet Solutions LibClamAV e Mimecast http www mimecast com e Kazuhiro Miyaji e Bozidar Mladenovic e Paul Morgan e Tomas Morkus e The Names Database http static namesdatabase com e Names Directory http www namesdir com e Michael Nolan http www michaelnolan co uk e Jorgen Norgaard e Numedeon Inc creators of Whyville http www whyville net e Oneworkspace com http www oneworkspace com e Online Literature http www couol com e Origin Solutions http www originsolutions com au e outermedia GmbH http www outermedia de e Kevin Pang http www freebsdblog org e Alexander Panzhin e Passageway Communications http www passageway com e Dan Pelleg http www libagent org e Thodoris Pitikaris e Paul Rantin e Thomas J Raef http www ebasedsecurity com e Luke Reeves http www neuro tech net e RHX http www rhx it e Stefano Rizzetto e Roaring Penguin Software Inc http www roaringpenguin com LibClamAV EN e Luke Rosenthal e Jenny Sfstrm nttp PokerListings com e School of Engineering University of Pennsylvania http www seas upenn edu e Tim Scoff e Seattle Server http www seattleserver com e Software Workshop Inc http www softwareworkshop com e Solutions In A Box http www siab com au e Stephane Rau
7. Use clamav config to check compilation information for libclamav zolw localhost clamav config libs L usr local lib lz 1bz2 lgmp lpthread zolw localhost clamav config cflags I usr local include g 02 6 4 5 Example You will find an example scanner application in the clamav sources example Don t forget that all programs based on libclamav must be linked against it gcc Wall exl c o ex1 lclamav 6 5 CVD format CVD ClamAV Virus Database is a digitally signed tarball containing one or more databases The header is a 512 bytes long string with colon separated fields ClamAV VDB build time version number of signatures functionality level required MD5 checksum digital signature builder name build time sec sigtool info displays detailed information on CVD files zolw localhost usr local share clamav sigtool i daily cvd File daily cvd Build time 10 Mar 2008 10 45 0000 Version 6191 Signatures 59084 Functionality level 26 Builder ccordes MD5 6e6e29dae36b4b7315932c921e568330 Digital signature zz9irc9irupR3zT7yX6J4OR6XdFPUat4HIM9ERn3kACOWpcMFxq Fs4toG5WJsHda0Jj921UusZ 7wAgY jpailNr jFfXHsJxvOdBkS5 XWMnt 30T1ctNgqmiF RLU6VOVeT140ej3Aya0cVpd9KA4XXevEO2eTTvzWNCAq0ZzWNdjc Verification OK 6 LibClamAV EJ 6 6 Contributors The following people contributed to our project in some way providing patches bug reports technic
8. robert desertsurf com e Brian A Reiter breiter wolfereiter com e Didi Rieder lt adrieder sbox tugraz at gt e Pavel V Rochnyack lt rpv fsf tsu ru gt e Rupert Roesler Schmidt r roesler schmidt uplink at e David Sanchez dsanchez veloxia com e David Santinoli david santinoli com e Vijay Sarvepalli vssarvep office uncg edu e Martin Schitter e Theo Schlossnagle lt jesus omniti com gt e Enrico Scholz lt enrico scholz informatik tu chemnitz de gt e Karina Schwarz k schwarz uplink at e Scsi lt scsi softland ru gt e Dr Matthew J Seaman lt m seaman infracaninophile co uk gt e Hector M Rulot Segovia lt Hector Rulot uv es gt e Omer Faruk Sen lt ofsen enderunix org gt e Sergey lt a_s_y sama ru gt e Tuomas Silen tuomas silen nodeta fi e David F Skoll lt dfs roaringpenguin com gt e Al Smith lt ajs clamav aeschi ch eu org gt e Sergey Smitienko lt hunter comsys com ua gt e Solar Designer solar openwall com e Joerg Sonnenberger joerg britannica bec de e Michal GiM Spadlinski http gim org pl e Kevin Spicer lt kevin kevinspicer co uk gt LibClamAV e GertJan Spoelman lt cav gjs cc gt e Ole Stanstrup ole stanstrup dk e Adam Stein adam scan mc xerox com e Steve steveb webtribe net e Richard Stevenson lt richard endace com gt e Sven Strickroth sstrickroth gym oha de e Matt Sullivan lt matt sullivan gen nz gt e Dr Zbigniew Szewczak zss
9. com au Allied Quotes http www AlliedQuotes com American Computer amp Electronic Services Corp http www acesnw com Amnesty International Swiss Section http www amnesty ch Steve Anderson Anonymous donor from Colorado US Arudius http arudius sourceforge net Peter Ashman LibClamAV e Atlas College http www atlascollege nl e Australian Payday Cash Loans http www cashdoctors com au e AWD Online http www awdonline com e BackupAssist Backup Software http www backupassist com e Dave Baker e Bear and Bear Consulting Inc http www bear consulting com e Aaron Begley e Craig H Block e Norman E Brake Jr e Josh Burstyn e By Design http www by design net e Canadian Web Hosting http www canadianwebhosting com e cedarcreeksoftware com http www cedarcreeksoftware com e Ricardo Cerqueira e Thanos Chatziathanassiou e Cheahch from Singapore e Conexim Australia business web hosting http www conexim com au e Alan Cook e Joe Cooper e CustomLogic LLC http www customlogic com e Ron DeFulio e Digirati http oss digirati com br e Steve Donegan http www donegan org e Dynamic Network Services Inc http www dyndns org e EAS Enterprises LLC LibClamAV e eCoupons com http www ecoupons com e Electric Embers http electricembers net e John T Ellis e Epublica e Bernhard Erdmann e David Eriksson http ww
10. e Jeremy Garcia lt jeremy linuxquestions org gt e Dean Gaudet lt dean clamav arctic org gt e Michel Gaudet Michel Gaudet ehess fr e Philippe Gay ph gay free fr e Nick Gazaloff lt nick sbin org gt e Geoff Gibbs lt ggibbs hgmp mrc ac uk gt LibClamAV Luca NERvOus Gibelli lt nervous nervous it gt Scott Gifford sgifford suspectclass com Wieslaw Glod lt wkg x2 p1 gt Stephen Gran lt steve lobefin net gt Koryn Grant koryn endace com Matthew A Grant grantma anathoth gen nz Christophe Grenier lt grenier cgsecurity org gt Marek Gutkowski lt hobbit core segfault pl gt Jason Haar lt Jason Haar trimble co nz gt Hrvoje Habjanic lt hrvoje habjanic zg hinet hr gt Michal Hajduczenia michalis mat uni torun pl Jean Christophe Heger jcheger acytec com Martin Heinz lt Martin hemag ch gt Kevin Heneveld lt kevin northstar k12 ak us gt Anders Herbjornsen lt andersh gar no gt Paul Hoadley paulh logixsquad net Robert Hogan lt robert roberthogan net gt Przemyslaw Holowczyc doozer skc com pl Thomas W Holt Jr twh cohesive net James F Hranicky lt jfh cise ufl edu gt Douglas J Hunley lt doug hunley homeip net gt Kurt Huwig lt kurt iku netz de gt Andy Igoshin ai vsu ru Michal Jaegermann michal harddata com Christophe Jaillet lt christophe jaillet wanadoo fr gt LibClamAV e Jay lt sysop clamav coronastreet net gt e Stephane Jeannenot lt stephane j
11. e g setenv ABI 32 before running the configuration script of GMP e check unit testing framework 3 2 Installing on shell account To install ClamAV locally on an unprivileged shell account you need not create any additional users or groups Assuming your home directory is home gary you should build it as follows configure prefix home gary clamav disable clamav make make install To test your installation execute 3See section 3 6 on how to run the unit tests 3 Installation clamav bin freshclam clamav bin clamscan The disable clamav switch disables the check for existence of the clamav user and group but clamscan would still require an unprivileged account to work in a superuser mode 3 3 Adding new system user and group If you are installing ClamAV for the first time you have to add a new user and group to your system groupadd clamav useradd g clamav s bin false c Clam AntiVirus clamav Consult a system manual if your OS has not groupadd and useradd utilities Don t forget to lock access to the account 3 4 Compilation of base package Once you have created the clamav user and group please extract the archive zcat clamav x yz tar gz tar xvf cd clamav x yz Assuming you want to install the configuration files in etc configure and build the software as follows configure sysconfdir etc make su c make install In the last step the software i
12. Mike Cathey mike clamav net USA Role co sysadmin e Christoph Cordes ccordes clamav net Germany Role virus database maintainer Core Team e Diego d Ambra diego clamav net Denmark Role virus database maintainer e Luca Gibelli lt luca clamav net gt Italy Role sysadmin mirror coordinator e Nigel Horne njh clamav net United Kingdom Role coder e Arnaud Jacques arnaud clamav net France Role virus database maintainer e Tomasz Kom lt tkojm clamav net gt Poland Role project leader coder e Tomasz Papszun lt tomek clamav net gt Poland Role various help e Sven Strickroth lt sven clamav net gt Germany Role virus database maintainer virus submission management e Edwin Torok lt edwin clamav net gt Romania Role coder e Trog lt trog clamav net gt United Kingdom Role coder
13. Virus 0 9x was tested on e GNU Linux e Solaris e FreeBSD OpenBSD e MacOS X Some features may not be available on your operating system If you are successfully running Clam AntiVirus on a system not listed above please let us know 2 20 Binary packages You can find the up to date list of binary packages at our website http www clamav net download packages Installation from a port is recommended 3 Installation EJ 3 Installation 3 1 Requirements The following elements are required to compile ClamAV e zlib and zlib devel packages e gcc compiler suite tested with 2 9x 3 x and 4 x series If you are compiling with higher optimization levels than the default one O2 for gcc be aware that there have been reports of misoptimizations The build system of ClamAV only checks for bugs affecting the default settings it is your responsibility to check that your compiler version doesn t have any bugs The following packages are optional but highly recommended e bzip2 and bzip2 devel library e GNUMP3 It s very important to install the GMP package because it allows freshclam to verify the digital signatures of the virus databases and scripted updates If fresh clam was compiled without GMP support it will display SECURITY WARN ING NO SUPPORT FOR DIGITAL SIGNATURES on every update You can download GNU MP at http www Swox com gmp A note for Solaris SPARC users you must set the ABI system variable to 32
14. ad the database from The default database mirror is database clamav net but multiple directives are allowed In or der to download the database from the closest mirror you should configure freshclam to use db xx clamav net where xx represents your country code For example if your server is in Ascension Island you should have the following lines included in freshclam conf DNSDatabaseInfo current cvd clamav net DatabaseMirror db ac clamav net DatabaseMirror database clamav net The second entry acts as a fallback in case the connection to the first mirror fails for some reason The full list of two letters country codes is available at http www iana org cctld cctld whois htm 5 Usage 5 1 Clam daemon clamd is a multi threaded daemon that uses libclamav to scan files for viruses It may work in one or both modes listening on e Unix local socket e TCP socket The daemon is fully configurable via the clamd conf file P clamd recognizes the following commands e PING Check the daemon s state should reply with PONG e VERSION Print program and database versions e RELOAD Reload the databases man 5 clamd conf 5 Usage 14 e SHUTDOWN Perform a clean exit e SCAN file directory Scan file or directory recursively with archive support enabled a full path is required e RAWSCAN file directory Scan file or directory recursively with archive and special file support disabled a full path is req
15. al support documentation good ideas e lan Abbott lt abbotti mev co uk gt e Clint Adams lt schizo debian org gt e Sergey Y Afonin lt asy kraft s ru gt e Robert Allerstorfer lt roal anet at gt e Claudio Alonso lt cfalonso yahoo com gt e Kevin Amorin lt kamorin ccs neu edu gt e Kamil Andrusz lt wizz mniam net gt e Tayfun Asker lt tasker metu edu tr gt e Jean Edouard Babin lt Jeb jeb com fr gt e Marc Baudoin lt babafou babafou eu org gt e Scott Beck sbeck gossamer threads com e Rolf Eike Beer eike mail math uni mannheim de e Rene Bellora lt rbellora tecnoaccion com ar gt e Carlo Marcelo Arenas Belon carenas sajinet com pe e Joseph Benden lt joe thrallingpenguin com gt e Hilko Bengen bengen vdst ka inka de e Hank Beatty lt hbeatty starband net gt e Alexandre Biancalana lt ale seudns net gt e Patrick Bihan Faou lt patrick mindstep com gt e Martin Blapp lt mb imp ch gt e Dale Blount dale velocity net e Serge van den Boom svdb stack nl LibClamAV e Oliver Brandmueller ob e Gitt NET e Boguslaw Brandys brandys o2 pl e Igor Brezac lt igor ipass net gt e Mike Brudenell lt pmb1 york ac uk gt e Brian Bruns bruns 2mbit com e Len Budney 1budney pobox com e Matt Butt mattb cre8tiv com e Christopher X Candreva chris westnet com e Eric I Lopez Carreon lt elopezc technitrade com gt e Ales Casar lt casar uni mb si gt e Jonatha
16. can lose access to protected files until the system is restarted e Never protect the directory your mail scanner software uses for attachment un packing Access to all infected files will be automatically blocked and the scanner including clama will not be able to detect any viruses In the result all infected mails may be delivered For example to protect the whole system add the following lines to clamd conf lamukoScanOnAccess lamukoIncludePath amukoExcludePath proc amukoExcludePath temporary dir of your mail scanning software 300 0 You can also use clamuko to protect files on Samba Netatalk but a far more better and safe idea is to use the samba vscan module NFS is not supported because Dazuko doesn t intercept NFS access calls 5 4 Output format 5 4 1 clamscan clamscan writes all regular program messages to stdout and errors warnings to stderr You can use the option stdout to redirect all program messages to stdout Warnings and error messages from 1ibclamav are always printed to stderr A typical output from clamscan looks like this tmp test removal tool exe Worm Sober FOUND tmp test md5 o OK tmp test blob c OK 3 Usage tmp test message c OK tmp test error hta VBS Inor D FOUND When a virus is found its name is printed between the ilename and FOUND strings In case of archives the scanner depends on libclamav and only prints the first virus found within an archive zo
17. e received a copy of the GNU General Public License along with this program if not write to the Free Software Foundation Inc 51 Franklin Street Fifth Floor Boston MA 02110 1301 USA ClamAV and Clam AntiVirus are trademarks of Sourcefire Inc Introduction Su 1 Introduction Clam AntiVirus is an open source GPL anti virus toolkit for UNIX designed espe cially for e mail scanning on mail gateways It provides a number of utilities including a flexible and scalable multi threaded daemon a command line scanner and advanced tool for automatic database updates The core of the package is an anti virus engine available in a form of shared library 1 1 Features e Licensed under the GNU General Public License Version 2 e POSIX compliant portable e Fast scanning e Supports on access scanning Linux and FreeBSD only e Detects over 400 000 viruses worms and trojans including Microsoft Office macro viruses mobile malware and other threats e Scans within archives and compressed files also protects against archive bombs built in support includes Zip including SFX RAR including SEX ARJ including SFX Tar Gzip Bzip2 MS OLE2 MS Cabinet Files including SFX MS CHM Compiled HTML MS SZDD compression format BinHex SIS SymbianOS packages Autolt e Supports Portable Executable 32 64 bit files compressed or obfuscated with Introduction E AsPack
18. eannenot wanadoo fr e Per Jessen lt per computer org gt e Dave Jones dave kalkbay co za e Jesper Juhl juhl dif dk e Kamil Kaczkowski kamil kamil eisp pl e Alex Kah lt alex narfonix com gt e Stefan Kaltenbrunner lt stefan kaltenbrunner cc gt e Lloyd Kamara lt 1 kamara imperial ac uk gt e Stefan Kanthak lt stefan kanthak fujitsu siemens com gt e Kazuhiko lt kazuhiko fdiary net gt e Jeremy Kitchen kitchen scriptkitchen com e Tomasz Klim tomek euroneto pl e Robbert Kouprie robbert exx nl e Martin Kraft martin kraft fal de e Petr Kristof lt Kristof P fce vutbr cz gt e Henk Kuipers henk opensourcesolutions nl e Nigel Kukard nkukard lbsd net e Eugene Kurmanin lt smfs users sourceforge net gt e Dr Andrzej Kurpiel akurpiel mat uni torun pl e Mark Kushinsky mark mdspc com e Mike Lambert lt l1ambert 3eol com gt e Thomas Lamy Thomas Lamy in online net e Stephane Leclerc lt sleclerc aliastec net gt e Marty Lee lt marty maui co uk gt LibClamAV e Dennis Leeuw dleeuw made it com e Martin Lesser admin debian bettercom de e Peter N Lewis lt peter stairways com au gt e Matt Leyda mfleyda e one com e James Lick lt jlick drivel com gt e Jerome Limozin jerome limozin net e Mike Loewen lt mloewen sturgeon cac psu edu gt e Roger Lucas lt roger planbit co uk gt e David Luyer david luyer pacific net au e Richard Lyons lt fr
19. endrik Muhs Hendrik Muhs student uni magdeburg de e Simon Munton lt simon munton demon co uk gt e Farit Nabiullin http program farit ru e Nemosoft Unv nemosoft smcc demon nl e Wojciech Noworyta wnow konarski edu pl e Jorgen Norgaard lt jnp anneli dk gt e Fajar A Nugraha lt fajar telkom co id gt LibClamAV e Joe Oaks lt joe oaks hp com gt e Washington Odhiambo wash wananchi com e Masaki Ogawa proc mac com e John Ogness lt jogness antivir de gt e Phil Oleson oz nixil net e Jan Ondrej lt ondrejj salstar sk gt e Martijn van Oosterhout kleptog svana org e OpenAntiVirus Team http www OpenAntiVirus org e Tomasz Papszun tomek lodz tpsa pl e Eric Parsonage eric eparsonage com e Oliver Paukstadt pstadt stud fh heilbronn de e Christian Pelissier lt Christian Pelissier onera fr gt e Rudolph Pereira rudolph usyd edu au e Dennis Peterson dennispe inetnw com e Ed Phillips ed UDel Edu e Andreas Piesk Andreas Piesk heise de e Mark Pizzolato clamav devel subscriptions pizzolato net e Dean Plant lt dean plant roke co uk gt e Alex Pleiner lt pleiner zeitform de gt e Ant La Porte ant dvere net e Jef Poskanzer jef acme com e Christophe Poujol Christophe Poujol atosorigin com e Sergei Pronin sp finndesign fi e Thomas Quinot thomas cuivre fr eu org e Ed Ravin eravin panix com LibClamAV e Robert Rebbun
20. gine NULL unsigned int sigs 0 int ret ret cl load cl retdbdir amp engine amp sigs CL DB STDOPT 6 3 3 Error handling Use c1 strerror to convert error codes into human readable messages The function returns a statically allocated string if ret printf cl load error s n cl strerror ret exit 1 8Remember to initialize the virus counter variable with 0 6 LibClamAV EN 6 3 4 Engine structure When all required databases are loaded you should prepare the detection engine by calling c1 build In the case of failure you should free the memory occupied by the engine with cl free int cl build struct cl engine engine void cl free struct cl engine engine In our example if ret cl build engine printf cl build error s n cl strerror ret cl free engine exit 1 6 4 Database reloading The most important thing is to keep the internal instance of the database up to date You can watch database changes with the cl stat family of functions int cl statinidir const char dirname struct cl stat dbstat int cl statchkdir const struct cl stat dbstat int cl statfree struct cl stat dbstat Initialization struct cl stat dbstat memset amp dbstat 0 sizeof struct cl stat cl statinidir dbdir amp dbstat To check for a change you just need to call cl statchkdir and check its return value 0 no change 1 some change occured if cl statc
21. he default configuration file The format and options of this file are fully described in the clamd conf 5 manual The config file is well commented and configuration should be straightforward 4 1 1 On access scanning One of the interesting features of clamd is on access scanning based on the Dazuko module available from http dazuko org This module is not required to run clamd furthermore you shouldn t run Dazuko on production systems At the moment Dazuko is avaliable for Linux and FreeBSD but the following information only covers Linux tar zxpvf dazuko a b c tar gz cd dazuko a b c make dazuko or make dazuko smp for smp kernels su insmod dazuko o cp dazuko o lib modules uname r misc depmod a Depending on your Linux distribution you may need to add a dazuko entry to etc modules or run the module during system s startup by adding sbin modprobe dazuko to some startup file You must also create a new device 4 Configuration KO cat proc devices grep dazuko 254 dazuko su c mknod m 600 dev dazuko c 254 0 Now configure Clamuko in clamd conf and read the 5 3 section 4 2 clamav milter Nigel Horne s clamav milter is a very efficient email scanner designed for Send mail It s written entirely in C and only depends on 1ibclamav or clamd You can find detailed installation instructions in the INSTALL file that comes with the clamav milter sources Basically to connect it
22. hkdir amp dbstat 1 reload database cl statfree amp dbstat 6 LibClamAV 22 cl statinidir cl retdbdir amp dbstat Remember to reset the cl stat structure after reload 6 4 1 Data scan functions It s possible to scan a file or descriptor using int cl scanfile const char filename const char virname unsigned long int scanned const struct cl engine engine const struct cl limits limits unsigned int options int cl scandesc int desc const char virname unsigned long int scanned const struct cl engine engine const struct cl limits limits unsigned int options Both functions will store a virus name under the pointer virname the virus name is part of the engine structure and must not be released directly If the third argument scanned 1s not NULL the functions will increase its value with the size of scanned data in CL COUNT PRECISION units Both functions have support for archive limits in order to protect against Denial of Service attacks struct cl limits unsigned long int maxscansize during the scanning of archives this size will never be exceeded Wi unsigned long int maxfilesize compressed files will only be decompressed and scanned up to this size Wi unsigned int maxreclevel maximum recursion level for archives unsigned int maxfiles maximum number of files to be scanned within a single archive Ki unsigned short archivememlim
23. ically enables the unit tests if it finds the check framework however it doesn t consider it a fatal error if unit tests cannot be enabled 3 Ins tallation EJ Unit tests disabled in this build Use configure nable check to enable them SKIP check clamav PASS check clamd sh PASS check freshclam sh PASS check sigtool sh PASS check clamscan sh All 4 tests passed 1 tests were not run Runni 3 7 ng configure enable check should tell you why Reporting a unit test failure bug If make check says that some tests failed we encourage you to report a bug on our bugzilla http bugs clamav net The information we need is see also http clamav net bugs The exact output from make check Output of uname mrsp your config log The following files from the unit tests directory test log clamscan log clamdscan log tmp clamd test log if it exists where and how you installed the check package Output of pkg config check cflags libs Optionally if valgrindis available on your platform the output of the following make check CK FORK no libtool mode execute valgrind unit tests check clamav 4 Configuration KO 4 Configuration 4 1 clamd Before you start using the daemon you have to edit the configuration file in other case clamd won t run clamd ERROR Please edit the example config file etc clamd conf This shows the location of t
24. lt e SearchMain http www searchmain com e Olivier Silber e Fernando Augusto Medeiros Silva http www linuxplace com br e Sollentuna Fria Gymnasium Sweden http www sfg se e StarBand http www starband com e Stroke of Color Inc e Synchro Sistemas de Informacao http synchro com br e Sahil Tandon e The Spamex Disposable Email Address Service http www spamex com e Brad Tarver e TGT Tampermeier amp Grill Steuerberatungs und Wirtschaftstreuhand OEG http www tgt at e Per Reedtz Thomsen e William Tisdale e Up Time Technology http www uptimetech com e Ulfi 7 Core Team 42 e Jeremy Vanderburg http www jeremytech com e Web arbyte Online Marketing http www webarbyte de e Webzone Srl http www webzone it e Markus Welsch http www linux corner net e Julia White http www convert tools com e Nicklaus Wicker e David Williams http kayakero net e Glenn R Williams e Kelly Williams e XRoads Networks http xroadsnetworks com e Zimbra open source collaboration suite http www zimbra com 6 8 Graphics The ClamAV logo was created by Mia Kalenius and Sergei Pronin from Finndesign http www finndesign fi 6 9 OpenAntiVirus Our database includes the virus database about 7000 signatures from OpenAntiVirus http OpenAntiVirus org 7 Core Team e aCaB acab clamav net Italy Role virus database maintainer coder e
25. n Chen lt jon clamav spock org gt e Andrey Cherezov lt andrey cherezov koenig su gt e Alex Cherney alex cher id au e Tom G Christensen tgc statsbiblioteket dk e Nicholas Chua nicholas ncmbox net e Chris Conn cconn abacom com e Christoph Cordes lt ib precompiled de gt e Ole Craig lt olc cs umass edu gt e Eugene Crosser crosser rol ru e Calin A Culianu calin ajvar org e Damien Curtain damien pagefault org e Krisztian Czako slapic linux co hu e Diego d Ambra da softcom dk e Michael Dankov misha btrc ru e Yuri Dario mc6530 mclink it LibClamAV e David djgardner users sourceforge net e Maxim Dounin mdounin rambler co ru e Alejandro Dubrovsky lt s328940 student uq edu au gt e James P Dugal lt jpd louisiana edu gt e Magnus Ekdahl lt magnus debian org gt e Mehmet Ekiz lt ekizm tbmm gov tr gt e Jens Elkner lt elkner linofee org gt e Fred van Engen lt fred wooha org gt e Jason Englander lt jason englanders cc gt e Oden Eriksson oeriksson mandrakesoft com e Daniel Fahlgren lt fahlgren ardendo se gt e Andy Fiddaman lt af jeamland org gt e Edison Figueira Junior lt edison brc com br gt e David Ford lt david cert blue labs org gt e Martin Forssen maf appgate com e Brian J France list firehawksystems com e Free Oscar lt freeoscar wp pl gt e Martin Fuxa yeti email cz e Piotr Gackiewicz lt gacek intertele pl gt
26. ob clamav webcentral com au gt e David S Madole david madole net e Thomas Madsen lt tm softcom dk gt e Bill Maidment bill maidment com au e Joe Maimon jmaimon ttec com e David Majorel dm 1agoon nc e Andrey V Malyshev amal krasn ru e Fukuda Manabu fukuda cri mw co jp e Stefan Martig sm officeco ch e Alexander Marx lt mad ml madness at gt e Andreas Marx http www av test org e Chris Masters lt cmasters insl co uk gt e Fletcher Mattox lt fletcher cs utexas edu gt e Serhiy V Matveyev matveyev uatele com e Reinhard Max max suse de e Brian May lt bam debian org gt LibClamAV e Ken McKittrick k1mac usadatanet com e Chris van Meerendonk cvm castel nl e Andrey J Melnikoff temnota kmv ru e Damian Menscher menscher uiuc edu e Denis De Messemacker ddm clamav net e Jasper Metselaar jasper formmailer net e Arkadiusz Miskiewicz lt misiek pld linux org gt e Ted Mittelstaedt tedm toybox placo com e Mark Mielke lt mark mark mielke cc gt e John Miller contact glideslopesoftware co uk e Jo Mills Jonathan Mills frequentis com e Dustin Mollo lt dustin mollo sonoma edu gt e Remi Mommsen lt remigius mommsen cern ch gt e Doug Monroe doug planetconnect com e Alex S Moore lt asmoore edge net gt e Tim Morgan lt tim sentinelchicken org gt e Dirk Mueller lt mueller kde org gt e Flinn Mueller lt flinn activeintra net gt e H
27. ous obfuscators encoders files vulnerable to security risks such as e JPEG exploit detection RIFF exploit detection e uuencode e ScrEnc obfuscation CryptFF 6 3 API 6 3 1 Header file Every program using libclamav must include the header file clamav h include lt clamav h gt 6 3 2 Database loading The following set of functions provides an interface for loading the virus database const char cl_retdbdir void int cl_load const char path struct cl_engine engine unsigned int signo unsigned int options 6 LibClamAV EJ cl retdbdir returns the default hardcoded path to the directory with ClamAV databases cl load loads a single database file or all databases from a directory if path points to a directory The second argument is used for passing in the engine structure which should be previously initialized with NULL A number of loaded signatures will be added to signo The last argument can pass the following flags e CL DB STDOPT This is an alias for a recommended set of scan options e CL DB PHISHING Load phishing signatures e CL DB PHISHING URLS Initialize the phishing detection module and load wdb and pdb files e CL DB PUA Load signatures for Potentially Unwanted Applications e CL DB CVDNOTMP Load CVD files directly without unpacking them into a temporary directory cl loadreturns 0 CL SUCCESS on success and a negative value on failure struct cl engine en
28. rsion checks through DNS proxy servers with authentication digital signatures and various error scenarios Quick test run freshclam as superuser with no parameters and check the output If every thing is OK you may create the log file in var log owned by clamav or another user freshclam will be running as touch var log freshclam log chmod 600 var log freshclam log chown clamav var log freshclam log Now you should edit the configuration file freshclam conf and point the UpdateLog File directive to the log file Finally to run freshclam in the daemon mode execute freshclam d The other way is to use the cron daemon You have to add the following line to the crontab of root or clamav user N usr local bin freshclam quiet to check for a new database every hour N should be a number between 3 and 57 of your choice Please don t choose any multiple of 10 because there are already too many clients using those time slots Proxy settings are only configurable via the configuration file and freshclam will require strict permission settings for the config file when HTTPProxyPassword is turned on PProxyServer myproxyserver com TPProxyPort 1234 PProxyUsername myusernam PProxyPassword mypass di Hi Hi RH 5 Usage 13 4 4 1 Closest mirrors The DatabaseMi rror directive in the config file specifies the database server freshclam will attempt up to MaxAttempts times to downlo
29. rus protection into your soft ware The library is thread safe and transparently recognizes and scans within archives mail files MS Office document files executables and other special formats 6 1 Licence Libclamav is licensed under the GNU GPL v2 licence This means you are not allowed to link commercial close source applications against it All software using libclamav must be GPL compliant 6 2 Supported formats 6 2 1 Executables The library has a built in support for 32 64 bit Portable Executable files and 32 bit ELF files Additionally it can handle PE files compressed or obfuscated with the following tools Aspack 2 12 UPX all versions FSG 1 3 1 31 1 33 2 0 Petite 2 x PeSpin 1 1 7You can still use clamd or clamscan instead 6 LibClamAV NsPack wwpack32 1 20 MEW Upack YOda Cryptor 1 3 6 2 2 Mail files Libclamav can handle almost every mail file format including TNEF winmail dat at tachments 6 2 3 Archives and compressed files The following archive and compression formats are supported by internal handlers Zip 4 SFX RAR SEX Tar Gzip Bzip2 MS OLE2 MS Cabinet Files SFX MS CHM Compiled HTML MS SZDD compression format BinHex SIS SymbianOS packages Autolt 6 LibClamAV 19 6 2 4 Documents The most popular file formats are supported e MS Office and MacOffice files e RTF e PDF e HTML 6 2 5 Others Libclamav can handle vari
30. s installed into the usr local directory and the config files into etc WARNING Never enable the SUID or SGID bits for Clam AntiVirus binaries 3 Installation EJ 3 5 Compilation with clamav milter enabled libmilter and its development files are required To enable clamav milter configure ClamAV with configure enable milter 3 6 Running unit tests ClamAV includes unit tests that allow you to test that the compiled binaries work cor rectly on your platform The first step is to use your OS s package manager to install the check package If your OS doesn t have that package you can download it from http check sourceforge net build it and install it To help clamav s configure script locate check it is recommended that you install pkg config preferably using your OS s package manager or from http pkg config freedesktop org The recommended way to run unit tests is the following which ensures you will get an error if unit tests cannot be built configure nable check make make check When make check is finished you should get a message similar to this If a unit test fails you get a message similar to the following See the next section on how to report a bug when a unit test fails 1 of 5 tests failed Please report to http bugs clamav net If unit tests are disabled and you didn t use enable check you will get this mes sage The configure script in ClamAV automat
31. tion e CL SCAN ALGORITHMIC Enable algorithmic detection of viruses 6 LibClamAV 24 e CL_SCAN_PHISHING_BLOCKSSL Phishing module always block SSL mismatches in URLs e CL SCAN PHISHING BLOCKCLOAK Phishing module always block cloaked URLs All functions return 0 CL CLEAN when the file seems clean CL VIRUS when a virus is detected and another value on failure struct cl limits limits const char virname memset amp limits 0 sizeof struct cl limits limits maxfiles 10000 limits maxscansize 100 1048576 100 MB limits maxfilesize 10 1048576 10 MB limits maxreclevel 16 if ret cl scanfile tmp test exe amp virname NULL engine amp limits CL STDOPT CL VIRUS printf Virus detected s n virname else printf No virus detected n if ret CL_CLEAN printf Error s n cl strerror ret 6 4 Memory Because the engine structure occupies a few megabytes of system memory you should release it with cl free if you no longer need to scan files 6 4 3 Forking daemons If you re using libclamav with a forking daemon you should call srand inside a forked child before making any calls to the libclamav functions This will avoid possi ble collisions with temporary filenames created by other processes of the daemon This procedure is not required for multi threaded daemons 6 LibClamAV EJ 6 4 4 clamav config
32. uired e CONTSCAN file directory Scan file or directory recursively with archive support enabled and don t stop the scanning when a virus is found e MULTISCAN file directory Scan file in a standard way or scan directory recursively using multiple threads to make the scanning faster on SMP machines e STREAM Scan stream clamd will return a new port number you should connect to and send data to scan e SESSION END Start end a clamd session you can do multiple commands per TCP session WARNING due to the clamd implementation the RELOAD command will break the session and reacts on the special signals e SIGTERM perform a clean exit e SIGHUP reopen the log file e SIGUSR2 reload the database 5 2 Clamdscan clamdscan is a simple clamd client In many cases you can use it as a clamscan replacement however you must remember that e it only depends on clamd e although it accepts the same command line options as clamscan most of them are ignored because they must be enabled directly in clamd i e clamd conf 5 Usage Kg e scanned files must be accessible for clamd e it can t use external unpackers 5 3 Clamuko Clamuko is a special thread in clamd that performs on access scanning under Linux and FreeBSD and shares internal virus database with the daemon You must follow some important rules when using it e Always stop the daemon cleanly using the SHUTDOWN command or the SIGTERM signal In other case you
33. w 2good nu e Philip Ershler e Explido Software USA Inc http www explido us e David Farrick e Jim Feldman e Petr Ferschmann http petr ferschmann cz e Andries Filmer http www netexpo nl e The Free Shopping Cart people http www precisionweb net e Paul Freeman e Jack Fung e Stephen Gageby e Paolo Galeazzi e GANDI http www gandi net e Jeremy Garcia http www linuxquestions org e GBC Internet Service Center GmbH http www gbc net e GCS Tech http www gcstech net e GHRS http www ghrshotels com e Lyle Giese e Todd Goodman e Bill Gradwohl http www ycc com LibClamAV e Grain of Salt Consulting e Terje Gravvold e Hart Computer http www hart co jp e Pen Helm e Hosting Metro LLC http www hostingmetro com e IDEAL Software GmbH http www IdealSoftware com e Industry Standard Computers http www ISCnetwork com e Interact2Day http www interact2day com e Invisik Corporation http www invisik com e itXcel Internet Domain Registration http www itxcel com e Craig Jackson e Stuart Jones e Jason Judge e Keith http www textpad com e Ewald Kicker http www very clever com e Brad Koehn e Christina Kuratli http www virusprotect ch e Logic Partners Inc http www logicpartners com e Mark Lotspaih http www lotcom org e Michel Machado http oss digirati com br e Olivier Marechal e Matthew McKenzie
34. with Sendmail add the following lines to etc mail sendmail mc INPUT MAIL FILTER clmilter S local var run clamav clmilter sock F T S 4m R 4m dnl define confINPUT MAIL FILTERS clmilter If you re running it in external mode check entry in clamd conf of the form LocalSocket var run clamav clamd sock Start clamav milter usr local sbin clamav milter lo var run clamav clmilter sock and restart sendmail 4 3 Testing Try to scan recursively the source directory clamscan r 1 scan txt clamav x yz It should find some test files in the clamav x yz test directory The scan result will be saved in the scan txt log file 5 To test clama start it and use clamdscan or instead connect directly to its socket and run the SCAN command clamdscan 1 scan txt clamav x yz Please note that the scanned files must be accessible by the user running clamd or you will get an error gt To get more info on clamscan options run man clamscan 4 Configuration 12 4 4 Setting up auto updating freshclam is the automatic database update tool for Clam AntiVirus It can work in two modes e interactive on demand from command line e daemon silently in the background freshclam is advanced tool it supports scripted updates instead of transferring the whole CVD file at each update it only transfers the differences between the latest and the current database via a special script database ve
35. z mat uni torun pl e Joe Talbott lt josepht cstone net gt e Gernot Tenchio g tenchio telco tech de e Masahiro Teramoto lt markun onohara to gt e Daniel Theodoro dtheodoro ig com br e Ryan Thompson clamav sasknow com e Gianluigi Tiesi lt sherpya netfarm it gt e Yar Tikhiy lt yar comp chem msu su gt e Andrew Toller lt atoller connectfree co uk gt e Michael L Torrie torriem chem byu edu e Trashware trashware gmx net e Matthew Trent mt rent localaccess com e Reini Urban lt rurban x ray at gt e Daniel Mario Vega lt dv5a dc uba ar gt e Denis Vlasenko lt vda ilport com ua gt e Laurent Wacrenier lwa teaser fr e Charlie Watts cewatts brainstorminternet net e Florian Weimer lt fw deneb enyo de gt 6 LibClamAV 6 7 Paul Welsh paul welshfamily com Nicklaus Wicker n wicker cnk networks de David Woakes david mitredata co uk Troy Wollenslegel troy intranet org ST Wong st wong cuhk edu hk Dale Woolridge lt dwoolridge drh net gt David Wu dyw iohk com Takumi Yamane lt yamtak b session com gt Youza Youzovic youza post cz Anton Yuzhaninov citrin rambler co ru Leonid Zeitlin 1z europe com ZMan Z x86zman go a way dyndns org Andoni Zubimendi andoni lpsat net Donors We ve received financial support from in alphabetical order ActiveIntra net Inc http www activeintra net Advance Healthcare Group http www ahgl

Download Pdf Manuals

image

Related Search

Related Contents

2124ZRCB 2126ZRCB 2148ZRCB 2160ZRCB 2172ZRCB  MR-MQ100 - Quick-Start Guide A  (utilisation éponge comme tampon.pub)  EPOXY BOND R  俄罗斯 x-90 LED Spot说明书-V2  BioSealer  Franke FCT 300 AS PW L A++  Hawking Technology HNAS1 User's Manual  MIDI KEYBDAHD CDNTF`IIÏJLLEH Mode d`emploi  Katalog-Download  

Copyright © All rights reserved.
Failed to retrieve file