Showing posts with label yara. Show all posts
Showing posts with label yara. Show all posts

Friday, November 20, 2026

, , , , , , , ,

Catching Ransomware: Introducing encrypts-files and Stricter MITRE ATT&CK T1486

When we search for ransomware samples during an investigation or detection test, we usually want to answer a direct question: Did this file actually encrypt user documents when executed?

Modern ransomware families implement file encryption in many different ways. While commodity builders may call standard operating system cryptographic APIs, contemporary Ransomware-as-a-Service (RaaS) payloads written in Rust, Go, C++, or .NET frequently embed statically linked AES, ChaCha20-Poly1305, RSA, or custom intermittent encryption routines that never touch OS crypto libraries. At the same time, benign installers, browsers, and updaters legitimately use cryptography and write thousands of temporary files during normal execution.

This week, we rolled out three updates across VirusTotal and Google Threat Intelligence to identify malware that encrypts user files:

  1. New encrypts-files Tag Across Windows and macOS Sandboxes: A cipher-agnostic behavioral trait (behaviour_tags:encrypts_files) and file-level search tag (tag:encrypts-files) emitted across CAPE Sandbox, Zenbox, and macOS Mirage only when dynamic analysis confirms real encryption of user documents.
  2. Stricter MITRE ATT&CK T1486 Gating in CAPE Sandbox: Previously, generic CAPE file-churn signatures mapped high-volume file deletes, overwrites, or moves directly to T1486. Newly scanned CAPE reports now require verified user-file encryption before emitting those T1486 mappings, cutting CAPE-only daily T1486 hits from 1,039/day (78.5% with 0 AV detections) to 0 on benign files and reducing false positives across platform-wide T1486 volume by 97.6% (from 7,238 to 171 files per day).
  3. Real-Time VirusTotal Livehunt Support: Real-time YARA-X matching on sandbox reports via vt.BehaviourTrait.ENCRYPTS_FILES.
Cipher-Agnostic File-Encryption Verification Pipeline across CAPE Sandbox, Zenbox, and macOS Mirage
Figure 1: High-level overview of how CAPE Sandbox, Zenbox, and macOS Mirage verify user-document encryption before emitting tag:encrypts-files and gating CAPE T1486.

How Cipher-Agnostic File-Encryption Verification Works

Across CAPE Sandbox (Windows), Zenbox (Windows), and macOS Mirage (Apple Silicon), each sandbox environment contains realistic user documents across standard user profile directories.

During and after detonation, our sandboxes apply three verification gates before emitting encrypts-files (and before CAPE emits generic T1486 mappings):

  1. Content Destruction and Entropy Verification (Cipher-Agnostic): Rather than hooking OS cryptographic APIs, each sandbox inspects modified user-file content on disk using format-aware verification tailored to its platform. Depending on the file type and sandbox, checks evaluate destroyed file structures, elevated entropy, or non-text byte patterns alongside corroborating ransomware behaviors without relying on a single fixed entropy threshold. Because verification evaluates the resulting files on disk, it catches AES, ChaCha20, intermittent encryption, and XOR ciphers alike.
  2. Coordinated Ransomware Extension Renames: Many ransomware families read original user documents, write encrypted copies under a uniform new extension (for example, .k404, .lkd, .INC, .BLWZ, or .heartbreaker), and delete the originals. Our sandboxes correlate reads, writes, moves, and unlinks across user directories to confirm coordinated encryption renames across user documents.
  3. Benign File-Churn Exclusion Guards: Self-extracting archives, software installers, compilers, browser caches, and logs are explicitly excluded when they only generate routine temporary or application files rather than encrypting user documents. Similarly, dropping a README.txt file or calling crypto APIs alone never triggers encrypts-files without corroborated document encryption.

Real-World Ransomware Caught in Action

Across 328,257 newly submitted unique files (405,469 total files including rescans) analyzed in CAPE Sandbox, Zenbox, and macOS Mirage since November 17, tag:encrypts-files matched 55 files and surfaced in-the-wild and validation payloads across Windows executables, Python scripts, DLLs, compressed archives (ZIP and RAR), and a rescanned Apple Silicon macOS binary with zero benign software false positives across all 55 manually reviewed matches (alongside 0 benign false positives across 9,976 random CAPE reports and 400 macOS Mirage runs in pre-rollout backtesting). Below are three examples you can inspect on VirusTotal.

1. Catching Zero- and Low-Detection In-the-Wild Lockers: The .k404 Campaign and lkd.exe

Static signatures often lag behind script-based or freshly compiled lockers. In an active .k404 extortion campaign submitted on November 17-18, Python locker fb0982bb9f5d5700685dcf4e99ff695f4593fbc3e3d0359d4c2baf23c545f354 (system_update.pyw) was flagged by 0 out of 75 static antivirus engines at the time of analysis, while companion PE binary 3dd45ab8e2f9c1af773a75221d792fb78870764419170e9c9c5941160364c700 (K404T_Fidye.exe) had 10 / 75 detections and separate Windows locker a8c2402ef3ae115300f5428712ccb0b5461f4a2f14b5bfdfbe08d5ad86bd3087 (lkd.exe) had 3 / 75 at the time of analysis.

VirusTotal Behavior report for undetected Python locker system_update.pyw showing encrypts-files, T1486, and .k404 encrypted Desktop files
Figure 2: VirusTotal Behavior report for undetected Python locker system_update.pyw (fb0982bb9f5d5700685dcf4e99ff695f4593fbc3e3d0359d4c2baf23c545f354, 0 / 59 AV on GUI at capture), showing encrypts-files, T1486, and Desktop user files encrypted with the .k404 extension.

When detonated in Zenbox, system_update.pyw runs under pythonw.exe from AppData\Roaming\WindowsSystemUpdate\, self-deletes, and rewrites Desktop user files into .k404 ciphertext, while K404T_Fidye.exe and lkd.exe encrypt user documents in CAPE Sandbox using .k404 and .lkd extensions alongside k404t.txt and read_me_restore.txt ransom notes. In CAPE Sandbox, verified encryption sets both tag:encrypts-files and T1486. Note that Zenbox, macOS Mirage, and third-party sandboxes (such as Dr.Web vxCube or VMRay) keep their own rule-level T1486 mappings, so a file can carry T1486 from another sandbox rule without tag:encrypts-files.

2. Enterprise RaaS & High-Speed Windows Encryptors: INC Ransom and BlackWizardLock

Modern Windows ransomware families optimize encryption speed using asynchronous I/O and multi-threaded directory queues. In sample d243031985f7fa82a741e5677a227c65b2e2f1b07e0e10f00fe575dcc0eb4645 (INC Ransom), CAPE Sandbox captures the payload binding user files to Windows I/O Completion Ports (IOCP), rewriting user documents into .INC files, and dropping INC-README.txt across directories.

VirusTotal Behavior report for INC Ransom showing T1486 user-file encryption and .INC renamed documents
Figure 3: INC Ransom (d243031985f7fa82a741e5677a227c65b2e2f1b07e0e10f00fe575dcc0eb4645) Behavior report showing T1486 user-file encryption and user documents rewritten with the .INC extension.

Similarly, sample 98110dedcca5803bc211f2d8dd640de79a2ba2a69d1def2f4970fa7799313f3e (BlackWizardLock) executes unpacked payload code from dynamically allocated memory, stages temporary .~BLWZ.tmp files, overwrites user documents with .BLWZ extensions (such as bitaddress.pdf.BLWZ and cover-letter-uidev.docx.BLWZ), and presents a full-screen Russian extortion lock screen that directs victims to @seedware on Telegram and threatens to destroy the Master Boot Record (MBR) after five wrong key attempts.

VirusTotal Behavior report for BlackWizardLock showing encrypts-files, T1486 impact, and .BLWZ encrypted user documents
Figure 4: BlackWizardLock (98110dedcca5803bc211f2d8dd640de79a2ba2a69d1def2f4970fa7799313f3e) Behavior report showing encrypts-files, T1486 impact, and user documents encrypted into .BLWZ files.

3. Native Apple Silicon macOS Ransomware: Heartbreaker (Historical macOS Sample Rescanned in macOS Mirage, 16 / 75 AV at Analysis)

While native macOS ransomware is rare in the wild compared to Windows, re-analyzing historical macOS samples validates Apple Silicon coverage. Sample 6bdf42a575d2daee3de2530161cb5b1fef6ca78b4abfa74f329d6b6c72890d18 (first submitted in May 2025 and rescanned in macOS Mirage) is a self-signed 64-bit ARM64 Mach-O binary detected by 16 out of 75 antivirus engines at the time of analysis.

VirusTotal Behavior report for native macOS Heartbreaker ransomware in macOS Mirage showing encrypts-files, T1486, and .heartbreaker encrypted files
Figure 5: Native macOS Heartbreaker ransomware (6bdf42a575d2daee3de2530161cb5b1fef6ca78b4abfa74f329d6b6c72890d18) Behavior report in macOS Mirage showing encrypts-files, T1486, and user files in Downloads encrypted to .heartbreaker.

When detonated on bare-metal Apple Silicon in macOS Mirage, the binary installs a persistent LaunchAgent (/Users/admin/Library/LaunchAgents/com.network.startup.plist), drops /Users/admin/Desktop/README.txt, and encrypts user documents in /Users/admin/Downloads/ into Invoice_INV-2026-0842.pdf.heartbreaker and Vendor_Payment_Schedule.xlsx.heartbreaker. This triggers both ENCRYPTS_FILES and T1486 (Data Encrypted for Impact).

Summary of Verified Public Samples

Every sample below is publicly available on VirusTotal and carries verified file-encryption behavioral telemetry across diverse file formats and ransomware families:

Sample SHA-256 (Behavior Link) Format Static AV (at analysis) Family / Threat Label Verified Encryption Evidence
fb0982bb9f5d5700685dcf4e99ff695f4593fbc3e3d0359d4c2baf23c545f354 Python Script (python) 0 / 75 WindowsSystemUpdate (.k404) Zenbox-verified system_update.pyw encrypting Desktop files to .k404 with 0 static AV hits
c920140b725f44c223f33d13fd1f8646a9155d34b4b56a8a2bcd7e762a56c80c Windows PE (peexe) 1 / 75 HotCrypt.exe (.aes) Zenbox-verified encryption of Desktop user documents to .aes, AES-256 ransom demand, and WindowsSecurityUpdater persistence
a8c2402ef3ae115300f5428712ccb0b5461f4a2f14b5bfdfbe08d5ad86bd3087 Windows PE (peexe) 3 / 75 ransomware.bugbugo (lkd.exe) CAPE-verified encryption of user documents to .lkd and read_me_restore.txt drop
e38acc358eb0a8e44a5dfc8050f010ebcae1f00be11e7ab6ff82e159453fdbcb Archive (zip) 4 / 75 K404T-Release.zip (.k404) Verified in both CAPE and Zenbox encrypting user documents to .k404 and dropping k404t.txt
3dd45ab8e2f9c1af773a75221d792fb78870764419170e9c9c5941160364c700 Windows PE (peexe) 10 / 75 K404T_Fidye.exe (.k404) Verified in both CAPE and Zenbox encrypting user documents to .k404
cea1fb6c7f0c2a047e9a8e11c51bc29d43f16668df025da471b0aa0bc2428364 Windows PE (peexe) 31 / 75 ransomware.medusa/amtb CAPE-verified encryption of user documents to .[A08D7447][Recovafiles@gmail.com].yuw
d243031985f7fa82a741e5677a227c65b2e2f1b07e0e10f00fe575dcc0eb4645 Windows PE (peexe) 36 / 75 ransomware.incransom/incrnsm IOCP-queued encryption of user documents to .INC + INC-README.txt across drives
98110dedcca5803bc211f2d8dd640de79a2ba2a69d1def2f4970fa7799313f3e Windows PE (peexe) 43 / 75 trojan.blackwizard/encoder Stages .~BLWZ.tmp files, encrypts user documents to .BLWZ, and shows @seedware lock screen
6bdf42a575d2daee3de2530161cb5b1fef6ca78b4abfa74f329d6b6c72890d18 macOS ARM64 (macho) 16 / 75 trojan.abtrojan/amtb (Heartbreaker) May 2025 sample rescanned in macOS Mirage, encrypting user files in Downloads to .heartbreaker
94b93a47e3e9e47e6daf5beee9007e90f9aaffb67598c3d18605620b284be08f Windows DLL (pedll) 59 / 75 ransomware.lockbit/blackmatter LockBit 3.0 DLL (executed via DllMain) encrypting user documents and dropping 7danYRSZp.README.txt
eebbe14d40411a370cffd4d46a9451912e84cb3e80bfbe089466d5ae52a14b81 Archive (rar) 43 / 75 trojan.wannacryptor/wannacry RAR-delivered WannaCry (wanacry.rar) encrypting user documents to .WNCRY in CAPE Sandbox

What This Signal Does Not Catch

tag:encrypts-files is a high-precision confirmation signal, not an exhaustive recall filter. A missing tag does not mean a sample is benign or lacks ransomware logic. Automated sandbox runs will not emit the tag in several common scenarios:

  • Samples that require command-line arguments or passwords: Affiliates often guard execution with a runtime flag (such as LockBit 3.0 builds that require -pass <key> to decrypt their payload).
  • Sandbox evasion, user-interaction gates, or long sleeps: Samples that exit on VM checks (DETECT_DEBUG_ENVIRONMENT), stall past the analysis window (LONG_SLEEPS), or wait for specific locales or clicks never reach their encryption loop.
  • Unreachable command-and-control key servers: Families that fetch an encryption key from an offline C2 server before touching local files abort prior to file modification.
  • DLLs with custom exported entry points: Standard rundll32 detonation executes DllMain, which misses DLL lockers that require calling a specific named or ordinal export with structured arguments.
  • Network-share-only targets or executable file infectors: Samples configured to encrypt only SMB shares, niche database extensions absent from the VM, or parasitic .exe infectors (such as Virlock and Neshta) do not encrypt user documents on the local profile.
  • Safe ransomware simulators and analysis timeouts: Tools that only encrypt their own newly created test files rather than user documents, as well as samples that time out before reaching their encryption loop, do not trigger the tag.

Practical Security Use Cases & VirusTotal Intelligence Queries

Security teams can use tag:encrypts-files (or behaviour_tags:encrypts_files) immediately across VirusTotal Intelligence Search and the v3 REST API to streamline four common workflows:

  1. Building Clean Ransomware Validation Corpora for EDR and Storage Defense: Endpoint protection engineers, NAS/SAN storage security teams, and purple teams need fresh samples guaranteed to perform real disk-level file encryption when testing ransomware rollback and anomaly-detection sensors. Filter directly on samples verified to encrypt user documents across operating systems and architectures:
  2. Uncovering Evasive or Newly Emerged Ransomware Families: Combine dynamic encryption proof with low static antivirus detection thresholds to catch novel packers, custom Go or Rust lockers, or targeted affiliate builds before broad signature coverage arrives:
  3. Rapid SOC Triage and Impact Prioritization: During incident response, seeing behaviour_tags:crypto on a suspicious binary only tells an analyst that cryptography libraries were linked or called. Seeing encrypts-files paired with T1486 confirms destructive file-encryption capability immediately, enabling faster containment and backup isolation decisions.
  4. Confidential Detonation in Private Scanning: When triaging sensitive incident samples that cannot be uploaded to the public corpus, you can detonate them in Private Scanning to run the same CAPE, Zenbox, and macOS Mirage checks inside an isolated tenant.

Real-Time Hunting with VirusTotal Livehunt and YARA-X

Beyond retrospective search, you can receive real-time IOC Stream notifications whenever newly submitted or sandbox-analyzed files exhibit verified document encryption by pairing VirusTotal Livehunt with the vt YARA-X module.

1. Core Livehunt Rule: Verified ENCRYPTS_FILES Trait

The rule below matches any file whose sandbox behavior emits vt.BehaviourTrait.ENCRYPTS_FILES. Because CAPE, Zenbox, and macOS Mirage only emit this trait after verifying user-document encryption, ANDing T1486 adds no extra precision:

import "vt"

rule HUNT_Ransomware_EncryptsFiles {
  meta:
    description = "Detects files verified to encrypt user documents in sandbox execution (ENCRYPTS_FILES trait)"
    author = "Google Threat Intelligence"
    date = "2026-11-17"
    reference = "https://docs.virustotal.com/docs/livehunt"

  condition:
    for any trait in vt.behaviour.traits : (
      trait == vt.BehaviourTrait.ENCRYPTS_FILES
    )
}

2. Targeted Variant: Evasive / Low-Detection Ransomware Alerting

To focus your SOC or threat research feed strictly on emerging or lightly detected ransomware payloads (such as the 0/75 system_update.pyw script and 3/75 lkd.exe binary above), add a vt.metadata.analysis_stats.malicious threshold:

import "vt"

rule HUNT_Evasive_Ransomware_LowAV_EncryptsFiles {
  meta:
    description = "Alerts on low-detection files (< 10 AV engines) verified to encrypt user documents in sandboxes"
    author = "Google Threat Intelligence"
    date = "2026-11-17"
    reference = "https://docs.virustotal.com/docs/livehunt"

  condition:
    vt.metadata.analysis_stats.malicious < 10 and
    for any trait in vt.behaviour.traits : (
      trait == vt.BehaviourTrait.ENCRYPTS_FILES
    )
}

Two practical tips when authoring Livehunt behavioral rules:

  • Prefer vt.behaviour.traits over vt.metadata.tags for immediate behavioral matching: Livehunt evaluates dynamic rules as soon as sandbox reports finish (vt.behaviour.traits), so checking vt.BehaviourTrait.ENCRYPTS_FILES matches directly on the normalized sandbox report without waiting for downstream file-tag indexing.
  • When (if ever) to query T1486 in Livehunt: Do not AND T1486 onto ENCRYPTS_FILES rules, because vt.behaviour.mitre_attack_techniques aggregates across every sandbox (including broader Zenbox and third-party mappings) and adds no precision over the trait. Only add a case-insensitive technique.id iequals "T1486" check in separate rules when you want broader T1486 hits from third-party sandboxes that do not emit ENCRYPTS_FILES.

Try It Out and Share Your Feedback

tag:encrypts-files (across CAPE Sandbox, Zenbox, and macOS Mirage) and stricter T1486 gating (in CAPE Sandbox) are live in production for newly scanned and re-analyzed files:

  • Where the tag appears: Check the top file header badges or Behavior > Behavior Tags (attributes.tags and behaviour_traits in the v3 API).
  • Where triggering file paths are recorded: Inspect Signatures and File system actions > Files written in the Behavior tab (or signature_matches[].match_data in /api/v3/files/{sha256}/behaviours) to see the specific affected file paths.
  • Evaluating older cached files: Cached reports from earlier scans keep their historical tags. Click Reanalyze in the VirusTotal web UI to queue dynamic runs on eligible sandboxes that have not yet analyzed that hash (POST /api/v3/files/{id}/analyse in the API refreshes static AV only unless the file is re-uploaded or detonated in Private Scanning).

To explore live matches right now, open VirusTotal Intelligence Search (entity:file tag:encrypts-files) or deploy the YARA rules above in VirusTotal Livehunt. If you spot an interesting sample, edge case, or feature request, please contact us.

Happy hunting!

Tuesday, October 27, 2026

, , ,

Process trees in Livehunt: YARA rules that know who launched what



Note: YARA-X v1.21.0 adds a parent_name field to the items in vt.behaviour.processes_list, and v1.22.0 adds ancestor_names. VirusTotal now fills that list for every sandbox report that includes a process tree, by flattening it. The result is one entry per process, and each entry knows the name of the process that created it and of the processes above it. Read the YARA-X blog.

If you have written Livehunt rules on top of sandbox behavior, you have probably used vt.behaviour.processes_created. It is a flat list of command lines. It tells you that mshta.exe ran and that powershell.exe ran, but not that one started the other. For a lot of detections that is the whole point: PowerShell on its own is noise, PowerShell launched by mshta.exe is not.
Our sandboxes have always recorded the full process tree. The problem was getting it into YARA, which has no recursive types. As of this month, every file with sandbox reports that reaches Livehunt carries vt.behaviour.processes_list: one entry per process, from every sandbox that ran the file, and each entry knows the name of its parent, the names of its ancestors, and the files it touched.
This post covers what is in each entry, what to keep in mind when writing rules against it, and five cases we worked through while preparing it, each with the rules we wrote and tested. Every case comes with at least one hash, so you can paste the rule in the Livehunt editor and test it yourself.
If you haven't read it yet, we recommend our earlier post It's all about the structure! Creating YARA rules by clicking. It shows how to open the Structure view of any file in the Livehunt editor and turn fields into rule conditions with a click, which is handy for everything that follows.

What each process entry carries

Field Type What it holds
name string The process, as the sandbox reports it. Usually the image path plus the command line.
parent_name string The name of the process that created this one. Empty for root processes and when the parent is unknown.
ancestor_names array of strings The names of its ancestors, nearest first: ancestor_names[0] is the parent (the same as parent_name), ancestor_names[1] the grandparent, and so on. Empty for root processes and when the parent is unknown.
process_id / parent_process_id string PIDs, as reported by the sandbox.
start_time / termination_time integer When the process started and ended, if known.
files_written array of strings Files this process created or modified.
files_opened array of strings Files this process opened.
files_deleted array of strings Files this process deleted.
files_copied[x].source / .destination string Files this process copied, when the sandbox attributes copies to a process.
The fields that change how you write rules are parent_name, ancestor_names and the per-process file lists. With them, "PowerShell wrote a .dll" becomes "the PowerShell that cmd.exe started wrote a .dll".
The simplest possible rule looks like this:
import "vt"

rule cmd_spawns_schtasks_create {
  condition:
    for any p in vt.behaviour.processes_list : (
      p.name icontains "schtasks" and
      p.name icontains "/create" and
      p.parent_name icontains "cmd.exe"
    )
}

Things to know before you write rules

Names are not normalized. Each sandbox writes process names its own way. CAPE gives the quoted command line, Zenbox prepends the image path to the command line, Tencent HABO gives only the executable name, and C2AE and Microsoft Sysinternals often leave environment variables unexpanded (%ComSpec% /c ...). Use icontains and match on the executable name, not on a full path with == or startswith.
Link processes by name, not by PID. A file is usually run by several sandboxes, and Livehunt puts all their processes in the same list. PID 1040 can be cmd.exe in one report and explorer.exe in another. To go more than one level up, use ancestor_names: it is built from each sandbox report on its own, so a chain never mixes processes from different sandboxes. For long chains, you can also climb by name: look for the entry whose name is equal to the parent_name you already have. Both strings come from the same sandbox report, so an exact == is safe there.
A practical workflow is to search first and write the rule second. Intelligence search already supports behavior_processes:"<command line>", which matches anywhere in the list with no hierarchy. It is a quick way to collect candidates. Then you write the rule with the parent condition, and test it against those hashes in the Livehunt editor.

Case 1: porting a Sigma rule, and what it misses

Sigma's Suspicious MSHTA Child Process (03cc0c25-389f-4bf8-b48d-11878079f1ca) is a good example of a detection that needs the parent. Stripped down, it says: the parent image ends with \mshta.exe and the child is a shell or a scripting host.
detection:
    selection_parent:
        ParentImage|endswith: '\mshta.exe'
    selection_child:

        - Image|endswith:
              - '\cmd.exe'
              - '\powershell.exe'
              - '\pwsh.exe'
              - '\wscript.exe'
              - '\cscript.exe'
              - '\sh.exe'
              - '\bash.exe'
              - '\reg.exe'
              - '\regsvr32.exe'
              - '\bitsadmin.exe'
    condition: all of selection*
The Livehunt version maps ParentImage to parent_name and Image to name:
import "vt"

rule mshta_spawns_shell {
  meta:
    description = "Port of Sigma 03cc0c25 (Suspicious MSHTA Child Process)"
  condition:
    for any p in vt.behaviour.processes_list : (
      p.parent_name icontains "mshta.exe" and
      (
        p.name icontains "cmd.exe" or
        p.name icontains "powershell" or
        p.name icontains "pwsh" or
        p.name icontains "wscript" or
        p.name icontains "cscript" or
        p.name icontains "bash.exe" or
        p.name icontains "reg.exe" or
        p.name icontains "regsvr32" or
        p.name icontains "bitsadmin"
      )
    )
}
One thing does not carry over. Sigma also checks OriginalFileName to catch renamed binaries, and sandbox process names have no equivalent. A renamed mshta.exe will get past this rule.
We tested it against d30a0a6c09f664446943d82982f0630e85c447cbe84be8a74b6db6d66effbe80, an Excel file named NOVI USD 44570.00 952PLA3262852510.xls (18/76, tagged cve-2017-0199). It matches. What is more interesting is the CAPE process tree behind the match:
Process Parent
EXCEL.EXE "...\attachment.xls" /dde Explorer.EXE
mshta.exe -Embedding svchost.exe -k DcomLaunch -p
cmd.exe "/c POwERSHeLl.Exe ... -EX BypaSS -nOp -w 1 -ec ..." mshta.exe -Embedding
POwERSHeLl.Exe ... -ec ... cmd.exe
WScript.exe "...\AppData\Roaming\westingcostringforme.vbe" POwERSHeLl.Exe
powershell.exe -nop -ep bypass -file "C:\Temp\XBRYINEZ.ps1" WScript.exe
aspnet_compiler.exe powershell.exe -file ...XBRYINEZ.ps1
Excel is not the parent of mshta.exe. The exploit has Office request an object through DCOM, so mshta.exe is started by the DCOM launcher service, and it shows up with -Embedding. A rule that looks for "Office spawns mshta" would never fire on this document. What we can do is walk one level up from the shell and check the grandparent:
import "vt"

rule dcom_mshta_spawns_shell {
  condition:
    for any p in vt.behaviour.processes_list : (
      (p.name icontains "cmd.exe" or p.name icontains "powershell") and
      p.parent_name icontains "mshta.exe" and
      p.ancestor_names[1] icontains "svchost.exe" and
      p.ancestor_names[1] icontains "dcomlaunch"
    )
}
The first entry of ancestor_names is always the parent, so ancestor_names[1] is the grandparent: the process that started mshta.exe. Without it, you need a second loop over the list to find the entry whose name is the shell's parent_name, and one more loop for every extra level.
The same rule matches other spreadsheets from the same wave, for example 8d249972358268b7a00e182e3f1ecf93ec8bbbee65d22ef4d8a3c382783c1cfa (PO#3302-20260520002.xls), 2d199776cc50b9ad548132105e95af86b29ec8ebca03895a7ddecde58587306b (Request Quotation.xls) and 7c8a3c8366b3106db56359e3defc654d365ce4de21d0a7b1fbad02fbb2aeae52. The rest of that chain shows up again in cases 4 and 5.

Case 2: a services.exe that is not, and the copies behind it

On a normal Windows system, services.exe is started by wininit.exe and by nothing else. A services.exe with any other parent deserves a look:
import "vt"

rule fake_services_wrong_parent {
  condition:
    for any p in vt.behaviour.processes_list : (
      p.name iendswith "\\services.exe" and
      p.parent_name != "" and
      not p.parent_name icontains "wininit.exe"
    )
}
The parent_name != "" check matters. In the reports we looked at, the real services.exe shows up as a root process with no parent, and we don't want those to match.
Our first version also covered lsass.exe. We tested it against 43 recent, clean, signed files, and it matched 19 of them. In those reports the sandbox records lsass.exe with services.exe as its parent. Whatever the reason, that is what the data says, so we dropped lsass.exe from the rule. The lesson is a general one: before encoding what the parent "should" be, check what the sandboxes actually report for clean files.
The rule matches fe8357febe314becf31510a7a2ecb0369e312ad58a448292f5f8a09075d7694c, a .NET executable (45/76) submitted as Cd5KK.exe. In the Jujubox report, Cd5KK.exe starts C:\Windows\System32\NlsLexicons0c1a\services.exe. That process writes two .vbs files to %TEMP% and runs each one with WScript.exe, and one of the scripts starts the fake services.exe again. The sample also launches one PowerShell per path to add Defender exclusions, and in the CAPE report it creates ONLOGON scheduled tasks through WMI, with wmiprvse.exe as the parent of schtasks.exe.
Where did the fake services.exe come from? Jujubox does not attribute file copies to a process, but it does report them at the summary level, in vt.behaviour.files_copied. Cd5KK.exe copied itself to eight places, each one with the name of a Windows binary:
C:\Windows\System32\NlsLexicons0c1a\services.exe
C:\System Volume Information\services.exe
C:\Windows\system\smss.exe
C:\Windows\System32\mfc42\taskeng.exe
C:\Users\Default User\WmiPrvSE.exe
C:\Program Files\Common Files\System\ado\en-US\WmiPrvSE.exe
C:\PerfLogs\Admin\sysmon.exe
C:\Users\<USER>\Downloads\patchregistry\event-stream.exe
You can combine both fields. This rule looks for a copy named after a system process, and then for a process in the list that runs from exactly that path and has a parent:
import "vt"

rule copy_with_system_name_is_executed {
  condition:
    for any c in vt.behaviour.files_copied : (
      (
        c.destination iendswith "\\services.exe" or
        c.destination iendswith "\\smss.exe" or
        c.destination iendswith "\\lsass.exe" or
        c.destination iendswith "\\csrss.exe" or
        c.destination iendswith "\\svchost.exe" or
        c.destination iendswith "\\wmiprvse.exe" or
        c.destination iendswith "\\taskhostw.exe" or
        c.destination iendswith "\\conhost.exe"
      ) and
      for any p in vt.behaviour.processes_list : (
        p.name icontains c.destination and
        p.parent_name != ""
      )
    )
}
The copy proves the file was planted, and the process entry proves it ran. We tested the rule against 30 recent files with a services.exe path in their Jujubox file activity: it matched 9 of them, among them 4930cc4e7e3e258bf2815793f0e5698bdd45adfae8e052bb1dc4c05c6689ade6, which shares the trojan.msil/basic label with Cd5KK.exe and also matches the services.exe parent rule above. It did not match any of the 43 clean files.

Case 3: headless consoles, renamed or not

conhost.exe --headless runs a console program without showing a window. Sigma has a rule that looks for --headless and powershell in the conhost.exe command line. With the parent available, we can ask a slightly different question: did a PowerShell process actually start with a headless console as its parent?
import "vt"

rule headless_console_runs_powershell {
  condition:
    for any p in vt.behaviour.processes_list : (
      (p.name icontains "powershell" or p.name icontains "pwsh") and
      p.parent_name icontains "--headless"
    )
}
A plain search shows why a rule on the command line alone gets noisy. behavior_processes:"conhost.exe --headless" fs:2026-09-01+ returned 947 files when we ran it. Part of that is legitimate software. Terminal emulators use pseudo-consoles, which start conhost.exe --headless --inheritcursor ... --server .... herdr.exe (c18555a6bb74cd021198b57d16b93b40e74e7d0f8f0c28a45f0a4cc22dea0f8b, 0/76) does exactly that, and the rule above does not match it, because that conhost.exe never starts a shell.
On the malicious side, 5c2ceaec797dfa79e81cde6d765898ee8102357e280fa322db6e5a4b0ce3fc4a is a Windows shortcut with a Korean-language lure about penalty guidelines for e-commerce law violations, named with a double .hwp.lnk extension (34/76). CAPE and Jujubox both show the same chain: opening the shortcut starts conhost.exe --headless powershell.exe -NoP -exec BYpass -w 1 -C $rukp = '...', and that console starts the PowerShell that runs the Base64 blob. The decoded script opens with a function called Invoke-EnvironmentCheck.
Notice that the rule checks for --headless in the parent, not for conhost.exe. That is deliberate. 77da8a02d71078564409863c358a544e981b9643c8f50c1daabc5d5d176e3c75 (42/76) drops a file called rhpmx63snl.exe into %APPDATA%\MicrosoftWorker_e08ec640d\. That file is 51bb5aeef2e48dd14fae764f80dc67f516df9914ea9c350329e229f6cea919a2, an unmodified Microsoft conhost.exe (original name CONHOST.EXE, 0/77) with a random name. It later runs as rhpmx63snl.exe --headless powershell.exe -w h -ep bypass -c & "...\xd24mgasgb4.exe". A rule that required conhost.exe in the parent would miss it. If you only want the renamed case, add not p.parent_name icontains "conhost".

Case 4: persistence that actually ran

Spotting schtasks /create is easy. Knowing whether the task did anything during the analysis is harder, and the process list can answer it. When a scheduled task fires, the new process has the Task Scheduler service as its parent (svchost.exe -k netsvcs -p -s Schedule, or taskeng.exe on older systems). If that process runs a file the sample wrote earlier, the persistence worked.
import "vt"

rule task_scheduler_runs_dropped_file {
  condition:
    for any run in vt.behaviour.processes_list : (
      (
        run.parent_name icontains "-s schedule" or
        run.parent_name icontains "taskeng.exe"
      ) and
      for any dropper in vt.behaviour.processes_list : (
        for any f in dropper.files_written : (
          (f iendswith ".exe" or f iendswith ".dll" or f iendswith ".vbs" or
           f iendswith ".js" or f iendswith ".ps1" or f iendswith ".bat" or
           f iendswith ".cmd") and
          run.name icontains f
        )
      )
    )
}
This is the first rule in the post that uses files_written, and it uses it to link two processes that are not parent and child: the one that wrote the file, and the one the scheduler started from it.
Back to 77da8a02d71078564409863c358a544e981b9643c8f50c1daabc5d5d176e3c75. In the CAPE report, software.exe writes rhpmx63snl.exe and xd24mgasgb4.exe to %APPDATA%\MicrosoftWorker_e08ec640d\, and then runs:
schtasks.exe /create /sc minute /mo 1 /tn "AdobeSecurityManager" /tr "C:\Users\<USER>\AppData\Roaming\MicrosoftWorker_e08ec640d\rhpmx63snl.exe --headless powershell.exe -w h -ep bypass -c & '...\xd24mgasgb4.exe'"
When the task fires, the scheduler starts rhpmx63snl.exe (the renamed conhost.exe from case 3), which starts PowerShell, which starts xd24mgasgb4.exe. Every link in that sentence is a parent_name, and the rule matches. The whole chain is also in the ancestor_names of xd24mgasgb4.exe: the PowerShell, rhpmx63snl.exe, the Schedule service and services.exe.
Zenbox saw the same task fire, but reported rhpmx63snl.exe as a root process with no parent. That is fine: CAPE has the link, and the rule only needs one sandbox to see it. It also shows why you shouldn't write rules that need every sandbox to agree.
One more format issue we ran into. a549a6c8c01da1d03e8da663eec70997a5bd5207e665d8e23f6fa75804dafc06, a VBS file we use in the next case, also creates a task that fires during the VMRay analysis, with taskeng.exe as the parent. The rule misses it, because VMRay logged that command line with doubled backslashes (C:\\Users\\Public\\Downloads\\PoItWjNFjv.vbs), so the path in files_written is not a substring of the process name. When a rule should match and does not, check the raw strings first. Here ancestor_names gives a check that does not depend on how paths are written: the task runs wscript.exe with the dropped script, the script starts PowerShell, and taskeng.exe is among that PowerShell's ancestors. A PowerShell process with for any a in p.ancestor_names : (a icontains "taskeng.exe") catches it.

Case 5: .NET binaries reading browser credentials

Loaders often inject the final payload into a signed .NET Framework binary such as MSBuild.exe, RegAsm.exe, RegSvcs.exe, InstallUtil.exe or aspnet_compiler.exe. On their own, these processes are normal on a developer machine. Started by PowerShell or a scripting host, and writing temporary copies of browser credential databases, they are not.
import "vt"

rule dotnet_lolbin_touches_browser_logins {
  condition:
    for any p in vt.behaviour.processes_list : (
      (
        p.name icontains "aspnet_compiler.exe" or
        p.name icontains "regasm.exe" or
        p.name icontains "regsvcs.exe" or
        p.name icontains "msbuild.exe" or
        p.name icontains "installutil.exe" or
        p.name icontains "addinprocess"
      ) and
      for any a in p.ancestor_names : (
        a icontains "powershell" or
        a icontains "wscript" or
        a icontains "cscript" or
        a icontains "mshta"
      ) and
      for any f in p.files_written : (
        f icontains "\\User Data\\" and
        (f icontains "\\Login Data" or f icontains "\\Web Data" or f icontains "\\Cookies")
      )
    )
}
All three conditions apply to the same process: what it is, what is above it, and what it wrote. That is the difference from the flat fields. behaviour_files:"Login Data" together with behavior_processes:"MSBuild.exe" can match a file where those two things happened in unrelated processes.
The rule matches a549a6c8c01da1d03e8da663eec70997a5bd5207e665d8e23f6fa75804dafc06, a VBS file named RFQ_638O-0194RFQ26_202610070614034439RFQ.vbs (14/76). In the CAPE report, a hidden PowerShell that rebuilds its script from environment variables is started through WMI (its parent is wmiprvse.exe), and that PowerShell starts MSBuild.exe, which writes ...\Google\Chrome\User Data\Default\Login Data.tmp and the matching -wal and -shm files. It also matches the Excel file from case 1, d30a0a6c09f664446943d82982f0630e85c447cbe84be8a74b6db6d66effbe80, where the last process in the chain, aspnet_compiler.exe, writes the same files. In that file, the ancestor_names of aspnet_compiler.exe go all the way back to the exploit: the PowerShell running XBRYINEZ.ps1, WScript.exe, the obfuscated PowerShell, cmd.exe and mshta.exe -Embedding.
Checking the ancestors instead of only the parent matters in 2d199776cc50b9ad548132105e95af86b29ec8ebca03895a7ddecde58587306b, the Request Quotation.xls from case 1. There, the process that writes the Chrome and Edge Login Data and Web Data files is a second aspnet_compiler.exe, started with /stext by the first one. Its parent is aspnet_compiler.exe, so a rule that only looks at parent_name misses it, while the PowerShell and WScript.exe above it are its second and third ancestors. On the 420 malicious and 324 clean files we used to measure ancestor_names, this version matched 5 malicious files that the parent-only version missed, and none of the clean ones.

Testing the rules

Everything in this post was tested two ways. First, against the hashes above and against a set of clean files, using the Livehunt rule tester. The tester rebuilds the vt module for the hash you give it, so it works for files analyzed before these fields existed. Second, in a live Livehunt ruleset with all the rules. Within a few minutes of enabling it we were already getting notifications for mshta_spawns_shell, dcom_mshta_spawns_shell, task_scheduler_runs_dropped_file and others. The ancestor_names versions of the rules were also run with YARA-X 1.22.0 against the same hashes and 324 clean files.

Wrapping up

A command line tells you what ran. Its parent and ancestors tell you how it got there, and the files it wrote tell you what it left behind. Rules that join the two are harder for a sample to sidestep, because the operator would need to change the chain, not just the strings. Open the vt module view of any file you are investigating, find the processes_list entry that bothers you, and write the rule from there.
Happy hunting!

Friday, October 18, 2024

, , , , , , , , , , , ,

Unveiling Hidden Connections: JA4 Client Fingerprinting on VirusTotal

VirusTotal has incorporated a powerful new tool to fight against malware: JA4 client fingerprinting. This feature allows security researchers to track and identify malicious files based on the unique characteristics of their TLS client communications.

JA4: A More Robust Successor to JA3

JA4, developed by FoxIO, represents a significant advancement over the older JA3 fingerprinting method. JA3's effectiveness had been hampered by the increasing use of TLS extension randomization in https clients, which made fingerprints less consistent. JA4 was specifically designed to be resilient to this randomization, resulting in more stable and reliable fingerprints.

Unveiling the Secrets of the Client Hello

JA4 fingerprinting focuses on analyzing the TLS Client Hello packet, which is sent unencrypted from the client to the server at the start of a TLS connection. This packet contains a treasure trove of information that can uniquely identify the client application or its underlying TLS library. Some of the key elements extracted by JA4 include:
  • TLS Version: The version of TLS supported by the client.
  • Cipher Suites: The list of cryptographic algorithms the client can use.
  • TLS Extensions: Additional features and capabilities supported by the client.
  • ALPN (Application-Layer Protocol Negotiation): The application-level protocol, such as HTTP/2 or HTTP/3, that the client wants to use after the TLS handshake.

JA4 in Action: Pivoting and Hunting on VirusTotal

VirusTotal has integrated JA4 fingerprinting into its platform through the behavior_network file search modifier. This allows analysts to quickly discover relationships between files based on their JA4 fingerprints.

To find the JA4 value, navigate to the "behavior" section of the desired sample and locate the TLS subsection. In addition to JA4, you might also find JA3 or JA3S there.

Example Search: Let's say you've encountered a suspicious file that exhibits the JA4 fingerprint "t10d070600_c50f5591e341_1a3805c3aa63" during VirusTotal's behavioral analysis.

You can click on this JA4 to pivot using the search query behavior_network:t10d070600_c50f5591e341_1a3805c3aa63 finding other files with the same fingerprint This search will pivot you to additional samples that share the same JA4 fingerprint, suggesting they might be related. This could indicate that these files are part of the same malware family or share a common developer or simply share a common TLS library.

Wildcard Searches

To broaden your search, you can use wildcards within the JA4 hash. For instance, the search: behaviour_network:t13d190900_*_97f8aa674fd9

Returns files that match the JA4_A and JA4_C components of the JA4 hash while allowing for variations in the middle section, which often corresponds to the cipher suite. This technique is useful for identifying files that might use different ciphers but share other JA4 characteristics.

YARA Hunting Rules: Automating JA4-Based Detection

YARA hunting rules using the "vt" module can be written to automatically detect files based on their JA4 fingerprints. Here's an example of a YARA rule that targets a specific JA4 fingerprint:


This rules will flag any file submitted to VirusTotal that exhibits the matching JA4 fingerprint. The first example only matches "t12d190800_d83cc789557e_7af1ed941c26" during behavioral analysis. The second rule will match a regular expression /t10d070600_.*_1a3805c3aa63/, only matching JA4_A and JA4_C components, excluding the JA4_B cipher suite. These fingerprints could be linked to known malware, a suspicious application, or any TLS client behavior that is considered risky by security analysts.



JA4: Elevating Threat Hunting on VirusTotal

VirusTotal's adoption of JA4 client fingerprinting will provide users with an invaluable tool for dissecting and tracking TLS client behaviors, leading to enhanced threat hunting, pivoting, and more robust malware identification.

Happy Hunting.

Wednesday, December 20, 2023

, , , ,

Sigma rules for Linux and MacOS

TLDR: VT Crowdsourced Sigma rules will now also match suspicious activity for macOS and Linux binaries, in addition to Windows.
We recently discussed how to maximize the value of Sigma rules by easily converting them to YARA Livehunts. Unfortunately, at that time Sigma rules were only matched against Windows binaries.
Since then, our engineering team worked hard to provide a better experience to Sigma lovers, increasing Crowdsourced Sigma rules value by extending matches to macOS and Linux samples.

Welcome macOS and Linux

Although we are still working to implement Sysmon in our Linux and macOS sandboxes, we implemented new features that allow Sigma rule matching by extracting samples’ runtime behavior.
For example, a process created in our sandbox that ends in “/crontab” and contains the "-l" parameter in the command line would match the following Sigma rule:

logsource:

  product: linux

  category: process_creation

detection:

  selection:

    Image|endswith: '/crontab'

    CommandLine|contains: ' -l'

  condition: selection

We have mapped all the fields used by Sigma rules with the information offered by our sandboxes, which allowed us to map rules for image_load, process_creation and registry_set, among others.
This approach has limitations. However, about 54% of Crowdsourced Sigma rules for Linux and 96% for macOS are related to process creation, meaning we already have enough information to match all these with our sandboxes’ output. The same happens for rules based on file creation.
Let’s look at some examples!

Linux, MacOS and Windows examples

The following shell script sample matches 11 Crowdsourced Sigma Rule matches.
For every rule, it is possible to check what triggered the match by clicking on "View matches”. In the case of Windows binaries, it would show what Sysmon event matched the behavior described in the Sigma rule, as we can see below:
In the case of the shell script mentioned above, it shows the values that are relevant to the logic of the rule as you can see in the following image:
Interestingly, Sigma rules intended for Linux also produce results in macOS environments, and vice versa. In this case, the shell script can be interpreted by both operating systems. Indeed, one of the matching rules for the sample called Indicator Removal on Host - Clear Mac System Logs was specifically created for macOS:
while a second matching rule, Commands to Clear or Remove the Syslog , was created for Linux:
To get more examples of samples with Sigma rules that match sandboxes’ output instead of Sysmon, you can use the following queries:
(have:sigma) and not have:evtx type:mac
(have:sigma) and not have:evtx type:linux
A second interesting example is a dmg matching 8 Sigma rules, 5 of them originally created for Linux OS under the “process_creation” category and 2 rules created for macOS. The last match… is a Sigma rule created for Windows samples!
The new feature matching Sigma rules with Linux and macOS samples helped us identify some rules that are maybe too generic, which is not necessarily a problem as long as this is the intended behavior.
In this case, the Usage Of Web Request Commands And Cmdlets rule was originally created to detect web request using Windows’ command line:
The rule seems a bit too generic since it only checks for a few strings in the command line, although it can be highly effective for generic detection of suspicious behavior.
To understand why our Macintosh Disk Image sample triggered a detection for this rule, we checked the matches:
As we can see, the use of the string “curl” in the command line was enough to match this sample.
This sigma rule had about 9k hits last year only, with more than 300 of the files being Linux or macOS samples. You can obtain the full list using the following query:
sigma_rule:f92451c8957e89bb4e61e68433faeb8d7c1461c3b90d06b3403c8f3d87c728b8 and (type:linux or type:mac)

Creating Livehunt rules from Sysmon EVTX outputs

So far we have mainly focused on samples that do not have Sysmon (EVTX) logs. Now let's see how it is possible to create a Livehunt rule based on Sysmon logs. For this, we are going to use the “structure” functionality provided in the Livehunt YARA editor, as we explain in this post.
The sample we will use in this example is associated with CobaltStrike and matches multiple Sigma rules that identify certain behaviors. It is important to note that for every Sigma match, we will see in the file “structure” the context that matched but not the full EVTX logs. These can be downloaded from the sample’s VT report behavior section under “Download Artifacts” or using our API (available for public and privately scanned files).
The following image shows the matching raw EVTX generated by our sample:
From the sample’s JSON Structure, Sigma_analysis_results is an array that contains objects with all the relevant information related to the matching Sigma rules, including details about the rule itself and EVTX logs. From the previous image, the first highlighted section is related to process creation and the second one is a registry event (value set).
As explained in our post, by just clicking on the fields that you are interested in you can start building your Livehunt rule, and adjust values accordingly. In this case, our rule will identify files creating registry keys under \\CurrentVersion\\RunOnce\\ with a .bat or .vbs extension:

import "vt"

rule sigma_example_registry_keys {

  meta:

    target_entity = "file"

  condition:

    for any vt_behaviour_sigma_analysis_results in vt.behaviour.sigma_analysis_results: (

      for any vt_behaviour_sigma_analysis_results_match_context in vt_behaviour_sigma_analysis_results.match_context: (

        vt_behaviour_sigma_analysis_results_match_context.values["TargetObject"] icontains "\\CurrentVersion\\RunOnce\\" and

        (vt_behaviour_sigma_analysis_results_match_context.values["Details"] endswith ".vbs" or vt_behaviour_sigma_analysis_results_match_context.values["Details"] endswith ".bat")

      )

    )

}

Running this YARA using a Retrohunt finds multiple files:
daef729493b9061e7048b4df10b71fdba2e11d9147512f48463994a88c834a30 141e87e62c110b86cf7b01a2def60faab6365f6391eb0d4a7cbad8d480dd4706 814b2cab7c5a12ec18f345eb743857e74f5be45c35642dc01330e7a0def6269a 31b0e9b188fe944d58867bbfc827d77c7711c3a690168a417377fe6bf1544408 dd6051509ed8cf3d059b538fa8878f87423c51b297b49a12144d3d2923c89cce 647323f0245da631cef57d9ca1e3327c3242fe1cbbf6582c4d187e9f5fbfb678 40a90dd3b2132a299f725e91a5d0127013b21af24074afb944d8bc5735c1bd53 b44c6d2dd8ad93cecd795cecde83081292ee9949d65b2e98d4a2a3c8a97bd936 710b0cca7e7c17a3dd2a309f5ca417b76429feac1ab5fb60f5502995ebbd1515 50c098119ce41771e7a3b8230a7aa61ebea925e8eda46c33f0dd42b8950b92fe
Here you can see some interesting matches:
The next rule focuses on file creation events related to Sysmon (EVID 11) under the “C:\Windows\System32” directory, with a “.dll” extension and having any “cve” tag (flagging potential CVE exploitation). Remember we can always include any additional details related to the samples we want to hunt, such as positives, metadata, tags, engines, … in addition to EVTX fields:

import "vt"

rule sigma_rule_evtx_cve {

  meta:

    target_entity = "file"

  condition:

    for any vt_behaviour_sigma_analysis_results in vt.behaviour.sigma_analysis_results: (

      for any vt_behaviour_sigma_analysis_results_match_context in vt_behaviour_sigma_analysis_results.match_context: (

        vt_behaviour_sigma_analysis_results_match_context.values["TargetFilename"] startswith "C:\\Windows\\System32\\" and

        vt_behaviour_sigma_analysis_results_match_context.values["TargetFilename"] endswith ".dll" and

        for any vt_metadata_tags in vt.metadata.tags: (

        vt_metadata_tags icontains "cve-"

        )

      )

    )

}

Sysmon EVTX fields - overlaps

Some of the details found in Sysmon EVTX fields (found in the VT JSON samples’ structure) can be redundant with details provided in other more traditional fields that you use for your Livehunt rules through the YARA VT module.
For example, instead of: vt_behaviour_sigma_analysis_results_match_context.values["TargetFilename"] from vt.behaviour.sigma_analysis_results
you could use: vt.behaviour.files_written to identify file creation events.
When that’s the case, we recommend using traditional fields found in VT samples’ structure for the following reasons:
  • Sysmon information is fully stored/indexed only the part matching the Sigma rule, which will limit any YARA hunting.
  • We mapped most Sysmon fields into YARA VT module for simplicity.
  • Linux and MacOS samples do not have any Sysmon information related to Sigma rules. Similar details about the match can be found under the “behaviour” JSON structure entry.
The new Sysmon-like details offered in the file “structure” also make VT an excellent platform for researchers and Sigma rule creators, allowing them to leverage this information without the need to create their own lab.
The following table helps mapping VT Intelligence queries, YARA VT module fields, Sigma Categories, and Sigma fields:

VT Intelligence

YARA VT module field

Sigma Category

Sigma Field

behavior_created_processes

vt.behaviour.processes_created

process_creation

Image

CommandLine

ParentCommandLine

ParentImage

OriginalFileName

behavior_files

vt.behaviour.files_attribute_changed

vt.behaviour.files_deleted

vt.behaviour.files_opened

vt.behaviour.files_copied

vt.behaviour.files_copied[x].destination

vt.behaviour.files_copied[x].source

vt.behaviour.files_written

vt.behaviour.files_dropped

vt.behaviour.files_dropped[x].path

vt.behaviour.files_dropped[x].sha256

vt.behaviour.files_dropped[x].type

file_access

file_change

file_delete

file_rename

file_event

TargetFilename

behavior_injected_processes

vt.behaviour.processes_injected

process_access

create_remote_thread

process_creation

CallTrace

GrantedAccess

SourceImage

TargetImage

StartModule

StartFunction

TargetImage

SourceImage

behavior_processes

vt.behaviour.processes_terminated

vt.behaviour.processes_killed

vt.behaviour.processes_created

vt.behaviour.command_executions

vt.behaviour.processes_injected

process_access

create_remote_thread

process_creation

CallTrace

GrantedAccess

SourceImage

TargetImage

StartModule

StartFunction

TargetImage

SourceImage

Image

CommandLine

ParentCommandLine

ParentImage

OriginalFileName

behavior_registry

vt.behaviour.registry_keys_deleted

vt.behaviour.registry_keys_opened

vt.behaviour.registry_keys_set

vt.behaviour.registry_keys_set[x].key

vt.behaviour.registry_keys_set[x].value

registry_add

registry_delete

registry_event

registry_rename

registry_set

EventType

TargetObject

Details

behavior_services

vt.behaviour.services_bound

vt.behaviour.services_created

vt.behaviour.services_opened

vt.behaviour.services_started

vt.behaviour.services_stopped

vt.behaviour.services_deleted

registry_set

process_creation

Image

CommandLine

ParentCommandLine

ParentImage

EventType

TargetObject

Details

behavior_network

vt.behaviour.dns_lookups

vt.behaviour.dns_lookups[x].hostname

vt.behaviour.dns_lookups[x].resolved_ips

vt.behaviour.hosts_file

vt.behaviour.ip_traffic

vt.behaviour.ip_traffic[x].destination_ip

vt.behaviour.ip_traffic[x].destination_port

vt.behaviour.ip_traffic[x].transport_layer_protocol

vt.behaviour.http_conversations

vt.behaviour.http_conversations[x].url

vt.behaviour.http_conversations[x].request_method

vt.behaviour.http_conversations[x].request_headers

vt.behaviour.http_conversations[x].response_headers

vt.behaviour.http_conversations[x].response_status_code

vt.behaviour.http_conversations[x].response_body_filetype

vt.behaviour.smtp_conversations[x].hostname

vt.behaviour.smtp_conversations[x].destination_ip

vt.behaviour.smtp_conversations[x].destination_port

vt.behaviour.smtp_conversations[x].smtp_from

vt.behaviour.smtp_conversations[x].smtp_to

vt.behaviour.smtp_conversations[x].message_from

vt.behaviour.smtp_conversations[x].message_to

vt.behaviour.smtp_conversations[x].message_cc

vt.behaviour.smtp_conversations[x].message_bcc

vt.behaviour.smtp_conversations[x].timestamp

vt.behaviour.smtp_conversations[x].subject

vt.behaviour.smtp_conversations[x].html_body

vt.behaviour.smtp_conversations[x].txt_body

vt.behaviour.smtp_conversations[x].x_mailer

vt.behaviour.tls

network_connection

DestinationHostname

DestinationIp

DestinationIsIpv6

DestinationPort

DestinationPortName

SourceIp

SourceIsIpv6

SourcePort

SourcePortName

behavior (too generic)

vt.behaviour.modules_loaded

image_load

ImageLoaded

Image

OriginalFileName

Wrapping up

At VirusTotal, we believe that the Sigma language is a valuable tool for the community to share information about samples’ behavior. Our objective is to make its use on VT as simple as possible. Our addition of MacOS and Linux is just the start of what we are working on, as we aim to add Sysmon for Linux to obtain more robust results, including the ability to download full generated logs.
Remember that here you have a list of all the Crowdsourced Sigma rules that are currently deployed in VirusTotal and that you can use for threat hunting.
We hope you join our fan club of Sigma and VirusTotal, and as always we are happy to hear your feedback.
Happy Hunting!