12.07.2015 Views

Bug Hunter Diary

Bug Hunter Diary

Bug Hunter Diary

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In sub_1000767F the user-provided wide-character string is convertedto a character string using the WideCharToMultiByte() function.After that, sub_10009642 is called, and the user-controlled characterstring is copied into another buffer. The code in sub_10009642 allowsa maximum of 256 user-controlled bytes to be copied into this newcharacter buffer (pseudo C code: strncpy (new_buffer, user_controlled_string, 256)). The function sub_10009826 is called, and it calls sub_100096D0,which then calls the vulnerable function sub_1000B37D.[..].text:1000B37D ; int __cdecl sub_1000B37D(DWORD cbData, LPBYTE lpData, int, int, int).text:1000B37D sub_1000B37D proc near.text:1000B37D.text:1000B37D SubKey= byte ptr -10Ch.text:1000B37D Type= dword ptr -8.text:1000B37D hKey= dword ptr -4.text:1000B37D cbData= dword ptr 8.text:1000B37D lpData= dword ptr 0Ch.text:1000B37D arg_8= dword ptr 10h.text:1000B37D arg_C= dword ptr 14h.text:1000B37D arg_10= dword ptr 18h.text:1000B37D.text:1000B37D push ebp.text:1000B37E mov ebp, esp.text:1000B380 sub esp, 10Ch.text:1000B386 push edi.text:1000B387 lea eax, [ebp+SubKey] ; the address of SubKey is saved in eax.text:1000B38D push [ebp+cbData] ; 4th parameter of sprintf(): cbData.text:1000B390 xor edi, edi.text:1000B392 push offset aAuthoring ; 3rd parameter of sprintf(): "Authoring".text:1000B397 push offset aSoftwareWebexU ; 2nd parameter of sprintf(): "SOFTWARE\\...text:1000B397; ..Webex\\UCF\\Components\\%s\\%s\\Install".text:1000B39C push eax ; 1st parameter of sprintf(): address of SubKey.text:1000B39D call ds:sprintf ; call to sprintf()[..].data:10012228 ; char aSoftwareWebexU[].data:10012228 aSoftwareWebexU db 'SOFTWARE\Webex\UCF\Components\%s\%s\Install',0[..]Listing 5-3: Disassembly of the vulnerable function sub_1000B37D (created in IDA Pro)The first argument of sub_1000B37D, called cbData, holds a pointerto the user-controlled data stored in the new character buffer (seenew_buffer in the description of Figure 5-8). As I said before, the usercontrolledwide-character data is stored in this new buffer as a characterstring with a maximum length of 256 bytes. Listing 5-3 showsthat the sprintf() function at address .text:1000B39D copies the usercontrolleddata pointed to by cbData into a stack buffer called SubKey(see .text:1000B387 and .text:1000B39C).80 Chapter 5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!