This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
parrot-install.sh
executable file
·176 lines (152 loc) · 8.88 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/bin/bash
# Parrot OS Alternative Install - All copyrights (©) are owned by: Lorenzo "Palinuro" Faletra
# Credits: @kyb3rvizsla (Kyb3r Vizsla <kyb3rvizsla.com>)
#---------- Variables ----------
# Define color variables for formatting output
endColor="\e[0m\e[0m"
redColor="\e[0;31m\e[1m"
blueColor="\e[0;34m\e[1m"
cyanColor="\e[01;96m\e[1m"
grayColor="\e[0;37m\e[1m"
greenColor="\e[0;32m\e[1m"
purpleColor="\e[0;35m\e[1m"
yellowColor="\e[0;33m\e[1m"
turquoiseColor="\e[0;36m\e[1m"
# Define a dot character for formatting output
dot="${redColor}[${endColor}${yellowColor}*${endColor}${redColor}] ${endColor}"
# Trap CTRL + C to exit gracefully
trap ctrl_c INT
function ctrl_c() {
echo -e "\n\n${dot}${yellowColor}Exiting...${endColor}"
exit
}
# Prompt format for user input
prompt=$(echo -e "${redColor}\n┌─[root${endColor}${yellowColor}@${endColor}${cyanColor}parrot${endColor}${redColor}]-[${endColor}${greenColor}/parrot-installer${endColor}${redColor}]\n└──╼ ${endColor}")
#---------- Install Functions ----------
# Function to install core components of Parrot OS
function core_install() {
apt update
apt install -y bash wget gnupg
wget -qO - https://deb.parrotsec.org/parrot/misc/parrotsec.gpg | apt-key add -
cp config/etc/apt/sources.list /etc/apt/sources.list
cp -r config/etc/apt/sources.list.d/* /etc/apt/sources.list.d
cp config/etc/apt/sources.list.parrot /etc/apt/sources.list.parrot
cp config/etc/apt/listchanges.conf /etc/apt/listchanges.conf
apt update
cp config/etc/os-release /etc/os-release
apt -y dist-upgrade
apt -y autoremove
apt update
apt install -y parrot-core
}
# Function to install headless edition of Parrot OS
function headless_install() {
apt -y --allow-downgrades install parrot-pico
}
# Function to install security edition of Parrot OS
function security_install() {
apt --allow-downgrades install -y parrot-interface parrot-interface-full parrot-mate parrot-tools-full parrot-drivers parrot-crypto parrot-privacy parrot-devel firefox
}
# Function to install home edition of Parrot OS
function home_install() {
apt --allow-downgrades install -y parrot-interface parrot-interface-full parrot-mate parrot-drivers parrot-privacy firefox vscodium zeal
}
# Function to install embedded edition of Parrot OS
function embedded_install() {
apt -y --allow-downgrades install parrot-interface parrot-mini
}
# Function to install Parrot OS repositories
function repos_install() {
apt update
apt install -y bash gnupg
wget -qO - https://deb.parrotsec.org/parrot/misc/parrotsec.gpg | apt-key add -
cp -r config/etc/apt/sources.list.d/* /etc/apt/sources.list.d
apt update
}
#---------- Script Functions ----------
# Function to display menu options to the user
function menu() {
clear
echo -e "${blueColor} ______ _____ _ _ _ _ ${endColor}"
echo -e "${blueColor}(_____ \ _ (_____) _ | | | | | (_) _ ${endColor}"
echo -e "${blueColor} _____) )___ ____ ____ ___ | |_ _ ____ ___| |_ ____| | | \ \ ____ ____ _ ____ | |_ ${endColor}"
echo -e "${blueColor}| ____/ _ |/ ___) ___) _ \| _) | | | _ \ /___) _)/ _ | | | \ \ / ___)/ ___) | _ \| _) ${endColor}"
echo -e "${blueColor}| | ( ( | | | | | | |_| | |__ _| |_| | | |___ | |_( ( | | | | _____) | (___| | | | | | | |__ ${endColor}"
echo -e "${blueColor}|_| \_||_|_| |_| \___/ \___) (_____)_| |_(___/ \___)_||_|_|_| (______/ \____)_| |_| ||_/ \___)${endColor}"
echo -e "${blueColor} |_| ${endColor}"
echo -e "\n${yellowColor}1) ${endColor}${blueColor}Install Core Only${endColor}"
echo -e "${yellowColor}2) ${endColor}${blueColor}Install Headless Editions${endColor}"
echo -e "${yellowColor}3) ${endColor}${blueColor}Install Security Edition${endColor}"
echo -e "${yellowColor}4) ${endColor}${blueColor}Install Home Edition${endColor}"
echo -e "${yellowColor}5) ${endColor}${blueColor}Install Embedded Edition${endColor}"
echo -e "${yellowColor}6) ${endColor}${blueColor}Install Repositories${endColor}"
# Check if there was an error and display appropriate message
if [ "$error" == "0" ]; then
echo -e "\n\n${dot}${yellowColor}Option does not exist, retry${endColor}";
fi;
read -p "$prompt" option
}
# Function to initialize the installer
function init_installer() {
menu
case $option in
1) clear;
echo -e "${blueColor} ╦┌┐┌┌─┐┌┬┐┌─┐┬ ┬ ┬┌┐┌┌─┐ ╔═╗┌─┐┬─┐┌─┐${endColor}";
echo -e "${blueColor} ║│││└─┐ │ ├─┤│ │ │││││ ┬ ║ │ │├┬┘├┤ ${endColor}";
echo -e "${blueColor} ╩┘└┘└─┘ ┴ ┴ ┴┴─┘┴─┘┴┘└┘└─┘ ╚═╝└─┘┴└─└─┘${endColor}${yellowColor}ooo${endColor}";
core_install
echo -e "\n\n${dot}${yellowColor}Parrot OS Core Installed!!!${endColor}"
;;
2) clear;
echo -e "${purpleColor} ╦┌┐┌┌─┐┌┬┐┌─┐┬ ┬ ┬┌┐┌┌─┐ ╦ ╦┌─┐┌─┐┌┬┐┬ ┌─┐┌─┐┌─┐${endColor}"
echo -e "${purpleColor} ║│││└─┐ │ ├─┤│ │ │││││ ┬ ╠═╣├┤ ├─┤ │││ ├┤ └─┐└─┐${endColor}"
echo -e "${purpleColor} ╩┘└┘└─┘ ┴ ┴ ┴┴─┘┴─┘┴┘└┘└─┘ ╩ ╩└─┘┴ ┴└─┘┴└─┴ ┴ ┴ ╚═╝─┴┘┴ ┴ ┴└─┘┘└┘${endColor}${yellowColor}ooo${endColor}"
core_install;
headless_install;
echo -e "\n\n${dot}${yellowColor}Parrot OS Headless Installed!!!${endColor}"
;;
3) clear;
echo -e "${redColor} ╦┌┐┌┌─┐┌┬┐┌─┐┬ ┬ ┬┌┐┌┌─┐ ╔═╗┌─┐┌─┐┬ ┬┬─┐┬┌┬┐┬ ┬ ╔═╗┌┬┐┬┌┬┐┬┌─┐┌┐┌${endColor}"
echo -e "${redColor} ║│││└─┐ │ ├─┤│ │ │││││ ┬ ╚═╗├┤ │ │ │├┬┘│ │ └┬┘ ║╣ │││ │ ││ ││││${endColor}"
echo -e "${redColor} ╩┘└┘└─┘ ┴ ┴ ┴┴─┘┴─┘┴┘└┘└─┘ ╚═╝└─┘└─┘└─┘┴└─┴ ┴ ┴ ╚═╝─┴┘┴ ┴ ┴└─┘┘└┘${endColor}${yellowColor}ooo${endColor}"
core_install;
security_install;
echo -e "\n\n${dot}${yellowColor}Parrot OS Security Edition Installed!!!${endColor}"
echo -e "${purpleColor}Estamos Hack - We Hack${endColor}"
;;
4) clear;
echo -e "${purpleColor} ╦┌┐┌┌─┐┌┬┐┌─┐┬ ┬ ┬┌┐┌┌─┐ ╦ ╦┌─┐┌┬┐┌─┐ ╔═╗┌┬┐┬┌┬┐┬┌─┐┌┐┌${endColor}"
echo -e "${purpleColor} ║│││└─┐ │ ├─┤│ │ │││││ ┬ ╠═╣│ ││││├┤ ║╣ │││ │ ││ ││││${endColor}"
echo -e "${purpleColor} ╩┘└┘└─┘ ┴ ┴ ┴┴─┘┴─┘┴┘└┘└─┘ ╩ ╩└─┘┴ ┴└─┘ ╚═╝─┴┘┴ ┴ ┴└─┘┘└┘${endColor}${yellowColor}ooo${endColor}"
core_install;
home_install;
echo -e "\n\n${dot}${yellowColor}Parrot OS Home Edition Installed!!!${endColor}"
;;
5) clear;
echo -e "${purpleColor} ╦┌┐┌┌─┐┌┬┐┌─┐┬ ┬ ┬┌┐┌┌─┐ ╔═╗┌┬┐┌┐ ┌─┐┌┬┐┌┬┐┌─┐┌┬┐${endColor}"
echo -e "${purpleColor} ║│││└─┐ │ ├─┤│ │ │││││ ┬ ║╣ │││├┴┐├┤ ││ ││├┤ ││${endColor}"
echo -e "${purpleColor} ╩┘└┘└─┘ ┴ ┴ ┴┴─┘┴─┘┴┘└┘└─┘ ╚═╝┴ ┴└─┘└─┘─┴┘─┴┘└─┘─┴┘${endColor}${yellowColor}ooo${endColor}"
core_install;
embedded_install;
echo -e "\n\n${dot}${yellowColor}Parrot OS Embedded Installed!!!${endColor}"
;;
6) clear;
echo -e "${purpleColor} ╦┌┐┌┌─┐┌┬┐┌─┐┬ ┬ ┬┌┐┌┌─┐ ╦═╗┌─┐┌─┐┌─┐┌─┐${endColor}"
echo -e "${purpleColor} ║│││└─┐ │ ├─┤│ │ │││││ ┬ ╠╦╝├┤ ├─┘│ │└─┐${endColor}"
echo -e "${purpleColor} ╩┘└┘└─┘ ┴ ┴ ┴┴─┘┴─┘┴┘└┘└─┘ ╩╚═└─┘┴ └─┘└─┘${endColor}${yellowColor}ooo${endColor}"
repos_install;
echo -e "\n\n${dot}${yellowColor}Parrot OS Embedded Installed!!!${endColor}"
;;
*) # Handle invalid input
error="0"
menu
;;
esac
}
#---------- Installer ----------
# Check if script is running as root and call init_installer function
if [ "$(id -u)" == "0" ]; then
init_installer;
else
echo -e "${yellowColor}R U Drunk? This script needs to be run as ${endColor}${redColor}root${endColor}${yellowColor}!${endColor}";
fi