-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparrot-install.sh
executable file
·157 lines (138 loc) · 4.08 KB
/
parrot-install.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#!/bin/bash
VARIANT=$1
show_menu(){
if [ $VARIANT ]
then
case $1 in
core)
opt = 1
;;
headless)
opt = 2
;;
security)
opt = 3
;;
home)
opt = 4
;;
embedded)
opt = 5
;;
esac
else
NORMAL=`echo "\033[m"`
MENU=`echo "\033[36m"` #Blue
NUMBER=`echo "\033[33m"` #yellow
FGRED=`echo "\033[41m"`
RED_TEXT=`echo "\033[31m"`
ENTER_LINE=`echo "\033[33m"`
echo -e "${MENU}*********************************************${NORMAL}"
echo -e "Welcome to Parrot On-Debian Installer Script"
echo -e "\t\trev 0.3 - 2020-03-19"
echo -e "${MENU}**${NUMBER} 1)${MENU} Install Core Only ${NORMAL}"
echo -e "${MENU}**${NUMBER} 2)${MENU} Install Headless Edition ${NORMAL}"
echo -e "${MENU}**${NUMBER} 3)${MENU} Install Security Edition ${NORMAL}"
echo -e "${MENU}**${NUMBER} 4)${MENU} Install Home Edition ${NORMAL}"
echo -e "${MENU}**${NUMBER} 5)${MENU} Install Embedded Edition ${NORMAL}"
echo -e "${MENU}*********************************************${NORMAL}"
echo -e "${ENTER_LINE}Please enter a menu option and enter or ${RED_TEXT}enter to exit. ${NORMAL}"
read opt
fi
}
function option_picked() {
COLOR='\033[01;31m' # bold red
RESET='\033[00;00m' # normal white
MESSAGE=${@:-"${RESET}Error: No message passed"}
echo -e "${COLOR}${MESSAGE}${RESET}"
}
function core_install() {
# Protect against HTTP vulnerabilities [https://www.debian.org/security/2016/dsa-3733], [https://www.debian.org/security/2019/dsa-4371]
apt-get update
apt-get -y full-upgrade
apt-get -y install gnupg
wget https://raw.githubusercontent.com/3isenHeiM/alternate-install/master/parrot.list -O /etc/apt/sources.list.d/parrot.list
echo -e "# The parrot repo is located at /etc/apt/sources.list.d/parrot.list" > /etc/apt/sources.list
wget -qO - https://deb.parrotsec.org/parrot/misc/parrotsec.gpg | apt-key add -
apt-get update
apt-get -y --force-yes -o Dpkg::Options::="--force-overwrite" install parrot-updater parrot-archive-keyring --no-install-recommends
apt-get update
apt -y --allow-downgrades -o Dpkg::Options::="--force-overwrite" -o DPkg::Options::="--force-confnew" install parrot-core parrot-hardened
apt -y --allow-downgrades -o Dpkg::Options::="--force-overwrite" -o DPkg::Options::="--force-confnew" dist-upgrade
apt -y autoremove
parrot-mirror-selector default rolling
}
function headless_install() {
apt -y --allow-downgrades install parrot-pico
}
function security_install() {
apt -y --allow-downgrades install parrot-interface parrot-interface-full parrot-tools-full
}
function home_install() {
apt -y --allow-downgrades install parrot-interface parrot-interface-full parrot-interface
}
function embedded_install() {
apt -y --allow-downgrades install parrot-mini
}
function init_function() {
clear
show_menu
while [ opt != '' ]
do
if [[ $opt = "" ]]; then
exit;
else
case $opt in
1) clear;
option_picked "Installing Core";
core_install;
option_picked "Operation Done!";
exit;
;;
2) clear;
option_picked "Installing Headless Edition";
core_install;
headless_install;
option_picked "Operation Done!";
exit;
;;
3) clear;
option_picked "Installing Parrot Security OS";
core_install;
security_install;
option_picked "Operation Done!";
exit;
;;
4) clear;
option_picked "Installing Home Edition";
core_install;
home_install;
option_picked "Operation Done!";
exit;
;;
5) clear;
option_picked "Installing Embedded Edition";
core_install;
embedded_install;
option_picked "Operation Done!";
exit;
;;
x)exit;
;;
q)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Pick an option from the menu";
show_menu;
;;
esac
fi
done
}
if [ `whoami` == "root" ]; then
init_function;
else
echo "R U Drunk? This script needs to be run as root!"
fi