Home / exploits IBM Personal Communications I-Series Buffer Overflow
Posted on 29 February 2012
## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = GreatRanking # ASLR+DEP bypass include Msf::Exploit::FILEFORMAT def initialize(info = {}) super(update_info(info, 'Name' => 'IBM Personal Communications I-Series Access WorkStation 5.9 Profile', 'Description' => %q{ The IBM Personal Communications I-Series application WorkStation is susceptible to a stack-based buffer overflow vulnerability within file parsing in which data copied to a location in memory exceeds the size of the reserved destination area. The buffer is located on the runtime program stack. When the WorkStation file is opened it will reach the code path at 0x67575180 located in pcspref.dll which conducts string manipulation and validation on the data supplied in the WorkStation file. The application will first check if 'Profile' header exists and appends a dot with the next parameter within the file. It will then measure the character length of the header by calling strcspn with a dot as its null-terminated character. It will then write the header into memory and ensure the header ends with a NUL character. The parameter character array is passed to the strcpy() function. The application has declared a 52-element character array for the destination for strcpy function. The function does not perform bounds checking therefore, data can be written paste the end of the buffer variable resulting in corruption of adjacent variables including other local variables, program state information and function arguments. You will notice that the saved RETURN address at offset 0x6c is overwritten by the data written past the buffer. To ensure we can perform arbitrary code execution we must we provide a valid pointer at 0x74 which is used as a argument for the called function at 0x675751ED as a id file extension parameter. Once the caller regains control we will reach our RETURN. The Ret instruction will be used to pop the overwritten saved return address which was currupted. This exploit has been written to bypass 2 mitigations DEP and ASLR on a Windows platform. Versions tested: IBM System i Access for Windows V6R1M0 version 06.01.0001.0000a Which bundles pcsws.exe version 5090.27271.709 Tested on: Microsoft Windows XP [Version 5.1.2600] Microsoft Windows Vista [Version 6.0.6002] Microsoft Windows 7 [Version 6.1.7600] }, 'License' => MSF_LICENSE, 'Author' => 'TecR0c <roccogiovannicalvi[at]gmail.com>',# Discovery & Metasploit module 'Payload' => { 'Space' => 800, 'BadChars' => "x00x0ax0dx3d" # NUL '