Telephaty: Harness the code

12
Telepathy Harness the code Juan Carlos Montes

Transcript of Telephaty: Harness the code

Page 1: Telephaty: Harness the code

Telepathy Harness the code

Juan Carlos Montes

Page 2: Telephaty: Harness the code

2

Inyecciones comunes

• Pedir memoria en el proceso remoto

• VirtualAllocEx

• Copiar el código a ejecutar en el proceso remoto

• WriteProcessMemory

• Ejecutar el código copiado

• CreateRemoteThread

Proceso A

kernel32.dll

user32.dll

test.dll

Inyector

LoadLibrary

Proceso A

kernel32.dll

user32.dll

test.dll

Proceso A

LoadLibrary

WriteProcessMemory CreateRemoteThread

Page 3: Telephaty: Harness the code

3

• Pedir memoria en el proceso remoto

• VirtualAllocEx

• Copiar el nombre de la DLL

• WriteProcessMemory

• Ejecutar LoadLibrary

• CreateRemoteThread

Inyección con Telepathy

Proceso A

kernel32.dll

user32.dll

Proceso A

kernel32.dll

user32.dll

test.dll

Proceso A

test.dll

WriteProcessMemory

CreateRemoteThread

test.dll Telepathy

Valor de Retorno

Page 4: Telephaty: Harness the code

4

Características Telepathy

• Inyectar DLLs

• Llamando directamente a LoadLibrary (sin uso de códigos insertados)

• Usar cualquier función del proceso remoto, incluidas sus DLLs

• Llamar funciones, tanto por nombre exportado como por dirección

• Usar parámetros en las funciones

• Recuperar su retorno tanto numérico como texto

• Listar todas los OPCODE CALL (xE8)

• Lista actualizable de todos los CALL del proceso

Page 5: Telephaty: Harness the code

5

¿¿Para que??

• Análisis de malware

• Uso de funciones de cifrado reversibles

• Uso de funciones de envió de datos cifrado

• Simulación de recepción de comandos de un panel de control

• …

Page 6: Telephaty: Harness the code

6

DEMO 1

Page 7: Telephaty: Harness the code

7

Page 8: Telephaty: Harness the code

8

DEMO 2

Page 9: Telephaty: Harness the code

9

Page 10: Telephaty: Harness the code

10

Múltiples parámetros

• Es posible usar CreateRemoteThread indicándole múltiples parámetros:

•NO • Solucion?

• PUSH PARAM1

• PUSH PARAM2

• …

• CALL FUNCTION

• RET

Page 11: Telephaty: Harness the code

11

Dudas??

• Dudas??

• Preguntas??

• Donaciones??

• Si, lo publicamos durante las conferencias: https://github.com/intecocert

Page 12: Telephaty: Harness the code

12

Gracias!!!

Juan C. Montes

Mail personal: [email protected]

Mail CERT: [email protected]

Twitter: @jcmontes_tec