elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
17 Mayo 2012, 07:18  


Tema destacado: [AIO elhacker.NET] Compilación herramientas análisis y desinfección malware

+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Análisis y Diseño de Malware (Moderadores: Karcrack, [Zero])
| | |-+  [ASM] Find Kernel Base Address (XP,Vista,7 - x86, x64)
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [ASM] Find Kernel Base Address (XP,Vista,7 - x86, x64)  (Leído 858 veces)
The Swash

Desconectado Desconectado

Mensajes: 74


-H-Sec Fan-


Ver Perfil WWW
[ASM] Find Kernel Base Address (XP,Vista,7 - x86, x64)
« en: 1 Mayo 2011, 18:31 »

Código
mov eax, fs:[030h]
mov eax, [eax + 0ch]
mov eax, [eax + 0ch]
mov eax, [eax]
mov eax, [eax]
mov eax, [eax + 018h]

Bueno leyendo un poco acerca de la PEB y entendiendo como localizaban el BaseAddress de kernel32, recordé que había un código que hicieron rehicieron y mejor dicho xD, bueno ese código dejo de funcionar en 7 donde se agrego Kernelbase.dll y obligó a cambiar el código. Tras pruebas mi código se baso en buscar el orden de carga de las librerías, y ese orden se respeta desde XP hasta 7 tanto en 64 como 32 bits. ;)

Un agradecimiento a Lord, y ya implementaré un método genérico  :P.
Saludos!
En línea
[Zero]
Moderador
***
Desconectado Desconectado

Mensajes: 1.057


CALL DWORD PTR DS:[0]


Ver Perfil WWW
Re: [ASM] Find Kernel Base Address (XP,Vista,7 - x86, x64)
« Respuesta #1 en: 2 Mayo 2011, 02:18 »

Buenísimo, como te dije por MSN  :D.

Saludos
En línea


“El Hombre, en su orgullo, creó a Dios a su imagen y semejanza.”
Nietzsche
The Swash

Desconectado Desconectado

Mensajes: 74


-H-Sec Fan-


Ver Perfil WWW
Re: [ASM] Find Kernel Base Address (XP,Vista,7 - x86, x64)
« Respuesta #2 en: 2 Mayo 2011, 06:09 »

Código genérico:
Código
.386    
.model flat, stdcall
option casemap:none
assume fs:nothing
 
.data
var1 db 'k',0,'e',0,'r',0,'n',0,'e',0,'l',0,'3',0,'2',0
var2 db 'K',0,'E',0,'R',0,'N',0,'E',0,'L',0,'3',0,'2',0
 
.code
start:
mov eax, fs:[030h]
mov eax, [eax + 0ch]
mov eax, [eax + 0ch]
xor edx, edx
mov esi, 0Fh
 
KERNEL:
mov eax, [eax]
mov ebx, [eax + 030h]
 
CMPSTR1:
mov cl, byte ptr [ebx + edx]
cmp byte ptr [offset var1 + edx], cl
jnz CMPSTR2
inc edx
cmp edx, esi
jz EXIT
jmp CMPSTR1
 
CMPSTR2:
mov cl, byte ptr [ebx + edx]
cmp byte ptr [offset var2 + edx], cl
jnz KERNEL
inc edx
cmp edx, esi
jz EXIT
jmp CMPSTR1
 
EXIT:
mov eax, [eax + 018h]
 
end start

Código con filtro:
Código
mov eax, fs:[030h]
mov eax, [eax + 0ch]
mov eax, [eax + 0ch]
KERNEL:
mov eax, [eax]
mov ebx, [eax + 030h]
mov ecx, 00320033h
cmp ecx, [ebx + 0ch]
JNZ KERNEL
mov eax, [eax + 018h]
« Última modificación: 2 Mayo 2011, 06:20 por The Swash » En línea
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Could not find kernel image: linux
Hacking Wireless
Apolo8 1 994 Último mensaje 1 Febrero 2007, 01:56
por Apolo8
Could not find kernel image: linux en elive
GNU/Linux
HK 1 904 Último mensaje 26 Septiembre 2007, 15:51
por ^Tifa^
cómo obtener la base address de una dll ?
Programación C/C++
*dark 3 1,446 Último mensaje 27 Febrero 2008, 05:26
por juas juas juas
Error Wifislax Small 3.1 "Could not find kernel image" AYUDA!
Wireless en Linux
josegarci 3 2,574 Último mensaje 25 Agosto 2009, 00:31
por KARR
Ayuda Find Memory address desde una Dll
Programación C/C++
force1758 1 574 Último mensaje 1 Marzo 2011, 21:34
por mDrinky
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines