
Un tool multithread in Python3 per attacchi SSH a dizionario.
Uno script Python 3 per eseguire attacchi dizionario/wordlist su un server SSH target utilizzando due file di testo come input. Scritto ai fini del mio technical screening Intel.
Questo script dipende da Paramiko e Colorama.
Installa le dipendenze tramite pip install -r requirements.txt oppure pip3 install -r requirements.txt.
Porta 22 senza limite di tentativi né periodo di blocco
python3 buffalo.py localhost users.txt passwords.txt
Il numero predefinito di thread è 100, è possibile aumentarlo o diminuirlo usando il flag thread.
python3 buffalo.py localhost users.txt passwords.txt --threads 200
Specifica il servizio sulla porta 2222
python3 buffalo.py localhost users.txt passwords.txt --port 2222
La maggior parte dei sistemi ha una sorta di limite di tentativi per account in un determinato intervallo di tempo. Per restare al di sotto di questo limite, il numero di tentativi per account può essere limitato tramite i flag --max_attempts e --lockout_period. Ad esempio, per limitare 3 tentativi per account in un periodo di 15 minuti.
python3 buffalo.py localhost users.txt passwords.txt --max_attempts 3 --lockout_period 15
[$] python3 buffalo.py -h [12:39:53]
usage: buffalo.py [-h] [--port [PORT]] [--max_attempts [MAX_ATTEMPTS]] [--lockout_period [LOCKOUT_PERIOD]]
[--threads [THREADS]]
target users passwords
Quick SSH brute force script for Red Team @Intel.
positional arguments:
target Target IP or hostname.
users Username file, one username per line.
passwords Password file, one password per line.
optional arguments:
-h, --help show this help message and exit
--port [PORT] SSH port. DEFAULT 22.
--max_attempts [MAX_ATTEMPTS]
Max attempts per account within the lockout window. DEFAULT unlimited.
--lockout_period [LOCKOUT_PERIOD]
Length of the lockout window in minutes. DEFAULT 0.
--threads [THREADS] Thread count. DEFAULT 100.
Ecco un breve elenco di cose che penso sarebbe interessante implementare in futuro.
invoke_shell del client Paramiko.exec_command se vengono trovate credenziali valide. Idee emerse dal brainstorming qui sotto.