T1129 Splunk · SPL

Detect Shared Modules in Splunk

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.

MITRE ATT&CK

Tactic
Execution
Technique
T1129 Shared Modules
Canonical reference
https://attack.mitre.org/techniques/T1129/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=7
| eval ImageLoaded=coalesce(ImageLoaded, "")
| eval Image=coalesce(Image, "")
| eval Signed=coalesce(Signed, "false")
| eval ImageLower=lower(ImageLoaded)
| eval ProcessLower=lower(Image)
| eval IsTempPath=if(match(ImageLower, "(\\\\appdata\\\\local\\\\temp\\\\|\\\\appdata\\\\roaming\\\\|\\\\windows\\\\temp\\\\|\\\\users\\\\public\\\\|c:\\\\temp\\\\|c:\\\\tmp\\\\|\\\\downloads\\\\)"), 1, 0)
| eval IsUNCPath=if(match(ImageLower, "^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\"), 1, 0)
| eval IsSuspiciousLoader=if(match(ProcessLower, "(\\\\rundll32\.exe|\\\\regsvr32\.exe|\\\\mshta\.exe|\\\\wscript\.exe|\\\\cscript\.exe|\\\\msbuild\.exe|\\\\installutil\.exe)"), 1, 0)
| eval IsKnownGoodDir=if(match(ImageLower, "(\\\\windows\\\\system32\\\\|\\\\windows\\\\syswow64\\\\|\\\\windows\\\\winsxs\\\\|\\\\program files\\\\|\\\\program files \\(x86\\)\\\\)"), 1, 0)
| eval IsUnsigned=if(Signed="false" OR Signed="", 1, 0)
| eval SuspicionScore=IsTempPath + IsUNCPath + (IsSuspiciousLoader * (1 - IsKnownGoodDir)) + IsUnsigned
| where SuspicionScore >= 1 AND IsKnownGoodDir=0
| table _time, host, User, Image, CommandLine, ImageLoaded, Signed, SignatureStatus, Hashes, IsTempPath, IsUNCPath, IsSuspiciousLoader, IsUnsigned, SuspicionScore
| sort - SuspicionScore, - _time
high severity medium confidence

Detects suspicious shared module loading using Sysmon Event ID 7 (ImageLoad). Scores each load event across four dimensions: loading from temp/writable paths, UNC network paths, suspicious host processes (rundll32/regsvr32/mshta/wscript/msbuild/installutil), and unsigned/invalid-signature modules. Excludes known-good system directories (System32, SysWOW64, WinSxS, Program Files). Higher suspicion scores indicate more concerning loads warranting investigation.

Data Sources

Module: Module LoadProcess: Process CreationSysmon Event ID 7

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • 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
  • Enterprise software with non-standard installation paths installed by portable or user-scoped apps
  • Security tools and EDR agents loading modules from non-standard paths during startup or updates
  • Virtualization and container software loading hypervisor or paravirtualization modules from custom paths
Download portable Sigma rule (.yml)

Other platforms for T1129


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Load DLL from Temp Directory via rundll32

    Expected signal: Sysmon Event ID 7 (ImageLoad): ImageLoaded path will be %TEMP%\df00tech-test-module.dll, Image will be C:\Windows\System32\rundll32.exe. Sysmon Event ID 1 (Process Create): rundll32.exe with command line containing the Temp path. Security Event ID 4688 if command line auditing is enabled.

  2. Test 2Load DLL via PowerShell Assembly.LoadFile from AppData

    Expected signal: Sysmon Event ID 7: ImageLoaded will show AppData\Roaming\df00tech-module.dll loaded by powershell.exe. Sysmon Event ID 1: PowerShell process creation with LoadFile command. Sysmon Event ID 11: File creation of df00tech-module.dll in AppData\Roaming.

  3. Test 3Load Shared Object from /tmp via dlopen on Linux

    Expected signal: Auditd syscall events: openat(2) call to /tmp/df00tech_test_module.so from python3 process. Linux audit event type=EXECVE for gcc and python3. If using Falco or Sysdig: proc.name=python3 with fd.name=/tmp/*.so triggers shared lib load from tmp rule. Syslog entry if auditd is configured to monitor /tmp for file opens.

  4. Test 4Regsvr32 Loading Unregistered DLL from User-Writable Path

    Expected signal: Sysmon Event ID 7 (ImageLoad): ImageLoaded=C:\Windows\Temp\df00tech-reg-test.dll, Image=C:\Windows\System32\regsvr32.exe. Sysmon Event ID 1: regsvr32.exe with /s flag and the temp path. The /s flag suppresses the dialog box — this silence flag is itself a behavioral indicator used in malware deployment.

  5. Test 5Load dylib from /tmp on macOS via Python ctypes

    Expected signal: macOS Endpoint Security Framework: ES_EVENT_TYPE_NOTIFY_MMAP event for the dylib mmap into python3 process address space. Unified log (log stream --predicate 'subsystem == "com.apple.dyld"') shows dylib load from /tmp. If Jamf Protect or CrowdStrike Falcon is deployed: 'Shared Library Loaded from /tmp' detection fires.

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