Squid - How to  make squid proxy prevent malwares

AID: 684
  • Status: Published

3010 points

  • Byabolinhas
  • TypeTutorial
  • Posted on2009-05-26 at 04:18:59
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.

Step 1:
Create a file called malware_block_list.txt and save in /etc/squid

Step 2:
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

                                    
1:
2:
3:
4:
5:
6:

Select allOpen in new window



Step 3:
Execute in shell.
wget -O - http://malware.hiperlinks.com.br/cgi/submit?action=list_squid > /etc/squid/malware_block_list.txt

                                    
1:

Select allOpen in new window



Step 4:
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

                                    
1:

Select allOpen in new window



Step 5:
Reload squid configuration.
service squid reload

                                    
1:

Select allOpen in new window



Every time that scheduled task is executed, the file is updated.
 
Open /etc/squid/malware_block_list.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.
5-26-2009-6-17-01-PM.png
  • 83 KB
  • error message
error message


Regards

André Bolinhas
    Asked On
    2009-05-26 at 04:18:59ID684
    Tags

    Linux

    ,

    Proxy

    ,

    Squid

    ,

    Security

    Topic

    Linux Administration

    Views
    2461

    Comments

    Author Comment

    by: abolinhas on 2009-05-26 at 17:39:06ID: 1153

    Hi WaterStreet,

    Thanks for warning me of the errors of my article, this was my first article that I wrote in my whole life:)

    I changed my article, I ask you to verify that it is within the guidelines set by you.

    If not, please let me know so I can re-edit it.

    Thanks for your help

    Regards

    André Bolinhas




    Add your Comment

    Please Sign up or Log in to comment on this article.

    Join Experts Exchange Today

    Gain Access to all our Tech Resources

    Get personalized answers

    Ask unlimited questions

    Access Proven Solutions

    Search 3.2 million solutions

    Read In-Depth How-To Guides

    1000+ articles, demos, & tips

    Watch Step by Step Tutorials

    Learn direct from top tech pros

    And Much More!

    Your complete tech resource

    See Plans and Pricing

    30-day free trial. Register in 60 seconds.

    Loading Advertisement...

    Top Linux Admin Experts

    1. maeltar

      4,300

      0 points yesterday

      Profile
      Rank: Guru
    2. xterm

      4,000

      0 points yesterday

      Profile
      Rank: Sage
    3. noci

      2,800

      0 points yesterday

      Profile
      Rank: Genius
    4. duncan_roe

      2,800

      0 points yesterday

      Profile
      Rank: Genius
    5. pcsmitpra

      1,800

      0 points yesterday

      Profile
      Rank: Wizard
    6. testez

      1,800

      0 points yesterday

      Profile
      Rank: Guru
    7. Nopius

      1,470

      30 points yesterday

      Profile
      Rank: Genius
    8. abbright

      1,000

      0 points yesterday

      Profile
      Rank: Guru
    9. torakeshb

      1,000

      0 points yesterday

      Profile
      Rank: Master
    10. woolmilkporc

      800

      0 points yesterday

      Profile
      Rank: Genius
    11. dbauermann

      600

      0 points yesterday

      Profile
    12. wasimibm

      600

      0 points yesterday

      Profile
      Rank: Guru
    13. unassassinable

      420

      0 points yesterday

      Profile
      Rank: Guru
    14. Anton74

      390

      0 points yesterday

      Profile
      Rank: Guru
    15. kosarajudeepak

      340

      0 points yesterday

      Profile
      Rank: Wizard
    16. abolinhas

      320

      0 points yesterday

      Profile
      Rank: Guru
    17. viju2008

      300

      0 points yesterday

      Profile
      Rank: Master
    18. farzanj

      300

      0 points yesterday

      Profile
      Rank: Genius
    19. OP_Zaharin

      300

      0 points yesterday

      Profile
      Rank: Sage
    20. ahmedhamdy27

      290

      0 points yesterday

      Profile
    21. allen-davis

      280

      10 points yesterday

      Profile
      Rank: Master

    Hall Of Fame