Curso de Seguridad Tipos de ataques de denegación de servicio. Alberto Escudero Pascual [email protected] Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 1 Denegación de Servicio Definición: “denegación de servicio” es una ataque caracterizado por un intento explícito de evitar la disponibilidad de un servicio. Recordatorio: La mayoría de los protocolos estan diseñados para dar servicios no para prevenir estos ataques. Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 2 Denegación de Servicio ● Ejemplos basados en CERT – – – – "flood", Inundar la red, previene tráfico legítimo. “Man-in-the-middle”, intento de bloquear una conexión entre máquinas. “Block Users”, intento de bloquear un usuario a la conexión entre máquinas. “Block Services”, intento de bloquear un servicio entre máquinas. Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 3 Denegación de Servicio ● Algunos ejemplos – – – – – – Gusanos “Worms”, UDP vs TCP P2P sin control de flujo. Código PIN (3 veces, queda bloqueado) RST en TCP/IP MAC and IP Spoofing Port Hijacking Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 4 Denegación de Servicio ● ¿Tenemos diseño contra DoS por defecto? – – – – TCP/IP GSM SMTP PSTN Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 5 Denegación de Servicio ● ¿Tenemos diseño contra DoS por defecto? – – – – TCP/IP: SYN Flooding GSM: RF Jamming SMTP: Mail bombing: SMTP PSTN: Phone ’war-dialing’ Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 6 Modos de ataque Tres tipos de ataques básicos: 1. Consumo de los recursos limitados o no renovables. Muy importante en el diseño de protocolos de autentificación (crypto) 2. Destrucción o alteración de la configuración de un servicio. Eg: SMTP Relay, Routing Loops 3. Destrucción Física de los Componentes. Eg: HD y sistemas de ficheros, Overclocking. Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 7 Ejemplos de ataques de saturación/inundación “flood” – UDP flood ● – SYN flood ● ● – Algunas veces se puede cambiar la dirección fuente del paquete. (e.g. Echo service, VoIP?) Parte del “apretón de manos” TCP-handshake. Queda incompleto. SYN_ACK reservan la memoria. Ataques de fragmentación ● ● ● Pilas TCP/IP poco robustas E.g. land (src/dst ip same), jolt2 (ip fragment offset 0), teardrop (overlapping fragments), etc (No tan comunes >2000) Saturar las colas de manejo de fragmentación. Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 8 Ejemplos de ataques de saturación/inundación “flood” (2) – ICMP flood ● – Envio de tormentas de ICMP Smurfing ● ● Enviar un paquete ICMP-Echo-Request a un ‘SMURF amplifier’ network (A-class broadcast address). Todos los ordenadores de esa red responden a la dirección de origen ¿Cómo podemos parar estos ataques? Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 9 Y la lista continua... – Ataque Tormenta (Stream) ● – Tormenta Null flood ● – Envio de TCP ACK TCP sin flags Tormenta de Flags falsas ● TCP con RST, URG, etc. Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 10 Syn Flood (Detalle) – – – – Manolo envía un TCP_SYN de una dirección IP falsificada a Sebastian. Sebastian (Server) envía un TCP_SYN_ACK a Alicia, Sebastian deja la conexión en Connection State (WAIT) y espera N segundos. Si Manolo envía una tormenta de paquetes TCP_SYN falso. Las conexiones se agotan.(No available socket) Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 11 Ataques distribuidos, DDoS, 1999­ ● DDoS – – – – – Se usan zombies Se usan N zombies como intermediarios del ataque El atacante se esconde detras de la red DdoS Se usa la técnica de Piggy-bag para esconder el tráfico de control del ataque. Más dificil de detectar si se usa encryptación, decoy y clientes en silencio. Este ataque tambien es conocido como ”El usuario Windows siempre esta en la red” Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 12 Red de Ataque Distribuida Attacker Handler Agent Agent Handler Agent Agent Handler Agent Agent Victim Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 13 DDoS Tools ● Trin00 – – – – – First occurrence: Early to mid 1999 Attack types: UDP flood Communication: TCP / UDP Encryption: Partially Note: Unprivileged ports, thus no root required Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 14 DDoS Tools ● Tribe Flood Network (TFN) – – – – – First occurrence: Attack types: Communication: Encryption: Note: Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 Mid 1999 UDP flood, ICMP flood, SYN flood, SMURF ICMP No Requires root access 15 DDoS Tools ● Stacheldraht – – – – – First occurrence: Attack types: Communication: Encryption: Note: Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 Fall 1999 UDP flood, ICMP flood, SYN flood, SMURF TCP and ICMP Partially Requires root access 16 DDoS Tools ● Shaft – – – – – First occurrence: Attack types: November 1999 UDP flood, ICMP flood, SYN flood Communication: TCP and UDP Encryption: No Note: Requires root access for spoofed attacks. Gathers statistics about the attack. Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 17 DDoS Tools ● Tribe Flood Network 2000 (TFN2k) – – – – – First occurrence: Attack types: Early 2000 UDP flood, ICMP flood, SYN flood, SMURF Communication: TCP, UDP and ICMP, plus decoy packets (!). Clients are ‘silent’. Encryption: Yes Note: Requires root access. From the same author as TFN (Mixter). Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 18 DDoS Tools ● Stacheldraht v2.666 – – – – – First occurrence: Mid to Fall 2000 Attack types: UDP flood, ICMP flood, SYN flood, SMURF, mstream, mixed-flags TCP floods, null flood Communication: TCP and ICMP Encryption: Partially Note: Requires root access Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 19 DDoS Tools ● Trinity v3 – – – – – First occurrence: Attack types: Fall 2000 UDP flood, fragment flood, SYN flood, mstream, mixed-flags TCP floods, null flood Communication: IRC Encryption: No Note: Requires root access Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 20 Los nuevos ataques DoS 2004­ ● ● ● ● Captura/Secuestro de dominios Inyección de código SQL Gusanos en MS Windows Combinación de Troyanos y Ataques a servidores/dominios Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 21 Tres ejemplos SYN Flooding (Septiembre 2002) Flooding VSAT Satellite (Julio 2003) Ataque a un dominio .org (Marzo 2006) Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 22 (1) Análisis de un ataque SYN SYN Flooder Juno­z Los numeros de las IPs 4, 24, 64, 128, 129, 193, 194, 198, 199, 205, 206, 208, 209, 210, 211, 216 Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 23 ¿Cuántas fuentes son necesarias para un SYN flood? Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 24 (2) Ataque: VSAT Flooding Flooded VSAT Uplink! ip route 0.0.0.0 0.0.0.0 51.12.227.193 ip route 23.110.68.0 255.255.255.0 23.110.64.2 ip route 23.110.64.0 255.255.240.0 Null0 250 Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 25 (3) Gusano contra un dominio .org • • • Un gusano se propaga en la red Tiene un código básico que descarga un ”kit” de ataque de una lista de servidores anteriormente comprometidos. El gusano usa un ”dominio” en lugar de una IP. Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 26 Defensas Filtros que memoricen el estado de las conexiones (State filters) ● Uso de Proxies entre los servidores y la DMZ ● Filtros de ingreso, salida ● Detectores de Intrusiones (Reaccionar Rápido) ● Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 27 Algunos conceptos para recordar... Iptables – Source, Destination NAT – Entender lo que es una DMZ – Herramientas para configuración de firewalls ● Protección contra SYN flooding ● Monitorización de conexiones ● Alberto Escudero Pascual <aep@it4se> Securing the Infrastructure and Services Last updated: 2006-09-29 28