<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[iRedMail — [Tutorial] Increasing ClamAV effectiveness]]></title>
		<link>https://forum.iredmail.org/topic12749-tutorial-increasing-clamav-effectiveness.html</link>
		<atom:link href="https://forum.iredmail.org/feed-rss-topic12749.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [Tutorial] Increasing ClamAV effectiveness.]]></description>
		<lastBuildDate>Fri, 04 Sep 2020 14:20:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post76452.html#p76452</link>
			<description><![CDATA[<p>I now just realized that a lot of the settings now ships by default with iredmail ! Thanks Zhang !</p>]]></description>
			<author><![CDATA[null@example.com (Quack66)]]></author>
			<pubDate>Fri, 04 Sep 2020 14:20:17 +0000</pubDate>
			<guid>https://forum.iredmail.org/post76452.html#p76452</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post76451.html#p76451</link>
			<description><![CDATA[<p>Updated for iredmail 1.3.1 and Ubuntu 20.01 !</p>]]></description>
			<author><![CDATA[null@example.com (Quack66)]]></author>
			<pubDate>Fri, 04 Sep 2020 14:10:38 +0000</pubDate>
			<guid>https://forum.iredmail.org/post76451.html#p76451</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56541.html#p56541</link>
			<description><![CDATA[<p><strong>Updates:</strong><br />- Removed SecurityInfo from the list of DBs since they are no longer hosted on SaneSecurity. Check their website <a href="https://www.securiteinfo.com/services/anti-spam-anti-virus/improve-detection-rate-of-zero-day-malwares-for-clamav.shtml">here</a> to add their DB. You will need to register</p><p>- Removed Malware patrol since the you need to register for free version and they are no longer hosted on SaneSecurity</p>]]></description>
			<author><![CDATA[null@example.com (Quack66)]]></author>
			<pubDate>Wed, 31 May 2017 18:45:30 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56541.html#p56541</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56465.html#p56465</link>
			<description><![CDATA[<div class="quotebox"><cite>awkpavo wrote:</cite><blockquote><p>Would also be nice to an alternative for the Sanesecurity hosted signatures. Just so you have a choice once Sanesecurity decides to charge for it, etc.</p></blockquote></div><p>Copying the Sanesecurity files and hosting on your own server doesn&#039;t change the fact: you use their work, but return nothing.</p>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Mon, 29 May 2017 05:30:04 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56465.html#p56465</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56446.html#p56446</link>
			<description><![CDATA[<div class="quotebox"><cite>Quack66 wrote:</cite><blockquote><p>======================== Required information ====<br />- iRedMail version (check /etc/iredmail-release): 0.9.6 <br />- Linux/BSD distribution name and version: Ubuntu 16.04 LTS<br />- Store mail accounts in which backend (LDAP/MySQL/PGSQL):&nbsp; PGSQL<br />- Web server (Apache or Nginx): Apache<br />- Manage mail accounts with iRedAdmin-Pro? Yes<br />- [IMPORTANT] Related original log or error message is required if you&#039;re experiencing an issue.<br />====</p><p>As you probably know, Clamav is fine as an AV but is not on-par with paid commercial product and sometime viruses can slip through.</p></blockquote></div><p>Thanks to Quack66, the OP, for this tutorial - it worked well for me !</p>]]></description>
			<author><![CDATA[null@example.com (martinveasey)]]></author>
			<pubDate>Fri, 26 May 2017 13:56:16 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56446.html#p56446</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56435.html#p56435</link>
			<description><![CDATA[<p>Would also be nice to an alternative for the Sanesecurity hosted signatures. Just so you have a choice once Sanesecurity decides to charge for it, etc.</p>]]></description>
			<author><![CDATA[null@example.com (awkpavo)]]></author>
			<pubDate>Thu, 25 May 2017 13:41:44 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56435.html#p56435</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56393.html#p56393</link>
			<description><![CDATA[<p>Hey Zhang,</p><p>I think those points are all valid. In my opinion the best way to approach this is maybe not to add it to the base but instead add a doc on how to do so with a disclaimer at the top.</p><p>Like Serge said, anyone maintaining their own server can integrate this easily.</p><p>Regards</p>]]></description>
			<author><![CDATA[null@example.com (Quack66)]]></author>
			<pubDate>Wed, 24 May 2017 12:42:57 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56393.html#p56393</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56391.html#p56391</link>
			<description><![CDATA[<p>IMHO people who really want to maintain his servers are able to integrate such services by himself. And IMHO your decision is right.</p>]]></description>
			<author><![CDATA[null@example.com (SergeAv)]]></author>
			<pubDate>Wed, 24 May 2017 11:41:56 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56391.html#p56391</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56387.html#p56387</link>
			<description><![CDATA[<p>According to the Donate page of Sanesecurity website, I&#039;m hesitate to integrate them:<br /><a href="http://sanesecurity.com/donate/">http://sanesecurity.com/donate/</a></p><p>iRedMail has few hundred deployments every day, i believe 99.9% users will NOT notice that Sanesecurity asks for a donation for personal and commercial use (it&#039;s free to use, but a donation is appreciated). So our integration brings them nothing, except network traffic and possible workload.</p><p>Any suggestions?</p>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Wed, 24 May 2017 09:39:10 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56387.html#p56387</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56380.html#p56380</link>
			<description><![CDATA[<p>clamdscan command use ClamAV daemon. In my case to enable SaneSecurity signatures to check I was need to set </p><div class="codebox"><pre><code>OfficialDatabaseOnly  no</code></pre></div><p> in clamd.conf<br />Thanks a lot to topicstarter for a useful idea!</p>]]></description>
			<author><![CDATA[null@example.com (SergeAv)]]></author>
			<pubDate>Wed, 24 May 2017 07:33:58 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56380.html#p56380</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56373.html#p56373</link>
			<description><![CDATA[<p>Amavisd is configured to pipe email to ClamAV socket, not running clam* commands directly.</p>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Wed, 24 May 2017 03:18:29 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56373.html#p56373</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56355.html#p56355</link>
			<description><![CDATA[<p>Dear <strong>ZhangHuangbin</strong>, is IRedMail use the <em>clamscan</em> command to check mail or <em>clamdscan</em>?<br />In my system (IRedMail-0.9.6, CentOS 6.7, MySQL) it shows different results:<br /></p><div class="codebox"><pre><code># clamdscan test.msg
/tmp/test.msg: OK

----------- SCAN SUMMARY -----------
Infected files: 0
Time: 0.001 sec (0 m 0 s)</code></pre></div><p>or<br /></p><div class="codebox"><pre><code># clamscan test.msg
test.msg: Sanesecurity.TestSig_Type3_Bdy.4.UNOFFICIAL FOUND

----------- SCAN SUMMARY -----------
Known viruses: 6449849
Engine version: 0.99.2
Scanned directories: 0
Scanned files: 1
Infected files: 1
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 21.308 sec (0 m 21 s)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (SergeAv)]]></author>
			<pubDate>Tue, 23 May 2017 14:41:40 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56355.html#p56355</guid>
		</item>
		<item>
			<title><![CDATA[Re: [Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56275.html#p56275</link>
			<description><![CDATA[<p>Thanks for sharing, i will check the tutorials later to see whether we can integrate it into iRedMail directly. <img src="https://forum.iredmail.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (ZhangHuangbin)]]></author>
			<pubDate>Fri, 19 May 2017 09:01:14 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56275.html#p56275</guid>
		</item>
		<item>
			<title><![CDATA[[Tutorial] Increasing ClamAV effectiveness]]></title>
			<link>https://forum.iredmail.org/post56262.html#p56262</link>
			<description><![CDATA[<p><strong>Edit:</strong> Currently tested and working on iredmail 1.3.1 under Ubuntu 20.01</p><p>As you probably know, Clamav is fine as an AV but is not on-par with paid commercial product and sometime viruses can slip through.</p><p>There is a way to add custom signatures (Databases) that are maintained by 3rd parties to clam to increase detection rate on viruses and 0-days. This tutorial is how to configure this.</p><p>The folks over at <a href="http://sanesecurity.com/">SaneSecurity</a> are kind enough to host a bunch of different signatures that can be used with clam. Please do not abuse this service and consider making a donation.</p><p>They do offer a script to automatically configure everything but I don&#039;t recommend it since it might break your installation.</p><p>All the signatures can be found <a href="http://sanesecurity.com/usage/signatures/">here</a>. I&#039;ve created this tutorial using the main ones. Feel free to modify/remove or use different signatures.</p><p>First, make sure your clamav is setup correctly. Edit the file <strong>/etc/clamav/clamd.conf</strong> and make sure <strong>OfficialDatabaseOnly</strong> is set to <strong>false</strong><br />If not then change it and restart clamav<br /></p><div class="codebox"><pre><code>service clamav restart</code></pre></div><p>Then we need to use freshclam to automatically download the third party databases. Open the following file <strong>/etc/clamav/freshclam.conf</strong> and add this at the end:</p><div class="codebox"><pre><code> 
# Sanesecurity + Foxhole
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/junk.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/jurlbl.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/phish.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/rogue.hdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/sanesecurity.ftm
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/sigwhitelist.ign2
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/scam.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/spamimg.hdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/spamattach.hdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/blurl.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/foxhole_generic.cdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/foxhole_filename.cdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/foxhole_js.cdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/foxhole_js.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/foxhole_all.cdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/foxhole_all.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/foxhole_mail.cdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/malwarehash.hsb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/hackingteam.hsb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/badmacro.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/shelter.ldb

# winnow
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/winnow_malware.hdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/winnow_malware_links.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/winnow_phish_complete_url.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/winnow_extended_malware.hdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/winnow.attachments.hdb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/winnow_bad_cw.hdb

# Malware.expert
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/malware.expert.hdb

# bofhland
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/bofhland_cracked_URL.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/bofhland_malware_URL.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/bofhland_phishing_URL.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/bofhland_malware_attach.hdb

# Porcupine
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/porcupine.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/phishtank.ndb
DatabaseCustomURL http://ftp.swin.edu.au/sanesecurity/porcupine.hsb</code></pre></div><p>You then need to restart freshclam<br /></p><div class="codebox"><pre><code>service clamav-freshclam restart</code></pre></div><p>To make sure the databases were downloaded check your logs in <strong>/var/log/clamav/freshclam.log</strong>. <br />You should not have any errors before continuing.</p><p>We need to tell amavis to pass the whole message to clam so it could also scan things like the subject.<br />To do so, open the following file: <br /><strong>/etc/amavis/conf.d/50-user</strong> <br />and find the following lines:<br /></p><div class="codebox"><pre><code>@keep_decoded_original_maps = (new_RE(
    # let virus scanner (clamav) see full original message (can be slow)
    # this setting is required if we&#039;re going to use third-party clamav
    # signatures. for example, Sanesecurity signatures.
    # FYI: http://sanesecurity.com/support/signature-testing/
    #qr&#039;^MAIL$&#039;,
    qr&#039;^MAIL-UNDECIPHERABLE$&#039;, # same as ^MAIL$ if mail is undecipherable
    qr&#039;^(ASCII(?! cpio)|text|uuencoded|xxencoded|binhex)&#039;i,
    #qr&#039;^Zip archive data&#039;,     # don&#039;t trust Archive::Zip
));</code></pre></div><p>You need to uncomment the following line so just remove the &#039;#&#039; before:<br /></p><div class="codebox"><pre><code>#qr&#039;^MAIL$&#039;, </code></pre></div><p>Clam will now detect everything based on our custom signature. The issue is that right now it will not know what to do with it since some signatures are spam, malware or even whitelist. Still in the same file:<br /><strong>/etc/amavis/conf.d/50-user</strong><br />check if <strong>virus_name_to_spam_score_maps</strong> already exist. If not add the following before <strong>@av_scanners</strong><br /></p><div class="codebox"><pre><code># Mark Spam/Virus with third-party clamav signatures: SaneSecurity.
#   *) The order matters, first match wins. Set to &#039;undef&#039; to keep as infected
#   *) Anything declared as undefined will be marked as a virus
@virus_name_to_spam_score_maps =(new_RE(
    # SaneSecurity + Foxhole
    [ qr&#039;^Sanesecurity\.(Malware|Badmacro|Foxhole|Rogue|Trojan)\.&#039; =&gt; undef ],
    [ qr&#039;^Sanesecurity\.MalwareHash\.&#039;    =&gt; undef ],
    [ qr&#039;^Sanesecurity.TestSig_&#039;          =&gt; undef ],
    [ qr&#039;^Sanesecurity\.&#039;                 =&gt; 0.1 ],

    # winnow
    [ qr&#039;^winnow\.(Exploit|Trojan|malware)\.&#039;     =&gt; undef ],
    [ qr&#039;^winnow\.(botnet|compromised|trojan)&#039;    =&gt; undef ],
    [ qr&#039;^winnow\.(exe|ms|JS)\.&#039;                  =&gt; undef ],
    [ qr&#039;^winnow\.phish\.&#039;                        =&gt; 3.0 ],
    [ qr&#039;^winnow\.&#039;                               =&gt; 0.1 ],

    # bofhland
    [ qr&#039;^Bofhland\.Malware\.&#039;                    =&gt; undef ],
    [ qr&#039;^BofhlandMWFile&#039;                         =&gt; undef ],
    [ qr&#039;^Bofhland\.Phishing\.&#039;                   =&gt; 3.0 ],
    [ qr&#039;^Bofhland\.&#039;                             =&gt; 0.1 ],

    # porcupine.ndb
    [ qr&#039;^Porcupine\.(Malware|Trojan)\.&#039;          =&gt; undef ],
    [ qr&#039;^Porcupine\.(Junk|Spammer)\.&#039;            =&gt; 3.0 ],
    [ qr&#039;^Porcupine\.Phishing\.&#039;                  =&gt; 3.0 ],
    [ qr&#039;^Porcupine\.&#039;                            =&gt; 0.01 ],

    # phishtank.ndb
    [ qr&#039;^PhishTank\.Phishing\.&#039;                  =&gt; 3.0 ],

    # SecuriteInfo
    [ qr&#039;^SecuriteInfo\.com\.Spammer\.&#039;           =&gt; 3.0 ],

    # Others
    [ qr&#039;^Structured\.(SSN|CreditCardNumber)\b&#039;            =&gt; 0.1 ],
    [ qr&#039;^(Heuristics\.)?Phishing\.&#039;                       =&gt; 0.1 ],
    [ qr&#039;^(Email|HTML)\.Phishing\.(?!.*Sanesecurity)&#039;      =&gt; 0.1 ],
    [ qr&#039;^Email\.Spam\.Bounce(\.[^., ]*)*\.Sanesecurity\.&#039; =&gt; 0   ],
    [ qr&#039;^Email\.Spammail\b&#039;                               =&gt; 0.1 ],
    [ qr&#039;^MSRBL-(Images|SPAM)\b&#039;                           =&gt; 0.1 ],
    [ qr&#039;^VX\.Honeypot-SecuriteInfo\.com\.Joke&#039;            =&gt; 0.1 ],
    [ qr&#039;^VX\.not-virus_(Hoax|Joke)\..*-SecuriteInfo\.com(\.|\z)&#039; =&gt; 0.1 ],
    [ qr&#039;^Email\.Spam.*-SecuriteInfo\.com(\.|\z)&#039;          =&gt; 0.1 ],
    [ qr&#039;^Safebrowsing\.&#039;                                  =&gt; 0.1 ],
    [ qr&#039;^INetMsg\.SpamDomain&#039;                             =&gt; 0.1 ],
    [ qr&#039;^Doppelstern\.(Spam|Scam|Phishing|Junk|Lott|Loan)&#039;=&gt; 0.1 ],
    [ qr&#039;^ScamNailer\.&#039;                                    =&gt; 0.1 ],
    [ qr&#039;^HTML/Bankish&#039;                                    =&gt; 0.1 ],
    [ qr&#039;(-)?SecuriteInfo\.com(\.|\z)&#039;                     =&gt; undef ],
    [ qr&#039;^MBL_NA\.UNOFFICIAL&#039;                              =&gt; 0.1 ],
    [ qr&#039;^MBL_&#039;                                            =&gt; undef ],
));</code></pre></div><p>Note: I&#039;m setting the spam score to 30 to make sure they are set to spam even if they have other valid scores. Anything declared as <strong>undefined</strong> will be marked as a virus</p><p>To apply everything we need to restart amavis<br /></p><div class="codebox"><pre><code>service amavis restart</code></pre></div><p>That&#039;s it !</p><p>To test everything, follow the instructions <a href="http://sanesecurity.com/support/signature-testing/">here</a>. All 3 tests should be marked as Viruses if everything was done correctly.</p>]]></description>
			<author><![CDATA[null@example.com (Quack66)]]></author>
			<pubDate>Thu, 18 May 2017 15:20:47 +0000</pubDate>
			<guid>https://forum.iredmail.org/post56262.html#p56262</guid>
		</item>
	</channel>
</rss>
