layout | title | published | tags | ||
---|---|---|---|---|---|
post |
clamav - install and configure on mac osx |
true |
|
Install clamav via homebrew
$ brew install clamav
Check the clamav config directory
$ ls /usr/local/etc/clamav
Create a minimum config (freshclam.conf
) for the definition update command freshclam
$ echo "DNSDatabaseInfo current.cvd.clamav.net\nDatabaseMirror database.clamav.net" > /usr/local/etc/clamav/freshclam.conf
Update freshclam virus definitions
$ freshclam
Scan your own users Downloads folder (takes some time to startup)
$ clamscan --infected --recursive ~/Downloads
----------- SCAN SUMMARY -----------
Known viruses: 6736785
Engine version: 0.102.2
Scanned directories: 32
Scanned files: 85
Infected files: 0
Data scanned: 2.41 MB
Data read: 1.65 MB (ratio 1.46:1)
Time: 18.931 sec (0 m 18 s)
Scan your files, create a logfile and move bad filtes to a quarantine folder
$ clamscan -r --log=~/clamav/log/scan.log --move=~/clamav/quarantine ~/Downloads
... or use the clamd demon for faster scanning.
Add a minimal config for clamd
$ echo "LocalSocket /tmp/clamd.socket" > /usr/local/etc/clamav/clamd.conf
Start the clamd
demon (takes some seconds)
$ clamd
Check if the clamd demon is running (end with 'q')
$ clamdtop
Use the clamdscan
command instead of the clamscan
command
$ clamdscan ~/Downloads
/Users/derfichtl/Downloads: OK
----------- SCAN SUMMARY -----------
Infected files: 0
Time: 1.298 sec (0 m 1 s)
Instead of using echo for creating freshclam.conf use this:
cat <<EOF | tee /usr/local/etc/clamav/freshclam.conf
DNSDatabaseInfo current.cvd.clamav.net
DatabaseMirror database.clamav.net
EOF
That will always work.