Detect Malware in Sumo Logic CSE
Adversaries may develop malware and malware components that can be used during targeting. Building malicious software can include the development of payloads, droppers, post-compromise tools, backdoors, packers, C2 protocols, and the creation of infected removable media. Because malware development occurs primarily on adversary-controlled infrastructure before deployment, defenders cannot directly observe this activity. Detection must pivot to identifying proxies: compilation and build tool activity on non-developer endpoints, use of known obfuscation and packing tools, characteristics of freshly compiled executables executing immediately after creation, and behavioral patterns consistent with malware testing (sandbox evasion checks, anti-analysis routines). Threat actors such as Lazarus Group, APT29, Sandworm, Kimsuky, and Indrik Spider are known to develop bespoke malware to avoid commodity detection signatures.
MITRE ATT&CK
- Tactic
- Resource Development
- Technique
- T1587 Develop Capabilities
- Sub-technique
- T1587.001 Malware
- Canonical reference
- https://attack.mitre.org/techniques/T1587/001/
Sumo Detection Query
_sourceCategory="windows/sysmon" OR _sourceCategory="windows/security"
| where EventID in ("1", "4688")
| parse field=CommandLine "*" as cmd_line nodrop
| parse field=Image "*" as image_path nodrop
| parse field=ParentImage "*" as parent_image nodrop
| eval image_lower = toLowerCase(image_path)
| eval cmd_lower = toLowerCase(cmd_line)
| eval parent_lower = toLowerCase(parent_image)
| eval is_compiler = if(image_lower matches ".*\\\\(csc|vbc|msbuild|ilasm|cl|link|rc)\.exe.*", 1, 0)
| eval is_packer = if(image_lower matches ".*\\\\(upx|themida|vmprotect|pecompact|aspack|mpress)\.exe.*" or cmd_lower matches ".*(upx\\s|--best|--brute|--ultra-brute).*", 1, 0)
| eval is_obfuscator = if(image_lower matches ".*(confuserex|obfuscar|dotfuscator|eazfuscator|dnguard|codeprotector).*" or cmd_lower matches ".*(confuserex|obfuscar|eazfuscator|dnguard).*", 1, 0)
| eval is_msfvenom = if(cmd_lower matches ".*(msfvenom|msfconsole|shell_reverse_tcp|shell_bind_tcp|windows/meterpreter|linux/x86/meterpreter).*", 1, 0)
| eval is_non_ide_parent = if(!(parent_lower matches ".*(devenv|code|rider64|idea64|eclipsec|dotnet)\.exe.*"), 1, 0)
| eval suspicious_output = if(cmd_lower matches ".*(\\\\temp\\\\|\\\\appdata\\\\local\\\\temp\\\\|\\\\users\\\\public\\\\|\\\\programdata\\\\).*", 1, 0)
| eval compiler_on_endpoint = if(is_compiler = 1 and is_non_ide_parent = 1, 1, 0)
| eval malware_dev_score = compiler_on_endpoint + is_packer + is_obfuscator + is_msfvenom
| where malware_dev_score > 0
| eval detection_branch = if(is_msfvenom = 1, "MsfvenomPayloadGeneration",
if(is_obfuscator = 1, "ObfuscatorUsage",
if(is_packer = 1, "PackerProtectorUsage",
if(compiler_on_endpoint = 1, "CompilerOnNonDevEndpoint", "Unknown"))))
| fields _messageTime, Computer, User, image_path, cmd_line, parent_image, detection_branch, malware_dev_score, suspicious_output
| sort by _messageTime desc Sumo Logic query over Sysmon EventID 1 and Windows Security EventID 4688 to detect malware development indicators: compilers running without an IDE parent, known packer/protector tools, obfuscators, and Metasploit payload generation commands. Scores each event across detection branches for analyst prioritization.
Data Sources
Required Tables
False Positives & Tuning
- Developer workstations where CSC.exe or MSBuild.exe runs during dotnet CLI operations without a visible IDE parent — add known developer hostnames to an exclusion lookup
- IT operations staff using UPX to compress self-extracting archives for software deployment packages
- Security tooling that bundles Metasploit or similar frameworks for legitimate pen-test automation — scope by authorized host names or service accounts
Other platforms for T1587.001
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 1On-System C# Payload Compilation via csc.exe
Expected signal: Sysmon Event ID 1 (Process Create): Image=csc.exe, CommandLine containing '/out:' and path to %TEMP%, ParentImage=cmd.exe. Sysmon Event ID 11 (File Create): TargetFilename ending in df00tech_payload.exe in the Temp directory, initiated by csc.exe. Security Event ID 4688 (if command line auditing enabled) for the csc.exe invocation.
- Test 2Executable Packing with UPX
Expected signal: Sysmon Event ID 1: Process Create for upx.exe with CommandLine containing '--best' and the target file path. Sysmon Event ID 11: File modification event on df00tech_target.exe as UPX rewrites the PE in-place. Sysmon Event ID 3: Network connection to GitHub for the UPX download (if not pre-staged).
- Test 3In-Memory C# Compilation via PowerShell Add-Type
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'Add-Type', '-TypeDefinition', and 'CSharpCodeProvider' (internal). PowerShell ScriptBlock Log Event ID 4104 capturing the full Add-Type invocation including the embedded C# source. Temporary .dll files may be written to %TEMP% by the CodeDom compiler with random names before being loaded and deleted.
- Test 4Metasploit msfvenom Payload Generation Simulation
Expected signal: Sysmon for Linux Event ID 1 (if deployed) or auditd execve records capturing the msfvenom command invocation. The string 'msfvenom' and 'reverse_tcp' in the command line are the primary indicators. If msfvenom is present and executes, an ELF binary is created in /tmp, triggering file creation events.
References (12)
- https://attack.mitre.org/techniques/T1587/001/
- https://attack.mitre.org/techniques/T1027/002/
- https://attack.mitre.org/techniques/T1027/004/
- https://www.mandiant.com/resources/blog/mandiant-apt1-report
- https://securelist.com/sofacy-apt-hits-high-profile-targets-with-updated-toolset/72924/
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicefileevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1587.001/T1587.001.md
- https://github.com/upx/upx
- https://docs.metasploit.com/docs/using-metasploit/basics/how-to-use-msfvenom.html
- https://learn.microsoft.com/en-us/dotnet/api/microsoft.csharp.csharpcodeprovider
- https://github.com/yck1509/ConfuserEx
Unlock Pro Content
Get the full detection package for T1587.001 including response playbook, investigation guide, and atomic red team tests.