Skip to content
maraventoPublic

Latest commit

 

History

284 Commits

Folders and files

Repository files navigation

status-maintained last commit Stargazers Twitter Follow

BlackWeb brings together public domain blocklists and adapts them for use as access control lists (ACLs) in Squid-Cache. It includes domains related to adult content, downloads, drugs, malware, spyware, trackers, bots, social networks, warez, weapons, and other categories. BlackWeb reúne listas públicas de dominios y las adapta para usarlas como listas de control de acceso (ACL) en Squid-Cache. Incluye dominios relacionados con contenido para adultos, descargas, drogas, malware, spyware, rastreadores, bots, redes sociales, warez y armas, entre otras categorías.

REQUIREMENTS


  • squid (or squid-openssl) to apply the BlackWeb rules
apt install -y squid

HOW TO USE


The archive includes blackweb.txt, prepared for use as a domain ACL in Squid. To use it, download the archive and save the file in a path Squid can access; then add the block rule shown below to the configuration. El archivo comprimido incluye blackweb.txt, preparado para usarse como ACL de dominios en Squid. Para aplicarlo, debe descargarse y guardarse en una ruta accesible para Squid; después, se añade a la configuración la regla de bloqueo que aparece abajo.

Download

wget -q -c -N https://raw.githubusercontent.com/maravento/blackweb/master/blackweb.tar.gz && cat blackweb.tar.gz* | tar xzf -

If Multiparts Exist

#!/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"

# Download
if $wgetd "$url"; then
  echo "File downloaded: $(basename $url)"
else
  echo "Main file not found. Searching for multiparts..."

  # Multiparts from a to z
  all_parts_downloaded=true
  for part in {a..z}{a..z}; do
    part_url="${url%.*}.$part"
    if $wgetd "$part_url"; then
      echo "Part downloaded: $(basename $part_url)"
    else
      echo "Part not found: $part"
      all_parts_downloaded=false
      break
    fi
  done

  if $all_parts_downloaded; then
    # Rebuild the original file in the current directory
    cat blackweb.tar.gz.* > blackweb.tar.gz
    echo "Multipart file rebuilt"
  else
    echo "Multipart process cannot be completed"
    exit 1
  fi
fi

# Unzip the file to the output folder
tar -xzf blackweb.tar.gz -C "$output_dir"

echo "Done"

Checksum

wget -q -c -N https://raw.githubusercontent.com/maravento/blackweb/master/blackweb.tar.gz && cat blackweb.tar.gz* | tar xzf -
wget -q -c -N https://raw.githubusercontent.com/maravento/blackweb/master/blackweb.txt.sha256
LOCAL=$(sha256sum blackweb.txt | awk '{print $1}'); REMOTE=$(awk '{print $1}' blackweb.txt.sha256); echo "$LOCAL" && echo "$REMOTE" && [ "$LOCAL" = "$REMOTE" ] && echo OK || echo FAIL

BlackWeb Rule for Squid-Cache


Open: Abra:
/etc/squid/squid.conf
Add the following lines at the indicated location: Añada las siguientes líneas en el punto indicado:
# 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
Add domains that should be exempt from blocking to allowdomains.txt, such as .accounts.google.com, .yahoo.com or .github.com. Place http_access allow allowdomains before the rules that deny access; otherwise, the exception may not take effect.

According to Squid's documentation, Google may use the subdomains accounts.google.com and accounts.youtube.com for authentication within its ecosystem. Blocking them could disrupt access to services such as Gmail, Drive and Docs.
En allowdomains.txt se incluyen los dominios que deben excluirse del bloqueo, como .accounts.google.com, .yahoo.com o .github.com. La regla http_access allow allowdomains debe colocarse antes de las reglas que deniegan el acceso; de lo contrario, la excepción puede no surtir efecto.

Según la documentación de Squid, Google puede utilizar los subdominios accounts.google.com y accounts.youtube.com para la autenticación dentro de su ecosistema. Bloquearlos podría interrumpir el acceso a servicios como Gmail, Drive y Docs.
acl allowdomains dstdomain "/path_to/allowdomains.txt"
http_access allow allowdomains
Block Rule for Domains
Use blockdomains.txt to list additional domains to block. This is a separate ACL; it does not automatically block every domain absent from blackweb.txt. blockdomains.txt contiene los dominios adicionales que se bloquearán mediante esa ACL. Es una lista independiente: no bloquea automáticamente todos los dominios que no aparezcan en blackweb.txt.
acl blockdomains dstdomain "/path_to/blockdomains.txt"
http_access deny blockdomains
Block Rule for gTLD, sTLD, ccTLD, etc
Use blocktlds.txt to block entire top-level domains, such as gTLDs, sTLDs or ccTLDs. blocktlds.txt contiene los TLD completos que se bloquearán, como gTLD, sTLD o ccTLD.
acl blocktlds dstdomain "/path_to/blocktlds.txt"
http_access deny blocktlds

Input:

.bardomain.xxx
.subdomain.bardomain.xxx
.bardomain.ru
.bardomain.adult
.foodomain.com
.foodomain.porn

Output:

.foodomain.com
Block Rule for Punycode
This optional rule blocks domain names containing a Punycode label (xn--). It may reduce some homograph risks, but it can also block legitimate internationalized domains. Review and test the rule before enabling it. For background, see Welivesecurity: Homograph attacks. Esta regla opcional bloquea dominios cuyo nombre contiene una etiqueta Punycode (xn--). Puede ayudar a reducir ciertos riesgos de ataques homográficos, pero también puede bloquear dominios internacionalizados legítimos. Conviene revisar y probar la regla antes de activarla. Para más información, puede consultarse Welivesecurity: Ataques homográficos.
acl punycode dstdom_regex -i \.xn--.*
http_access deny punycode

Input:

.bücher.com
.mañana.com
.google.com
.auth.wikimedia.org
.xn--fiqz9s
.xn--p1ai

ASCII Output:

.google.com
.auth.wikimedia.org
Block Rule for Patterns
This optional rule blocks URLs that match patterns in the file. It may produce false positives, so review the list before enabling the rule. Esta regla opcional bloquea las URL que coincidan con los patrones del archivo. Puede generar falsos positivos; conviene revisar la lista antes de activarla.
# Example: Download ACL:
sudo wget -P /etc/acl/squid https://raw.githubusercontent.com/maravento/vault/refs/heads/master/gateproxy/acl/squid/blockpatterns.txt
# Squid Rule to Block Patterns (change path):
acl blockpatterns url_regex -i "/etc/acl/squid/blockpatterns.txt"
http_access deny blockpatterns

Input:

.bittorrent.com
https://www.google.com/search?q=torrent
https://www.google.com/search?q=mydomain
https://www.google.com/search?q=porn
.mydomain.com

Output:

https://www.google.com/search?q=mydomain
.mydomain.com
Streaming (Optional)
Use streaming.txt to block streaming domains not included in blackweb.txt, such as .youtube.com, .googlevideo.com or .ytimg.com. To allow them instead, use an allow rule in place of the example deny rule. streaming.txt permite bloquear dominios de servicios de streaming que no estén en blackweb.txt, por ejemplo .youtube.com, .googlevideo.com o .ytimg.com. Para permitirlos, se puede configurar una regla allow en lugar de la regla deny del ejemplo.
acl streaming dstdomain "/path_to/streaming.txt"
http_access deny streaming
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. Conviene depurarla manualmente según el objetivo. Por ejemplo:
  • Para bloquear Facebook, se conservan los dominios principales y se eliminan los subdominios específicos.
  • Para bloquear solo algunas funciones, como el streaming de Facebook, se conservan los subdominios específicos y se eliminan los dominios principales, a fin de no afectar el acceso general al sitio. Por ejemplo:
# Block Facebook
.fbcdn.net
.facebook.com

# Block some Facebook streaming content
.z-p3-video.flpb1-1.fna.fbcdn.net
AI (Optional)
Use ai.txt to block domains related to artificial intelligence. To allow them instead, use an allow rule in place of the example deny rule. ai.txt permite bloquear dominios relacionados con servicios de inteligencia artificial. Para permitirlos, se puede configurar una regla allow en lugar de la regla deny del ejemplo.
acl ai dstdomain "/path_to/ai.txt"
http_access deny ai

Advanced Rules Summary

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

# Allow Rule for Domains
# https://raw.githubusercontent.com/maravento/blackweb/master/bwupdate/lst/allowdomains.txt
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
# https://raw.githubusercontent.com/maravento/blackweb/master/bwupdate/lst/blocktlds.txt
acl blocktlds dstdomain "/path_to/blocktlds.txt"
http_access deny blocktlds

# Block Rule for Domains
# https://raw.githubusercontent.com/maravento/blackweb/master/bwupdate/lst/blockdomains.txt
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/gateproxy/acl/squid/blockpatterns.txt
acl blockpatterns url_regex -i "/path_to/blockpatterns.txt"
http_access deny blockpatterns

# Block Rule for Blackweb
# https://raw.githubusercontent.com/maravento/blackweb/master/blackweb.tar.gz
acl blackweb dstdomain "/path_to/blackweb.txt"
http_access deny blackweb

DATA SHEET


ACL Blocked Domains File Size
blackweb.txt 7963236 194,5 MB

REPOSITORY STRUCTURE


bwupdate/
├── bwupdate.sh                  # Main script: downloads lists, builds blackweb.txt and reloads Squid
├── lst/                         # ACLs and helper lists used by bwupdate.sh
│   ├── ai.txt                      # Separate Squid ACL for AI-related domains; not modified by bwupdate.sh
│   ├── allowdomains.txt            # Separate Squid ACL for exempt domains; not modified by bwupdate.sh
│   ├── allowtlds.txt               # Allowed-TLD pattern used during debugging
│   ├── blockdomains.txt            # Separate Squid ACL for additional blocked domains; not modified by bwupdate.sh
│   ├── blocktlds.txt               # Separate Squid ACL for blocking whole TLDs; not modified by bwupdate.sh
│   ├── debugbl.txt                 # Added to the candidate blocklist before debugging
│   ├── debugwl.txt                 # Excludes false positives during debugging (Google, Hotmail, Yahoo, etc.)
│   ├── invalid.txt                 # Added to urls.txt during debugging, along with debugwl.txt
│   ├── pendingtld.txt              # Not read by scripts; maintainer reference
│   ├── streaming.txt               # Separate Squid ACL for streaming domains; not modified by bwupdate.sh
│   ├── tldsappx.txt                # TLD source used by dofi/domfilter.py
│   └── tldsbk.txt                  # Not read by scripts; maintainer reference
└── tools/
    ├── checksources.sh          # Downloads the source lists and searches them for a domain
    └── debugerror.py            # Removes domains flagged in Squid's cache.log when their parent domain is already blocked

BLACKWEB UPDATE


⚠️ WARNING: BEFORE YOU CONTINUE

This section describes how bwupdate.sh updates and processes the list. Running the script is not required to use the published blackweb.txt. Updates can take time and use substantial CPU, memory, network and bandwidth resources; run the process on a test system. Esta sección describe el proceso que sigue bwupdate.sh para actualizar y depurar la lista. No es necesario ejecutar este script para usar el archivo blackweb.txt publicado. La actualización puede tardar y consumir muchos recursos de CPU, memoria, red y ancho de banda; se recomienda ejecutarla en un equipo de pruebas.
Note: bwupdate.sh tested on Ubuntu 24.04/26.04 LTS. Use on other versions or distributions is at your own risk. Nota: bwupdate.sh ha sido probado en Ubuntu 24.04/26.04 LTS. Su uso en otras versiones o distribuciones queda bajo su propio riesgo.

Dependencies (for bwupdate.sh)

  • Python 3.x, Bash 5.x
  • wget, curl, tar, gzip, idn2, squid (or squid-openssl), python3, bind9-host, findutils, grep, sed, coreutils, util-linux, file, libc-bin, sudo
  • Python module: requests (required by domfilter.py)
apt install -y wget curl tar gzip idn2 squid python3 bind9-host findutils grep sed coreutils python3-requests util-linux file libc-bin sudo

Bash Update

bwupdate.sh runs the steps needed to generate and update blackweb.txt in sequence. The script requests elevated privileges when an operation requires them. bwupdate.sh ejecuta en secuencia los pasos necesarios para generar y actualizar blackweb.txt. Cuando una operación requiere privilegios, el script los solicita.
git clone --depth=1 https://github.com/maravento/blackweb.git && cd blackweb/bwupdate && ./bwupdate.sh
Before continuing, check that Squid is installed and its service is running. Antes de continuar, conviene comprobar que Squid esté instalado y que el servicio funcione.

Capture Public Blocklists

Downloads the public blocklists listed under SOURCES, extracts their domains and combines them for further processing. Descarga las listas públicas indicadas en SOURCES, extrae sus dominios y los reúne para continuar con la depuración.

Domains Debugging

Removes redundant domains when a broader entry already covers them, normalizes entries for Squid ACLs, and applies debugwl.txt to retain domains that should not be blocked. Elimina dominios redundantes cuando uno ya queda cubierto por otro más general, normaliza las entradas al formato de ACL de Squid y aplica la lista debugwl.txt para conservar dominios que deben excluirse del bloqueo.

Input:

com
.com
.domain.com
domain.com
0.0.0.0 domain.com
127.0.0.1 domain.com
::1 domain.com
domain.com.co
foo.bar.subdomain.domain.com
.subdomain.domain.com.co
www.domain.com
www.foo.bar.subdomain.domain.com
domain.co.uk
xxx.foo.bar.subdomain.domain.co.uk

Output:

.domain.com
.domain.com.co
.domain.co.uk

TLD Validation

Removes domains whose suffix is not in the configured list of valid TLDs. The list covers different levels of public and private suffixes, including domains with up to four labels. Elimina los dominios cuyo sufijo no figura entre los TLD válidos de las fuentes configuradas. La lista contempla distintos niveles de sufijos públicos y privados, incluidos dominios de hasta cuatro etiquetas.

Input:

.domain.exe
.domain.com
.domain.edu.co

Output:

.domain.com
.domain.edu.co

Debugging Punycode-IDN

Removes domain names that exceed length limits or contain unsupported characters, as defined by RFC 1035 and the IDN tools.

It also converts domains containing non-ASCII characters to Punycode/IDNA so they can be validated and processed as ASCII names.
Elimina nombres de dominio que exceden los límites de longitud o contienen caracteres no admitidos.

También convierte los dominios con caracteres no ASCII a formato Punycode/IDNA, para que puedan validarse y procesarse como nombres ASCII. Esta conversión no significa que todos esos dominios se usen para ataques homográficos.

Input:

bücher.com
café.fr
españa.com
köln-düsseldorfer-rhein-main.de
mañana.com
mūsųlaikas.lt
sendesık.com
президент.рф

Output:

xn--bcher-kva.com
xn--caf-dma.fr
xn--d1abbgf6aiiy.xn--p1ai
xn--espaa-rta.com
xn--kln-dsseldorfer-rhein-main-cvc6o.de
xn--maana-pta.com
xn--mslaikas-qzb5f.lt
xn--sendesk-wfb.com

Debugging non-ASCII characters

Removes entries with invalid encoding, non-printable characters, whitespace or unsupported symbols. It then converts the output to ASCII text for further domain validation and processing: Elimina entradas con codificación inválida, caracteres no imprimibles, espacios o símbolos no admitidos. Después convierte la salida a texto ASCII para continuar con la validación y el procesamiento de los dominios:

Input:

M-C$
-$
.$
0$
1$
23andmê.com
.òutlook.com
.ălibăbă.com
.ămăzon.com
.ăvăst.com
.amùazon.com
.aməzon.com
.avalón.com
.bĺnance.com
.bitdẹfender.com
.blóckchain.site
.blockchaiǹ.com
.cashpluÈ™.com
.dẹll.com
.diócesisdebarinas.org
.disnẹylandparis.com
.ebăy.com
.əməzon.com
.evo-bancó.com
.goglÄ™.com
.gooÄŸle.com
.googļę.com
.googlÉ™.com
.google.com
.ibẹria.com
.imgúr.com
.lloydÅŸbank.com
.mýetherwallet.com
.mrgreęn.com
.myẹthẹrwallet.com
.myẹthernwallet.com
.myethẹrnwallet.com
.myetheá¹™wallet.com
.myethernwallẹt.com
.nętflix.com
.paxfùll.com
.türkiyeisbankasi.com
.třezor.com
.westernúnion.com
.yòutube.com
.yăhoo.com
.yoütübe.co
.yoütübe.com
.yoütu.be

Output:

.google.com

DNS Lookup

Many SOURCES contain invalid or nonexistent domains, so DNS queries run in two stages to discard domains that do not resolve. The queries run in parallel and can use substantial CPU and bandwidth. The parallel_procs variable controls concurrency: El proceso comprueba los dominios mediante consultas DNS en dos etapas para descartar los que no resuelven. Las consultas se ejecutan en paralelo y pueden consumir bastante CPU y ancho de banda. parallel_procs permite ajustar la cantidad de consultas simultáneas según los recursos del equipo y la red:
parallel_procs=$(($(nproc)))        # Conservative (network-friendly)
parallel_procs=$(($(nproc) * 2))    # Balanced
parallel_procs=$(($(nproc) * 4))    # Aggressive (default)
parallel_procs=$(($(nproc) * 8))    # Extreme (8 or higher, use with caution)
For example, on a system with a Core i5 CPU (4 physical cores and 8 threads with Hyper-Threading): Por ejemplo, en un equipo con CPU Core i5, cuatro núcleos físicos y ocho subprocesos con Hyper-Threading:
nproc             → 8
parallel_procs=$((8 * 4))  → 32 parallel queries
⚠️ Warning: Higher parallel_procs values can speed up DNS resolution, but may saturate CPU or bandwidth, especially on constrained networks such as satellite links. The following shows an example of the live progress output: ⚠️ Advertencia: Los valores altos de parallel_procs pueden acelerar la resolución DNS, pero también saturar la CPU o el ancho de banda, especialmente en redes limitadas como los enlaces satelitales. El siguiente ejemplo muestra el progreso durante la ejecución:
Processed: 2463489 / 7244989 (34.00%)

Output (manual run):

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.

Input:

.argentina.gob.ar
.mydomain.com
.gob.mx
.gov.uk
.navy.mil

Output:

.mydomain.com

Run Squid-Cache with BlackWeb

When Squid runs with BlackWeb, errors are written to SquidErrors.txt. Al ejecutar Squid-Cache con BlackWeb, los errores se escriben en SquidErrors.txt.

Log

Both bwupdate.sh and checksources.sh write a log file (bwupdate.log or checksources.log) in the directory containing the script. bwupdate.sh y checksources.sh escriben un archivo de registro (bwupdate.log o checksources.log) en el directorio donde se encuentra cada script.

Download Status

Tag Shows English Español
SAVED: File name The transfer completed and the file was written La descarga terminó y el archivo se guardó
PARTIAL: Full URL The download started and was cut off before finishing La descarga comenzó y se interrumpió antes de terminar
BUSY: Full URL The server answered 5xx: it is up but not serving the list right now El servidor respondió con un error 5xx: está disponible, pero no entrega la lista en ese momento
TIMEOUT: Full URL The server did not answer at all El servidor no respondió
BROKEN: Full URL The server answered 404 or 410: broken or nonexistent URL El servidor respondió 404 o 410: el recurso no existe o la URL ya no es válida

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.
  • bwupdate.sh uses --no-check-certificate (wget) and -k (curl) because some public blocklist sources have certificate issues. This allows download attempts but weakens verification of the server's identity; keep this in mind when changing or reviewing sources.
  • La ruta predeterminada para instalar la ACL es /etc/acl; puede cambiarse en bwupdate.sh.
  • Si el script se interrumpe durante la etapa DNS Lookup, al volver a ejecutarlo continuará desde esa etapa. Si se interrumpe antes, será necesario iniciarlo de nuevo o modificarlo para reanudar desde otro punto.
  • Si se usa aufs, debe cambiarse 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.
  • bwupdate.sh desactiva la verificación estricta de certificados porque algunas fuentes públicas tienen problemas con ellos. Esto permite intentar la descarga, pero reduce la verificación de la identidad del servidor; conviene tenerlo en cuenta al modificar o revisar las fuentes.

SOURCES


BLOCKLISTS

DEBUG LISTS

SUBPROJECTS


BlackWeb's core is the domain and TLD blocklist (blackweb.txt and bwupdate.sh). It also includes related projects, each with its own tools and update process. El núcleo de BlackWeb es la lista de bloqueo de dominios y TLD (blackweb.txt y bwupdate.sh). También incluye proyectos relacionados, cada uno con sus propias herramientas y proceso de actualización.

Filter Pack (fpack)

fpack/ contains optional ACLs outside BlackWeb's core flow; bwupdate.sh does not process them. To generate the ACLs, download the lists and run fpack.sh, then apply the Squid rules shown below. They cover ransomware-related file extensions, malicious User-Agents and static web3 lists. fpack.sh generates the first two; the web3 lists are maintained manually and are not modified by the script. fpack/ contiene ACL opcionales, ajenas al flujo principal de BlackWeb; bwupdate.sh no las procesa. Para generarlas, se descargan las listas y se ejecuta fpack.sh; después, se aplican las reglas de Squid que aparecen abajo. Incluyen extensiones de archivo relacionadas con ransomware, User-Agents maliciosos y listas web3 estáticas. fpack.sh genera las dos primeras; las listas web3 se mantienen manualmente y el script no las modifica.
fpack/
├── fpack.sh              # generates rw/rwext.txt and ua/blockua.txt
├── rw/
│   ├── rw.txt               # administrator ransomware blacklist (source)
│   ├── rwext.txt            # Squid url_regex ACL (generated)
│   └── wl.txt               # administrator ransomware whitelist (source)
├── ua/
│   └── blockua.txt          # Squid browser ACL for bad User-Agents (generated)
└── web3/
    ├── web3domains.txt      # Squid dstdomain ACL, web3/wallet domains (static)
    └── web3tld.txt          # Squid dstdomain ACL, web3/wallet TLDs (static)

Requirements

  • wget, curl, grep, sed, coreutils, util-linux
apt install -y wget curl grep sed coreutils util-linux

Download

Either clone the whole BlackWeb repo, or download just the fpack/ folder with gitfolder.py (same tool vault subprojects use): Clone todo el repo de BlackWeb, o descargue solo la carpeta fpack/ con gitfolder.py (la misma herramienta que usan los subproyectos de vault):
# Option 1: full clone
git clone --depth=1 https://github.com/maravento/blackweb.git
cd blackweb/fpack

# Option 2: folder-only download
wget -qO gitfolder.py https://raw.githubusercontent.com/maravento/vault/master/scripts/python/gitfolder.py
chmod +x gitfolder.py
python3 gitfolder.py https://github.com/maravento/blackweb/fpack
cd fpack

Run

fpack.sh only produces Squid ACLs. Run it manually, as a non-root user — it is not scheduled by any installer: fpack.sh solo produce ACLs para Squid. Se ejecuta manualmente, como usuario no root — ningún instalador la programa:
bash fpack.sh
Log: fpack.log, generated in fpack/, emptied at the start of every run. Log: fpack.log, generado en fpack/, vaciado al inicio de cada ejecución.

How It Works

fpack.sh downloads and normalizes the User-Agent list into ua/blockua.txt. It then downloads several ransomware extension/pattern lists, merges them with the administrator list (rw/rw.txt), normalizes extension forms (ext, .ext, _ext, -ext, *ext all become *.ext), and keeps only simple *.ext patterns. It removes entries listed in the administrator whitelist (rw/wl.txt) and discards ransom-note-style or implausibly long extensions. The result is written as a Squid url_regex ACL, rw/rwext.txt, with regex metacharacters escaped so they match literally. fpack.sh descarga y normaliza la lista de User-Agents en ua/blockua.txt. Luego descarga varias listas de extensiones/patrones de ransomware, las combina con la lista del administrador (rw/rw.txt), normaliza las formas de extensión (ext, .ext, _ext, -ext, *ext pasan todas a *.ext) y conserva solo patrones simples *.ext. Elimina las entradas de la lista blanca del administrador (rw/wl.txt) y descarta extensiones tipo nota-de-rescate o implausiblemente largas. El resultado se escribe como ACL url_regex de Squid, rw/rwext.txt, con los metacaracteres de regex escapados para que coincidan como texto literal.

rw/wl.txt excludes entries by exact match, format *.ext, one per line. Do not add *.zip or *.rar: they are common legitimate ransomware suffixes (e.g. *.bart.zip) and would be discarded if whitelisted.

rw/wl.txt excluye entradas por coincidencia exacta, formato *.ext, una por línea. No agregue *.zip ni *.rar: son sufijos legítimos comunes de ransomware (ej. *.bart.zip) y se descartarían si se agregan a la lista blanca.

Squid Rules

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

# Block Rule for Ransomware Extensions/Patterns (Optional)
# https://raw.githubusercontent.com/maravento/blackweb/master/fpack/rw/rwext.txt
acl block_ransomware url_regex -i "/path_to/rwext.txt"
http_access deny block_ransomware

# Block Rule for web3 domains (Optional)
# https://raw.githubusercontent.com/maravento/blackweb/master/fpack/web3/web3domains.txt
acl web3domains dstdomain "/path_to/web3domains.txt"
http_access deny web3domains

# Block Rule for web3 TLDs (Optional)
# https://raw.githubusercontent.com/maravento/blackweb/master/fpack/web3/web3tld.txt
acl web3tld dstdomain "/path_to/web3tld.txt"
http_access deny web3tld

# Block Rule for User-Agents (Optional)
# https://raw.githubusercontent.com/maravento/blackweb/master/fpack/ua/blockua.txt
acl bad_useragents browser -i "/path_to/blockua.txt"
http_access deny bad_useragents

Domain Filtering (DoFi)

Domain Filtering (DoFi) removes redundant domains, validates their suffixes, and can check DNS resolution. bwupdate.sh uses domfilter.py during updates and stops if that step fails. DoFi can also be used independently to process other domain lists: DoFi (Domain Filtering) elimina dominios redundantes, valida sus sufijos y puede comprobar su resolución DNS. bwupdate.sh usa domfilter.py durante la actualización y se detiene si esa etapa falla. DoFi también puede emplearse por separado para procesar otras listas:
python3 domfilter.py --input mylst.txt
dofi/
├── domcheck.sh          # Checks domain existence with the host command
└── domfilter.py         # Removes overlapping domains, validates TLDs

Requirements

  • Python 3.12.3, Bash 5.2.21
  • python3-requests (required by domfilter.py), bind9-host, findutils, grep, sed, coreutils, util-linux (required by domcheck.sh)
apt install -y python3 python3-requests bind9-host findutils grep sed coreutils util-linux

Download

# Option 1: full clone
git clone --depth=1 https://github.com/maravento/blackweb.git
cd blackweb/dofi

# Option 2: folder-only download
wget -qO gitfolder.py https://raw.githubusercontent.com/maravento/vault/master/scripts/python/gitfolder.py
chmod +x gitfolder.py
python3 gitfolder.py https://github.com/maravento/blackweb/dofi
cd dofi

Domain Filter

Before running the filter, remove http://, https:// and www. prefixes from the input list. The script:
- Downloads public suffix lists from multiple sources.
- Removes invalid or duplicate TLDs.
- Filters domains against the valid suffix list.
- Removes overlapping domains.
- Excludes duplicates from previously processed domains.
- Writes the results to a file.
Antes de ejecutar el filtro, deben quitarse de la lista los prefijos http://, https:// y www.. El script:
- Descarga listas de sufijos públicos de varias fuentes.
- Elimina TLD no válidos o duplicados.
- Filtra dominios según la lista de sufijos válidos.
- Elimina dominios superpuestos.
- Excluye dominios duplicados ya procesados.
- Guarda los resultados en un archivo.
python3 domfilter.py --input mylst.txt
In the command, replace mylst.txt with the input filename. By default, results go to output.txt and removed lines to removed.txt; these paths can be changed with the following options: En el comando, mylst.txt debe sustituirse por el nombre del archivo de entrada. De forma predeterminada, el resultado se guarda en output.txt y las líneas descartadas en removed.txt; esas rutas pueden cambiarse con las opciones siguientes:
python3 domfilter.py --input mylst.txt --output outlst.txt --removed removelst.txt

The tlds.txt list includes ccTLDs, gTLDs, sTLDs, eTLDs, and domains of up to four labels.

La lista tlds.txt incluye ccTLD, gTLD, sTLD, eTLD y dominios de hasta cuatro etiquetas.

Domains Check with Host Command

The script queries each domain with the host command and separates results into two files:
- hit.txt: domains that resolved.
- fault.txt: domains that did not resolve.
El script consulta cada dominio con el comando host y separa los resultados en dos archivos:
- hit.txt: dominios que resolvieron.
- fault.txt: dominios que no pudieron resolverse.

Before running the script, remove http://, https://, and www. prefixes from the input list.

Antes de ejecutar el script, quite de la lista los prefijos http://, https:// y www..

chmod +x domcheck.sh
bash domcheck.sh my_domain_list.txt
In the command, replace my_domain_list.txt with the input filename. The optional second argument sets the number of parallel processes (default: nproc × 4, capped at 200): En el comando, my_domain_list.txt debe sustituirse por el nombre del archivo de entrada. El segundo argumento, opcional, indica la cantidad de procesos paralelos (por defecto: nproc × 4, con tope de 200):
bash domcheck.sh my_domain_list.txt 50
2026-07-07 13:29:58 domcheck start...
2026-07-07 13:29:58 Step 1...
2026-07-07 13:30:17 OK
2026-07-07 13:30:17 Step 2...
2026-07-07 13:30:28 hit.txt: domains successfully resolved
2026-07-07 13:30:28 fault.txt: unresolved domains
2026-07-07 13:30:28 Summary:
2026-07-07 13:30:28   Input domains : 7896
2026-07-07 13:30:28   Resolved      : 7349
2026-07-07 13:30:28   Unresolved    : 547
2026-07-07 13:30:28   Elapsed time  : 30s
2026-07-07 13:30:29 domcheck done at: mar 07 jul 2026 13:30:29 -05
Log: dofi.log, generated in dofi/, emptied at the start of every run. Log: dofi.log, generado en dofi/, vaciado al inicio de cada ejecución.

Sources

BACKLINKS


NOTICE


  • This project includes third-party components.
  • Changes must be proposed via Issues. Pull Requests are not accepted.
  • BlackWeb is designed exclusively for Squid-Cache. Because of the large number of blocked domains, it is not recommended in other environments, such as DNSMasq or Pi-Hole, nor in the Windows Hosts file, since it could slow them down or crash them. Use it at your own risk. For more information see 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, review the public sources in SOURCES to identify which list includes it, and contact the maintainer of that list to request its removal. Once the domain is removed from the upstream source, it disappears from Blackweb on the next update. You can also use the following script to perform the same check:
  • 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. Debido a la gran cantidad de dominios bloqueados, no se recomienda usarlo en otros entornos, como DNSMasq o Pi-Hole, ni en el archivo Hosts de Windows, ya que podría ralentizarlos o bloquearlos. Ú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 es un error, revise las fuentes públicas en SOURCES para identificar en cuál lista aparece, y contacte al responsable de esa lista para solicitar su eliminación. Una vez eliminado en la fuente original, el dominio desaparece de Blackweb en la siguiente actualización. También puede usar el siguiente script para hacer la misma comprobación:
wget https://raw.githubusercontent.com/maravento/blackweb/refs/heads/master/bwupdate/tools/checksources.sh
chmod +x checksources.sh
./checksources.sh

e.g:

[?] 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/wildcard/ultimate-onlydomains.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

ACKNOWLEDGMENTS


Special thanks to: Jhonatan Sneider

SPONSOR THIS PROJECT


Image

PROJECT LICENSES


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 GPL-3.0
RAG, Workers, Specialized Modules, Docs CC

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.

Used by

Contributors

Languages