Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - Juan

#121
Códigos Fuentes / Re:[C] Explorando la IT
Mayo 14, 2013, 04:53:03 PM
Es que el mayor problema que tengo a la hora de leer información es que esta en ingles... y no tengo ni idea de ingles  :-[ Este año que biene me apuntare a la academia haber si obtengo resultados jajajajajajjaa

un saludo.
#122
Códigos Fuentes / Re:[C] Explorando la IT
Mayo 14, 2013, 03:14:13 PM
La verdad que no sabia que el compilador de C hacía eso, no os voy a engañar  :)

De lo que me gustaría aprender es más de ensamblador a 16 bits, y como obtienen los datos del PC en 16 bits y eso.... estoy buscando por ahí algun libro gratis en pdf donde expliquen todo esto.


#123
Códigos Fuentes / Re:[C] Explorando la IT
Mayo 14, 2013, 02:53:22 PM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
@mDrinky: Revisa la IAT del ejecutable, sospecho que el compilador ha sido más listo que tú y ha quitado todo lo que hay después del return 0; xD


:o :o :o :o :o :o :o :o :-[ :-[ :-[ :-[ :-[ :-[


Efectivamente era eso... pero no veo el porque no lo compila, tendría que compilarlo desde mi punto de vista... Esto en ASM no pasa jajajaj
#124
Códigos Fuentes / Re:[C] Explorando la IT
Mayo 14, 2013, 01:24:13 PM
Código: c
    #include <string.h>
    #include <stdio.h>
    #include <windows.h>

    int main()
    {
            const char libreria[]="USER32.dll";
            const char funcion[]="MessageBoxA";
            DWORD image_base=(DWORD)GetModuleHandleA(0);
            PIMAGE_DOS_HEADER DOS;
            PIMAGE_NT_HEADERS NT;
            PIMAGE_IMPORT_DESCRIPTOR IT;
            PIMAGE_IMPORT_BY_NAME *IMPORTED_FUNCTIONS;
            PIMAGE_THUNK_DATA Funcion;
            DWORD *IMPORTED_DLL_NAME;
            DWORD *IMPORTED_FUNCTION_NAME;
            unsigned int i=0;

            DOS=(PIMAGE_DOS_HEADER)image_base;
            NT=(PIMAGE_NT_HEADERS)(DOS->e_lfanew + image_base);
            IT=(PIMAGE_IMPORT_DESCRIPTOR)(NT->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress + image_base);
            IMPORTED_DLL_NAME=(DWORD *)(IT->Name + image_base);

            while( (IT->Name) != 0 )
            {
                    IMPORTED_DLL_NAME=(DWORD *)(IT->Name + image_base);
                    if(!strcmp((char *)IMPORTED_DLL_NAME, libreria))
                    {
                            printf("%s\n", (char *)IMPORTED_DLL_NAME);
                            break;
                    }
                    IT++;
            }

            IMPORTED_FUNCTIONS=(PIMAGE_IMPORT_BY_NAME *)(IT->Characteristics + image_base);

            for(i=0;;i++)
            {
                    IMPORTED_FUNCTION_NAME=(DWORD *)((*IMPORTED_FUNCTIONS)->Name + image_base);
                    if(((*IMPORTED_FUNCTIONS)!=0) && (!strcmp((char *)IMPORTED_FUNCTION_NAME, funcion)))
                    {
                            printf("\t%s\n", (char *)IMPORTED_FUNCTION_NAME);
                            break;
                    }
                    IMPORTED_FUNCTIONS++;
            }

            Funcion=(PIMAGE_THUNK_DATA)(IT->FirstThunk + image_base);
            Funcion+=i;
            printf("\t\tDireccion funcion: %p \t Addr en IT: %p\n", *Funcion, Funcion);
            getchar();
            return 0;

            MessageBoxA(0,0,0,0);
    }


Lo he probado correctamente y no funciona.

un saludo!
#125
Códigos Fuentes / Re:[C] Explorando la IT
Mayo 14, 2013, 07:42:28 AM
Código: c
const char libreria[]="USER32.dll";
            const char funcion[]="MessageBoxA";


::) ::) ::) ::)

plof  :-\
#126
Que no te pillen jajajajajajaja  ;D ;D ;D
#127
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Lo cargué y me tiró un tal "Se produjo un error en la llamada DllRegisterServer"

Tienes que ejecutar la consola como administrador.

un saludo.
#129
ASM / Re:ShellCode Kernel32
Abril 19, 2013, 11:55:47 PM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Como no me di cuenta  >:(  Excelente Capo era eso.  ;D gracias

El fallo era mio, nada de gracias.

Un saludo. ;)
#130
ASM / Re:ShellCode Kernel32
Abril 19, 2013, 03:14:41 PM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Excelente mDrinky. me podrias decir porque en W7 x64 el código en FASM se cuelga. osea muestra los datos bien pero deja de funcionar.
con  C funciona perfecto.

Hola, no tengo x64 y no lo puedo probar bien pero vamos así mirando por encima he he dado cuenta de que aqui:

Código: asm

cinvoke GetModuleHandleW,Kernel


No sería con cinvoke sino con invoke

Código: asm
invoke GetModuleHandleW,Kernel


Ya que es una llamada stdcall y no _cdecl

Prueba haber si es eso y me comentas ;)

un saludo!
#131
Off Topic / Alguien ha usado qustodian?
Abril 18, 2013, 05:57:20 AM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login

Quiero saber si realmente me puedo ganar una propinilla con este programa...

#132
Es gracioso  :P
#133
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
¿Esto son las f.a.q.'s?  :-\

CitarP: ¿Como puedo practicar o hacer programas en ASM?
R: Puedes bajar un compilador. Entre los mas comunes estan: TASM (Turbo Asemmbler de Borland), MASM (Macro Assembler de Microsoft) y el RadASM.

xDDDD no se compila nada, se ensambla y linkea. TASM trabaja a 16 bit, y MASM es Assembly de alto nivel. RADASM es un IDE, por decir una linea al azar

Y 3 años desactualizada

En fin, muy corta mi visita por esta comunidad

Un saludo

Adiós.
#134
No se aprende a programar cripters, se aprende a programar y cuando ya sabes programar puedes programar cripters o lo que quieras.
Yo te recomiendo C.

Un saludo.
#135
ASM / ShellCode Kernel32
Abril 15, 2013, 09:31:29 AM
Código: c
// ShellCode que obtiene la direccion de Kernel32.DLL en el proceso
// Programada por Juan fary (mDrinky)
// [email protected]

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>

char code[] = "\x31\xFF\x64\x03\x7F\x30\x8B\x7F\x0C\x8B\x7F\x1C\x8B\x3F\x8B\x57"\
              "\x20\x8B\x4F\x08\x52\x51\x57\x56\xE8\x00\x00\x00\x00\x5B\x81\xEB"\
              "\x1D\x10\x40\x00\x53\x59\x81\xC1\x8A\x10\x40\x00\x53\x81\xC3\x46"\
              "\x10\x40\x00\x51\x52\xFF\xD3\x5B\x5E\x5F\x59\x5A\x8B\x3F\x83\xF8"\
              "\x01\x75\xCB\x89\xC8\xC3\xE8\x00\x00\x00\x00\x5B\x81\xEB\x4B\x10"\
              "\x40\x00\x81\xC3\x62\x10\x40\x00\x55\x89\xE5\x8B\x75\x08\x8B\x4D"\
              "\x0C\x49\x41\xAC\x38\x01\x75\x0D\x3C\x00\x74\x02\xFF\xE3\x80\x39"\
              "\x00\x74\x0B\x75\x00\xB8\x00\x00\x00\x00\x5D\xC2\x08\x00\xB8\x01"\
              "\x00\x00\x00\x5D\xC2\x08\x00\x0A\x0D\x00\x6B\x00\x65\x00\x72\x00"\
              "\x6E\x00\x65\x00\x6C\x00\x33\x00\x32\x00\x2E\x00\x64\x00\x6C\x00\x6C\x00";

int main()
{
        int (*func)();
        func = (int (*)()) code;
        printf("Kernel32 Shellcode: 0x%x\n",(int)(*func)());
        printf("KernelGetModuleHandle: 0x%x\n",GetModuleHandle("KERNEL32.DLL"));
        system("PAUSE");
       
        return 0;
}


Código: asm
; mDrinky

format PE Console

include 'win32ax.inc'
entry start

section '.text' code readable executable
start:
;db 0x31,0xFF,0x64,0x03,0x7F,0x30,0x8B,0x7F,0x0C,0x8B,0x7F,0x1C,0x8B,0x3F,0x8B,0x57
;db 0x20,0x8B,0x4F,0x08,0x52,0x51,0x57,0x56,0xE8,0x00,0x00,0x00,0x00,0x5B,0x81,0xEB
;db 0x1D,0x10,0x40,0x00,0x53,0x59,0x81,0xC1,0x88,0x10,0x40,0x00,0x53,0x81,0xC3,0x44
;db 0x10,0x40,0x00,0x51,0x52,0xFF,0xD3,0x5B,0x5E,0x5F,0x59,0x5A,0x8B,0x3F,0x83,0xF8
;db 0x01,0x75,0xCB,0xC3,0xE8,0x00,0x00,0x00,0x00,0x5B,0x81,0xEB,0x49,0x10,0x40,0x00
;db 0x81,0xC3,0x60,0x10,0x40,0x00,0x55,0x89,0xE5,0x8B,0x75,0x08,0x8B,0x4D,0x0C,0x49
;db 0x41,0xAC,0x38,0x01,0x75,0x0D,0x3C,0x00,0x74,0x02,0xFF,0xE3,0x80,0x39,0x00,0x74
;db 0x0B,0x75,0x00,0xB8,0x00,0x00,0x00,0x00,0x5D,0xC2,0x08,0x00,0xB8,0x01,0x00,0x00
;db 0x00,0x5D,0xC2,0x08,0x00,0x0A,0x0D,0x00,0x6B,0x00,0x65,0x00,0x72,0x00,0x6E,0x00
;db 0x65,0x00,0x6C,0x00,0x33,0x00,0x32,0x00,0x2E,0x00,0x64,0x00,0x6C,0x00,0x6C,0x00
;db 0x00

       xor edi,edi
       add edi,[fs:edi+30h]
       mov edi,[edi+0ch]
       mov edi,[edi+1ch]
       mov edi,[edi]

       next_module:

       mov edx,[edi+0x20]
       mov ecx,[edi+0x8]

       push edx
       push ecx
       push edi ;..
       push esi ;..

       call offset1
       offset1:
       pop ebx
       sub ebx,offset1

       push ebx
       pop ecx  ; Para calcular kernel
       add ecx,Kernel

       push ebx ; guardamos delta

       add ebx,CompararCadenas

       push ecx
       push edx
       call ebx ; Funcion comparar

       ;stdcall ebx,edx,ecx

       pop ebx  ; salvamos el delta

       pop esi ;..
       pop edi ;..
       pop ecx
       pop edx

       mov edi,[edi]

       ;add ebx,next_module

       cmp eax,1
       jne next_module

       mov eax,ecx   ; EAX = KERNEL32.DLL


       cinvoke printf,"Mediante el PEB: %x",eax;ecx
       cinvoke printf,salto

       cinvoke GetModuleHandleW,Kernel
       cinvoke printf,"Mediante GetModuleHandle: %x",eax
       cinvoke printf,salto


       ret

CompararCadenas:
        ; registros que usa EAX, ECX, ESI, EDI, EBX

        call offset2   ; delta offset
        offset2:
        pop ebx
        sub ebx,offset2

        add ebx, bucle   ; delta para la etiquta bucle

        push ebp
        mov ebp, esp

        mov esi,dword[ebp+8]
        mov ecx,dword[ebp+12]
        dec ecx
        bucle:
            inc ecx
            lodsb
            cmp byte[ecx],al
            jne diferentes
            cmp al,0
            je comprobar
            jmp ebx
        comprobar:
            cmp byte[ecx],0
            je iguales
            jne diferentes
        diferentes:
            mov eax,0
            pop ebp
            ret 8
        iguales:
            mov eax,1
            pop ebp
            ret 8

       salto              db 10,13,0
       Kernel             db 0x6B,0x00,0x65,0x00,0x72,0x00,0x6E,0x00,0x65,0x00,0x6C,0x00,0x33,0x00,0x32,0x00,0x2E,0x00,0x64,0x00,0x6C,0x00,0x6C,0x00,0x00,0x00

section '.idata' import data readable writeable
        library MSVCRT,'msvcrt.dll',\
                KERNEL32,'KERNEL32.DLL'

        import MSVCRT,printf,'printf'

        import KERNEL32,lstrcmpW,'lstrcmpW',\
               GetModuleHandleW,'GetModuleHandleW'         


saludos.
#136
Off Topic / Re:De que pais eres?
Abril 11, 2013, 03:33:41 PM
Español y comunista ;D
#137
Off Topic / Re:¿Alguien irá a la GuadalajaraCON?
Abril 04, 2013, 05:09:38 PM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Yo voy (si consigo que mis padres me lleven 3:) ), para ver si los que dan las conferencias estan a buen nivel o son n00bs.

Jaja , creo q el amigo se refirió a guadalajara pero de España! Y el evento es en México, los de guadalajara España son de la comunidad de castilla la mancha ( manchegos).

XD

si...  ::) ::) ::) ::) ::)
#138
Off Topic / Re:¿Alguien irá a la GuadalajaraCON?
Abril 03, 2013, 06:32:51 PM
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Eres manchego 2facer?

¿Qué es eso? xD

Eres español?

#139
Off Topic / Re:¿Alguien irá a la GuadalajaraCON?
Abril 03, 2013, 12:21:55 PM
Eres manchego 2facer?
#140
En Code::Blocks no funciona la siguiente instrucción al precompilador:

Código: c
#pragma comment(lib, "urlmon.lib")


Eso es para VS.

Tiene que haber un parametro que se le pasa al linker para linkear esa librería pero desconozco cual es. Yo que tu la cargaría en memoria con la API GetProcAdress y listo  ;)

un saludo.