T1129

Shared Modules

Adversaries may execute malicious payloads by loading shared modules into running processes. Shared modules are executable files (DLLs on Windows, .so on Linux, .dylib on macOS) loaded at runtime to provide reusable code or access OS API functions. Adversaries abuse this by loading malicious shared objects from arbitrary local paths or UNC network paths, allowing payload execution within the memory space of a legitimate host process. Windows uses LoadLibrary/LoadLibraryEx (via NTDLL.dll Native API), Linux uses dlopen/dlsym from dlfcn.h, and macOS uses both dlopen and Objective-C runtime calls. This technique enables modular malware architectures where the main dropper loads additional capability modules — seen in gh0st RAT, Astaroth, RotaJakiro, FoggyWeb, and BLINDINGCAN.

Microsoft Sentinel / Defender
kusto
let SuspiciousLoadPaths = dynamic([
  "\\AppData\\Local\\Temp\\",
  "\\AppData\\Roaming\\",
  "\\Users\\Public\\",
  "\\ProgramData\\Microsoft\\Windows\\Start Menu\\",
  "\\Windows\\Temp\\",
  "C:\\Temp\\",
  "C:\\tmp\\",
  "\\Downloads\\"
]);
let UNCPathPattern = @"\\\\[^\\]+\\[^\\]+\\.*\.dll";
let KnownGoodDirs = dynamic([
  "\\Windows\\System32\\",
  "\\Windows\\SysWOW64\\",
  "\\Windows\\WinSxS\\",
  "\\Program Files\\",
  "\\Program Files (x86)\\"
]);
DeviceImageLoadEvents
| where Timestamp > ago(24h)
| where FileName endswith ".dll"
| where not(FolderPath has_any (KnownGoodDirs))
| where FolderPath has_any (SuspiciousLoadPaths)
    or FolderPath matches regex UNCPathPattern
    or (InitiatingProcessFileName in~ ("rundll32.exe", "regsvr32.exe", "mshta.exe", "wscript.exe", "cscript.exe", "msbuild.exe", "installutil.exe") and not(FolderPath has_any (KnownGoodDirs)))
| extend IsUNCPath = FolderPath matches regex @"^\\\\\\\\[^\\]+"
| extend IsTempPath = FolderPath has_any (SuspiciousLoadPaths)
| extend IsSuspiciousLoader = InitiatingProcessFileName in~ ("rundll32.exe", "regsvr32.exe", "mshta.exe", "wscript.exe", "cscript.exe", "msbuild.exe", "installutil.exe")
| extend IsUnsigned = isempty(Signer) or Signer == "" or IsCertificateValid == false
| project Timestamp, DeviceName, AccountName,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         FileName, FolderPath, SHA256,
         Signer, IsCertificateValid,
         IsUNCPath, IsTempPath, IsSuspiciousLoader, IsUnsigned
| sort by Timestamp desc
high severity medium confidence

Data Sources

Module: Module Load Process: Process Creation Microsoft Defender for Endpoint

Required Tables

DeviceImageLoadEvents

False Positives

  • Legitimate software installers temporarily staging DLLs in %TEMP% before moving them to installation directories
  • Developer tools (Visual Studio, JetBrains IDEs) loading debug or test assemblies from user-writable paths during development builds
  • Enterprise software with non-standard installation paths (e.g., installed to C:\Tools or user home directories by portable apps)
  • Security tools and EDR agents loading kernel modules or helper DLLs from non-standard paths during startup
  • Virtualization software (VMware Tools, VirtualBox Guest Additions) loading drivers from paths outside System32

Unlock Pro Content

Get the full detection package for T1129 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections