-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmcr.sh
68 lines (67 loc) · 1.8 KB
/
mcr.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
#!/bin/bash
#########################################
# Meltdown Checker and Remediation(MCR) #
# Written by: Ahmed Samir #
#########################################
#
# this is tool used to check if your system vulnerable to meltdown or not and remediate your system
user=`whoami`
echo "your current user is "$user
if [ "$user" == "root" ]
then
echo "*****************************************************"
echo "* MCR Meltdown Checker and Remediation Ver. 1.0 *"
echo "* used to check if your system vulnerable *"
echo "* to meltdown or not and remediate your system *"
echo "* Coded by Ahmed Samir *"
echo "* Cyber Security Lover *"
echo "*****************************************************"
PS3="please choose one from the above options (or 'enter' for choices):"
select opt1 in "Meltdown Checker" "Meltdown Remediation" "exit"
do
case $REPLY in
1)echo "looking for your linux banner address"
meltdown_addr=`cat /proc/kallsyms |grep linux_proc_banner|cut -d " " -f1`
echo $meltdown_addr
echo "enter the number of addresses you want to read thier content:"
read num
if [ -s ./meltdown.out ]
then
if ! sudo ./meltdown.out $meltdown_addr $num > /dev/null
then
uname -rvi
head /proc/cpuinfo
echo "your system is vulnerable"
sudo ./meltdown.out $meltdown_addr $num
else
uname -rvi
head /proc/cpuinfo
echo "your system is not vulnerable"
fi
else
echo "Building Meltdown Checker. Please choose Checker again to run."
gcc meltdown.c -o meltdown.out
fi
;;
2)echo -n "updating your system please wait ."
for i in `seq 1 10`
do
sleep 1
echo -n "."
done
sudo apt update
echo -n "upgrading your system please wait ."
for i in `seq 1 10`
do
sleep 1
echo -n "."
done
sudo apt upgrade
;;
3)exit
;;
esac
done
else
echo "please run the script with sudo command"
fi