查看: 9412|回复: 11

Windows 8.1 (32/64 bit) - Privilege Escalation

[复制链接]
  • TA的每日心情

    2024-12-14 22:22
  • 签到天数: 1631 天

    [LV.Master]伴坛终老

    发表于 2015-1-11 18:14:30 | 显示全部楼层 |阅读模式
    [AppleScript] 纯文本查看 复制代码
    ## Source: [url]http://code.google.com/p/google-security-research/issues/detail?id=118#c1[/url]
     
     
    Platform: Windows 8.1 Update 32/64 bit (No other OS tested)
     
    On Windows 8.1 update the system call NtApphelpCacheControl (the code is actually in ahcache.sys) allows application compatibility data to be cached for quick reuse when new processes are created. A normal user can query the cache but cannot add new cached entries as the operation is restricted to administrators. This is checked in the function AhcVerifyAdminContext.
     
    This function has a vulnerability where it doesn't correctly check the impersonation token of the caller to determine if the user is an administrator. It reads the caller's impersonation token using PsReferenceImpersonationToken and then does a comparison between the user SID in the token to LocalSystem's SID. It doesn't check the impersonation level of the token so it's possible to get an identify token on your thread from a local system process and bypass this check. For this purpose the PoC abuses the BITS service and COM to get the impersonation token but there are probably other ways. 
     
    It is just then a case of finding a way to exploit the vulnerability. In the PoC a cache entry is made for an UAC auto-elevate executable (say ComputerDefaults.exe) and sets up the cache to point to the app compat entry for regsvr32 which forces a RedirectExe shim to reload regsvr32.exe. However any executable could be used, the trick would be finding a suitable pre-existing app compat configuration to abuse. 
     
    It's unclear if Windows 7 is vulnerable as the code path for update has a TCB privilege check on it (although it looks like depending on the flags this might be bypassable). No effort has been made to verify it on Windows 7. NOTE: This is not a bug in UAC, it is just using UAC auto elevation for demonstration purposes. 
     
    The PoC has been tested on Windows 8.1 update, both 32 bit and 64 bit versions. I'd recommend running on 32 bit just to be sure. To verify perform the following steps:
     
    1) Put the AppCompatCache.exe and Testdll.dll on disk
    2) Ensure that UAC is enabled, the current user is a split-token admin and the UAC setting is the default (no prompt for specific executables). 
    3) Execute AppCompatCache from the command prompt with the command line "AppCompatCache.exe c:\windows\system32\ComputerDefaults.exe testdll.dll". 
    4) If successful then the calculator should appear running as an administrator. If it doesn't work first time (and you get the ComputerDefaults program) re-run the exploit from 3, there seems to be a caching/timing issue sometimes on first run.

    点评

    沙发  发表于 2015-1-11 18:47
    回复

    使用道具 举报

  • TA的每日心情

    2021-9-9 23:35
  • 签到天数: 1 天

    [LV.1]初来乍到

    发表于 2015-1-11 20:17:55 | 显示全部楼层
    感受到满满的干货
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    发表于 2015-1-11 22:03:27 | 显示全部楼层
    支持楼主啊
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2017-8-21 09:22
  • 签到天数: 181 天

    [LV.7]常住居民III

    发表于 2015-1-12 08:59:46 | 显示全部楼层
    都是宝贝儿啊
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2017-9-30 10:51
  • 签到天数: 312 天

    [LV.8]以坛为家I

    发表于 2015-1-12 12:04:06 | 显示全部楼层
    谢谢分享
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2016-8-27 01:19
  • 签到天数: 50 天

    [LV.5]常住居民I

    发表于 2015-1-12 18:21:27 | 显示全部楼层
    小学生只能观望中
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    发表于 2015-1-13 00:47:12 | 显示全部楼层
    谢谢分享。。。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情

    2017-7-26 10:09
  • 签到天数: 54 天

    [LV.5]常住居民I

    发表于 2015-1-13 21:00:06 | 显示全部楼层
    谢谢分享
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    发表于 2015-1-18 05:13:18 | 显示全部楼层
    谢谢分享
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    指导单位

    江苏省公安厅

    江苏省通信管理局

    浙江省台州刑侦支队

    DEFCON GROUP 86025

    旗下站点

    邮箱系统

    应急响应中心

    红盟安全

    联系我们

    官方QQ群:112851260

    官方邮箱:security#ihonker.org(#改成@)

    官方核心成员

    Archiver|手机版|小黑屋| ( 苏ICP备2021031567号 )

    GMT+8, 2024-12-23 05:34 , Processed in 0.031487 second(s), 18 queries , Gzip On, MemCache On.

    Powered by ihonker.com

    Copyright © 2015-现在.

  • 返回顶部