For system administrators and IR teams in Romania

Incident Response Methodology

What to do, step by step, from the minute something looks wrong.

A field guide: the first 15 minutes, triage commands for Windows and Linux, scoping, containment, recovery and the reporting deadlines in GEO 155/2024. Every command block copies with one click and says what it is for.

  1. Preparation
  2. Detection and analysis
  3. Containment
  4. Eradication and recovery
  5. After the incident
99command blocks
56checklist items
6scenarios for the first 15 minutes
24h / 72h / 1 monthNIS2 deadlines in short

For authorized interventions only. Run binaries from external media and write results to an external disk, never to the investigated system. Test in a lab first. The examples (IPs, domains, accounts) are fictitious. This page is not an official document of any authority.

Contents

Quick start

Start

The first 15 minutes#

Is an incident happening right now? Choose what you are seeing and get the steps for the first 15 minutes.

Ransomware or encrypted files

Do now, in this order
  1. Disconnect from the network the systems that are encrypting (cable, Wi-Fi or EDR isolation), but do not shut them down: the encryption key may still be in RAM.
  2. Stop the file shares and disable the accounts running the encryption.
  3. Check whether the backups are intact and disconnect them from the network.
  4. Photograph the ransom note and keep one encrypted file as a sample.
  5. Inform management over a channel outside the affected network and open the incident log.
  6. Start the reporting clock: the early warning is due within 24 hours.
Do not
  • Do not shut down or reboot the affected systems.
  • Do not restore over compromised systems before imaging them.
  • Do not contact the attacker or pay without a management decision taken with legal counsel.
  • Do not discuss the incident on the organization's email or chat.
Continue with

Ransomware playbookContainmentReporting deadlines

Compromised account or fraudulent email

Do now, in this order
  1. Revoke the account's sessions and tokens, then reset the password. A reset alone does not close sessions that are already open.
  2. Find and delete the inbox rules and forwarding set up by the attacker.
  3. Check the registered MFA methods and the OAuth applications that were granted consent.
  4. Export the audit logs (sign-in, Unified Audit Log) before they expire.
  5. Warn the recipients of the fraudulent messages. If a payment was made, call the bank immediately.
  6. Assess whether the attacker had access to personal data (GDPR deadline: 72 hours).
Do not
  • Do not delete the account: you lose the logs and the evidence.
  • Do not rely on a password change alone.
  • Do not assume MFA protected you: stolen tokens bypass it.
Continue with

Email and M365 playbookIdentity: AD and cloudReporting deadlines

Compromised website or web server

Do now, in this order
  1. Copy the suspicious files and the access logs (with hashes) before any cleanup.
  2. Take the site out of production or put it behind a WAF or a maintenance page.
  3. Look for web shells and recently modified files.
  4. Change every secret in the configuration: database password, API keys, application keys.
  5. Check whether the attacker escaped the web account: processes, cron, network connections.
  6. Find in the access log the vulnerability used to get in.
Do not
  • Do not restore from backup without closing the vulnerability: it will be compromised again.
  • Do not delete logs or reinstall before preserving the evidence.
Continue with

Website playbookWordPress playbookLinux triage

Suspicious Windows workstation or server

Do now, in this order
  1. Do not shut the system down. Isolate it from the network only if impact is ongoing, preferably with EDR isolation.
  2. Capture RAM to external media.
  3. Collect the triage artifacts with KAPE.
  4. Run live triage: processes, connections, persistence.
  5. Note every account that logged on to the system: treat them as compromised.
  6. Record each step in the log and hash every piece of evidence.
Do not
  • Do not log on to the suspect system with a Domain Admin account: you expose its credentials.
  • Do not run a "cleanup" antivirus scan before collection.
  • Do not save anything to the investigated disk.
Continue with

Memory captureKAPEWindows triage

Suspicious Linux server

Do now, in this order
  1. Do not reboot the server.
  2. If it is a VPS or cloud instance, take a provider snapshot before changing anything.
  3. Capture memory with AVML.
  4. Run the automated collection with UAC.
  5. Check processes, network and persistence with static binaries from USB.
  6. Check authorized_keys, cron and systemd units.
Do not
  • Do not install packages on the investigated system.
  • Do not delete the attacker's files before copying and hashing them.
  • Do not trust ps, ls or ss on the system: they may have been replaced.
Continue with

Memory captureUACLinux triage

I do not know yet

Do now, in this order
  1. Open the incident log and note the time in UTC.
  2. Write down what was observed, by whom and when.
  3. Preserve the evidence: do not shut down, reinstall or delete.
  4. Check whether impact is ongoing (encryption, exfiltration, abused accounts).
  5. Gather the context listed in the rapid briefing template.
  6. Escalate to the person who decides (Incident Manager).
Do not
  • Do not assume it is a false alarm without checking.
  • Do not make changes "to see if it goes away".
Continue with

Rapid briefingAcquisitionReporting deadlines

Seven rules you do not break#

  • Do not shut systems down.Shutdown wipes memory, connections and processes, which are your best evidence.
  • Memory first, then disk.Collect in order of volatility: what disappears first is taken first.
  • Log everything, in UTC.What you did, when, on which system and who did it. Your memory will fail you.
  • Hash every piece of evidence.SHA-256 right after collection. Without a hash, the evidence proves nothing.
  • Communicate outside the affected network.The attacker may be reading the organization's email and chat.
  • No privileged accounts on suspect systems.A Domain Admin logged on to a compromised machine is a gift.
  • Do not clean up before you know the scope.A half-evicted attacker hides better.

How to use this page#

  • Placeholders. Replace HOSTNAME/HOST with the system name, E:\ and /mnt/evidence with your external media, YYYY-MM-DD with the date of the first trace of the attack.
  • Privileges. Windows commands run in cmd or PowerShell opened as Administrator. Linux commands run as root.
  • The changes the system label marks blocks that change state (isolation, resets, configuration). The rest only read or collect.
  • Checklist ticks are saved in your browser and can be reset from the top bar.
  • The "Commands only" button hides the explanations, for fast work in the field. The / key jumps to search.

Preparation, before an incident

Preparation

Preparation checklist#

Everything else on this page goes more smoothly if the items below are ticked in advance.

Logging to enable on Windows#

Without these settings, the logs contain neither the command line nor PowerShell scripts, which is exactly what you need in an investigation. In a domain, apply them through GPO.

cmdchanges the system
:: audit process creation + command line in event 4688
auditpol /set /subcategory:"Process Creation" /success:enable
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit" /v ProcessCreationIncludeCmdLine_Enabled /t REG_DWORD /d 1 /f

:: PowerShell Script Block Logging (event 4104)
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" /v EnableScriptBlockLogging /t REG_DWORD /d 1 /f

:: larger logs, so they are not overwritten within hours
wevtutil sl Security /ms:1073741824
wevtutil sl "Microsoft-Windows-PowerShell/Operational" /ms:268435456

Check the result:

cmd
auditpol /get /category:*
wevtutil gl Security

Sysmon adds visibility into processes, network and registry. Install it with a community configuration (for example SwiftOnSecurity or sysmon-modular):

cmdchanges the system
sysmon64.exe -accepteula -i sysmonconfig.xml

Logging to enable on Linux#

On many distributions, logs are lost on restart or do not record executed commands. The settings below fix that.

bashchanges the system
# persistent journald (logs survive a reboot)
sudo mkdir -p /var/log/journal && sudo systemctl restart systemd-journald

# auditd
sudo apt install auditd          # Debian / Ubuntu
sudo dnf install audit           # RHEL / Alma / Rocky
sudo systemctl enable --now auditd

# record every executed command
sudo auditctl -a always,exit -F arch=b64 -S execve -k exec

# time synchronization
sudo timedatectl set-ntp true

The auditctl rule disappears on restart. To keep it, put it in a file under /etc/audit/rules.d/. Also ship logs to a central server (rsyslog or a SIEM agent): an attacker with root can delete the local ones.

bash
timedatectl status
sudo auditctl -l
journalctl --disk-usage

The NIST framework, in short#

NIST finalized SP 800-61 Revision 3 in April 2025. It integrates incident response into risk management aligned with CSF 2.0 and replaces Revision 2. Rev. 3 folds the classic stages into the CSF functions (Detect, Respond, Recover), with preparation absorbed into Identify and Protect.

Operationally, this guide uses the four-phase skeleton from Rev. 2, mapped to CSF 2.0:

  1. Preparation → Govern, Identify, Protect
  2. Detection & Analysis → Detect
  3. Containment, Eradication & Recovery → Respond, Recover
  4. Post-Incident Activity (Lessons Learned) → Improve

Jump kit: the investigation toolkit#

A. Acquisition and live triage (endpoint)

  • KAPE (Kroll Artifact Parser and Extractor) — fast collection of targeted artifacts.
  • Velociraptor — collection and hunting at scale, VQL artifacts.
  • CyLR / FastIR Collector — lightweight Windows collectors.
  • UAC (Unix-like Artifacts Collector) — the equivalent for Linux/Unix/macOS.
  • Magnet RESPONSE / AXIOM Cyber — commercial collection and analysis.

B. Memory acquisition (RAM)

  • DumpIt (MoonSols/Magnet) / WinPmem / Magnet RAM Capture / FTK Imager — Windows.
  • AVML / LiME — Linux.
  • Volatility 3 — memory dump analysis.

C. Forensic disk acquisition (imaging)

  • Paladin Forensic Suite (SUMURI) — bootable Linux distribution for forensically sound cloning and imaging.
  • FTK Imager — bit-by-bit imaging (E01), the de facto standard.
  • dc3dd / dcfldd / dd — block-level imaging with on-the-fly hashing.
  • Guymager — open-source imaging with a GUI.
  • Hardware write blockers (Tableau, WiebeTech).

D. Offline forensic analysis

  • Autopsy / The Sleuth Kit, X-Ways Forensics.
  • Eric Zimmerman Tools (Registry Explorer, EvtxECmd, MFTECmd, PECmd, AmcacheParser, AppCompatCacheParser).
  • Plaso / log2timeline, Timeline Explorer.

E. Network analysis

  • Wireshark / tshark, Zeek, NetworkMiner, Arkime.

F. Malware analysis

  • YARA, Ghidra / IDA Free, PE Studio / Detect It Easy, CAPE / Cuckoo Sandbox, strings / ExifTool / oletools.

G. Log management, SIEM, correlation

  • Splunk / Elastic Stack / Microsoft Sentinel, Sigma, MISP.
  • Chainsaw / Hayabusa — hunting in EVTX files with Sigma rules.

H. Documentation and chain of custody

  • Evidence register with SHA-256 hashes at every step.
  • Incident log template (UTC timestamp, action, who did it).

I. Secure out-of-band communication

  • A channel separate from the potentially compromised infrastructure (Signal, a dedicated phone).

Preparation also includes pre-signed access agreements, escalation contacts and test environments for validating the toolkit regularly.

The first hours: briefing, log, severity

Detection and analysis

Rapid briefing for the Incident Manager#

Send it over an out-of-band channel within the first 30 to 60 minutes after arrival, complete it as information comes in and repeat it as a SITREP at a fixed interval. Do not wait until you have everything.

template
RAPID BRIEFING – Incident [ID] – TLP:[level]
Time (UTC):
Organization / NIS2 sector (essential / important / no):
Suspected incident type (ransomware, BEC, intrusion, DDoS, exfiltration):
Known attack window (first trace – detection):
Detected by / how:
Affected systems CONFIRMED:            SUSPECT:
Current operational impact (services down, data unavailable):
Actions taken by the organization before arrival (isolations, shutdowns, resets):
Available log sources + retention:
Relevant public exposure (VPN, RDP, web):
Notifications already made / active deadlines (NIS2, GDPR 72h, insurer):
Team on site + next step:
Next update at:

Context to collect on arrival, before touching any system: topology and architecture (network diagram, segmentation, inventory of critical assets); the attack window (first abnormal trace, dwell time, recent changes); detection (who, how, which mechanism, the artifact behind the initial alert); confirmed versus suspect systems; logging sources and their retention; public exposure; perimeter protection (firewall, WAF, anti-DDoS, MFA, segmentation); business context (critical systems, SLAs, air-gapped or immutable backups); active reporting obligations; access and logistics for the team (a dedicated investigation account, a single technical point of contact).

The incident log#

Open the log in the first minute and keep it until the incident is closed. It is the team's memory and the basis of the final report.

template
INCIDENT LOG [ID]
Timestamp (UTC)   | Action / observation                       | System      | Done by | Result / evidence
YYYY-MM-DD HH:MMZ | Alert: powershell -enc on a server         | SRV-FILE01  | name    | screenshot, ticket
YYYY-MM-DD HH:MMZ | Memory captured with DumpIt                | SRV-FILE01  | name    | SHA-256: ...
YYYY-MM-DD HH:MMZ | Decision: EDR isolation (approved by ...)  | SRV-FILE01  | name    | isolated, IR access kept
  • One action per line, with a time. Record decisions too, including who took them.
  • Also note what you did not do and why (for example, why a system was not isolated).
  • Keep the log outside the affected network.

Severity classification#

An indicative example. Adapt the thresholds to your organization and agree on them before an incident.

LevelWhenResponse
CriticalEncryption or exfiltration in progress, domain controller compromised, essential services down.Immediate mobilization, management informed, reporting clock started.
HighConfirmed compromise of a server or a privileged account, without major operational impact yet.Investigation the same day, containment prepared.
MediumIsolated malware on one workstation, standard account compromised, no signs of lateral movement.Triage and remediation within 24 to 48 hours, scoping check.
LowBlocked attempts, phishing with no click, scans.Record it, block if needed and tune detections.

Getting time right: UTC and Romanian time#

Most timeline errors come from mixed time zones. Work in UTC everywhere.

  • Romanian time is UTC+2 in winter (EET) and UTC+3 in summer (EEST).
  • EVTX files store time in UTC, but Event Viewer shows it in the local time of the machine you read them on.
  • Text logs on Linux usually use the server's local time. Check with timedatectl.
  • Firewalls, proxies and cloud services may each use a different zone. Note it for every source.
cmd
w32tm /tz
powershell -c "(Get-Date).ToUniversalTime().ToString('u')"
bash
date -u
timedatectl

OSINT: exposure and leaks

Detection and analysis

Runs at the same time as the technical team and stays strictly passive at first. The deliverable is an exposure report that feeds two decisions: the likely entry vector and which accounts to reset first.

A. Exposed surface (what the attacker sees)#

Shodan:

search
org:"Organization Name"
net:193.x.x.0/24
hostname:example.ro
ssl.cert.subject.cn:example.ro
port:3389 org:"Organization Name"        # exposed RDP
port:1194,443 product:"OpenVPN"             # VPN

CLI: shodan host 193.x.x.x — service versions, CVEs, history.

Censys:

search
services.tls.certificates.leaf_data.subject.common_name: example.ro
ip: 193.x.x.0/24
autonomous_system.name: "AS-NAME" and services.service_name: RDP
services.software.product: "Exchange"

Subdomain and service enumeration (passive):

shell
subfinder -d example.ro -all -o subs.txt
amass enum -passive -d example.ro
httpx -l subs.txt -title -tech-detect -status-code
theHarvester -d example.ro -b all

Plus crt.sh (%.example.ro), dnsdumpster, Wayback Machine, VirusTotal/URLScan.

Active scanning (nmap -sV --script vuln, nuclei -severity critical,high) only with written authorization and after notifying the technical team.

B. Credentials and leaks#

  • HaveIBeenPwned — domain search → addresses seen in breaches; the stealer logs section.
  • IntelX — search by domain, email, IP; pastes, leaks, darknet.
  • Hudson Rock (Cavalier) — employees infected with an infostealer → possible patient zero.
  • Dehashed / LeakCheck — cleartext credentials.
  • Ransomware leak sites — ransomware.live, ransomwatch: has the organization been claimed?
  • GitHub — trufflehog github --org=OrgName, gitleaks detect — API keys, hardcoded passwords.
  • Google dorks: site:example.ro filetype:pdf, site:example.ro intitle:"index of", site:example.ro inurl:login.

Results go to the Incident Manager and the technical team with every SITREP.

Acquisition: memory, triage, image

Detection and analysis

The order on each live machine follows the order of volatility (RFC 3227): memory → volatile triage → targeted artifacts → shutdown → clone. Run every binary from the jump-kit USB, not the ones on the system (the attacker may have replaced netstat, tasklist, ps, ss).

Order of volatility:

template
1. CPU registers, cache, RAM              (seconds - minutes)
2. Routing tables, ARP cache, processes    (minutes)
3. Temporary file system / swap            (hours)
4. Disk                                    (days - permanent)
5. Remote logs / backups                   (varies)
6. Physical configuration / topology       (stable)

Step 0 — on arrival#

DumpIt — Windows memory#

  1. Prepare a USB drive with free space ≥ RAM + 10%.
  2. Open cmd as Administrator, from the USB directory, and run:
cmd
E:\Tools\DumpIt.exe /OUTPUT E:\Evidence\HOSTNAME_mem.dmp /QUIET

Classic MoonSols version: launch it, answer y, it writes a .raw file in the current directory.

  • Do not use compression (.zdmp): Volatility cannot read it. The .dmp/.raw format is read directly by Volatility 3.

Right after the capture, compute the hash and save the system context:

cmd
certutil -hashfile E:\Evidence\HOSTNAME_mem.dmp SHA256 >> E:\Evidence\hashes.txt
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Boot Time" >> E:\Evidence\HOSTNAME_sysinfo.txt

For pagefile.sys / hiberfil.sys (locked): FTK Imager through raw disk access.

Linux: ./avml /mnt/evidence/HOST_mem.lime or LiME (insmod lime-$(uname -r).ko "path=... format=lime"). Note uname -r: it is essential for the Volatility profile.

Artifact triage — KAPE (Windows)#

After capturing memory and before the full clone (which takes hours), quickly collect the set of critical artifacts with KAPE (Kroll Artifact Parser and Extractor). Run it from the jump-kit USB, with the destination on external media (never on the investigated disk).

Targeted collection (Targets) — the essential DFIR artifacts:

cmd
kape.exe --tsource C: --tdest E:\Triage\HOSTNAME --target !SANS_Triage

!SANS_Triage is the recommended compound target: it covers registry hives, Event Logs, $MFT/$J (USN Journal), Prefetch, Amcache, ShimCache, SRUM, jump lists, browser history, LNK files and more. Alternatively, target by category:

cmd
kape.exe --tsource C: --tdest E:\Triage\HOSTNAME --target RegistryHives,EventLogs,FileSystem,Prefetch,WindowsTimeline,BrowsingHistory

Collection + processing in one step (Targets + Modules), if time allows — it parses the artifacts directly with Eric Zimmerman Tools:

cmd
kape.exe --tsource C: --tdest E:\Triage\HOSTNAME --target !SANS_Triage ^
         --mdest E:\Triage\HOSTNAME_processed --module !EZParser --mflush

The output in ..._processed contains CSV files ready to open in Timeline Explorer (Event Logs, MFT, Prefetch, Amcache, ShimCache).

Useful options in the field:

  • --tflush / --mflush — empty the destination directory before the run (clean collection).
  • --vhdx HOSTNAME — pack the collection into a VHDX container (a single file, easy to hash and transport).
  • --zip HOSTNAME — archive the collection (alternative to VHDX).
  • --vss — also include Volume Shadow Copies (earlier versions of files, useful after anti-forensics).
  • --tdrive/target on multiple partitions or on an already mounted image (the volume letter of an E01 image mounted with Arsenal Image Mounter).

Right after collection, hash the container:

cmd
certutil -hashfile E:\Triage\HOSTNAME.vhdx SHA256 >> E:\Evidence\hashes.txt

KAPE does not replace a full clone when complete forensic evidence is required (see Paladin), but within minutes it delivers the artifacts that outline the attack chain. That is often enough for triage and scoping, before deciding which systems deserve a full image.

Triage at scale (many machines at once) — Velociraptor. With tens or hundreds of endpoints, collect centrally with the Windows.KapeFiles.Targets artifact (the VQL reimplementation of KAPE) or Windows.Triage.Collector, run as a hunt on all flagged machines. Details in the scoping section (S3).

Linux/Unix triage — UAC. The KAPE equivalent for *nix systems: ./uac -p ir_triage /mnt/evidence/ (see the Linux playbook, L1). It produces an archive with artifacts and hashes.

Check for encryption BEFORE shutdown#

If the disk is encrypted, an offline clone is unusable ciphertext.

shell
manage-bde -status
manage-bde -protectors -get C:      # save the recovery key in the evidence log

Linux (LUKS):

shell
lsblk -f | grep -i crypt
dmsetup table --showkeys            # or image the unlocked /dev/mapper/<vol> live

Paladin Forensic Suite — clone / image#

  1. Boot from the Paladin USB: set USB boot in UEFI and disable Secure Boot if it does not start. Paladin does not mount internal disks automatically (forensically sound).
  2. Open PALADIN Toolbox.
  3. Disk Manager tab: identify the source (/dev/sda) and the destination (external, > source). Select the destination → Mount-RW. The source stays unmounted.
  4. Imager tab:
    • Source: /dev/sda (the whole disk, not a partition)
    • Image Type: E01 (compressed, case metadata) or DD/RAW; disk-to-disk = destination Device
    • Destination: the disk mounted RW, Label: HOSTNAME_disk
    • Segment size: 0 or 4096 MB; tick Verify after creation
    • Paladin can write to two destinations at once: a working copy and a sealed one
  5. Start. Note the MD5/SHA1 and the verification result; keep the log written next to the image.
  6. Logs tab → export as part of the chain of custody.

Live alternative (Linux, accepted risk):

shell
dc3dd if=/dev/sda hof=/mnt/evidence/HOSTNAME.dd hash=sha256 log=/mnt/evidence/HOSTNAME.log

Chain of custody, for every artifact:

template
[UTC timestamp] | [Artifact] | [SHA-256 hash] | [Collected by] | [Method] | [Destination]

Windows: live triage

Detection and analysis

Write all output to the USB drive (> E:\Evidence\HOSTNAME_<comanda>.txt).

W1. System, time, sessions#

What it is forFixes the context: time zone, how long the system has been up and who is logged on. Every timeline depends on the correct time.

cmd
date /t & time /t & w32tm /tz
systeminfo
query user
net session
whoami /all

W2. Processes#

What it is forThe process list, with parent and command line, is the fastest way to find active malware.

cmd
tasklist /v
tasklist /m
wmic process get processid,parentprocessid,name,commandline,creationdate /format:csv
PowerShell
Get-CimInstance Win32_Process | Select ProcessId,ParentProcessId,Name,CommandLine,CreationDate,@{n='User';e={$_.GetOwner().User}} | Export-Csv E:\Evidence\HOST_procs.csv

Visual: Process Explorer (columns Verified Signer, VirusTotal, Command Line, Image Path).

What to look for:

  • processes running from \Temp\, \AppData\, \ProgramData\, \Public\, \PerfLogs\, C:\Windows\Tasks\
  • almost-right names: svch0st.exe, lsas.exe, csrss.exe with the wrong parent
  • abnormal parent: cmd/powershell spawned by winword.exe, excel.exe, outlook.exe, w3wp.exe, sqlservr.exe
  • powershell.exe -enc / -e / -w hidden / -nop / IEX / DownloadString
  • rundll32, regsvr32, mshta, wscript, certutil -urlcache, bitsadmin
  • remote access and exfiltration tools: AnyDesk, TeamViewer, ScreenConnect, Atera, NetSupport, rclone, MEGAsync, WinSCP, ngrok, chisel, plink

Injection / hollowing:

cmd
hollows_hunter.exe /dir E:\Evidence\HOST_hh
pe-sieve64.exe /pid <PID>

W3. Network connections#

What it is forShows who the system is talking to: active connections, DNS cache, shares and SMB sessions.

cmd
netstat -anob
arp -a
ipconfig /all & ipconfig /displaydns
route print
net use & net share
PowerShell
Get-NetTCPConnection -State Established | Select LocalAddress,LocalPort,RemoteAddress,RemotePort,OwningProcess,@{n='Proc';e={(Get-Process -Id $_.OwningProcess).Name}}
Get-SmbSession; Get-SmbOpenFile; Get-SmbConnection

Visual: TCPView. Named pipes:

PowerShell
[System.IO.Directory]::GetFiles("\\.\pipe\") | Where {$_ -match 'psexesvc|msagent_|postex_|MSSE-|status_|mojo\.'}

W4. Persistence — the full map#

What it is forEvery place an attacker can anchor in order to survive a restart.

Automated, first:

cmd
autorunsc.exe -accepteula -a * -c -h -s -v -vt -nobanner > E:\Evidence\HOST_autoruns.csv

In the Autoruns GUI: Options → Hide Microsoft Entries + Hide VirusTotal Clean Entries.

Registry Run keys:

cmd
reg query HKCU\Software\Microsoft\Windows\CurrentVersion\Run
reg query HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Run
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
reg query HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run

Winlogon (Userinit = ...userinit.exe, ; Shell = explorer.exe):

cmd
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Userinit
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList"

Startup folders:

cmd
dir /a "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup"
dir /a "%ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp"

Scheduled Tasks:

cmd
schtasks /query /fo LIST /v > E:\Evidence\HOST_tasks.txt
dir /s /a C:\Windows\System32\Tasks
PowerShell
Get-ScheduledTask | Where State -ne 'Disabled' | Select TaskName,TaskPath,Author,@{n='Exec';e={$_.Actions.Execute}},@{n='Args';e={$_.Actions.Arguments}},@{n='User';e={$_.Principal.UserId}} | Format-List

Suspicious: random names, user-writable paths, powershell -enc, unknown author, tasks without a matching XML file (created directly in the TaskCache registry key).

Services:

cmd
sc query type= service state= all
PowerShell
Get-CimInstance Win32_Service | Where {$_.PathName -notlike 'C:\Windows\*' -and $_.PathName -notlike '"C:\Program Files*'} | Select Name,DisplayName,State,StartMode,PathName,StartName

WMI Event Subscriptions (fileless):

PowerShell
Get-CimInstance -Namespace root\subscription -ClassName __EventFilter
Get-CimInstance -Namespace root\subscription -ClassName __EventConsumer
Get-CimInstance -Namespace root\subscription -ClassName __FilterToConsumerBinding

BITS Jobs:

cmd
bitsadmin /list /allusers /verbose

Hijacks and advanced locations:

cmd
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" /s /v Debugger
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v AppInit_DLLs
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v BootExecute
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "Security Packages"
reg query "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components" /s

IFEO with a Debugger on sethc.exe, utilman.exe, osk.exe = Sticky Keys backdoor at the logon screen.

Security changes made by the attacker (strong IOAs):

cmd
reg query "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" /v UseLogonCredential
reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v LocalAccountTokenFilterPolicy
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections
PowerShell
Get-MpPreference | Select ExclusionPath,ExclusionProcess,ExclusionExtension,DisableRealtimeMonitoring
vssadmin list shadows     # no shadow copies = deleted ahead of ransomware

W5. Accounts and identity#

What it is forAccounts created or promoted by the attacker. On a domain controller, signs that the domain is compromised.

cmd
net user
net localgroup administrators
net localgroup "Remote Desktop Users"
PowerShell
Get-LocalUser | Select Name,Enabled,LastLogon,PasswordLastSet,Description
Get-LocalGroupMember Administrators

On a DC / with RSAT:

PowerShell
Get-ADUser -Filter * -Properties whenCreated,LastLogonDate,PasswordLastSet | Sort whenCreated -Desc | Select -First 30 Name,whenCreated,PasswordLastSet
Get-ADGroupMember "Domain Admins","Enterprise Admins","Schema Admins" -Recursive
Get-ADUser krbtgt -Properties PasswordLastSet      # years old = Golden Ticket risk
Get-ADComputer -Filter {TrustedForDelegation -eq $true}

W6. Event Logs — extracted IDs#

What it is forPulls from the logs the events that tell the story: logons, new services, PowerShell.

PowerShell
Get-WinEvent -FilterHashtable @{LogName='Security';Id=4624,4625,4648,4672,4688,4697,4698,4720,4728,4732,4756,4768,4769,4771,4776,5140,5145,1102} | Export-Csv E:\Evidence\HOST_security.csv
Get-WinEvent -FilterHashtable @{LogName='System';Id=7045,7040,104,1074,6005,6006} | Export-Csv E:\Evidence\HOST_system.csv
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-PowerShell/Operational';Id=4104,4103} | Where Message -match 'FromBase64String|DownloadString|IEX|-enc|Net.WebClient|Mimikatz' | Export-Csv E:\Evidence\HOST_ps.csv

Quick meaning:

  • 1102 / 104 — logs cleared → anti-forensics
  • 4624 type 3 (network) / type 10 (RDP) outside working hours → lateral movement; type 9 → pass-the-hash
  • 4648 — explicit credentials → pivot
  • 7045 / 4697 — new service (PSEXESVC, random name = PsExec/Cobalt Strike)
  • 4698 — task created; 4720/4732/4728 — account created / added to an admin group
  • 4769 with RC4 (0x17) — Kerberoasting; repeated 4771 — password spraying
  • 5140/5145 on ADMIN$/C$/IPC$ — lateral SMB access
  • 4104 — the content of the PowerShell script, decoded

Sysmon (if present): 1 (process), 3 (network), 7 (image), 8 (CreateRemoteThread), 10 (LSASS access), 11 (file), 12/13 (registry), 17/18 (pipes), 22 (DNS).

Automated hunting:

cmd
chainsaw hunt E:\Evidence\HOST_evtx\ -s sigma\ --mapping mappings\sigma-event-logs-all.yml -r rules\ --csv --output E:\Evidence\HOST_chainsaw
hayabusa.exe csv-timeline -d E:\Evidence\HOST_evtx\ -o E:\Evidence\HOST_hayabusa.csv

W7. File system#

What it is forFiles left behind by the attacker, unsigned binaries and traces of execution.

PowerShell
$since=(Get-Date).AddDays(-14)
Get-ChildItem C:\Users\*\AppData\Local\Temp,C:\Users\*\AppData\Roaming,C:\Windows\Temp,C:\ProgramData,C:\Users\Public,C:\PerfLogs -Recurse -Force -ErrorAction SilentlyContinue | Where LastWriteTime -gt $since | Select FullName,LastWriteTime,CreationTime,Length | Export-Csv E:\Evidence\HOST_recentfiles.csv
cmd
sigcheck.exe -accepteula -u -e -s -vt -c C:\Windows\System32 > E:\Evidence\HOST_sigcheck.csv
streams.exe -accepteula -s C:\Users       # Alternate Data Streams
loki.exe -p C:\ --noprocscan -l E:\Evidence\HOST_loki.log

Lateral RDP:

cmd
dir /a "%LOCALAPPDATA%\Microsoft\Terminal Server Client\Cache"
reg query "HKCU\Software\Microsoft\Terminal Server Client\Servers"

Execution artifacts (offline, from the KAPE collection):

cmd
PECmd.exe -d C:\Windows\Prefetch --csv E:\Processed\HOST
AmcacheParser.exe -f C:\Windows\AppCompat\Programs\Amcache.hve --csv E:\Processed\HOST
AppCompatCacheParser.exe --csv E:\Processed\HOST

W8. Memory analysis (Volatility 3)#

What it is forMemory dump analysis is done on the analysis workstation, not on the investigated system.

cmd
vol -f HOST_mem.dmp windows.info
vol -f HOST_mem.dmp windows.pstree
vol -f HOST_mem.dmp windows.psscan          # compare with pstree → hidden processes
vol -f HOST_mem.dmp windows.cmdline
vol -f HOST_mem.dmp windows.netscan
vol -f HOST_mem.dmp windows.malfind --dump  # injected RWX regions
vol -f HOST_mem.dmp windows.svcscan
vol -f HOST_mem.dmp windows.hashdump
vol -f HOST_mem.dmp windows.lsadump

Linux: live triage

Detection and analysis

Run static binaries from the USB drive (/mnt/usb/bin/ss, /mnt/usb/busybox ps), not the ones on the system. Write output to /mnt/evidence/HOST_*.txt.

L0. Memory (the first thing)#

What it is forRAM is lost on reboot, so it is captured before any other action.

bash
./avml /mnt/evidence/HOST_mem.lime
sha256sum /mnt/evidence/HOST_mem.lime >> /mnt/evidence/hashes.txt
uname -r > /mnt/evidence/HOST_kernel.txt

L1. Automated collection (KAPE equivalent)#

What it is forA single script collects most of the artifacts below and packs them with hashes.

bash
./uac -p ir_triage /mnt/evidence/

L2. System, time, users, sessions#

What it is forSystem context: the time, the version, who is and who was logged on.

bash
date -u; uptime; timedatectl
uname -a; cat /etc/os-release; hostname -f
w; who -a
last -aiF | head -100          # /var/log/wtmp
lastb | head -50               # /var/log/btmp – failed logins
lastlog

L3. Accounts and access#

What it is forNew or over-privileged accounts, added SSH keys and commands left in the history.

bash
cat /etc/passwd
awk -F: '($3==0){print "UID0: "$1}' /etc/passwd
awk -F: '($7 !~ /nologin|false/){print $1" -> "$7}' /etc/passwd
awk -F: '($2 !~ /^[!*]/){print "PAROLA SETATA: "$1}' /etc/shadow
cat /etc/group | grep -E 'sudo|wheel|adm|docker|root'
cat /etc/sudoers; ls -la /etc/sudoers.d/; cat /etc/sudoers.d/*
ls -la --time-style=full-iso /etc/passwd /etc/shadow /etc/sudoers

SSH:

bash
for d in /root /home/*; do f="$d/.ssh/authorized_keys"; [ -f "$f" ] && { echo "== $f"; ls -la "$f"; cat "$f"; }; done
grep -Ei '^(PermitRootLogin|PasswordAuthentication|AuthorizedKeysCommand|TrustedUserCAKeys)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* 2>/dev/null
find / -name authorized_keys -not -path "/home/*" -not -path "/root/*" 2>/dev/null

Histories (all users):

bash
for d in /root /home/*; do for h in .bash_history .zsh_history .python_history .mysql_history .viminfo .lesshst; do [ -f "$d/$h" ] && { echo "== $d/$h"; cat "$d/$h"; }; done; done

Signal: empty history / link to /dev/null, unset HISTFILE, history -c, HISTSIZE=0.

L4. Processes#

What it is forProcesses running from unusual places, or whose binary has been deleted from disk.

bash
ps auxwwf
ps -eo pid,ppid,user,lstart,etime,stat,cmd --sort=start_time
pstree -ap
ls -la /proc/*/exe 2>/dev/null | grep -i deleted         # binary deleted, process still alive
lsof +L1                                                  # files deleted but still open
for p in /proc/[0-9]*; do echo "$(basename $p): $(tr '\0' ' ' < $p/cmdline 2>/dev/null) | cwd=$(readlink $p/cwd 2>/dev/null)"; done

What to look for: processes running from /tmp, /dev/shm, /var/tmp, /run/user/* or hidden directories; names that imitate kernel threads ([kworker/0:1]) but with PPID ≠ 2; a service user (www-data, postgres) running bash/python -c/nc; miners (xmrig, kdevtmpfsi, kinsing).

Rootkit — discrepancies between sources:

bash
for p in /proc/[0-9]*; do echo ${p#/proc/}; done | sort -n > /tmp/a; ps -eo pid --no-headers | sort -n > /tmp/b; diff /tmp/a /tmp/b
unhide proc sys brute; chkrootkit; rkhunter --check --sk

L5. Network#

What it is forOpen ports and active connections, plus changes to DNS, hosts and the firewall.

bash
ss -tulpan
lsof -i -P -n
ip a; ip route; ip neigh
cat /etc/hosts /etc/resolv.conf
iptables -L -n -v; nft list ruleset

L6. Persistence — the full map#

What it is forEvery place an attacker can use to come back after a restart.

Cron / at:

bash
cat /etc/crontab
ls -la /etc/cron.d/ /etc/cron.hourly/ /etc/cron.daily/ /etc/cron.weekly/
cat /etc/cron.d/*
for u in $(cut -f1 -d: /etc/passwd); do c=$(crontab -l -u $u 2>/dev/null); [ -n "$c" ] && { echo "== $u"; echo "$c"; }; done
ls -la /var/spool/cron/crontabs/ /var/spool/cron/ 2>/dev/null
atq

Suspicious: curl ... | bash, base64, */1 * * * * (watchdog), scripts in /tmp or /dev/shm.

systemd:

bash
systemctl list-units --type=service --all --no-pager
systemctl list-timers --all --no-pager
systemctl list-unit-files --state=enabled --no-pager
find /etc/systemd /usr/lib/systemd /lib/systemd -type f -newermt "YYYY-MM-DD" 2>/dev/null
ls -la /home/*/.config/systemd/user/ /root/.config/systemd/user/ 2>/dev/null
systemctl show <unit> -p FragmentPath,ExecStart,User

Suspicious: ExecStart pointing to /tmp//dev/shm; units with no owning package (dpkg -S / rpm -qf = not owned).

Legacy init and rc:

bash
cat /etc/rc.local; ls -la /etc/init.d/ /etc/rc*.d/ 2>/dev/null; cat /etc/inittab 2>/dev/null

Shell startup:

bash
for f in /etc/profile /etc/bash.bashrc /etc/profile.d/*; do echo "== $f"; cat $f; done
for d in /root /home/*; do for f in .bashrc .bash_profile .profile .zshrc; do [ -f "$d/$f" ] && { echo "== $d/$f"; cat "$d/$f"; }; done; done

Also check: /etc/update-motd.d/, ~/.config/autostart/, /etc/NetworkManager/dispatcher.d/, /etc/udev/rules.d/ (RUN+=), /etc/apt/apt.conf.d/ (Pre/Post-Invoke).

LD_PRELOAD / userland rootkit:

bash
cat /etc/ld.so.preload               # must NOT exist, or be empty
grep -l LD_PRELOAD /proc/*/environ 2>/dev/null
cat /etc/ld.so.conf.d/*

Kernel modules / eBPF:

bash
lsmod; cat /proc/modules
cat /proc/sys/kernel/tainted; dmesg | grep -iE 'taint|module verification failed'
cat /etc/modules /etc/modules-load.d/* /etc/modprobe.d/* 2>/dev/null
bpftool prog list; bpftool map list

PAM and authentication:

bash
ls -la /etc/pam.d/; cat /etc/pam.d/common-auth /etc/pam.d/sshd 2>/dev/null
find / -name "pam_*.so" -newermt "YYYY-MM-DD" 2>/dev/null

Suspicious: an unknown pam_exec.so, a pam_unix.so whose hash does not match the package.

Binary integrity:

bash
rpm -Va 2>/dev/null | grep -E '^..5'      # RHEL
debsums -c 2>/dev/null                     # Debian
for b in ps ls ss sudo sshd login su crontab; do p=$(command -v $b) && { echo -n "$p "; sha256sum $p | cut -d' ' -f1; dpkg -S $p 2>/dev/null || rpm -qf $p 2>/dev/null; }; done
which -a ps ls ss sudo                     # shadowing through PATH

SUID / capabilities / immutable files:

bash
find / -xdev -type f \( -perm -4000 -o -perm -2000 \) -newermt "YYYY-MM-DD" 2>/dev/null
getcap -r / 2>/dev/null
lsattr -R / 2>/dev/null | awk '$1 ~ /i/'   # chattr +i on a backdoor

Containers:

bash
docker ps -a
docker ps -q | xargs -I{} docker inspect {} --format '{{.Name}} privileged={{.HostConfig.Privileged}}' 2>/dev/null

L7. Logs#

What it is forLogons, created accounts and signs that logs were wiped.

bash
grep -E 'Accepted (password|publickey)' /var/log/auth.log /var/log/secure 2>/dev/null
grep -E 'Failed password' /var/log/auth.log /var/log/secure 2>/dev/null | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head
grep -E 'useradd|usermod|groupadd|passwd\[' /var/log/auth.log /var/log/secure 2>/dev/null
journalctl --since "YYYY-MM-DD" _COMM=sshd --no-pager | grep -E 'Accepted|Failed|Invalid'
grep -E ' install ' /var/log/dpkg.log; zgrep -E ' install ' /var/log/dpkg.log.*.gz 2>/dev/null

Anti-forensics:

bash
ls -la /var/log/          # 0-byte files, missing wtmp/btmp
journalctl --verify
find /var/log -type f -size 0

L8. File system — hunting#

What it is forFiles created or modified during the attack window. Replace YYYY-MM-DD with the date of the first trace.

bash
find / -xdev -type f -newermt "YYYY-MM-DD" ! -path "/proc/*" ! -path "/sys/*" ! -path "/var/cache/*" -printf '%T+ %u %m %p\n' 2>/dev/null | sort | tail -1000
find /tmp /var/tmp /dev/shm /run/user -type f 2>/dev/null -exec ls -la {} \;
find / -xdev -type f -executable -newermt "YYYY-MM-DD" 2>/dev/null -exec file {} + | grep -E 'ELF|script'
find / -xdev \( -nouser -o -nogroup \) -type f 2>/dev/null
find / -xdev -type f -size +200M -newermt "YYYY-MM-DD" 2>/dev/null    # exfiltration archives

Timestomping: stat — ctime > mtime on an "old" file = touch -r; on ext4, debugfs -R 'stat /path' /dev/sda1 shows crtime.

L9. Linux memory analysis (Volatility 3)#

What it is forDump analysis on the analysis workstation. It reveals processes and modules hidden by a rootkit.

Requires an ISF for the exact kernel (dwarf2json from a vmlinux with debug symbols).

bash
vol -f HOST_mem.lime linux.pslist
vol -f HOST_mem.lime linux.pstree
vol -f HOST_mem.lime linux.bash            # bash history from memory
vol -f HOST_mem.lime linux.sockstat
vol -f HOST_mem.lime linux.check_modules   # hidden modules
vol -f HOST_mem.lime linux.check_syscall   # syscall table hooks
vol -f HOST_mem.lime linux.malfind
vol -f HOST_mem.lime linux.tty_check

Quick references

Detection and analysis

Windows event IDs#

IDLogWhat it indicates
4624SecuritySuccessful logon. Type 3 (network) / 10 (RDP) outside working hours = lateral movement; type 9 = new credentials (possible pass-the-hash).
4625SecurityFailed logon. High volume across many accounts = password spraying; on one account = brute force.
4648SecurityLogon with explicit credentials (runas, pivoting).
4672SecuritySpecial privileges assigned at logon (administrative account).
4688SecurityProcess created (the command line appears only if auditing is enabled).
4697SecurityService installed. A random name or PSEXESVC = PsExec / Cobalt Strike.
4698SecurityScheduled task created (persistence or remote execution).
4720SecurityUser account created.
4728 / 4732 / 4756SecurityMember added to a global / local / universal group (watch the administrative groups).
4662SecurityOperation on an AD object. With the replication GUIDs = DCSync.
4768SecurityKerberos TGT request (on the DC).
4769SecurityService ticket request. RC4 encryption type (0x17) = a hint of Kerberoasting.
4771SecurityKerberos pre-authentication failed; repeated = password spraying.
4776SecurityNTLM credential validation (on the DC).
5140 / 5145SecuritySMB share access. ADMIN$, C$, IPC$ = lateral movement.
1102SecuritySecurity log cleared = anti-forensics.
104SystemLog cleared (System/Application) = anti-forensics.
7045SystemNew service installed (see also 4697).
7040SystemStart type of a service changed.
1074 / 6005 / 6006SystemRestart initiated / Event Log service started / stopped. Useful for the timeline.
4104 / 4103PowerShell/OperationalScript content (decoded) / module activity. Look for FromBase64String, DownloadString, IEX, -enc.
Sysmon 1 / 3 / 7SysmonProcess created / network connection / image loaded.
Sysmon 8 / 10SysmonCreateRemoteThread (injection) / process access, e.g. LSASS.
Sysmon 11 / 12-13SysmonFile created / registry changes.
Sysmon 17-18 / 22SysmonNamed pipes / DNS queries.

Logon types (4624)#

TypeNameNotes
2InteractiveLocal console.
3NetworkSMB, WinRM, share access. Typical of lateral movement.
4BatchScheduled tasks.
5ServiceService accounts.
7UnlockUnlocking a session.
8NetworkCleartextPassword sent in clear text (e.g. IIS basic auth).
9NewCredentialsNew credentials for outbound connections (runas /netonly, pass-the-hash).
10RemoteInteractiveRDP.
11CachedInteractiveLogon with cached credentials (machine out of contact with the DC).

Windows artifacts: where to find them#

ArtifactLocationWhat it showsTool
PrefetchC:\Windows\Prefetch\*.pfWhat ran, how many times, the latest executions. Often disabled on servers.PECmd
AmcacheC:\Windows\AppCompat\Programs\Amcache.hveExecutables run or installed, with SHA-1.AmcacheParser
ShimCacheHKLM\SYSTEM\...\AppCompatCachePresence of executable files (on Win10+ it does not prove execution by itself).AppCompatCacheParser
SRUMC:\Windows\System32\sru\SRUDB.datNetwork and resource usage per application, over weeks.SrumECmd
$MFTVolume rootFile timeline ($SI and $FN timestamps, useful against timestomping).MFTECmd
USN Journal$Extend\$UsnJrnl:$JFile creations, deletions and renames.MFTECmd
Event LogsC:\Windows\System32\winevt\Logs\*.evtxLogons, services, PowerShell, Sysmon.EvtxECmd, Chainsaw, Hayabusa
RegistryC:\Windows\System32\config\ (SAM, SYSTEM, SOFTWARE, SECURITY), NTUSER.DAT, UsrClass.datConfiguration, persistence, per-user activity.Registry Explorer
LNK / Jump Lists%APPDATA%\Microsoft\Windows\Recent\Recently opened files, including from shares or USB.LECmd, JLECmd
ShellBagsUsrClass.dat, NTUSER.DATFolders accessed, including network shares.SBECmd
PowerShell history%APPDATA%\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txtCommands typed interactively by the user.Text editor
Scheduled TasksC:\Windows\System32\Tasks\ + registry TaskCachePersistence. Watch for tasks without a matching XML file.Autoruns, KAPE
WMI RepositoryC:\Windows\System32\wbem\Repository\Fileless persistence (event subscriptions).PyWMIPersistenceFinder
RDP cache%LOCALAPPDATA%\Microsoft\Terminal Server Client\CacheVisual fragments of outbound RDP sessions.bmc-tools

Linux artifacts: where to find them#

ArtifactLocationWhat it shows
Authentication/var/log/auth.log (Debian/Ubuntu), /var/log/secure (RHEL)SSH, sudo, su, account changes.
wtmp / btmp / lastlog/var/log/wtmp, btmp, lastlogSuccessful and failed logins. Binary files, read with last, lastb, lastlog.
journald/var/log/journal/ or /run/log/journal/systemd logs. Verify integrity with journalctl --verify.
Shell history~/.bash_history, ~/.zsh_history, ~/.viminfo, ~/.mysql_historyCommands run. Signal: empty, linked to /dev/null, HISTFILE unset.
Cron/etc/crontab, /etc/cron.*, /var/spool/cron/Persistence and scheduled execution.
systemd/etc/systemd/system, /usr/lib/systemd/system, ~/.config/systemd/userNew or modified services and timers.
SSH~/.ssh/authorized_keys, /etc/ssh/sshd_configKeys added by the attacker, weakened settings.
Installed packages/var/log/dpkg.log, /var/log/apt/history.log, /var/log/dnf.logTools installed during the attack window.
Web/var/log/nginx/, /var/log/apache2/ (Debian), /var/log/httpd/ (RHEL)Entry vector, web shells, brute force.
Preload/etc/ld.so.preloadMust not exist, or must be empty. Otherwise, a userland rootkit.

Scoping: how far the attacker got

Detection and analysis

Scoping answers a single question: how far did the attacker get? It is iterative: each newly confirmed machine brings new IOCs/IOAs, which are searched again across the whole network, until a complete round brings nothing new.

S1. The scoping register (Host Master List)#

template
Host | IP | Role | Status (CONFIRMED / SUSPECT / VERIFIED-CLEAN / UNVERIFIED) | First trace (UTC) | Last trace | IOCs found | Accounts seen | Action | Owner

The golden rule: a system moves to VERIFIED-CLEAN only after it has been searched with all current IOCs/IOAs. Any account that authenticated on a CONFIRMED system during the attack window is considered compromised (its credentials were in that system's memory).

S2. From IOCs to hunting questions#

What we found The scoping question Where to look
C2 IP/domain Who else talked to it? Firewall, proxy, DNS, NetFlow, Zeek, EDR
Binary hash / path Where else does it exist / did it run? EDR, Velociraptor FileFinder, Amcache/Prefetch
Compromised account Where did it authenticate, and from where? 4624/4768/4769 on the DC, SIEM, Entra sign-in logs
Task / service / registry key Who else has the same persistence? Velociraptor, EDR registry, Autoruns
Named pipe / mutex Who else has an active beacon? Velociraptor NamedPipes, memory
Source of lateral movement (internal IP) What other destinations did it reach? 5140/5145, 7045, 4624 type 3, filtered

S3. Velociraptor — hunting at scale#

Deploy: MSI with embedded config (GPO/SCCM/Intune) or the offline collector on isolated systems.

Velociraptor
Windows.Search.FileFinder            # file IOCs (hash + path)
Windows.Detection.Yara.Process       # beacon in memory
Windows.Network.Netstat              # C2 connections
Windows.System.TaskScheduler
Windows.Sys.Services
Windows.Persistence.PermanentWMIEvents
Windows.Analysis.EvidenceOfExecution # Prefetch/Amcache/ShimCache
Windows.Detection.NamedPipes         # Cobalt Strike / PsExec
Linux.Sys.Crontab / Linux.Sys.Services / Linux.Search.FileFinder / Linux.Sys.SUID

Pivot VQL:

VQL
SELECT ClientId, Fqdn, FullPath, Mtime FROM hunt_results(hunt_id='H.xxx', artifact='Windows.Search.FileFinder')
WHERE Hash.SHA256 IN ('<hash1>','<hash2>')

S4. EDR — Advanced Hunting (Defender, KQL)#

KQL
DeviceNetworkEvents
| where RemoteIP in ("185.x.x.x") or RemoteUrl has_any ("evil.tld")
| summarize first=min(Timestamp), last=max(Timestamp), count() by DeviceName, RemoteIP

DeviceProcessEvents
| where SHA256 in ("<hash>") or FileName in~ ("rclone.exe","anydesk.exe","procdump64.exe")
| project Timestamp, DeviceName, AccountName, FolderPath, ProcessCommandLine

DeviceLogonEvents
| where AccountName in~ ("svc_backup","compromised.user") and LogonType in ("Network","RemoteInteractive")
| summarize by DeviceName, RemoteIP, LogonType, bin(Timestamp, 1h)

S5. SIEM — pivoting (Splunk)#

Splunk SPL
index=wineventlog EventCode=4624 TargetUserName="compromised.user" | stats earliest(_time) latest(_time) count by Computer, IpAddress, LogonType
index=wineventlog EventCode=7045 earliest="MM/DD/YYYY:00:00:00" | table _time, Computer, ServiceName, ImagePath
index=wineventlog (EventCode=1102 OR EventCode=104) | table _time, Computer, SubjectUserName
index=wineventlog EventCode=4769 TicketEncryptionType=0x17 | stats count by TargetUserName, IpAddress
index=proxy dest_ip IN (185.x.x.x) | stats count by src_ip, user, url
index=dns query IN ("evil.tld","*.cdn-update.xyz") | stats count by src_ip

S6. Network — NetFlow / Zeek#

shell
nfdump -R /var/nfcapd/YYYY/MM 'dst ip 185.x.x.x' -o extended -s srcip/bytes
nfdump -R /var/nfcapd/YYYY/MM 'not dst net 10.0.0.0/8 and not dst net 192.168.0.0/16' -s srcip/bytes -n 20
cat conn.log | zeek-cut id.orig_h id.resp_h id.resp_p duration orig_bytes | awk '$5>0' | sort -k4 -rn | head
cat dns.log | zeek-cut id.orig_h query | sort | uniq -c | sort -rn | awk '$1<3' | head -100

S7. Identity — AD and cloud#

PowerShell
Get-ADPrincipalGroupMembership compromised.user | Select Name
(Get-Acl "AD:\DC=x,DC=ro").Access | Where {$_.ObjectType -in '1131f6aa-9c07-11d1-f79f-00c04fc2dcd2','1131f6ad-9c07-11d1-f79f-00c04fc2dcd2'} | Select IdentityReference   # DCSync rights

SharpHound/BloodHound run defensively: if the attacker had account X, what path did they have to Domain Admin? Without LAPS, the local admin password is probably the same everywhere → all workstations are SUSPECT.

M365 / Entra:

PowerShell
Search-UnifiedAuditLog -UserIds compromised.user@example.ro -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) -ResultSize 5000 | Export-Csv UAL.csv
Get-InboxRule -Mailbox compromised.user@example.ro | Select Name,Enabled,ForwardTo,RedirectTo,DeleteMessage
Search-UnifiedAuditLog -Operations "Consent to application","Add service principal" -StartDate ...

S8. Patient zero and the full chain#

Sort the register by "First trace": the oldest timestamp is the patient zero candidate. Rerun the playbook on it, focusing on the initial vector (email, exposed services correlated with the OSINT report, credentials, supply chain). The deliverable is the attack chain on a timeline (initial access → execution → persistence → escalation → lateral movement → collection/exfiltration → impact), with host, account, time and evidence for every step.

S9. Exit criteria for scoping#

Containment and eviction

Containment

C1. Two phases#

  • Short-term containment (immediate) — stop the bleeding without destroying evidence: network isolation of confirmed systems, C2 blocking at the perimeter, disabling visibly abused accounts. During scoping, act surgically, only where impact continues.
  • Coordinated eviction (long-term containment) — after scoping is closed: all measures at once, in a single window. A half-evicted attacker hides better.

C2. Decision criteria (recorded in the log, with who decided)#

  1. Is impact ongoing? Active encryption, exfiltration or deletion → isolate immediately.
  2. Tipping-off risk — if you block one C2 out of five, the attacker finds out; sometimes monitoring is preferable.
  3. Evidence preservation — memory and volatile triage before any isolation that changes state (EDR isolation is fine; shutdown is not).
  4. Service availability — what goes down if X is isolated; who approves (management).
  5. Reversibility — prefer measures that can be undone.
  6. Legal obligations — law enforcement or the insurer may require consultation before irreversible actions.

Ransomware with encryption in progress: immediately disconnect the encrypting systems from the network and do NOT shut them down (the key may be in RAM); stop the shares; disable the accounts running the encryption; put domain controllers in selective isolation.

C3. Technical measures — catalogue#

Host isolation (keeps investigation access):

shellchanges the system
# Defender: Isolate device (Full/Selective)
# Velociraptor: Windows.Remediation.Quarantine
netsh advfirewall set allprofiles firewallpolicy blockinbound,blockoutbound
netsh advfirewall firewall add rule name="IR-allow" dir=out action=allow remoteip=<IR_server_IP>
# Linux
iptables -P INPUT DROP; iptables -P OUTPUT DROP; iptables -A OUTPUT -d <IR_IP> -j ACCEPT; iptables -A INPUT -s <IR_IP> -j ACCEPT
# Switch: shut the port or move it to a quarantine VLAN

Blocking C2 / exfiltration at the perimeter:

  • Firewall: deny in both directions, with logging on the rule.
  • DNS sinkhole (RPZ / Windows DNS Query Resolution Policy) — machines that still query the domain give themselves away.
  • Proxy: block the URL and the user agent.
  • Egress: block outbound SMB/RDP/SSH/FTP and rclone/MEGA/Dropbox.

Identity — the order is crucial:

PowerShellchanges the system
# 1. Disable
Disable-ADAccount -Identity compromised.user
# 2. Reset the password + end sessions (a reset alone does NOT close sessions or tokens)
Set-ADAccountPassword -Identity compromised.user -Reset -NewPassword (Read-Host -AsSecureString)
Get-SmbSession | Where ClientUserName -like "*compromised*" | Close-SmbSession -Force
Revoke-MgUserSignInSession -UserId compromised.user@example.ro    # Entra: otherwise the refresh token lasts 90 days
# 3. Accounts exposed on confirmed systems – forced reset
Get-Content exposed_accounts.txt | ForEach { Set-ADUser $_ -ChangePasswordAtLogon $true }
# 4. Local admin on ALL workstations if there is no LAPS
# 5. Computer accounts of the compromised systems
# 6. krbtgt x2 if DCSync or a Golden Ticket is suspected (New-KrbtgtKeys.ps1),
#    spaced by more than the TGT lifetime + replication; NOT twice in a row

Linux:

shellchanges the system
usermod -L attacker; passwd -l attacker; pkill -KILL -u attacker
rm /etc/ssh/ssh_host_*; ssh-keygen -A; systemctl restart sshd   # if sshd is compromised

Cloud / M365:

PowerShellchanges the system
Remove-InboxRule -Mailbox compromised.user@example.ro -Identity "<rule>"
Set-Mailbox compromised.user@example.ro -ForwardingSmtpAddress $null -ForwardingAddress $null
Remove-MgServicePrincipal -ServicePrincipalId <id>    # malicious OAuth app
New-ComplianceSearch -Name "IR-phish-01" -ExchangeLocation All -ContentMatchQuery 'subject:"Invoice" AND from:billing@evil.tld'
Start-ComplianceSearch "IR-phish-01"; New-ComplianceSearchAction -SearchName "IR-phish-01" -Purge -PurgeType HardDelete

Blocking execution:

  • EDR: block by hash and by certificate.
  • ASR / WDAC / AppLocker on user-writable paths (%TEMP%, %APPDATA%, C:\ProgramData, C:\Users\Public).
  • YARA/Sigma rules distributed through Velociraptor, with alerting.
  • Disable: Office macros from the internet, PowerShell v2, WDigest → 0, LocalAccountTokenFilterPolicy → 0, RDP from outside.

Closing the initial vector:

  • Exposed service: patch immediately or take it off the internet; MFA on VPN/OWA/RDP gateway.
  • Phishing: purge, block the sender and domain, reset everyone who clicked.
  • Leaked credentials (OSINT): reset every account on the list.

C4. Eviction day (D-Day)#

C5. Mistakes that ruin containment#

  • Resetting a password without closing sessions and tokens → the attacker stays logged in.
  • Forgetting krbtgt → the Golden Ticket keeps working months after the "cleanup".
  • Blocking a single C2 → the attacker switches to the backup channel and knows you are watching.
  • Discussing the incident on the organization's email or Teams (read by the attacker).
  • Deleting the attacker's tools before imaging and hashing → the evidence is gone.
  • Restoring from backup without checking the date of the first trace → you bring the persistence back.
  • Reimaging with a gold image that has the same local admin password.
  • Declaring "containment successful" without the 72-hour monitoring.

Eradication and recovery

Eradication and recovery

Clean or rebuild?#

The simple rule: if you cannot say with certainty everything the attacker did on a system, rebuild it.

SituationDecision
The attacker obtained administrator or root rights on the system.Rebuild from a clean image or from a backup that predates the first trace.
Rootkit, modified system binaries, unknown kernel modules.Rebuild. There is no trustworthy cleanup.
Domain controller compromised (DCSync, Golden Ticket).AD recovery following Microsoft's guide, with a double krbtgt reset. Consider a forest rebuild.
Web shell on a site, no escape from the web account, vector identified.Cleanup is possible: code reinstalled from a clean source, secrets changed, vulnerability closed.
Malware on a workstation, standard user rights, persistence fully identified.Cleanup is possible, but reimaging is often faster and safer.

Order of recovery#

  1. Identity: Active Directory, Entra ID, privileged accounts. Without clean identity, everything else gets compromised again.
  2. Core infrastructure: DNS, DHCP, the backup system, management servers.
  3. Critical applications, in the order agreed with management.
  4. Workstations, by reimaging.
  • Restore only from backups that predate the first trace of the attacker.
  • Restore into an isolated network and scan with the incident's IOCs before reconnecting.
  • Apply patches and close the entry vector before putting the system back on the network.
  • Use new passwords everywhere, including service accounts and the local administrator.

Validation before going back to production#

Intensified monitoring, 72 hours#

The first 72 hours after eviction show whether the attacker is really gone. Watch for:

  • DNS queries for the blocked domains (sinkhole): the machine making them is still infected.
  • Failed logons (4625) on old accounts and Kerberos requests (4768) for disabled accounts.
  • Executions from user-writable paths: %TEMP%, %APPDATA%, C:\ProgramData, /tmp, /dev/shm.
  • New accounts, new members in administrative groups, new services or tasks.
  • Outbound traffic that is unusual in volume or destination.

If any of these appear, go back to scoping. Do not declare the incident closed before this period ends.

Playbooks by scenario

Playbooks

The flow is the same in all of them: triage → identify the vector → hunt IOCs/IOAs at scale → contain while preserving evidence → eradicate and close the vector → recover from a clean source → monitor for 72 hours → report to DNSC. The cases only change where to look and which IOCs/IOAs are typical.

Use case 1 — Ransomware on a domain (AD compromised)#

Typical scenario. Access through exposed RDP/VPN or phishing → escalation → DCSync or theft of Domain Admin credentials → distribution through GPO / PsExec / scheduled task → simultaneous encryption. Often preceded by exfiltration (double extortion). Signs: ransom notes, extensions changed in bulk, inaccessible shares.

The first three decisions: (1) is encryption still running? → isolate immediately, do not shut down; (2) are the backups intact? (3) are the domain controllers compromised? → this drives the krbtgt reset and a possible rebuild.

Confirming AD compromise:

PowerShell
Get-WinEvent -FilterHashtable @{LogName='Security';Id=4662} | Where Message -match '1131f6aa-9c07-11d1-f79f-00c04fc2dcd2'   # DCSync
Get-ADUser krbtgt -Properties PasswordLastSet,msDS-KeyVersionNumber
Get-WinEvent -FilterHashtable @{LogName='Security';Id=4728,4732,4756} | Where TimeCreated -gt (Get-Date).AddDays(-14)
Get-GPO -All | Where {$_.ModificationTime -gt (Get-Date).AddDays(-14)} | Select DisplayName,ModificationTime
Get-ChildItem \\example.ro\SYSVOL\example.ro\Policies -Recurse -Include *.bat,*.ps1,*.exe,ScheduledTasks.xml | Where LastWriteTime -gt (Get-Date).AddDays(-14)

Pre-encryption signature commands (in 4104/4688, at scale): vssadmin delete shadows /all /quiet, wmic shadowcopy delete, bcdedit /set recoveryenabled no, wbadmin delete catalog, net stop on backup/AV/SQL services.

Backups — verify from a clean machine, with a new account: air-gapped or immutable? is the last copy from BEFORE the first trace (S8)? test the restore in isolation, not in production; scan the backup with the IOCs.

Containment (order matters): isolate file servers and encrypting machines, stop shares → selectively isolate DCs → disable and reset Domain/Enterprise Admins → krbtgt x2 → disable the malicious GPO, clean up tasks and services → reset local admin on all workstations.

Forest rebuild. If the attacker had Domain Admin or DCSync, "cleaning" AD gives no guarantees (Skeleton Key, DSRM, AdminSDHolder, SID history, forged ADCS certificates). The standard (Microsoft's AD recovery guide) is to rebuild from a backup that predates the compromise, or from scratch.

Recovery: AD/identity → infrastructure (DNS/DHCP/file server from a clean backup) → applications → reimage workstations. Paying is not recommended (it does not guarantee data recovery and it funds criminals; see No More Ransom); check nomoreransom.org for a decryptor; keep the note and a sample for identification (ID Ransomware).

Use case 2 — Attack on the mail server#

2a. Exchange on-premises (e.g. ProxyShell/ProxyNotShell-style). Exploitation of the exposed server → web shell in the Exchange paths → system account → pivot.

Web shells:

PowerShell
$paths = @("$env:ExchangeInstallPath\FrontEnd\HttpProxy\owa\auth","$env:ExchangeInstallPath\FrontEnd\HttpProxy\ecp\auth","C:\inetpub\wwwroot\aspnet_client")
Get-ChildItem $paths -Recurse -Include *.aspx,*.ashx,*.asmx -Force | Where LastWriteTime -gt (Get-Date).AddDays(-30) | Select FullName,LastWriteTime,Length
Get-ChildItem $paths -Recurse -Include *.aspx -Force | Select-String 'eval\(|Request\[|System.Diagnostics.Process|JScript'

IIS logs (C:\inetpub\logs\LogFiles\W3SVC1\):

cmd
findstr /i "autodiscover.json powershell mapi/nspi X-Rps-CAT" *.log
LogParser "SELECT cs-uri-stem, c-ip, COUNT(*) FROM *.log WHERE cs-method='POST' GROUP BY cs-uri-stem, c-ip ORDER BY COUNT(*) DESC" -i:IISW3C

Exchange persistence:

PowerShell
Get-TransportAgent
Get-ManagementRoleAssignment -Role ApplicationImpersonation
Get-TransportRule | Select Name,BlindCopyTo,RedirectMessageTo,State

Containment: take it off the internet until patched; delete the web shell (after copying and hashing it); patch to the current CU/SU; reset the Exchange service accounts; rotate the Machine Keys (some exploits steal ViewState keys → persistent RCE).

2b. BEC in M365. AiTM phishing (Evilginx) → session token theft (MFA bypass) → inbox rules → fraud.

PowerShell
Search-UnifiedAuditLog -UserIds tinta@example.ro -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) -ResultSize 5000 | Where Operations -in 'New-InboxRule','Set-InboxRule','Add-MailboxPermission','MailItemsAccessed' | Export-Csv UAL_bec.csv
Get-Mailbox -ResultSize Unlimited | Get-InboxRule | Where {$_.ForwardTo -or $_.RedirectTo} | Select MailboxOwnerId,Name,ForwardTo,RedirectTo
Get-Mailbox -ResultSize Unlimited | Where {$_.ForwardingSmtpAddress -ne $null} | Select PrimarySmtpAddress,ForwardingSmtpAddress

Entra sign-in logs: MFA satisfied by claim in token from an unusual IP = stolen token. MailItemsAccessed = GDPR exposure. Containment: revoke tokens, disable the account, delete the rules, re-register MFA from scratch, review OAuth apps, purge the phishing emails, emergency Conditional Access.

Use case 3 — Attack on a website (IIS/Windows or Nginx-Apache/Linux)#

Typical vector: application vulnerability (unfiltered upload, deserialization, SQLi→RCE, LFI/RFI) → web shell → web service account → escalation.

3a. IIS / Windows:

PowerShell
Get-ChildItem C:\inetpub\wwwroot -Recurse -Include *.aspx,*.asmx,*.ashx,*.asp,*.config -Force | Where LastWriteTime -gt (Get-Date).AddDays(-30)
Get-ChildItem C:\inetpub\wwwroot -Recurse | Select-String 'eval\(|Request\.Item|Process\.Start|FromBase64String'
Get-WinEvent -FilterHashtable @{LogName='Security';Id=4688} | Where {$_.Message -match 'w3wp' -and $_.Message -match 'cmd\.exe|powershell|whoami|net\.exe'}   # child of w3wp = RCE

3b. Linux (Nginx/Apache + PHP):

shell
DOCROOT=/var/www
find $DOCROOT -type f \( -name "*.php" -o -name "*.phtml" \) -newermt "YYYY-MM-DD" -printf '%T+ %p\n' | sort
grep -rlE '(eval|assert|system|exec|shell_exec|passthru|popen|proc_open|base64_decode|gzinflate)\s*\(' $DOCROOT 2>/dev/null
grep -rlE '\$_(GET|POST|REQUEST|COOKIE)\s*\[[^]]+\]\s*\(' $DOCROOT 2>/dev/null    # $_GET['x']()
find $DOCROOT -path '*upload*' -name '*.php' 2>/dev/null
grep -iE '\.\./|union.*select|base64|eval\(|/bin/sh|c99|r57|wso|filesman' /var/log/nginx/access.log* 2>/dev/null | head -100
ps -u www-data -o pid,ppid,lstart,cmd; ss -tnp | grep -E 'www-data|apache|nginx'
crontab -l -u www-data 2>/dev/null

Containment (both): take it out of production / WAF blocking; delete the shell (after copying and hashing it); patch the application and dependencies; reset ALL secrets in the configuration (database, API keys, application keys); verify code integrity against the repository or backup; least privilege for the app pool / web user. Database exfiltration (SQLi) → GDPR assessment.

Use case 4 — Attack on WordPress#

Typical vector: vulnerable plugin or theme, brute-forced or leaked admin credentials, upload. Result: fake admin, malicious plugin, web shell, SEO spam or redirects, card skimmer.

Core integrity and modified files:

shell
WP=/var/www/html; cd $WP
wp core verify-checksums --allow-root
wp plugin verify-checksums --all --allow-root 2>/dev/null
find $WP -type f -name "*.php" -newermt "YYYY-MM-DD" -printf '%T+ %p\n' | sort
find $WP/wp-content/uploads -type f -name "*.php*" 2>/dev/null    # uploads should hold media only!

Infection patterns:

shell
grep -rlE '(eval|assert|base64_decode|gzinflate|str_rot13|create_function|preg_replace.*/e)\s*\(' $WP/wp-content 2>/dev/null
ls -la $WP/wp-content/mu-plugins/ 2>/dev/null    # mu-plugins load automatically, a favourite backdoor spot
grep -i "auto_prepend_file\|auto_append_file" $WP/.htaccess $WP/.user.ini 2>/dev/null
find $WP -name ".htaccess" -newermt "YYYY-MM-DD" -exec cat {} \;

Database:

shell
wp user list --role=administrator --fields=ID,user_login,user_email,user_registered --allow-root
wp db query "SELECT ID,user_login,user_registered FROM wp_users WHERE user_registered > 'YYYY-MM-DD';" --allow-root
wp db query "SELECT option_name FROM wp_options WHERE option_value LIKE '%<script%' OR option_value LIKE '%base64_%';" --allow-root
wp cron event list --allow-root    # wp_cron as persistence

Logs (the vector):

shell
grep 'POST.*wp-login' /var/log/nginx/access.log* | awk '{print $1}' | sort | uniq -c | sort -rn | head    # brute-force
grep -iE 'xmlrpc.php|/wp-content/plugins/|admin-ajax.php|wp-json' /var/log/nginx/access.log* | grep POST | head
grep -iE '/uploads/.*\.php|eval|base64' /var/log/nginx/access.log* | head

Containment: maintenance mode / WAF; delete the shell and clean up (after copying and hashing); reinstall core, plugins and themes from clean sources (wp core download --force); delete fake admins, reset all user passwords, rotate the wp-config.php secrets and salts (wp config shuffle-salts — this invalidates stolen cookies); update everything; delete inactive plugins and themes; MFA for admins; DISALLOW_FILE_EDIT; block PHP in uploads; disable xmlrpc.php. A skimmer on the checkout page → card data breach (PCI DSS + notification).

MITRE ATT&CK mapping

Playbooks

MITRE ATT&CK is the global knowledge base that catalogues adversary tactics and techniques based on observations from real attacks. It serves three purposes here: a common language in the report to DNSC and with partner CSIRTs, a structure for the attack chain reconstructed during scoping (S8), and a starting point for detection rules.

Three levels: the Tactic (why — the objective), the Technique (how — the method, e.g. T1053 Scheduled Task), the Procedure (exactly what the attacker did — the actual command). In the report, map each confirmed step to a technique, with its evidence (host, time, artifact).

The 14 Enterprise tactics: Reconnaissance (TA0043), Resource Development (TA0042), Initial Access (TA0001), Execution (TA0002), Persistence (TA0003), Privilege Escalation (TA0004), Defense Evasion (TA0005), Credential Access (TA0006), Discovery (TA0007), Lateral Movement (TA0008), Collection (TA0009), Command and Control (TA0011), Exfiltration (TA0010), Impact (TA0040).

Tools: ATT&CK Navigator for a heatmap of the observed techniques (JSON layer attached to the report); MITRE D3FEND for mapping countermeasures. The practical rule: map only what the evidence supports, otherwise the report becomes fiction.

Ransomware on AD#

Tactic Technique What it looks like
Initial Access T1133 External Remote Services / T1566 Phishing exposed RDP/VPN, email with a payload
Execution T1059.001 PowerShell, T1569.002 Service Execution loader, PsExec
Persistence T1053.005 Scheduled Task, T1543.003 Windows Service re-launch
Privilege Escalation T1068 Exploitation, T1078.002 Domain Accounts escalation to Domain Admin
Credential Access T1003.001 LSASS, T1003.006 DCSync, T1558.001 Golden Ticket Mimikatz, AD replication
Defense Evasion T1562.001 Disable Tools, T1070.001 Clear Event Logs AV stopped, 1102
Discovery T1018 Remote System, T1087.002 Domain Account AD enumeration / BloodHound
Lateral Movement T1021.001 RDP, T1021.002 SMB/Admin Shares, T1570 Tool Transfer movement between machines
Collection / Exfiltration T1560 Archive, T1567.002 Exfil to Cloud, T1048 Over C2 double extortion
Impact T1486 Data Encrypted, T1490 Inhibit Recovery, T1489 Service Stop encryption, shadow copies deleted

Exchange on-prem#

Tactic Technique What it looks like
Initial Access T1190 Exploit Public-Facing Application ProxyShell/NotProxyShell-style
Persistence T1505.003 Web Shell, T1505.002 Transport Agent .aspx in the Exchange paths
Credential Access T1003 OS Credential Dumping from the compromised server
Collection T1114.002 Remote Email Collection access to other mailboxes
Command and Control T1071.001 Web Protocols C2 over HTTPS

BEC in M365#

Tactic Technique What it looks like
Initial Access T1566.002 Spearphishing Link AiTM page (Evilginx)
Credential Access T1539 Steal Web Session Cookie, T1621 MFA Request Generation token theft, MFA bypass
Persistence T1098.002 Additional Email Delegate, T1137 Office Rules, T1098.001 Additional Cloud Credentials inbox rules, OAuth, new MFA method
Collection T1114 Email Collection mailbox reading
Impact T1657 Financial Theft invoice fraud

Website (IIS/Linux)#

Tactic Technique What it looks like
Initial Access T1190 Exploit Public-Facing Application SQLi, upload, deserialization, LFI/RFI
Persistence T1505.003 Web Shell .aspx / .php in the docroot
Execution T1059.004 Unix Shell / T1059.003 Windows Cmd child of w3wp/www-data
Privilege Escalation T1068, T1548.001 Setuid (Linux) escalation from the web account
Credential Access T1552.001 Credentials in Files web.config/.env/wp-config
Command and Control T1071.001, T1090 Proxy reverse shell, tunnel
Exfiltration T1030 Data Transfer Size Limits, T1041 Over C2 database dump

WordPress#

Tactic Technique What it looks like
Initial Access T1190 Exploit App, T1110 Brute Force vulnerable plugin, wp-login brute force
Persistence T1505.003 Web Shell, T1136.001 Create Account, T1505.004 Server Software Component fake admin, mu-plugin backdoor, wp_cron
Defense Evasion T1027 Obfuscated Files, T1070 Indicator Removal base64/eval payload, log cleanup
Credential Access T1552 Unsecured Credentials wp-config.php
Impact T1565 Data Manipulation, T1491.002 External Defacement SEO spam, redirect, skimmer

After the incident

After the incident

Closing the incident#

After recovery, close the loop. An incident without lessons learned repeats itself.

Glossary

After the incident

Terms used on this page#

TermWhat it means
IOCIndicator of compromise: a hash, IP, domain or file path left by the attacker.
IOA / TTPThe attacker's behaviour (tactics, techniques, procedures). Longer-lived than an IOC.
C2The command-and-control server through which the attacker drives compromised systems.
TriageFast collection and analysis, to decide what matters before the full analysis.
ScopingEstablishing the extent: which systems, accounts and data are affected.
ContainmentLimiting the spread of the attack without destroying evidence.
EvictionRemoving the attacker from the whole network in a coordinated way, in a single window.
EradicationRemoving persistence, malware and the entry vector.
Patient zeroThe first system compromised.
Dwell timeThe time between the initial compromise and detection.
Lateral movementThe attacker moving from one system to another inside the network.
PersistenceThe mechanism that lets the attacker survive a restart or a password change.
ExfiltrationCopying data out of the organization.
LOLBinsLegitimate system tools used maliciously (powershell, certutil, rundll32).
Web shellA script uploaded to a web server that gives the attacker command execution.
DCSyncAbuse of Active Directory replication to extract the domain's password hashes.
Golden TicketA Kerberos ticket forged with the hash of the krbtgt account. It grants access to any resource in the domain.
KerberoastingRequesting service tickets in order to crack service account passwords offline.
Pass-the-hashAuthenticating with the NTLM hash, without knowing the password.
krbtgtThe account that signs Kerberos tickets. After a domain compromise it is reset twice.
LAPSThe Microsoft solution that gives every machine a unique local administrator password.
AiTMAdversary-in-the-middle: a proxy phishing page that steals the session token and bypasses MFA.
BECBusiness email compromise: fraud through a compromised or impersonated email account.
EDRAn endpoint agent that detects attacks and enables response (isolation, collection).
SIEMA platform that centralizes and correlates logs.
SITREPA short situation report, sent at a fixed interval.
TLPTraffic Light Protocol: a marking that says who information may be shared with.
Chain of custodyThe record of who handled each piece of evidence, when and how.
Order of volatilityCollect first what disappears fastest (RAM), then the disk.
TimestompingChanging a file's timestamps to hide activity.