| ID | Technique | Tactic |
|---|---|---|
| T1059.003 | Windows Command Shell | Execution |
| T1027 | Obfuscated Files or Information | Defense Evasion |
| T1036 | Masquerading | Defense Evasion |
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 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.
Search
1
2| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime
3 from datamodel=Endpoint.Processes where
4 Processes.process_name IN ("svchost.exe", "tcc.exe")
5 Processes.process="* -nostdlib*"
6 Processes.process="* -run*"
7 Processes.process IN ("*.c", "*conf.c*")
8 NOT Processes.process_path IN (
9 "*:\\Windows\\System32\\*",
10 "*:\\Windows\\SysWOW64\\*"
11 )
12 by Processes.action Processes.dest Processes.user Processes.process Processes.parent_process
13 Processes.parent_process_exec Processes.parent_process_guid
14 Processes.parent_process_id Processes.parent_process_name
15 Processes.parent_process_path Processes.process_name Processes.process_id
16 Processes.process_exec Processes.process_guid Processes.process_hash
17 Processes.process_integrity_level Processes.process_path
18 Processes.original_file_name Processes.user_id Processes.vendor_product
19
20| `drop_dm_object_name(Processes)`
21
22| `security_content_ctime(firstTime)`
23
24| `security_content_ctime(lastTime)`
25
26| `windows_tinycc_shellcode_execution_filter`
Data Source
| Name | Platform | Sourcetype | Source |
|---|---|---|---|
| Sysmon EventID 1 | 'XmlWinEventLog' |
'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational' |
|
| Windows Event Log Security 4688 | 'XmlWinEventLog' |
'XmlWinEventLog:Security' |
Macros Used
| Name | Value |
|---|---|
| security_content_ctime | convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$) |
| 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 Notable | Yes |
| Rule Title | %name% |
| Rule Description | %description% |
| Notable Event Fields | user, dest |
| Creates Risk Event | True |
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:
- Renamed binary (svchost.exe with tcc.exe OriginalFileName)
- Execution from user-writable directories (AppData, Temp, ProgramData)
- 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
Risk Based Analytics (RBA)
Risk Message:
TinyCC compiler execution on $dest$ by user $user$ from $process_path$, indicating potential malicious code execution.
| Risk Object | Risk Object Type | Risk Score | Threat Objects |
|---|---|---|---|
| dest | system | 50 | process_name, process_path, process |
| user | user | 50 | process_name, process_path, process |
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: 1