跳转到帖子

游客您好,欢迎来到黑客世界论坛!您可以在这里进行注册。

赤队小组-代号1949(原CHT攻防小组)在这个瞬息万变的网络时代,我们保持初心,创造最好的社区来共同交流网络技术。您可以在论坛获取黑客攻防技巧与知识,您也可以加入我们的Telegram交流群 共同实时探讨交流。论坛禁止各种广告,请注册用户查看我们的使用与隐私策略,谢谢您的配合。小组成员可以获取论坛隐藏内容!

TheHackerWorld官方

Oracle VM VirtualBox - Cooperating VMs can Escape from Shared Folder

精选回复

发布于
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1037

There is a security issue in the shared folder implementation that
permits cooperating guests with write access to the same shared folder to
gain access to the whole filesystem of the host, at least on Linux hosts.

The issue is that, when the host checks whether a given path escapes the root
directory of the shared folder in vbsfPathCheckRootEscape(), the function
assumes that the directory hierarchy is static: E.g. the path
"base/a/b/c/../../.." is assumed to be equivalent to "base/a/b/../..",
"base/a/.." and "base". However, at least on Linux, renames can occur at the
same time as path traversal.

This means that, if VM A attempts to open "base/a/b/c/../../../foo" while
VM B is moving "base/a/b/c" to "base/c_", VM A might actually end up opening
"base/../../foo" instead of "base/foo".

To demonstrate the issue, on a Linux host with Virtualbox 5.1.10:

 - Place a file called "real_root_marker" in the root directory of the Linux
   host, containing some secret text. The VMs will attempt to obtain
   the contents of this file.

   root@host:/# echo "this is secret text in the host fs" > /real_root_marker

 - Create two Linux VMs with a shared writable folder.
 - In the VMs, install the guest extensions, with the attached patch
   vboxsf_new.patch applied.
 - In the VMs, ensure that the new vboxsf kernel module is loaded and that
   the shared folder is mounted.
 - In VM A, compile and run the attached file openspam.c:

   root@vmA:/media/sf_vboxshared# gcc -o openspam openspam.c -std=gnu99
   root@vmA:/media/sf_vboxshared# ./openspam
   entering directory...
   entered directory and prepared folders, racing...

 - In VM B, compile and run the attached file renamespam.c:

   root@vmB:/media/sf_vboxshared# gcc -o renamespam renamespam.c -std=gnu99
   root@vmB:/media/sf_vboxshared# ./renamespam

Now, in VM A, you should see the contents of the host's /real_root_marker
within seconds:

    SUCCESS
    this is secret text in the host fs
    EOF

Note: The exploit assumes that the shared folder isn't more than nine levels
away from the filesystem root.


Proof of Concept:
https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/41597.zip
            

创建帐户或登录后发表意见

最近浏览 0

  • 没有会员查看此页面。