Squid ClamAV Not Reporting Virus'
-
Ok…I wiped my drive and installed a fresh pfSense 2.3.2-RELEASE (amd64). I do not have Snort installed at this time. I installed Squid and setup with no issues. I did notice this - in the General tab, if I don't enable the Transparent HTTP Proxy, I am able to download the http eicar virus test files. If I enable the Transparent HTTP Proxy, I get the "Server not found" error page when trying to download the http eicar virus test files. I've attached screenshots of the General, Local Cache, and Antivirus pages. Maybe you can find something that I've completely missed.
I check the thread you posted. The process seems quite involved; not that I can't do it. It's a bit of work to get it to work correctly.
![Squid Proxy Server - General.png](/public/imported_attachments/1/Squid Proxy Server - General.png)
![Squid Proxy Server - General.png_thumb](/public/imported_attachments/1/Squid Proxy Server - General.png_thumb)
![Squid Proxy Server - Local Cache.png](/public/imported_attachments/1/Squid Proxy Server - Local Cache.png)
![Squid Proxy Server - Local Cache.png_thumb](/public/imported_attachments/1/Squid Proxy Server - Local Cache.png_thumb)
![Squid Proxy Server - Antivirus.png](/public/imported_attachments/1/Squid Proxy Server - Antivirus.png)
![Squid Proxy Server - Antivirus.png_thumb](/public/imported_attachments/1/Squid Proxy Server - Antivirus.png_thumb) -
Does anyone know who maintains the Squid/ClamAV package? Maybe they could take a look and see if there is anything in my setup that is incorrect. Or would anyone else know what could be wrong??? I'm just a newbie to pfSense trying to get this working correctly. Any more ideas at all?
-
I'm finding out a little more about squid and clamav.
If you do a search on the following github site for "redirect", you'll find 2/3rds down the page, the 3rd match on my Firefox, information about URL redirection. If you look in the cgi-bin directory as described, you can find the virus warning files:
https://github.com/darold/squidclamavIf you do a search in pfSense from Diagnostics | Command Prompt using the following command line text: find / -name "clwarn.cgi" , you'll find the file is located here: /usr/local/libexec/squidclamav/clwarn.cgi . If you look in the /usr/local/libexec/squidclamav path, you can find all of the files that the github cgi-bin directory references.
Interestingly enough, when I went to pfSense, Services | Squid Proxy Server | Antivirus, and chose the following Redirect URL:
http://192.168.1.1/cgi-bin/clwarn.cgi , the actual warning page appeared on the http eicar virus test file. I thought my issue was fixed. Nope, it's not. For whatever reason, pfSense stopped using that url redirect after testing the http eicar test files a few more times to make sure it was going to work. >:( -
I'm finding out a little more about squid and clamav, too.
Are you setting up your clients individually or using WPAD? -
I'm setting up my clients individually for the https MITM; importing the CA into Firefox on each. I'm then telling the browser to auto-detect the proxy settings. Although I've read about it, I'm not really sure what WPAD is.
I'm just trying to find the correct URL redirect in order for squidclamav to use the built-in virus/malware warning page (/cgi-bin/clwarn.cgi.en_EN). I've tried everything that I can find in my searches with no luck.
-
I tried a redirect to my internal pfsense ip with the /squid_clwarn extension rather than the default redirect address and I noticed I was able to get the message working on IE but on Chrome the page says the site can't be reached. What's interesting is that on IE it uses the redirected IP address I used within the "Antivirus" settings however, Chrome reverts back to https://pfsense.localdomain/squid_clwarn.php…
I attempted to clear my local cache to see if this would resolve the problem but it did not. From what I see in the logs and with the real-time monitor, its actually doing what its intended to do on both browsers. I'm just getting mixed results based on the browser of choice in regards to a message being displayed to the user via Chrome vs. IE. If there's another location the redirect address is stored then that's probably the root of my problem but until I figure out why Chrome gets the old https://pfsense.localdomain/squid_clwarn.php and not https://<ip_address>/squid_clwarn.php, it's just going to have to stay the way it is.
Figured I'd share that here in case anyone else runs into this and has a solution.</ip_address>
-
PlowHouse…Thanks for the response. Very informative. Have you tried Firefox?
-
Just did, same result as Chrome. Interestingly enough, IE has stopped issuing me a warning now and reverted to using the old url rather than the IP re-direct I created. However, I tried downloading the file from a separate laptop and got a blocked notification on all three browsers. I was even blocked on my cell phone while connected to the wireless during my tests.
I know the AV is doing it's job whether it's displaying a notification or not, but maybe the previous message where it cannot resolve DNS while it blocks the virus is something that just cached for my MAC or IP… I even went as far as enabling "Manual Configuration" - Load Advanced files - and replacing the redirect there with the IP redirect I have. Even after doing that the old URL is still what is shown on my laptop or phone but the AV notification displays. I doubt this is OS specific but the system that isn't receiving the alerts is Windows 10 while the laptop is Windows 8.1 and the phone is Android.
I'm kind of stumped why the redirect isn't using the IP, because that works on it's own if I copy and paste that into any browser. Instead, pfSense keeps using https://pfsense.localdomain/squid_clwarn.php when it really should be https://<ip_address>/squid_clwarn.php...
I think if I can figure out the root to why that IP isn't sticking it should work for your environment as well. Just to test, try using https://<ip_address>/squid_clwarn.php (or http://) on your firefox browser and see if the notification shows. At least you'll know that the contents its pulling that information to display the notification works. If I think of anything else I'll post it here.</ip_address></ip_address>
-
PlowHouse…As you suggested, I tried using https://<ip_address>/squid_clwarn.php and http://<ip_address>/squid_clwarn.php on my Firefox browser. Both worked. Good catch!
So this is interesting...about a week and a half ago I added an interface for my wireless LAN on my pfSense box. In the Squid General Settings, I made sure I highlighted my WLAN with the default that was already highlighted which is the LAN. I then restarted my router. I then went back to the EICAR site to attempt to download the virus test files from my LAN. I couldn't reach the EICAR site for whatever reason but had connectivity to any other website I tried. About two days later I attempted to go to the EICAR site again and it finally displayed. I then tried to download all 8 of the virus test files and they weren't being blocked at all. Very odd, especially when they were being blocked before the addition of the interface and before I couldn't reach EICAR. I don't know if EICAR changed something in their test files or if the addition of the interface on pfSense changed something in my pfSense box. I know I can't really use pfSense until this gets fixed. I may wipe my drive and try a fresh installation again to see if I get the same results.
I hope I don't anger the good people at pfSense, but, have you tried IPFire? I don't want to move away from pfSense, and I'm a gold member, but I just need something that works.</ip_address></ip_address>
-
You may have not been able to connect to the eicar site because of local browser cache on the system and not necessarily because of squidav. One thing to mention about the AV is that I believe its only going to catch sites/files over http and not https unless you have ssl man-in-the-middle filtering on. So the top four files on the test download site should be blocked as long as AV is active on for you LAN and WLAN interfaces. However, the https files will most likely be permitted to go through as the AV filter has no visibility into the signatures of those files.
As a test, I'd check to make sure you have the AV on for the LAN by selecting only the LAN interface in the "Proxy Interface/s" section of the Squid General settings, clear the browsing data/cache locally for the given test system, navigate to the eicar site and try to download any of the top eicar test files (only for http). On another tab I'd have the "real-time" monitor for squid open and you should see the files being blocked. Since you're testing the functionality of this setup I'd make sure wireless is off or insure it's only obtaining an address from the LAN rather than WLAN. Once you validate this is working I'd repeat the steps for WLAN. Let me know how you make out.
-
Well, I've wiped my drive and installed and configured once more. I'm back to where I was. The http eicar test files get blocked (without the warning page we are looking for) and this time the eicar https test files get this reply with the SSL Man In the Middle Filtering enabled:
Your connection is not secure
The owner of secure.eicar.org has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website.
Interestingly, I had SSL Man In the Middle Filtering enabled on my first install and the https eicar test files were blocked; I didn't receive the above message at that time. Odd that I'm receiving that message now.
-
That's one way to go about troubleshooting something, just wipe the whole thing :D
BTW, I've never heard of IPFire but I may give it a shot. I don't believe anyone here is going to flame you for mentioning another product that is functional and worth the mention. Although that's just me, I'm always interested in hearing about other products that may have something different to offer.
-
I have this same issue but only with opera browser when turbo mode is enabled.
Then browser can happily download Eicar test files and nothing detected in ClamAv logs.
But if I disable turbo mode or use FF or Chrome then Clam works and detect eicar files. -
I have this same issue but only with opera browser when turbo mode is enabled.
Then browser can happily download Eicar test files and nothing detected in ClamAv logs.Not surprising as Opera turbo mode compresses the data so all signature based AV intercepting the traffic is effectively made useless.
If using Opera turbo mode, pray that Opera do the AV for you before compressing.
-
Ok…I wiped my drive and installed a fresh pfSense 2.3.2-RELEASE (amd64). I do not have Snort installed at this time. I installed Squid and setup with no issues. I did notice this - in the General tab, if I don't enable the Transparent HTTP Proxy, I am able to download the http eicar virus test files. If I enable the Transparent HTTP Proxy, I get the "Server not found" error page when trying to download the http eicar virus test files. I've attached screenshots of the General, Local Cache, and Antivirus pages. Maybe you can find something that I've completely missed.
I check the thread you posted. The process seems quite involved; not that I can't do it. It's a bit of work to get it to work correctly.
Hey I am just wondering how you guys done the warning for a virus I have it set up but would like to see a page with a warning like your showing newuser 192.168.1.1/ just wondering myself is that something that's already there or did you make it?
Robert
-
Well, I've wiped my drive and installed and configured once more. I'm back to where I was. The http eicar test files get blocked (without the warning page we are looking for) and this time the eicar https test files get this reply with the SSL Man In the Middle Filtering enabled:
Your connection is not secure
The owner of secure.eicar.org has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website.
Interestingly, I had SSL Man In the Middle Filtering enabled on my first install and the https eicar test files were blocked; I didn't receive the above message at that time. Odd that I'm receiving that message now.
trying to follow your thread but with no success. Having the same issue with AV and wonder if you could summarize your findings/suggestions in short form?
Thx in advance!
-
I decided to test mine and it too is not triggering the warning or the blocked pages.
I am not using HTTPS/SSL Interception, but I would expect it to block the http files.
I've uninstalled squid, rebooted, and then re-installed squid, however still no dice.2.4.2-RELEASE (amd64)
built on Mon Nov 20 08:12:56 CST 2017
FreeBSD 11.1-RELEASE-p4c-icap and clamd both show a green light status.
C-ICAP Server Table shows as empty, even after downloading the eicar test file which it doesn't catch.
And upon further discovery on the web, this was my solution. Not sure if it is correct, but it is once again working. https://www.ceos3c.com/2017/06/23/install-squid-clamav-pfsense-2-3-3/ except I did not have to set the proxy on my browser since it was already in transparent mode.
So it makes me wonder what exactly I did to knock c-icap offline and not scan traffic, even though it was showing the green light status. I can't remember testing it after updating to 2.4.2, or even the prior release.
-
No sure why we need FW rule it used to work before w/o it?
Tried as was suggested by @mtarbox https://www.ceos3c.com/2017/06/23/install-squid-clamav-pfsense-2-3-3/ and still no love
??!!
-
If I were to guess I'd say that Transparent Proxy Settings stopped working roughly at the time of upgrading to 2.4.1
-
I don't get the response page but it is blocked and I don't use a firewall rule.
I have squid setup with mitm and transparent.
When I check the real time tab the (clamd table) show's the eicar file is found instream
and also the C-ICAP server is showing that it generated a response page even though
none appeared.I had just assumed it was a conflict between one of the other package's I have installed.