BlackIP
BlackIP is a project that collects and unifies public blocklists of IP addresses, to make them compatible with Squid and IPSET (Iptables Netfilter)
BlackIP es un proyecto que recopila y unifica listas públicas de bloqueo de direcciones IPs, para hacerlas compatibles con Squid e IPSET (Iptables Netfilter)
DATA SHEET
| ACL | Blocked IP | File Size |
|---|---|---|
| blackip.txt | 3049758 | 43.6 Mb |
GIT CLONE
git clone --depth=1 https://github.com/maravento/blackip.gitHOW TO USE
blackip.txt is already optimized. Download it and unzip it in the path of your preference / blackip.txt ya viene optimizada. Descárguela y descomprimala en la ruta de su preferencia
Download
wget -q -N https://raw.githubusercontent.com/maravento/blackip/master/blackip.tar.gz && cat blackip.tar.gz* | tar xzf -Checksum
wget -q -N https://raw.githubusercontent.com/maravento/blackip/master/checksum.md5
md5sum blackip.txt | awk '{print $1}' && cat checksum.md5 | awk '{print $1}'IPSET-SQUID RULES
IPSET Rules
This module allows us to perform mass filtering, at a processing speed far superior to other Solutions (See the benchmark). It includes geographical areas with IPDeny) / Este módulo nos permite realizar filtrado masivo, a una velocidad de procesamiento muy superior a otras soluciones (Vea el benchmark). Se incluye zonas geográficas con IPDeny)
Edit your Iptables script and add the following lines: / Edite su script de Iptables y agregue las siguientes líneas:
# IPSET BLOCKZONE (select country to block and ip/range) ###
# http://www.ipdeny.com/ipblocks/
ipset=/sbin/ipset
iptables=/sbin/iptables
route=/path_to_blackip/
zone=/path_to_zones/zones
if [ ! -d $zone ]; then mkdir -p $zone; fi
$ipset -F
$ipset -N -! blockzone hash:net maxelem 1000000
# Uncomment this line if you want to block entire countries
#for ip in $(cat $zone/{cn,ru}.zone $route/blackip.txt); do
# Uncomment this line if you want to block only ips (recommended)
for ip in $(cat $route/blackip.txt); do
$ipset -A blockzone $ip
done
$iptables -t mangle -A PREROUTING -m set --match-set blockzone src -j NFLOG --nflog-prefix 'Blockzone'
$iptables -t mangle -A PREROUTING -m set --match-set blockzone src -j DROP
$iptables -A FORWARD -m set --match-set blockzone dst -j NFLOG --nflog-prefix 'Blockzone'
$iptables -A FORWARD -m set --match-set blpckzone dst -j DROPYou can block entire countries ranges (e.g. China, Rusia, etc) with IPDeny adding the countries to the line: / Puede incluir rangos completos de países (e.g. China, Rusia, etc) con IPDeny agregando los países a la línea:
for ip in $(cat $zone/{cn,ru}.zone $route/blackip.txt); doIn case of error or conflict, execute: / En caso de error o conflicto, ejecute:
ipset flush blockzone # (or: ipset flush)NFLOG: /var/log/ulog/syslogemu.log
chown root:root /var/log
apt -y install ulogd2
if [ ! -d /var/log/ulog/syslogemu.log ]; then mkdir -p /var/log/ulog && touch /var/log/ulog/syslogemu.log; fi
usermod -a -G ulog $USERSquid Rule
Edit:
/etc/squid/squid.confAnd add the following lines: / Y agregue las siguientes líneas:
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
acl blackip dst "/path_to/blackip.txt"
http_access deny blackipImportant about BlackIP
- Should not be used
blackip.txtin IPSET and in Squid at the same time (double filtrate) / No debe utilizarblackip.txten IPSET y en Squid al mismo tiempo (doble filtrado) blackip.txtis a list IPv4. Does not include CIDR /blackip.txtes una lista IPv4. No incluye CIDRblackip.txthas been tested in Squid v3.5.x /blackip.txtha sido testeada en Squid v3.5.x
Squid-Cache Advanced Rules
blackip contains millions of IP addresses, therefore it is recommended: / blackip contiene millones de direcciones IP, por tanto se recomienda:
- Use
bipextra.txtto add IP/CIDR that are not included inblackip.txt(By default it contains some Block CIDR) / Usebipextra.txtpara agregar IP/CIDR que no están incluidas enblackip.txt(Por defecto contiene algunos Block CIDR) - Use
allowip.txt(a allow list of IPv4 IP addresses like a Hotmail, Gmail, Yahoo. Etc) / Useallowip.txt(una lista blanca de direcciones IPs IPv4 tales como Hotmail, Gmail, Yahoo. etc) - Use
aipextra.txtto add allowlists of IP/CIDRs that are not included inallowip.txt/ Useaipextra.txtpara agregar listas blancas de IP/CIDR que no están incluidas enallowip.txt - By default
blackip.txtdoes not exclude private or reserved ranges RFC1918. Use IANA (iana.txt) to exclude these ranges / Por defecto blackip.txt no excluye rangos privados o reservados RFC1918. Use IANA (iana.txt) para excluir estos rangos - To increase security, close Squid to any other request to IP addresses. Very useful for blocking anonymizers / Para incrementar la seguridad, cierre Squid a cualquier otra petición a direcciones IP. Muy útil para el bloqueo de anonimizadores
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
# IP/CIDRs that are not included in allowip
acl aipextra dst "/path_to/aipextra.txt"
http_access allow aipextra
# allowip
acl allowip dst "/path_to/allowip.txt"
http_access allow allowip
# IANA -private/reserved ranges- (Optional)
acl iana dst "/path_to/iana.txt"
http_access allow iana
# IP/CIDR that are not included in blackip
acl bipextra dst "/path_to/bipextra.txt"
http_access deny bipextra
# blackip
acl blackip dst "/path_to/blackip.txt"
http_access deny blackip
# deny all IPs
acl no_ip url_regex -i [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
http_access deny no_ipUPDATE
⚠️ WARNING: BEFORE YOU CONTINUE
This section is only to explain how update and optimization process works. It is not necessary for 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
Blackip Update
The update process of
blackip.txtis executed in sequence by the scriptbipupdate.sh/ El proceso de actualización deblackip.txtes ejecutado en secuencia por el scriptbipupdate.sh
wget -q -N https://raw.githubusercontent.com/maravento/blackip/master/bipupdate/bipupdate.sh && chmod +x bipupdate.sh && ./bipupdate.shDependencies
git ipset iptables bash tar zip wget squid subversion python ulogd2Important about BLackip Update
tw.txtcontaining IPs of teamviewer servers. By default they are commented. To block or authorize them, activate them inbipupdate.sh. To update it usetw.sh/tw.txtcontiene IPs de servidores teamviewer. Por defecto están comentadas. Para bloquearlas o autorizarlas activelas enbipupdate.sh. Para actualizarla usetw.sh- You must activate the rules in Squid before using
bipupdate.sh/ Antes de utilizarbipupdate.shdebe activar las reglas en Squid
Check execution (/var/log/syslog):
BLackip: Done 06/05/2019 15:47:14AllowIP Update
allowip.txtis already updated and optimized. The update process ofallowip.txtis executed in sequence by the scriptaipupdate.sh/allowip.txtya esta actualizada y optimizada. El proceso de actualización deallowip.txtes ejecutado en secuencia por el scriptaipupdate.sh
wget -q -N https://raw.githubusercontent.com/maravento/blackip/master/bipupdate/wlst/aipupdate.sh && chmod +x aipupdate.sh && ./aipupdate.shSOURCES
Blacklists
Actives Blocklists IP
- Abuse.ch Feodo Tracker
- adservers yoyo
- BL Myip
- Cinsscore
- Emerging Threats Block
- Emerging Threats compromised
- Firehold Forus Spam
- Greensnow
- IPDeny
- Malc0de IP Blocklist
- Malwaredomain IP List
- Maxmind
- MyIP BL
- Open BL
- opsxcq proxy-list
- Project Honeypot
- Ransomwaretracker
- Rulez BruteForceBlocker
- Spamhaus
- StopForumSpam 180
- The LashBack UBL
- TOR BulkExitList
- TOR Node List
- Ultimate Hosts IPs Blocklist. Mirror
- Zeustracker
Inactive Blocklists IP (Added to: oldips.txt)
- Blocklist and Blocklist Export. Replaced by Ultimate Hosts IPs Blocklist
- Firehold Level 1 (Excluded for containing CIDR)
- OpenBL
- StopForumSpam Toxic CIDR (Excluded for containing CIDR)
- UCEPROTECT IP Blocklists / BACKSCATTERER.ORG Blocklist
Whitelists
Actives Allowlists IP
- Amazon AWS (Excluded for containing CIDR)
- Microsoft Azure Datacenter (Excluded for containing CIDR)
Inactives Allowlists IP
- O365IPAddresses (No longer support. See This post)
Worklists
Worktools
CONTRIBUTIONS
We thank all those who contributed to this project. Those interested may contribute sending us new "Blocklist" links 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 "Blocklist", para ser incluidas en este proyecto
Special thanks to: Jhonatan Sneider
DONATE
BTC: 3M84UKpz8AwwPADiYGQjT9spPKCvbqm4Bc
LICENCES

© 2020 Maravento Studio
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.
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.
Source Wikipedia
Therefore / Por tanto
blacklist, blocklist, blackweb, blackip, whitelist, etc.
are terms that have nothing to do with racial discrimination / son términos que no tienen ninguna relación con la discriminación racial
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.