Browse All Articles
> Squid - How to make squid proxy prevent malwares
In this tutorial I will explain how to make squid prevent malwares in five easy steps:
Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator.
Create a file called malware_block_list.txt and save in /etc/squid
Create a new access list (ACL) in your squid.conf
# File which contains the list
acl malware_block_list url_regex-i "/etc/squid/malware_block_list.txt"
# Access Denied
http_access deny malware_block_list
# Redirect message - (You can make your own)
deny_info http://malware.hiperlinks.com.br/denied.shtml malware_block_list
Execute in shell.
wget -O - http://malware.hiperlinks.com.br/cgi/submit?action=list_squid > /etc/squid/malware_block_list.txt
Put in Scheduled Tasks (Crontab).
**In my case the file from the list of malware is updated at 00 hours and 06 hours.
* 00,06 * * * wget -O - http://malware.hiperlinks.com.br/cgi/submit?action=list_squid > /etc/squid/malware_block_list.txt
Reload squid configuration.
service squid reload
Every time that scheduled task is executed, the file is updated.
ist.txt and see if you can see the list of urls, take one and put in your browser to see if the the error message appears.