[AutoIt] Запуск шеллкодов/Инлайн машинный код:)

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by D4rkC10ud, 15 Oct 2012.

  1. D4rkC10ud

    D4rkC10ud New Member

    Joined:
    30 Jul 2012
    Messages:
    27
    Likes Received:
    1
    Reputations:
    0
    Забавный способ запускать шелл-коды с помощью AutoIt. Этот код получает адрес kernel32.dll

    FASM
    Code:
    GetKernelHandle_x86:
        mov    eax, [fs:030h]
        mov    eax, [eax+0ch]
        mov    eax, [eax+01ch]
        mov    eax, [eax]
        mov    eax, [eax+08h]
        ret
    
    AutoIt

    Code:
    #include <winapi.au3>
     
    $strucGetKernelHandle_x86 = DllStructCreate("char[64]");
    $GetKernelHandle_x86 = Chr(0x64)&Chr(0xA1)&Chr(0x30)&Chr(0x0)&Chr(0x0)&Chr(0x0)&Chr(0x8B)&Chr(0x40)&Chr(0x0C)&Chr(0x8B)
    $GetKernelHandle_x86 &= Chr(0x40)&Chr(0x1c)&Chr(0x8B)&Chr(0x0)&Chr(0x8B)&Chr(0x40)&Chr(0x08)&Chr(0xC3)
    DllStructSetData($strucGetKernelHandle_x86, 1, $GetKernelHandle_x86)
    $hKernel32 = _WinAPI_CallWindowProc(DllStructGetPtr($strucGetKernelHandle_x86), 0, 0, 0, 0)
    MsgBox(0, "Address of Kernel32.dll", Hex($hKernel32))