Posts

Squint Configure

1.       Download actual version of squint and extract it: http://www.ledge.co.za/software/squint/ wget www.ledge.co.za/software/squint/squint-0.3.18.tar.gz 2.       tar – zxvf squint-0.3.18.tar.gz         3.        cd squint-0.3.18            ##To see installation steps --- more INSTALL   ### 4.       cp squint.pl squint.cron.sh /usr/local/bin/ 5.         cd /usr/local/bin# restart squint.pl squint.cron.sh squint.cron.sh init 6.       squint.cron.sh all 7.       squint.cron.sh regen 8.       Now Edit BASEDIR=”/var/www/localhost/htdocs/squint”          ### unhash this Line and Changed to >     ...

Setting up Mandatory Authentication for Internet Access

To setup authentication, first we need to download the package apache2 (Debian). First, we need to create a file that would contain the username and passwords of users who are allowed access. Step 1: #apt-get install apache2 Step 2 : #vim /etc/squid/password_file Now, the file ownership must be changed as owner: root and group: proxy #chown root:proxy /etc/squid/password_file #chmod 640 /etc/squid/password_file   Step 3 : Create the users: #htpasswd /etc/squid/passwd username   Step 4:  #/etc/squid/squid.conf   acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl bol_network src 192.168.200.0/24 acl login proxy_auth REQUIRED    ### Edit This line   http_access allow bol_network login       ### Edit This line http_access deny all   edit:   auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd   The following lines should be...

Setting Specific Time & Day for Browsing

The following lines have been taken from the file squid.conf. Each day can be represented by an alphabet. Moreover,browsing time can be limited using h1:m1 – h2:m2 parameters, where h1:m1 > h2:m2. #acl aclname time [day-abbrevs] [h1:m1-h2:m2] # day-abbrevs: # S - Sunday # M - Monday # T - Tuesday # W - Wednesday # H - Thursday # F - Friday # A - Saturday # h1:m1 must be less than h2:m2 # /etc/squid/squid.conf acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl time_limit time SMTWH 10:00 – 14:00 acl our_network src 192.168.200.0/24 http_access deny our_network time_limit http_access deny all Example: allow browsing during office hours only # /etc/squid/squid.conf acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl office_hours time SMTWH 08:00-18:00 acl non_office_hours time SMTWHFA 17:01-00:00 acl non_office_hours time SMTWHFA 00:00-08:59 acl our_network src 192.168.200.0/24 http_access deny our_network non_office_hou...

Blocking Specific MAC & Blocking Multiple MAC

Blocking Specific MAC: acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl bad_MAC arp 192.168.200.100/32 acl our_network src 192.168.200.0/24 http_access deny bad_MAC http_access allow our_network http_access deny all Blocking Multiple MAC: We could write down the MACs one by one separated with ‘spaces’. Or we could create a file (in this case /etc/squid/invalid_MAC _file) containing the MACs. 48:5B:39:0C:CE:10 00:1F:D0:63:A3:03 acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl invalid_MAC src 48:5B:39:0C:CE:10 00:1F:D0:63:A3:03 acl invalid_MAC src “/etc/squid/invalid_MAC_file” acl our_network src 192.168.200.0/24 OR http_access deny invalid_MAC http_access allow our_network http_access deny all

Blocking Multiple IP

Step 1: We could write down the IPs one by one separated with ‘spaces’. Or we could create a file (in this case /etc/squid/invalid_ip_file ) containing the IPs. 192.168.200.100 192.168.200.101 192.168.200.102 Step 2: vim /etc/squid/squid.conf acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl invalid_IP src 192.168.200.100 192.168.200.101 acl invalid_IP src “/etc/squid/invalid_ip_file”     ### Add this line acl our_network src 192.168.200.0/24 OR http_access deny invalid_IP    ###### Add this line http_access allow our_network http_access deny all

Blocking Specific IP

Step 1 : Create a folder  /etc/squid/bad_IP and put the IP: Step 2: vim /etc/squid/squid.conf acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8 acl bad_IP src 192.168.200.100/32    ### Add this Line acl our_network src 192.168.200.0/24 http_access deny bad_IP       ### Add this line http_access allow our_network http_access deny all :wq!     ### Save and Exit

Blocking Multiple Websites:

We would create a file /etc/squid/sitelist and add all to be blocked websites in the file. Below is a sample content of this file:      .bad_site.com \.hacker.$ \.mp3$                   #   \keyword? Indicates string keyword string acl localhost src 127.0.0.1/32 acl to_localhost dst 127.0.0.0/8             acl our_network src 192.168.200.0/24 acl facebook url_regex [i] .facebook.com acl bad_domain urlpath_regex [i] “/etc/squid/sitelist”               http_access deny bad_domain http_access deny facebook http_access allow our_network   http_access deny all