You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BlackWeb is a project that collects and unifies public blocklists of domains (porn, downloads, drugs, malware, spyware, trackers, bots, social networks, warez, weapons, etc.) to make them compatible with Squid-Cache.
BlackWeb es un proyecto que recopila y unifica listas públicas de bloqueo de dominios (porno, descargas, drogas, malware, spyware, trackers, bots, redes sociales, warez, armas, etc.) para hacerlas compatibles con Squid-Cache.
blackweb.txt is already updated and optimized for Squid-Cache. Download it and unzip it in the path of your preference and activate the Squid-Cache Rule.
blackweb.txt ya viene actualizada y optimizada para Squid-Cache. Descárguela y descomprímala en la ruta de su preferencia y active la Regla de Squid-Cache.
#!/bin/bash# Variables
url="https://raw.githubusercontent.com/maravento/blackweb/master/blackweb.tar.gz"
wgetd="wget -q -c --timestamping --no-check-certificate --retry-connrefused --timeout=10 --tries=4 --show-progress"# TMP folder
output_dir="bwtmp"
mkdir -p "$output_dir"# Downloadif$wgetd"$url";thenecho"File downloaded: $(basename $url)"elseecho"Main file not found. Searching for multiparts..."# Multiparts from a to z
all_parts_downloaded=true
forpartin {a..z}{a..z};do
part_url="${url%.*}.$part"if$wgetd"$part_url";thenecho"Part downloaded: $(basename $part_url)"elseecho"Part not found: $part"
all_parts_downloaded=false
breakfidoneif$all_parts_downloaded;then# Rebuild the original file in the current directory
cat blackweb.tar.gz.*> blackweb.tar.gz
echo"Multipart file rebuilt"elseecho"Multipart process cannot be completed"exit 1
fifi# Unzip the file to the output folder
tar -xzf blackweb.tar.gz -C "$output_dir"echo"Done"
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS# Block Rule for Blackweb
acl blackweb dstdomain "/path_to/blackweb.txt"
http_access deny blackweb
Advanced Rules
BlackWeb contains millions of domains, therefore it is recommended:
BlackWeb contiene millones de dominios, por tanto se recomienda:
Allow Rule for Domains
Use allowdomains.txt to exclude essential domains or subdomains, such as .accounts.google.com, .yahoo.com, .github.com, etc. According to Squid's documentation, the subdomains accounts.google.com and accounts.youtube.com may be used by Google for authentication within its ecosystem. Blocking them could disrupt access to services like Gmail, Drive, Docs, and others.
Use allowdomains.txt para excluir dominios o subdominios esenciales, como .accounts.google.com, .yahoo.com, .github.com, etc. Según la documentación de Squid, los subdominios accounts.google.com y accounts.youtube.com pueden ser utilizados por Google para la autenticación dentro de su ecosistema. Bloquearlos podría interrumpir el acceso a servicios como Gmail, Drive, Docs, entre otros.
Use streaming.txt to block streaming domains not included in blackweb.txt (for example: .youtube.com, .googlevideo.com, .ytimg.com, etc.).
Utilice streaming.txt para bloquear dominios de streaming no incluidos en blackweb.txt (por ejemplo: .youtube.com, .googlevideo.com, .ytimg.com, etc.).
Note: This list may contain overlapping domains. It is important to manually clean it according to the proposed objective. Example:
If your goal is to block Facebook, keep the primary domains and remove specific subdomains.
If your goal is to block features, like Facebook streaming, keep the specific subdomains and remove the primary domains to avoid impacting overall site access. Example:
Nota: Esta lista puede contener dominios superpuestos. Es importante depurarla manualmente según el objetivo propuesto. Ejemplo:
Si el objetivo es bloquear Facebook, conserva los dominios principales y elimina los subdominios específicos.
Si el objetivo es bloquear funcionalidades, como el streaming de Facebook, mantén los subdominios específicos y elimina los dominios principales para no afectar el acceso general al sitio. Ejemplo:
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS# Allow Rule for Domains
acl allowdomains dstdomain "/path_to/allowdomains.txt"
http_access allow allowdomains
# Block Rule for Punycode
acl punycode dstdom_regex -i \.xn--.*
http_access deny punycode
# Block Rule for gTLD, sTLD, ccTLD
acl blocktlds dstdomain "/path_to/blocktlds.txt"
http_access deny blocktlds
# Block Rule for Domains
acl blockdomains dstdomain "/path_to/blockdomains.txt"
http_access deny blockdomains
# Block Rule for Patterns (Optional)# https://raw.githubusercontent.com/maravento/vault/refs/heads/master/blackshield/acl/source/squid/blockpatterns.txt
acl blockwords url_regex -i "/path_to/blockpatterns.txt"
http_access deny blockpatterns
# Block Rule for web3 (Optional)# https://raw.githubusercontent.com/maravento/vault/refs/heads/master/blackshield/acl/source/web3/web3domains.txt
acl web3 dstdomain "/path_to/web3domains.txt"
http_access deny web3
# Block Rule for Blackweb
acl blackweb dstdomain "/path_to/blackweb.txt"
http_access deny blackweb
BLACKWEB UPDATE
⚠️ WARNING: BEFORE YOU CONTINUE
This section is only to explain how the update and optimization process works. It is not necessary for the user to run it. This process can take time and consume a lot of hardware and bandwidth resources, therefore it is recommended to use test equipment.
Esta sección es únicamente para explicar cómo funciona el proceso de actualización y optimización. No es necesario que el usuario la ejecute. Este proceso puede tardar y consumir muchos recursos de hardware y ancho de banda, por tanto se recomienda usar equipos de pruebas.
Bash Update
The update process of blackweb.txt consists of several steps and is executed in sequence by the script bwupdate.sh. The script will request privileges when required.
El proceso de actualización de blackweb.txt consta de varios pasos y es ejecutado en secuencia por el script bwupdate.sh. El script solicitará privilegios cuando lo requiera.
Capture domains from downloaded public blocklists (see SOURCES) and unify them in a single file.
Captura los dominios de las listas de bloqueo públicas descargadas (ver FUENTES) y las unifica en un solo archivo.
Domains Debugging
Remove overlapping domains ('.sub.example.com' is a subdomain of '.example.com'), does homologation to Squid-Cache format and excludes false positives (google, hotmail, yahoo, etc.) with an allowlist (debugwl.txt).
Elimina dominios superpuestos ('.sub.example.com' es un dominio de '.example.com'), hace la homologación al formato de Squid-Cache y excluye falsos positivos (google, hotmail, yahoo, etc.) con una lista de permitidos (debugwl.txt).
Remove domains with invalid TLDs (with a list of Public and Private Suffix TLDs: ccTLD, ccSLD, sTLD, uTLD, gSLD, gTLD, eTLD, etc., up to 4th level 4LDs).
Elimina dominios con TLD inválidos (con una lista de TLDs Public and Private Suffix: ccTLD, ccSLD, sTLD, uTLD, gSLD, gTLD, eTLD, etc., hasta 4to nivel 4LDs).
Input:
.domain.exe
.domain.com
.domain.edu.co
Output:
.domain.com
.domain.edu.co
Debugging Punycode-IDN
Remove hostnames larger than 63 characters (RFC 1035) and other characters inadmissible by IDN and convert domains with international characters (non ASCII) and used for homograph attacks to Punycode/IDNA format.
Elimina hostnames mayores a 63 caracteres (RFC 1035) y otros caracteres inadmisibles por IDN y convierte dominios con caracteres internacionales (no ASCII) y usados para ataques homográficos al formato Punycode/IDNA.
Removes entries with invalid encoding, non-printable characters, whitespace, disallowed symbols, and any content that does not conform to the strict ASCII format for valid domain names (CP1252, ISO-8859-1, corrupted UTF-8, etc.). Converts the output to plain text with charset=us-ascii, ensuring a clean, standardized list ready for validation, comparison, or DNS resolution:
Elimina entradas con codificación incorrecta, caracteres no imprimibles, espacios en blanco, símbolos no permitidos y cualquier contenido que no se ajuste al formato ASCII estricto para nombres de dominio válidos (CP1252, ISO-8859-1, UTF-8 corrupto, etc.) y convierte la salida a texto sin formato charset=us-ascii, lo que garantiza una lista limpia y estandarizada, lista para validación, comparación o resolución DNS:
Most of the SOURCES contain millions of invalid or nonexistent domains, so each domain is double-checked via DNS (in 2 steps) to exclude those entries from Blackweb. This process is performed in parallel and can be resource-intensive, depending on your hardware and network conditions. You can control concurrency with the PROCS variable:
La mayoría de las FUENTES contienen millones de dominios inválidos o inexistentes, por lo que cada dominio se verifica mediante DNS (en dos pasos) para excluir esas entradas de Blackweb. Este proceso se realiza en paralelo y puede consumir muchos recursos, dependiendo del hardware y las condiciones de la red. Puede controlar la concurrencia con la variable PROCS:
PROCS=$(($(nproc))) # Conservative (network-friendly)
PROCS=$(($(nproc) *2))# Balanced
PROCS=$(($(nproc) *4))# Aggressive (default)
PROCS=$(($(nproc) *8))# Extreme (8 or higher, use with caution)
For example, on a system with a Core i5 CPU (4 physical cores / 8 threads with Hyper-Threading):
Por ejemplo, en un sistema con una CPU Core i5 (4 núcleos físicos/8 subprocesos con Hyper-Threading):
nproc → 8
PROCS=$((8*4)) → 32 parallel queries
⚠️ Warning: High PROCS values increase DNS resolution speed but may saturate your CPU or bandwidth, especially on limited networks like satellite links. Adjust accordingly. Real-time processing example:
⚠️ Advertencia: Los valores altos de PROCS aumentan la velocidad de resolución del DNS, pero pueden saturar la CPU o el ancho de banda, especialmente en redes limitadas como enlaces satelitales. Ajuste el sistema según corresponda. Ejemplo de procesamiento en tiempo real:
Processed: 2463489 / 7244989 (34.00%)
Output:
HIT google.com
google.com has address 142.251.35.238
google.com has IPv6 address 2607:f8b0:4008:80b::200e
google.com mail is handled by 10 smtp.google.com.
FAULT testfaultdomain.com
Host testfaultdomain.com not found: 3(NXDOMAIN)
Excludes government-related TLDs
Remove government domains (.gov) and other related TLDs from BlackWeb.
Elimina de BlackWeb los dominios de gobierno (.gov) y otros TLD relacionados.
Run Squid-Cache with BlackWeb and any error sends it to SquidError.txt.
Corre Squid-Cache con BlackWeb y cualquier error lo envía a SquidError.txt.
Log
Both bwupdate.sh and checksources.sh generate a log file (bwupdate.log / checksources.log) in the same directory where they are executed.
bwupdate.sh y checksources.sh generan un archivo de log (bwupdate.log / checksources.log) en el mismo directorio donde se ejecutan.
Important about BlackWeb Update
The default path of BlackWeb is /etc/acl. You can change it for your preference.
If you need to interrupt the execution of bwupdate.sh (ctrl + c) and it stopped at the DNS Lookup part, it will restart at that point. If you stop it earlier, you will have to start from the beginning or modify the script manually so that it starts from the desired point.
If you use aufs, temporarily change it to ufs during the upgrade, to avoid: ERROR: Can't change type of existing cache_dir aufs /var/spool/squid to ufs. Restart required.
El path por default de BlackWeb es /etc/acl. Puede cambiarlo por el de su preferencia.
Si necesita interrumpir la ejecución de bwupdate.sh (ctrl + c) y se detuvo en la parte de DNS Lookup, reiniciará en ese punto. Si lo detiene antes deberá comenzar desde el principio o modificar el script manualmente para que inicie desde el punto deseado.
Si usa aufs, cámbielo temporalmente a ufs durante la actualización, para evitar: ERROR: Can't change type of existing cache_dir aufs /var/spool/squid to ufs. Restart required.
Changes must be proposed via Issues. Pull Requests are not accepted.
BlackWeb is designed exclusively for Squid-Cache and due to the large number of blocked domains it is not recommended to use it in other environments (DNSMasq, Pi-Hole, etc.), or add it to the Windows Hosts File, as it could slow down or crash it. Use it at your own risk. For more information check Issue 10
Blackweb is NOT a blacklist service itself. It does not independently verify domains. Its purpose is to consolidate and reformat public blacklist sources to make them compatible with Squid.
If your domain appears in Blackweb and you believe this is an error, you should review the public sources in SOURCES to identify where it is listed and contact the maintainer of that list to request its removal. Once the domain is removed from the upstream source, it will automatically disappear from Blackweb in the next update. You can also use the following script to perform the same verification:
Este proyecto incluye componentes de terceros.
Los cambios deben proponerse mediante Issues. No se aceptan Pull Requests.
BlackWeb está diseñado exclusivamente para Squid-Cache y debido a la gran cantidad de dominios bloqueados no se recomienda usarlo en otros entornos (DNSMasq, Pi-Hole, etc.), o agregarlo al archivo Hosts de Windows, ya que podría ralentizarlo o bloquearlo. Úselo bajo su propio riesgo. Para más información revise el Issue 10
Blackweb NO es un servicio de listas negras como tal. No verifica de forma independiente los dominios. Su función es consolidar y formatear listas negras públicas para hacerlas compatibles con Squid.
Si su dominio aparece en Blackweb y considera que esto es un error, debe revisar las fuentes públicas en SOURCES para identificar en cuál(es) aparece, y contactar al responsable de dicha lista para solicitar su eliminación. Una vez que el dominio sea eliminado en la fuente original, desaparecerá automáticamente de Blackweb en la siguiente actualización. También puede usar el siguiente script para obtener el mismo resultado de verificación:
[?] Enter domain to search: kickass.to
[*] Searching for'kickass.to'...
[+] Domain found in: https://github.com/fabriziosalmi/blacklists/releases/download/latest/blacklist.txt
[+] Domain found in: https://hostsfile.org/Downloads/hosts.txt
[+] Domain found in: https://raw.githubusercontent.com/blocklistproject/Lists/master/everything.txt
[+] Domain found in: https://raw.githubusercontent.com/hagezi/dns-blocklists/main/domains/ultimate.txt
[+] Domain found in: https://raw.githubusercontent.com/Ultimate-Hosts-Blacklist/Ultimate.Hosts.Blacklist/master/hosts/hosts0
[+] Domain found in: https://sysctl.org/cameleon/hosts
[+] Domain found in: https://v.firebog.net/hosts/Kowabit.txt
Done
STARGAZERS
CONTRIBUTIONS
We thank all those who have contributed to this project. Those interested can contribute, sending us links of new lists, to be included in this project.
Agradecemos a todos aquellos que han contribuido a este proyecto. Los interesados pueden contribuir, enviándonos enlaces de nuevas listas, para ser incluidas en este proyecto.
This project uses a dual-licensing model to balance software freedom with content protection:
Este proyecto utiliza un modelo de licencia dual para equilibrar la libertad del software con la protección del contenido:
Content
Licensed Under
Scripts, Binaries, Infrastructure
RAG, Workers, Specialized Modules, Docs
DISCLAIMER
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
OBJECTION
Due to recent arbitrary changes in computer terminology, it is necessary to clarify the meaning and connotation of the term blacklist, associated with this project:
In computing, a blacklist, denylist or blocklist is a basic access control mechanism that allows through all elements (email addresses, users, passwords, URLs, IP addresses, domain names, file hashes, etc.), except those explicitly mentioned. Those items on the list are denied access. The opposite is a whitelist, which means only items on the list are let through whatever gate is being used. Source Wikipedia
Therefore, blacklist, blocklist, blackweb, blackip, whitelist and similar, are terms that have nothing to do with racial discrimination.
Debido a los recientes cambios arbitrarios en la terminología informática, es necesario aclarar el significado y connotación del término blacklist, asociado a este proyecto:
En informática, una lista negra, lista de denegación o lista de bloqueo es un mecanismo básico de control de acceso que permite a través de todos los elementos (direcciones de correo electrónico, usuarios, contraseñas, URL, direcciones IP, nombres de dominio, hashes de archivos, etc.), excepto los mencionados explícitamente. Esos elementos en la lista tienen acceso denegado. Lo opuesto es una lista blanca, lo que significa que solo los elementos de la lista pueden pasar por cualquier puerta que se esté utilizando. Fuente Wikipedia
Por tanto, blacklist, blocklist, blackweb, blackip, whitelist y similares, son términos que no tienen ninguna relación con la discriminación racial.