-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathexploit_module.sh
executable file
·184 lines (174 loc) · 5.3 KB
/
exploit_module.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
177
178
179
180
181
182
183
184
#!/bin/bash
source pakuri.conf
source $MODULES_PATH/misc_module.sh
WINDOW_NAME="${modules[2]}"
MSF=0
function passcrack_menu()
{
local KEY
local BRUTE
box_1 "Password Crack"
echo -e "-------- Select Action ---------"
if [ $MSF = 1 ];then
echo -e "${RED_b}Metasploit is running! ->${NC}"
read -p "Press Enter to continue..."
else
echo -e "Do you want to do it?"
yes-no-help
read -n 1 -s KEY
if [ $KEY = 1 ];then
cd $WDIR
if [[ ! -d $WDIR/brutespray ]]; then
mkdir $WDIR/brutespray
else
rm $WDIR/brutespray/*.txt
fi
BRUTE="$WDIR/brutespray/brute"
tmux send-keys -t $WINDOW_NAME.1 "nmap -T4 -p- --max-retries 1 --max-scan-delay 20 --defeat-rst-ratelimit --open -oX $BRUTE-target.xml -iL $TARGETS ; \
brutespray --file $BRUTE-target.xml --output $WDIR/brutespray/ --threads 5 --hosts 5 ; cat $WDIR/brutespray/*.txt" C-m
tmux select-pane -t $WINDOW_NAME.0
read -p "Press Enter to continue..."
elif [ $KEY -eq 3 ];then
tmux send-keys -t $WINDOW_NAME.1 "$MODULES_PATH/help/exploit_help_module.sh 21" C-m
tmux select-pane -t $WINDOW_NAME.0
fi
fi
}
function metasploit_menu()
{
local KEY
local Ans
box_2 "Metasploit"
echo -e "------- Metasploit Menu --------"
if [ $MSF = 0 ];then
select_3 "Setup" "Start Metasploit" "help"
else
select_3 "Setup" "Stop Metasploit" "help"
fi
read -n 1 -s KEY
exploit_banner
box_2 "Metasploit"
echo -e "------- Metasploit Menu --------"
case $KEY in
1 )
if [ $MSF = 1 ];then
echo -e "${RED_b}Metasploit is running! ->${NC}"
read -p "Press Enter to continue..."
else
msf_setup_menu
fi ;;
2)
if [ $MSF = 0 ];then
box_2 "Start Matasploit"
tmux send-keys -t $WINDOW_NAME.1 'msfconsole' C-m
MSF=1
echo -e "Please wait a moment for the metasploit to start up."
sleep 10
read -p "Press Enter to continue..."
else
box_2 "Stop Matasploit"
echo -e "Are you sure you want to stop Metasploit?"
yes-no
read -n 1 -s Ans
if [ $Ans -eq 1 ];then
tmux send-keys -t $WINDOW_NAME.1 'exit -y' C-m
MSF=0
read -p "Press Enter to continue..."
fi
fi ;;
3)
tmux send-keys -t $WINDOW_NAME.1 "$MODULES_PATH/help/exploit_help_module.sh 22" C-m
tmux select-pane -t $WINDOW_NAME.0
;;
9)
break;;
*)
;;
esac
}
function msf_setup_menu()
{
local KEY
local Ans
box_1 "Setup"
echo -e "-------- Select Action ---------"
select_3 "Create DB" "Delete DB" "Help"
read -n 1 -s KEY
case $KEY in
1)
box_1 "Create DB"
tmux send-keys -t $WINDOW_NAME.1 'msfdb init' C-m
read -p "Press Enter to continue..."
;;
2)
box_2 "Delete DB"
echo -e "Are you sure you want to delete it?"
yes-no
read -n 1 -s Ans
if [ $Ans -eq 1 ];then
tmux send-keys -t $WINDOW_NAME.1 'msfdb delete' C-m
read -p "Press Enter to continue..."
fi
;;
3)
tmux send-keys -t $WINDOW_NAME.1 "$MODULES_PATH/help/exploit_help_module.sh 221" C-m
tmux select-pane -t $WINDOW_NAME.0
;;
9)
break;;
*)
;;
esac
}
function searchsploit_menu()
{
box_3 "Searchsploit"
echo -e "-------- Select Action ---------"
echo -e "Search the Exploit Database for Keywords."
echo -e " e.g. CVE-XXXX-XXXX, MSXX-XXX, apache ..."
echo -e ""
read -p "Imput keyword: " keyword
tmux send-keys -t $WINDOW_NAME.1 "searchsploit $keyword" C-m
echo -e "Select it with the mouse cursor and press enter to copy it to the clipboard."
echo -e ""
read -p "Press Enter to continue..."
}
function exploit_manage()
{
local KEY
local Ans
local flg_pc
while :
do
exploit_banner
if ps -ef|grep brutespray|grep -v "grep" >/dev/null;then
flg_pc=1
else
flg_pc=0
fi
select_4 "Password Crack" "Metasploit" "Searchsploit" "Help"
read -n 1 -t 25 -s KEY
exploit_banner
if [ $flg_pc = "1" ];then
echo -e "Password Crack process is Running!"
read -p "Press Enter to continue..."
else
case "$KEY" in
1 )
passcrack_menu ;;
2 )
metasploit_menu ;;
3 )
searchsploit_menu ;;
4 )
tmux send-keys -t $WINDOW_NAME.1 "$MODULES_PATH/help/exploit_help_module.sh main" C-m
tmux select-pane -t $WINDOW_NAME.0 ;;
9 )
tmux select-window -t "${modules[0]}" ;;
* )
;;
esac
fi
done
}
exploit_manage