elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


  Mostrar Mensajes
Páginas: 1 ... 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 [104] 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 ... 123
1031  Seguridad Informática / Análisis y Diseño de Malware / Re: Ayuda api hoking :P en: 4 Mayo 2011, 19:34 pm
Este es el código que he reparado con los errores que me diiste Zero pero sigue sin funcionar:

Código
  1. format PE GUI 4.0 DLL
  2. entry DllEntryPoint
  3.  
  4. include 'win32ax.inc'
  5.  
  6. section '.code' code readable executable
  7.  
  8. proc DllEntryPoint hinstDLL,fdwReason,lpvReserved
  9.        locals
  10.            proteccion dd ?
  11.        endl
  12.  
  13.        invoke LoadLibrary,'user32.dll'
  14.        invoke GetProcAddress,eax,"MessageBoxA"
  15.        mov ebx,eax; ebx  = direccion MessageBoxA
  16.  
  17.        invoke VirtualProtect,ebx,5,PAGE_EXECUTE_READWRITE,addr proteccion
  18.  
  19.        mov byte[ebx],0xE9
  20.        inc ebx
  21.        call distancia
  22.        distancia:
  23.        pop ecx
  24.        add ecx,4
  25.        sub ecx,hook
  26.        mov dword[ebx],ecx
  27.        add ebx,4
  28.        ret
  29. endp
  30.  
  31. proc hook,uno,dos,tres,cuatro
  32.    invoke MessageBox,0,'Juan te hookeo',0,0
  33.    mov eax,0
  34.    ret
  35. endp
  36. ; VOID ShowErrorMessage(HWND hWnd,DWORD dwError);
  37.  
  38. proc ShowErrorMessage hWnd,dwError
  39.  local lpBuffer:DWORD
  40.        lea     eax,[lpBuffer]
  41.        invoke  FormatMessage,FORMAT_MESSAGE_ALLOCATE_BUFFER+FORMAT_MESSAGE_FROM_SYSTEM,0,[dwError],LANG_NEUTRAL,eax,0,0
  42.        invoke  MessageBox,[hWnd],[lpBuffer],NULL,MB_ICONERROR+MB_OK
  43.        invoke  LocalFree,[lpBuffer]
  44.        ret
  45. endp
  46.  
  47. ; VOID ShowLastError(HWND hWnd);
  48.  
  49. proc ShowLastError hWnd
  50.        invoke  GetLastError
  51.        stdcall ShowErrorMessage,[hWnd],eax
  52.        ret
  53. endp
  54. section '.data' data readable writeable
  55.        mensajito db ?
  56.  
  57.  
  58. section '.idata' import data readable writeable
  59.  
  60.  library kernel,'KERNEL32.DLL',\
  61.          user,'USER32.DLL'
  62.  
  63.  import kernel,\
  64.         GetLastError,'GetLastError',\
  65.         SetLastError,'SetLastError',\
  66.         FormatMessage,'FormatMessageA',\
  67.         LocalFree,'LocalFree',\
  68.         LoadLibrary,'LoadLibraryA',\
  69.         GetProcAddress,'GetProcAddress',\
  70.         VirtualProtect,'VirtualProtect'
  71.  
  72.  import user,\
  73.         MessageBox,'MessageBoxA'
  74.  
  75. section '.edata' export data readable
  76.  
  77.  export 'ERRORMSG.DLL',\
  78.         ShowErrorMessage,'ShowErrorMessage',\
  79.         ShowLastError,'ShowLastError'
  80.  
  81. section '.reloc' fixups data discardable          

salu2! y gracias por la ayudaaa
1032  Seguridad Informática / Análisis y Diseño de Malware / Ayuda api hoking :P en: 3 Mayo 2011, 20:41 pm
Bueno estoi intentando hookear una API desde una DLL creada en Fasm pero no lo consigo y nose que estoi haciendo mal, este es el código de la dll:

Código
  1. format PE GUI 4.0 DLL
  2. entry DllEntryPoint
  3.  
  4. include 'win32ax.inc'
  5.  
  6. section '.code' code readable executable
  7.  
  8. proc DllEntryPoint hinstDLL,fdwReason,lpvReserved
  9.        locals
  10.            proteccion dd ?
  11.        endl
  12.  
  13.        invoke LoadLibrary,'user32.dll'
  14.        invoke GetProcAddress,eax,"MessageBoxA"
  15.        mov ebx,eax; ebx  = direccion MessageBoxA
  16.  
  17.        invoke VirtualProtect,-1,ebx,5,PAGE_EXECUTE_READWRITE,edx
  18.  
  19.        mov ebx,0xE9
  20.        inc ebx
  21.        mov dword[ebx],hook
  22.        add ebx,4
  23.        ret
  24. endp
  25.  
  26. proc hook,uno,dos,tres,cuatro
  27.    invoke MessageBox,0,0,0,0
  28.    mov eax,0
  29.    ret
  30. endp
  31. ; VOID ShowErrorMessage(HWND hWnd,DWORD dwError);
  32.  
  33. proc ShowErrorMessage hWnd,dwError
  34.  local lpBuffer:DWORD
  35.        lea     eax,[lpBuffer]
  36.        invoke  FormatMessage,FORMAT_MESSAGE_ALLOCATE_BUFFER+FORMAT_MESSAGE_FROM_SYSTEM,0,[dwError],LANG_NEUTRAL,eax,0,0
  37.        invoke  MessageBox,[hWnd],[lpBuffer],NULL,MB_ICONERROR+MB_OK
  38.        invoke  LocalFree,[lpBuffer]
  39.        ret
  40. endp
  41.  
  42. ; VOID ShowLastError(HWND hWnd);
  43.  
  44. proc ShowLastError hWnd
  45.        invoke  GetLastError
  46.        stdcall ShowErrorMessage,[hWnd],eax
  47.        ret
  48. endp
  49. section '.data' data readable writeable
  50.        mensajito db ?
  51.  
  52.  
  53. section '.idata' import data readable writeable
  54.  
  55.  library kernel,'KERNEL32.DLL',\
  56.          user,'USER32.DLL'
  57.  
  58.  import kernel,\
  59.         GetLastError,'GetLastError',\
  60.         SetLastError,'SetLastError',\
  61.         FormatMessage,'FormatMessageA',\
  62.         LocalFree,'LocalFree',\
  63.         LoadLibrary,'LoadLibraryA',\
  64.         GetProcAddress,'GetProcAddress',\
  65.         VirtualProtect,'VirtualProtectEx'
  66.  
  67.  import user,\
  68.         MessageBox,'MessageBoxA'
  69.  
  70. section '.edata' export data readable
  71.  
  72.  export 'ERRORMSG.DLL',\
  73.         ShowErrorMessage,'ShowErrorMessage',\
  74.         ShowLastError,'ShowLastError'
  75.  
  76. section '.reloc' fixups data discardable  


Esperando repuesta...

salu2!
1033  Seguridad Informática / Análisis y Diseño de Malware / Re: Ayuda para analizar lo que hace este virus. en: 8 Abril 2011, 17:05 pm
ya que esta programado en VB lo mas sensato seria decompilarlo con VBDecompiler y ver lo que hace tranquilamente  :P

salu2!
1034  Seguridad Informática / Análisis y Diseño de Malware / Re: Shell Remota en C en: 31 Marzo 2011, 15:19 pm
Ah, vale...   ;D

thanks...
1035  Seguridad Informática / Análisis y Diseño de Malware / Re: Shell Remota en C en: 27 Marzo 2011, 23:42 pm
Hasta que el proceso no se crea no continua la ejecución de tu programa :D

No se me ocurre como hacerlo... de una forma rápida, alguna pista?

salu2!
1036  Seguridad Informática / Análisis y Diseño de Malware / Re: Shell Remota en C en: 27 Marzo 2011, 20:34 pm
Te refieres a esperar a que se cree el proceso usando WaitForSingleObject, no?

salu2!
1037  Seguridad Informática / Análisis y Diseño de Malware / Re: Shell Remota en C en: 27 Marzo 2011, 18:02 pm
Muchas gracias a los dos, ya lo consegui hacer... el caso es que me quedo así:

Código
  1. #include <windows.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.    SECURITY_ATTRIBUTES sa;
  8.    STARTUPINFO si;
  9.    PROCESS_INFORMATION pi;
  10.  
  11.    void * leer;
  12.    void * escribir;
  13.  
  14.    ZeroMemory(&sa,sizeof(&sa));
  15.  
  16.    sa.nLength = sizeof(SECURITY_ATTRIBUTES);
  17.    sa.bInheritHandle = TRUE;
  18.    sa.lpSecurityDescriptor = NULL;
  19.  
  20.    CreatePipe(&leer,&escribir,&sa,0);
  21.  
  22.    GetStartupInfoA(&si);
  23.  
  24.    si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
  25.    si.wShowWindow = SW_HIDE;
  26.    si.hStdOutput = escribir;
  27.    si.hStdError  = escribir;
  28.    si.hStdInput = leer;
  29.  
  30.    CreateProcessA(0,"c:\\windows\\system32\\cmd.exe /c dir",0,0,TRUE,0,0,0,&si,&pi);
  31.    Sleep(200);
  32.    CloseHandle(escribir);
  33.  
  34.    char buffer[1024];
  35.    DWORD bleidos;
  36.    ReadFile(leer,buffer,1024,&bleidos,0);
  37.    MessageBoxA(0,buffer,0,0);
  38.  
  39.    system("PAUSE");
  40.    return 0;
  41. }


No es una "MegaShell" pero su "apaño" hace  :P
salu2!
1038  Seguridad Informática / Análisis y Diseño de Malware / Re: Shell Remota en C en: 27 Marzo 2011, 15:36 pm
Muchas gracias Karcrack sin duda lo leeré pero tambien me gustaria saber que ago mal en el código que postee.

salu2!
1039  Seguridad Informática / Análisis y Diseño de Malware / Shell Remota en C en: 27 Marzo 2011, 14:48 pm
Buenas, estoi intentando hacer una Shell Remota en C  ya que nunca hice una en este lenguaje y me pica la curiosidad  :xD el caso es que no me sale...

El código que tengo es este:

Código
  1. #include <windows.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.    PHANDLE leer;
  8.    PHANDLE escribir;
  9.  
  10.    SECURITY_ATTRIBUTES sa;
  11.    STARTUPINFO si;
  12.    PROCESS_INFORMATION pi;
  13.  
  14.    DWORD bytes;
  15.  
  16.    CreatePipe(leer,escribir,&sa,0);
  17.  
  18.    si.cb = 68;
  19.    si.dwFlags = 257;
  20.  
  21.    si.hStdError = escribir;
  22.    si.hStdOutput = escribir;
  23.  
  24.    CreateProcessA(0,"cmd.exe /c ping 127.0.0.1", &sa, &sa, 1, NORMAL_PRIORITY_CLASS, 0, 0, &si, &pi);
  25.    Sleep(100);
  26.    CloseHandle(escribir);
  27.  
  28.    char buffer[1024];
  29.    char total[1024];
  30.  
  31.    int ret = ReadFile(leer,buffer,250,&bytes,0);
  32.  
  33.    lstrcat(total,buffer);
  34.  
  35.    while(ret != 0)
  36.    {
  37.        ret = ReadFile(leer,buffer,250,&bytes,0);
  38.        lstrcat(total,buffer);      
  39.    }
  40.  
  41.    MessageBoxA(0,total,0,0);
  42.    system("PAUSE");
  43.  
  44.    return 0;
  45. }
  46.  

Alguien sabe que hago mal?

salu2!
1040  Programación / Programación C/C++ / Re: Linkear APIS librerias como lo quieran llamar. en: 16 Marzo 2011, 17:28 pm
Yo uso Dev c++ y Visual Studio. Creo que se le pasan las mismas instrucciones a los otros compiladores. En algunos como Visual Studio no hace falta pasarle la instruccion al liker si las librerias que usas son de windows.

salu2!
Páginas: 1 ... 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 [104] 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 ... 123
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines