базонезависимый код+поиск кернела(проблемка)

Тема в разделе "WASM.BEGINNERS", создана пользователем n1kt0, 12 авг 2009.

  1. n1kt0

    n1kt0 Забанен

    Публикаций:
    0
    Регистрация:
    18 июл 2007
    Сообщения:
    160
    код инструкций, которым ищу кернел:
    MOV EAX,-1h
    MOV EDI,DWORD PTR FS:[0h]
    далее заводим цикл
    ------------------------------------------
    В общем при попытке найти кернел при третьей или четвертой итерации вываливается олька с Access violation when reading 7FFA0000
    Начальным адресом является 7FFD7000.
    Просмотр шелл-кода выполняется из си программы прямым запуском:

    .....
    .....
    __asm {
    mov eax,[shellcode]
    int 3
    call eax
     
  2. n1kt0

    n1kt0 Забанен

    Публикаций:
    0
    Регистрация:
    18 июл 2007
    Сообщения:
    160
    могу кусок трейса выложить.Нужно ?
     
  3. icent

    icent New Member

    Публикаций:
    0
    Регистрация:
    23 апр 2009
    Сообщения:
    154
    закрывай скорее тему)
     
  4. n1kt0

    n1kt0 Забанен

    Публикаций:
    0
    Регистрация:
    18 июл 2007
    Сообщения:
    160
    closed.
     
  5. icent

    icent New Member

    Публикаций:
    0
    Регистрация:
    23 апр 2009
    Сообщения:
    154
    актуальный код для Win2k-7RC1

    Код (Text):
    1.   cld                    // clear the direction flag for the loop
    2.   xor edx, edx           // zero edx
    3.  
    4.   mov edx, [fs:edx+0x30] // get a pointer to the PEB
    5.   mov edx, [edx+0x0C]    // get PEB->Ldr
    6.   mov edx, [edx+0x14]    // get the first module from the InMemoryOrder module list
    7. next_mod:
    8.   mov esi, [edx+0x28]    // get pointer to modules name (unicode string)
    9.   push byte 24           // push down the length we want to check
    10.   pop ecx                // set ecx to this length for the loop
    11.   xor edi, edi           // clear edi which will store the hash of the module name
    12. loop_modname:
    13.   xor eax, eax           // clear eax
    14.   lodsb                  // read in the next byte of the name
    15.   cmp al, 'a'            // some versions of Windows use lower case module names
    16.   jl not_lowercase
    17.   sub al, 0x20           // if so normalise to uppercase
    18. not_lowercase:
    19.   ror edi, 13            // rotate right our hash value
    20.   add edi, eax           // add the next byte of the name to the hash
    21.   loop loop_modname      // loop until we have read enough
    22.   cmp edi, 0x6A4ABC5B    // compare the hash with that of KERNEL32.DLL
    23.   mov ebx, [edx+0x10]    // get this modules base address
    24.   mov edx, [edx]         // get the next module
    25.   jne next_mod           // if it doesn't match, process the next module
    26.  
    27.   // when we get here EBX is the kernel32 base (or change to suit).
    (с) Harmony Security Blog