百度空间 | 百度首页 
 
查看文章
 
MS Windows Token Kidnapping本地提权的解决方案
2008-10-10 10:01
昨天放出来的exp让大家狠狠的爽了一把吧,听说有人连续提权了十多台webshell的。

今天MS更新了安全公告

这个漏洞是由于在NetworkService 或者 LocalService 下运行的代码,可以访问同样是在 NetworkService 或者 LocalService 下运行的进程,某些进程允许提升权限为LocalSystem

对于IIS,默认安装是不受影响的,受影响的是你的ASP.NET代码是以 Full Trust 运行,如果权限低于 Full Trust,也不会受影响。老的Asp 代码不受影响,只有 ASP.NET才受影响。

对于 SQL Server,如果用户以administrative 权限运行代码,则会受影响

对于Windows Server 2003,攻击者可以通过MSDTC获取token访问其他同样token的进程,从而可能造成提权。

任何具有SeImpersonatePrivilege的进程都有可能造成提权。

对于服务器管理员来说,做一些简单的调整可以在IIS上对抗此威胁。

IIS 6.0 - Configure a Worker Process Identity (WPI) for an application pool in IIS to use a created account in IIS Manager and disable MSDTC

Perform the following steps:

1.

In IIS Manager, expand the local computer, expand Application Pools, right-click the application pool and select Properties.

2.

Click the Identity tab and click Configurable. In the User name and Password boxes, type the user name and password of the account under which you want the worker process to operate.

3.

Add the chosen user account to the IIS_WPG group.

Disabling the Distributed Transaction Coordinator will help protect the affected system from attempts to exploit this vulnerability. To disable the Distributed Transaction Coordinator, perform these steps:

1.

Click Start, and then click Control Panel. Alternatively, point to Settings, and then click Control Panel.

2.

Double-click Administrative Tools. Alternatively, click Switch to Classic View and then double-click Administrative Tools.

3.

Double-click Services.

4.

Double-click Distributed Transaction Coordinator.

5.

In the Startup type list, click Disabled.

6.

Click Stop (if started), and then click OK.

You can also stop and disable the MSDTC service by using the following command at the command prompt:

sc stop MSDTC & sc config MSDTC start= disabled

Impact of Workaround: Managing the additional user accounts created in this workaround results in increased administrative overhead. Depending on the nature of applications running in this application pool, application functionality may be affected. An example is Windows Authentication; see Microsoft Knowledge Base Article 871179. Disabling MSDTC will prevent applications from using distributed transactions. Disabling MSDTC will prevent IIS 5.1 from running in Windows XP Professional Service Pack 2 and Windows XP Professional Service Pack 3, and IIS 6.0 running in IIS 5.0 compatibility mode. Disabling MSDTC will prevent configuration as well as running of COM+ applications.


类别:象牙塔 | 添加到搜藏 | 浏览() | 评论 (14)
 
最近读者:
 
网友评论:
1
2008-10-10 10:42 | 回复
哦。好的。
 
2
2008-10-10 11:23 | 回复
遇到一台机 死活没爽成 老回显命令格式不对 刺知道为啥? /churrasco/-->Usage: Churrasco.exe "command to run"
 
3
2008-10-10 11:23 | 回复
输入你要执行的命令啊,比如 net user xxx /add
 
4
2008-10-10 11:49 | 回复
先暂时只关闭msdtc服务是否可行?我每个站点都是程序池运行的,加上服务器数量不少,这样工作量大了点。
 
5
2008-10-10 13:08 | 回复
nukе,/churrasco/-->Usage: Churrasco.exe "command to run" ? 看webshell的代码,肯定加了 & /c & ,去掉这个再执行... 和我昨天的情况一抹一样。 :)
 
6
2008-10-10 13:09 | 回复
我是输入命令 但还是不能够执行 只是回显格式不正确 相当郁闷
 
7
2008-10-10 13:10 | 回复
谢谢楼上的! 我去看看
 
8
2008-10-10 14:43 | 回复
请楼上那位兄弟联系我 QQ78778444
 
9
2008-10-12 11:26 | 回复
如果删除wscript.shell会不会这个漏洞就无效了呢? 现在N多的管理员所谓的安全办法就是删除wscript.shell等方法, asp.net默认是以system权限运行的,测试c:\wwwroot\Churrasco.exe "net user administrator /add" - -#
 
10
2008-10-12 14:37 | 回复
to winsyk: 治标不治本啊。 删除wscript.shell只能防止这个exploit和一些脚本小子。 当获取localsystem的权限后,以这个权限执行的代码都将非常危险
 
11
2008-10-13 10:42 | 回复
一般网站都是NetworkService的吧,有谁给网站localsystem的权限? 删除wscript.shell之后,是不是就不可能通过WEBSHELL提权了呢? 当然有了本地权限就很危险的了。
 
12
2008-10-13 13:31 | 回复
这个漏洞就是通过NetworkService去提权到LocalSystem 只要令牌和权限有了,有不有shell都没关系了,通过其他方法比如调用API或者写文件之类一样能做到shell的事情。
 
13
2008-10-13 21:58 | 回复
我现在只在可以执行命令的WEBSHELL中成功提权过。 有些WEBSHELL存在wscript.shell但禁止访问了,也不能提权。可能是偶菜。 能够本地操作是很容易提权的。但一般都是远程的,如通过WEBSHELL。
 
14
2008-12-07 02:16 | 回复
2008-10-10 13:08 nukе,/churrasco/-->Usage: Churrasco.exe "command to run" ? 看webshell的代码,肯定加了 & /c & ,去掉这个再执行... 和我昨天的情况一抹一样。 :) 什么意思啊,怎么弄 QQ363068541
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu