Detection: Windows TinyCC Shellcode Execution

Description

Detects abuse of Tiny-C-Compiler (TinyCC) for shellcode execution, where tcc.exe is renamed to masquerade as svchost.exe and used to compile and execute C source files containing shellcode. This technique was observed in the Lotus Blossom Chrysalis backdoor campaign, where attackers renamed "tcc.exe" to "svchost.exe", and executed a file named "conf.c" containing Metasploit block_api shellcode with the flags -nostdlib -run. TinyCC is a legitimate C compiler, but its ability to compile and execute code on-the-fly makes it attractive to attackers seeking to evade detection. The combination of a renamed compiler binary executing from non-standard locations with suspicious flags is a strong indicator of malicious activity.

 1
 2| tstats `security_content_summariesonly`
 3  count min(_time) as firstTime
 4        max(_time) as lastTime
 5
 6from datamodel=Endpoint.Processes where
 7
 8Processes.process_name IN ("svchost.exe", "tcc.exe")
 9Processes.process="* -nostdlib*"
10Processes.process="* -run*"
11Processes.process IN ("*.c", "*conf.c*")
12NOT Processes.process_path IN (
13    "*:\\Windows\\System32\\*",
14    "*:\\Windows\\SysWOW64\\*"
15)
16
17By Processes.action Processes.dest Processes.user Processes.process Processes.parent_process
18   Processes.parent_process_exec Processes.parent_process_guid
19   Processes.parent_process_id Processes.parent_process_name
20   Processes.parent_process_path Processes.process_name Processes.process_id
21   Processes.process_exec Processes.process_guid Processes.process_hash
22   Processes.process_integrity_level Processes.process_path
23   Processes.original_file_name Processes.user_id Processes.vendor_product
24
25
26| `drop_dm_object_name(Processes)`
27
28| `security_content_ctime(firstTime)`
29
30| `security_content_ctime(lastTime)`
31
32| `windows_tinycc_shellcode_execution_filter`

Data Source

Name Platform Sourcetype Source
Windows Event Log Security 4688 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Security'
Sysmon EventID 1 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'

Macros Used

Name Value
security_content_summariesonly summariesonly=summariesonly_config allow_old_summaries=oldsummaries_config fillnull_value=fillnull_config``
windows_tinycc_shellcode_execution_filter search *
windows_tinycc_shellcode_execution_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Finding (Notable) Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Intermediate Finding (Risk Event) Yes
TTP detections generate a Finding (Notable) and may generate Intermediate Findings (Risk Events) for associated entities.

Implementation

To successfully implement this search, you need to be ingesting logs with process creation information from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA and have enabled EventCode 1 (Process Create). Ensure that command-line arguments are being captured in your Sysmon configuration. The detection relies on the OriginalFileName field being populated to distinguish between legitimate svchost.exe and renamed tcc.exe binaries. Ensure Sysmon is configured to capture full command-line arguments.

Known False Positives

Legitimate TinyCC usage by developers may trigger this detection if executed from non-standard locations. However, the combination of:

  1. Renamed binary (svchost.exe with tcc.exe OriginalFileName)
  2. Execution from user-writable directories (AppData, Temp, ProgramData)
  3. Suspicious flags (-nostdlib -run) with .c file execution

is highly suspicious and warrants investigation. Legitimate TinyCC usage typically occurs from Program Files or developer directories with standard compilation workflows.

Allowlist known development environments if needed.

Associated Analytic Story

Finding

Title Entity Field Entity Type Risk Score
TinyCC compiler execution on [$dest$] by user [$user$] from [$process_path$] via the CommandLine [$process$] from the ParentProcess [$parent_process$], indicating potential malicious code execution. user user 50

Intermediate Findings

Message Entity Field Entity Type Risk Score
TinyCC compiler execution on [$dest$] by user [$user$] from [$process_path$] via the CommandLine [$process$] from the ParentProcess [$parent_process$], indicating potential malicious code execution. dest system 50

Threat Objects

Field Type
process process
process_path file_path
process_name process_name

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
Integration ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub |

Version: 4