-
Notifications
You must be signed in to change notification settings - Fork 1
/
debapps.sh
128 lines (117 loc) · 3.81 KB
/
debapps.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
#!/usr/bin/env bash
SCRIPT_SOURCE="debapps.sh"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
#### START OF REQUIRED INFORMATION FOR IMPORTING BASH TEMPLATES ###
TEMPLATES_REQUIRED=("generic.tmpl.sh" "debian.tmpl.sh")
# Imports bash script functions from a local template or the github hosted template file.
import_templates() {
local templates_remote="https://raw.githubusercontent.com/bradsec/debapps/main/src/templates/"
# Set templates_local to relative path to clone repo.
local templates_local="${SCRIPT_DIR}/src/templates/"
for tmpl in ${TEMPLATES_REQUIRED[@]}; do
if [[ -f "${templates_local}${tmpl}" ]]; then
source "${templates_local}${tmpl}" || echo -e "An error occurred in template import."
else
local remote_template="${templates_remote}${tmpl}"
if wget -q --spider "${remote_template}"; then
# Download the remote template to a temporary file
local tmp_template_file=$(mktemp)
wget -qO "${tmp_template_file}" "${remote_template}"
# Source the temporary file and then remove it
source "${tmp_template_file}" || echo -e "An error occurred in template import."
rm "${tmp_template_file}"
else
echo -e "Unable to import required template: \"${tmpl}\". Exiting..."
exit 1
fi
fi
done
}
import_templates
print_message PASS "${SCRIPT_SOURCE} active."
script_fetch() {
local script_local="${SCRIPT_DIR}/src/${1}"
local script_remote="https://raw.githubusercontent.com/bradsec/debapps/main/src/${1}"
if [[ -f "${script_local}" ]]; then
print_message INFO "Using local script: ${script_local}"
bash "${script_local}"
else
print_message INFO "Fetching remote script: ${script_remote}"
bash -c "$(wget -qO- ${script_remote})"
fi
}
### END OF REQUIRED FUNCTION ###
# Display a list of menu items for selection
function display_menu () {
echo
echo -e " ========================"
echo -e " Application Categories "
echo -e " ========================\n"
echo -e " 1. Password Manager apps"
echo -e " 2. Note apps"
echo -e " 3. Messenger apps"
echo -e " 4. Office apps"
echo -e " 5. Collaboration apps"
echo -e " 6. Web Browsers and Web API Tools"
echo -e " 7. Code Editor apps"
echo -e " 8. Virtual Machine (VM) apps"
echo -e " 9. Burp Suite apps\n"
echo -e " 10. Exit\n"
echo -n " Enter option [1-10]: "
while :
do
read choice </dev/tty
case ${choice} in
1) clear
print_message INFO "Fetching Password manager application options menu..."
script_fetch passwordapps.sh
;;
2) clear
print_message INFO "Fetching Note application options..."
script_fetch noteapps.sh
;;
3) clear
print_message INFO "Fetching Messenger application options..."
script_fetch messengerapps.sh
;;
4) clear
print_message INFO "Fetching Office application options..."
script_fetch officeapps.sh
;;
5) clear
print_message INFO "Fetching Collaboration application options..."
script_fetch collabapps.sh
;;
6) clear
print_message INFO "Fetching Web browser application options..."
script_fetch webapps.sh
;;
7) clear
print_message INFO "Fetching Code editor options..."
script_fetch codeeditapps.sh
;;
8) clear
print_message INFO "Fetching Virtual machine application options..."
script_fetch vmapps.sh
;;
9) clear
print_message INFO "Fetching Burp application options..."
script_fetch burpapps.sh
;;
10) clear
exit
;;
*) clear
main
;;
esac
clear
main
done
}
# Main function
function main() {
about
display_menu
}
main "${@}"