Quicklinks: Home | Contact |

Subscribe to our RSS feed for regular updates

Renowed security researcher "Kingcope" published a recent zero day vulnerability (i.e no patch and unkown at the time of publication) affecting Microsoft IIS 5 and IIS 6. Functional exploit code exists for IIS 5 / 5.1 no functional code execution exploit code is known to exist for IIS 6.

Update: Kingcope released another exploit against IIS5/IIS6/IIS7 that performs a Denial of Service attack against IIS5/IIS6/IIS7 using unsecure globbing mechanism. This attacks works with standard user accounts (doesn't required write access). The second exploit is tracked under CVE-2009-2521

Updates :
  • Kingcope publishes a new attack against IIS5/IIS6/IIS7 - Denial of service only - CVE-2009-2521
  • Microsoft published KB975191 with more information
  • VDB IDS are : CVE-2009-3023 , VU#276653
  • To perform a DoS attack write access is not required - this is also the case for IIS6
  • Summary: Code execution possible on IIS5/5.1 if write access granted, DoS is possible on both IIS5 and IIS6. Note - there is a improbable condition that may allow code execution on IIS5/5.1 even if write access is not granted, the condition is that a directory is present that has certain characters in it. It's improbable but possible. Thanks to Guido Landi for the insight.
Fast facts IIS5/6 Code execution (CVE-2009-3023:
  • Affects IIS5 /5.1 and IIS6 - currently only a functional code execution exploit for IIS 5/Win2k exists, DoS attacks is possible against all versions.
  • The attacker must use an FTP account that is allowed to create directories (anon or known user) for the exploit to work
  • The FTP service is not enabled by default
  • Anonymous access is not enabled by default
Current vulnerability requirements (code execution):
  • IIS 5 (5.1) or IIS 6 installed and
  • FTP service enabled and
  • Code exec only requirement : NTFS write permissions given to anonymous or known users
    (IIS5 and IIS6 run on Windows XP, Windows 2000, Windows 2003)
    Current mitigations :
    • Disable FTP service on IIS5 and IIS6 if not required or
    • If FTP is required, disable create directory permissions (see KB975191) or disable write access all together (pic) Note: this will not protect against Denial of Service attacks



      1.
      Browse to the root directory of your FTP site. By default this is in %systemroot%\inetpub\ftproot.
      2.
      Right-click on the directory and select Properties.
      3.
      Click the Security tab and click Advanced.
      4.
      Click Change Permissions.
      5.
      Select the Users group and click Edit.
      6.
      Deselect Create Folders/Append Data.
    Comments :
    • Successfull  code execution might be possible without the need to be able to create directories (more research required). Note: For a successful  Denial of Service attack the creation of a directory is not required.

    • The reason there is no functional exploit against IIS6 (Windows 2003) is that the exploit mitigations that ship with Windows2003 make it harder to reliably exploit (if at all)

    • It's possible that the vulnerable part of the IIS code can be reached by other means, if other methods are known we will update this blog.
    Tools :
    • Nmap script to scan network for IIS FTP with write permissions (Credit: Xavier Mertens)
    • OpenVas is able to scan for this flaw
    Links :
    Posted by Thierry Zoller, Luxembourg

    Subscribe to the RSS feed in case you are interested in updates


    As you may or may not know there is massive client-side exploitation movement going on since last year (there has been before but on a less massive scale). There seems to be an ongoing competition between different nations (government orgs.) , revolving around who is able to order chinese servers, deploy client side exploits and run with the false flag the fastest.

    Those that had to look into client-side attacks surely feel the pain of doing so, apart from run-time analysis, it takes some in-depth knowledge of the format and common exploitation techniques (recognise shellcode patterns ) to spot and dissect them.

    The office file format is a file format on steroids, has it's on MFT and own structure - hell the file format can even fragment - that kind of steroid. One can only imaging how this format came to live, did Microsoft launch an internal competition of who comes up with the most complicated and most difficult file format ever ? Compatibility was surely not the goal [1]. Anyway enough ramblings...

    Luckily there has been good progress on the Office fileformat analysis front, there was Officecat [2] and STG Docfileviewer [3] but honestly in terms of supporting analysts, these didn't cut it.

    This week Microsoft released "Offvis", basically DOC/XLS/PPT/OLE parser with added bonus of detecting existing attacks. It's main goal is to help researchers and vendors to facilitate the parsing and dissection of the awfully complicated office file format.

    On another front, Frank Boldewin releases an awesome automatic and generic doc/ppt/xls dissection tool. The tool extracts macros and information about the structure of the file, and searches for common shellcode patterns, has it's own small disassembly logic and, as an added bonus, brute forces possible XOR and ADD obfuscation loops.



    Offvis

    As input Offvis takes Office file format files, such as DOC,XLS and so forth. On the left hand it displays raw content of the file, on the upper right it displays the result of the parsing attempt. The display is interactive allowing you to select a field and see the raw content displayed.

    If the file exploits includes a commonly and known vulnerability, it will display and warn you. It does not detect any other attempts, including the commonly used method of dropping malicious code using macros.

    There seems to be no generic detection of shellcode or malware. In essence Offviss' goal appears to be to help developers and vendors at better understanding the format itself and test the implementations of their parsers. The added CVE recognition of known exploits is a bonus at best, although it has one nifty feature that comes in handy during analysis - defragementation.

    » Download Offviz : http://go.microsoft.com/fwlink/?LinkId=158791
    » Download Fact sheet



    Office Malscanner
    Office Malscanner is a new suite of tools from Frank Boldewin
    • OfficeMalscanner - Scans, parses the format, searches for shellcode patterns, extracts macros, bruteforces all possible XOR and ADD obfuscation keys and searches for executable magic bytes.

    • Disview - Takes an offset as an argument and tries to disassemble the input

    • MalHost-Setup - Patches the shellcode as to halt on execution to allow debugging of the shellcode

    The results we had with the tool were great, it is the first (to our knowledge) generic utility to detect malicious code within office file formats, by that we mean that it doesn't look for specific patterns of known exploits, but uses generic means to detect possible malicious code with the possibility of false positives (as in all generic methods).



    OfficeMalScanner in action analysing a malicious PPT file


    It detects the api hashing method commonly used in shellcode at offsets that are located nearby, it then brute forces all possibly XOR keys and matches MZ,PE signatures indicating binary executables, and extracts them to disk. Additionally it rates the different findings in a metric called "Malicious Index", one might imagine this index to be used to filter out malicious documents at the border setting a minimum "malicious index" to reach.



    Video of the extraction and analysis of a macro based Word dropper

    Click here to see the video in full screen

    The video shows the extraction of a malicious VBA macro included in a Word document and the modifications done to the vba file to drop the exe without executing it.



    Malhost-Setup - disassembling shellcode (here exploit targeting office)



    Malhost-setup can be used to analyse malicious code that directly exploits office - Malhost-setup takes the malicious file as input and the address of the start of the shell code as hexadecimal offset. It then extracts the shellcode and embeds it into an executable allowing to proceed with analysis in your debugger of choice.

    » Download : OfficeMalScanner
    » Paper and malicious samples : Analyzing MSOffice malware with OfficeMalScanner


    Posted by Thierry

    Links:
    [1] http://www.microsoft.com/interop/docs/OfficeBinaryFormats.mspx
    [2] http://www.snort.org/vrt/vrt-resources/officecat
    [3] http://support.microsoft.com/kb/139545/de