Detect Stripped Payloads in Elastic Security
Adversaries may attempt to make a payload difficult to analyze by removing symbols, strings, and other human readable information. Scripts and executables may contain variable names and other strings that help developers document code functionality. Symbols are often created by an operating system's linker when executable payloads are compiled. Adversaries use stripped payloads to make malware analysis more difficult. Stripped payload formats include run-only AppleScripts (compiled and stripped AppleScript), stripped ELF binaries on Linux, and stripped PE files on Windows. Cuckoo Stealer and macOS.OSAMiner are notable examples using stripped formats. Golang malware is frequently stripped to remove symbol tables.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1027 Obfuscated Files or Information
- Sub-technique
- T1027.008 Stripped Payloads
- Canonical reference
- https://attack.mitre.org/techniques/T1027/008/
Elastic Detection Query
process where event.type == "start" and (
(process.name in~ ("osascript", "osacompile") and
(process.command_line : "* -x *" or process.command_line : "*run-only*")) or
(process.name == "strip" and
(process.command_line : "*--strip-all*" or process.command_line : "* -s *")) or
(process.name == "go" and process.args == "build" and
process.command_line : "*-ldflags*" and
(process.command_line : "* -s *" or process.command_line : "* -w *")) or
(process.name in ("gcc", "g++", "cc") and process.command_line : "* -s ") or
(process.name in~ ("pdbremove", "cv2pdb") and
not process.executable : ("C:\\Windows\\*", "C:\\Program Files\\*", "/usr/bin/*"))
) Detects T1027.008 stripped payload creation using Elastic EQL process telemetry. Covers osacompile run-only AppleScript compilation on macOS, strip --strip-all on Linux ELF binaries, Go build with -ldflags -s -w for symbol table removal, GCC/G++ -s compiler stripping, and Windows PE symbol removal utilities (pdbremove, cv2pdb). Maps directly to behavior in existing KQL and SPL detections.
Data Sources
Required Tables
False Positives & Tuning
- Go release CI/CD builds commonly use -ldflags '-s -w' to minimize binary size in production artifacts and Docker images — expect high volume on build servers and engineering workstations
- System administrators and Linux package maintainers invoking strip --strip-all on compiled binaries during build and deployment workflows (make install, dpkg-buildpackage, rpmbuild)
- macOS developers using osacompile -x to create run-only AppleScript distributions for enterprise endpoint deployment via Jamf or other MDM solutions
Other platforms for T1027.008
Testing Methodology
Validate this detection against 4 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.
- Test 1Create Run-Only AppleScript (macOS Stripped Payload)
Expected signal: Process creation events for osacompile (twice) and osascript. File creation events for compiled.scpt and runonly.scpt. The runonly.scpt will fail osadecompile, confirming stripped (run-only) status.
- Test 2Strip Symbols from Linux Binary with strip Command
Expected signal: Process creation for cp, strip, file, and nm commands. File creation and modification events for /tmp/stripped_ls. The 'file' output will show 'stripped', and nm will return 'no symbols'.
- Test 3Compile Go Binary with Symbol Stripping Flags
Expected signal: Process creation for go build with -ldflags '-s -w' arguments. File creation of stripped_go in /tmp. Execution of stripped_go from /tmp. The 'file' command shows stripped ELF.
- Test 4Verify Stripped Binary Cannot Be Analyzed with Standard Tools
Expected signal: Process creation events for cp (twice), strip, and nm (twice). This test demonstrates the before/after comparison an analyst would perform to confirm stripping.
References (4)
- https://attack.mitre.org/techniques/T1027/008/
- https://www.sentinelone.com/labs/fade-dead-adventures-in-reversing-malicious-run-only-applescripts/
- https://www.intezer.com/blog/malware-analysis/executable-linkable-format-101-part-2-symbols/
- https://www.mandiant.com/resources/blog/golang-internals-symbol-recovery
Unlock Pro Content
Get the full detection package for T1027.008 including response playbook, investigation guide, and atomic red team tests.