-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwizard.sh
123 lines (106 loc) · 2.91 KB
/
wizard.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
#!/bin/bash
# Sailfish OS easy_pwn
#
# Copyright (C) 2020 <Giuseppe `r3vn` Corti>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check privileges
if [ "$EUID" -ne 0 ]
then
echo "[!] run as root"
exit 1
fi
# check args
if [ "$#" -lt 1 ]
then
echo "[!] usage: $0 [kalifs path]"
exit 1
fi
# set variables
WIZ_PATH=`readlink -f "$0"`
PWN_DIR=`dirname "$WIZ_PATH"`
PWN_SCRIPT=$PWN_DIR/easy_pwn.sh
CHROOT_PATH="$1"
# import default settings
. $PWN_DIR/mount/settings.sh
script_selection(){
echo "[+] available scripts:"
av_scripts=$(ls $PWN_DIR/mount/scripts/)
i=1
for j in $av_scripts
do
echo " - $i $j"
av_scripts[i]=$j
i=$(( i + 1 ))
done
read -p "(script) [>] " SC_SELECT
echo "[-] selected: ${av_scripts[$SC_SELECT]}"
$PWN_SCRIPT script $CHROOT_PATH ${av_scripts[$SC_SELECT]}
}
input_loop(){
read -p "[>] " SELECTION
case "$SELECTION" in
1)
# start chroot desktop
echo "[?] select desktop orientation (default portrait): [p]ortrait, [l]andscape: "
read -p "(desktop) [>]" DESKTOP_ORIENTATION
if [ "$DESKTOP_ORIENTATION" == "l" ]
then
. $PWN_SCRIPT desktop $CHROOT_PATH --landscape
else
. $PWN_SCRIPT desktop $CHROOT_PATH
fi
;;
2) . $PWN_SCRIPT shell $CHROOT_PATH ;;
3) . $PWN_SCRIPT ssh $CHROOT_PATH ;;
4) . $PWN_SCRIPT bettercap $CHROOT_PATH ;;
5) script_selection ;;
6) . $PWN_SCRIPT update $CHROOT_PATH ;;
7) . $PWN_SCRIPT kill $CHROOT_PATH ;;
8) . $PWN_SCRIPT quit $CHROOT_PATH ;;
00) help_msg ;;
*)
echo "[!] invalid selection"
exit 1
esac
}
help_msg(){
echo "[+] available options:"
echo " - 1 kali desktop"
echo " - 2 kali shell"
echo " - 3 ssh server"
echo " - 4 bettercap webui"
echo " - 5 run a pwn script"
echo " - 6 update easy_pwn"
echo " - 7 kill all chroot processes"
echo " - 8 umount and quit (experimental)"
echo " - 00 this message"
}
if test -f "$CHROOT_PATH/etc/hosts"
then
echo " ___ __ _ ___ _ _ _ ____ ___ __"
echo " / _ \\/ _\` / __| | | | | '_ \\ \\ /\\ / / '_ \\ "
echo "| __/ (_| \\__ \\ |_| | | |_) \\ V V /| | | |"
echo " \\___|\\__,_|___/\\__, | | .__/ \\_/\\_/ |_| |_|"
echo " __/ |_____| |"
echo " |___/______|_| ($PWN_VERSION) "
echo " "
help_msg
while :
do
input_loop
done
else
echo "[!] $1 is not a valid kali root."
fi