Cómo bloquear el tráfico de BitTorrent con IPtables

0 acciones
0
0
0
0

IPTABLES es una aplicación de espacio de usuario que permite al administrador del sistema configurar las tablas proporcionadas por el firewall del kernel de Linux (implementado como varios módulos Netfilter) y sus cadenas y reglas almacenadas.

Configurar reglas de IPtables

Para bloquear el tráfico de BitTorrent con IPTABLES, puede editar /etc/sysconfig/iptables (CentOS 7) e incluir lo siguiente:

vim /etc/sysconfig/iptables

.Primero debes agregar la cadena justo encima de las primeras reglas.

:RH-Firewall-1-INPUT - [0:0]

 

Luego agregue lo siguiente encima de la línea COMMIT.

# Torrent ALGO Strings using Boyer-Moore
-A RH-Firewall-1-INPUT -m string --algo bm --string "BitTorrent" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "BitTorrent protocol" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "peer_id=" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string ".torrent" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "announce.php?passkey=" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "torrent" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "announce" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "info_hash" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string "/default.ida?" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string ".exe?/c+dir" -j DROP
-A RH-Firewall-1-INPUT -m string --algo bm --string ".exe?/c_tftp" -j DROP

# Torrent Keys
-A RH-Firewall-1-INPUT -m string --string "peer_id" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "BitTorrent" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "BitTorrent protocol" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "bittorrent-announce" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "announce.php?passkey=" --algo kmp -j DROP

# Distributed Hash Table (DHT) Keywords
-A RH-Firewall-1-INPUT -m string --string "find_node" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "info_hash" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "get_peers" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "announce" --algo kmp -j DROP
-A RH-Firewall-1-INPUT -m string --string "announce_peers" --algo kmp -j DROP

 

Reiniciar IPtables

/etc/init.d/iptables restart

Ver tablas IP/Verificar reglas

iptables -L

Salida de muestra

Chain RH-Firewall-1-INPUT (0 references)
target     prot opt source               destination         
DROP       all  --  anywhere             anywhere            STRING match "BitTorrent" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "BitTorrent protocol" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "peer_id=" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match ".torrent" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "announce.php?passkey=" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "torrent" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "announce" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "info_hash" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "/default.ida?" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match ".exe?/c+dir" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match ".exe?/c_tftp" ALGO name bm TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "peer_id" ALGO name kmp TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "BitTorrent" ALGO name kmp TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "BitTorrent protocol" ALGO name kmp TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "bittorrent-announce" ALGO name kmp TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "announce.php?passkey=" ALGO name kmp TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "find_node" ALGO name kmp TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "info_hash" ALGO name kmp TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "get_peers" ALGO name kmp TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "announce" ALGO name kmp TO 65535 
DROP       all  --  anywhere             anywhere            STRING match "announce_peers" ALGO name kmp TO 65535

 

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *


También te puede gustar
Las mejores formas de prevenir ataques DDoS

Mejores prácticas para prevenir ataques DDoS para administradores de sitios web

Los ataques DDoS (Denegación de Servicio Distribuido) son una de las amenazas de seguridad más comunes y destructivas para sitios web y servidores. Al enviar un gran volumen de solicitudes maliciosas, estos ataques saturan los recursos del servidor y provocan graves ralentizaciones, tiempo de inactividad del sitio web e incluso la pérdida de ingresos y reputación de marca. Para los administradores de sitios web y servidores, familiarizarse con los métodos básicos para abordar los ataques DDoS es una necesidad, no una opción. En este artículo, examinaremos las soluciones técnicas y prácticas más eficaces para prevenir y reducir el impacto de los ataques DDoS de forma experta.
Habilitación y deshabilitación de Cloudflare Universal SSL: una guía práctica y segura para administradores de servidores y desarrolladores

Habilitación y deshabilitación de Cloudflare Universal SSL: una guía práctica y segura para administradores de servidores y desarrolladores

En este artículo, explicaremos detalladamente y con detalle cómo habilitar y deshabilitar Universal SSL en Cloudflare. Esta guía te ayudará a aprovechar al máximo este servicio para proteger tu sitio web. Aprende a habilitarlo y deshabilitarlo, y familiarízate con la configuración de seguridad.