Script squid 3 Debian

Resultado de imagem para squid3

http_port 3128
visible_hostname linux
error_directory /usr/share/squid3/errors/pt-br

acl SSL_ports port 443
acl Safe_ports port 80        # http
acl Safe_ports port 21        # ftp
acl Safe_ports port 443        # https
acl Safe_ports port 70        # gopher
acl Safe_ports port 210        # wais
acl Safe_ports port 1025-65535    # unregistered ports
acl Safe_ports port 280        # http-mgmt
acl Safe_ports port 488        # gss-http
acl Safe_ports port 591        # filemaker
acl Safe_ports port 777        # multiling http
acl CONNECT method CONNECT

# ACLS
acl sites_proibidos url_regex -i “/etc/squid3/sites_proibidos”
acl downloads_proibidos url_regex -i \.exe \.torrent \.avi \.mp3

# CONTROLE DE ACESSO
http_access deny sites_proibidos
http_access deny downloads_proibidos
http_access allow all

# NETWORK OPTIONS
# —————————————————————————–

# MEMORY CACHE OPTIONS
# —————————————————————————–
#Default:
cache_mem 256 MB

#Default:
maximum_object_size_in_memory 512 KB

# DISK CACHE OPTIONS
# —————————————————————————–
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid3 100 16 256

# OPTIONS FOR TUNING THE CACHE
# —————————————————————————–

# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:        1440    20%    10080
refresh_pattern ^gopher:    1440    0%    1440
refresh_pattern -i (/cgi-bin/|\?) 0    0%    0
refresh_pattern .        0    20%    4320

Script squid Ubuntu e Kali Linux

Resultado de imagem para squid3

http_port 3128
visible_hostname srv01
error_directory /usr/share/squid/errors/pt-br

acl SSL_ports port 443
acl Safe_ports port 80        # http
acl Safe_ports port 21        # ftp
acl Safe_ports port 443        # https
acl Safe_ports port 70        # gopher
acl Safe_ports port 210        # wais
acl Safe_ports port 1025-65535    # unregistered ports
acl Safe_ports port 280        # http-mgmt
acl Safe_ports port 488        # gss-http
acl Safe_ports port 591        # filemaker
acl Safe_ports port 777        # multiling http
acl CONNECT method CONNECT

# ACLS
acl bloquear-sites url_regex -i “/etc/squid/lista-sites”

# CONTROLE DE ACESSO
http_access deny bloquear-sites
http_access allow all

# NETWORK OPTIONS
# —————————————————————————–

# Squid normally listens to port 3128
http_port 3128

# MEMORY CACHE OPTIONS
# —————————————————————————–
#Default:
cache_mem 256 MB

#Default:
maximum_object_size_in_memory 512 KB

# DISK CACHE OPTIONS
# —————————————————————————–
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 100 16 256

# OPTIONS FOR TUNING THE CACHE
# —————————————————————————–

# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:        1440    20%    10080
refresh_pattern ^gopher:    1440    0%    1440
refresh_pattern -i (/cgi-bin/|\?) 0    0%    0
refresh_pattern .        0    20%    4320

Antes de Executar o script não esquecer de criar o arquivos lista-sites em /etc/squid3/ onde em lista-sites você colocara os sites onde vai bloquear.

Download (DOCX, 15KB)

Observação: Para cada linux que existe a um tipo diferente de script então não adianta utilizar o mesmo script tem que ser criado o script e testado na versão que você estiver utilizando