T1548.006

TCC Manipulation

Adversaries manipulate or abuse macOS Transparency, Consent, and Control (TCC) to grant malicious processes elevated permissions without user consent. TCC controls access to camera, microphone, Full Disk Access, Screen Recording, and other sensitive resources. Techniques include: directly modifying the TCC SQLite database, injecting into existing processes that already have TCC entitlements, exploiting the limited process list to find TCC-entitled processes to hijack, or abusing MDM configuration profiles. Phil Stokes documented multiple TCC bypass techniques used by macOS malware.

Microsoft Sentinel / Defender
kusto
// T1548.006 — TCC Database Manipulation detection (macOS)
// Requires macOS endpoints in Defender for Endpoint
// Part 1: Detect writes to TCC database files
let TCCDBWrite = DeviceFileEvents
| where Timestamp > ago(24h)
| where FileName in~ ("TCC.db", "com.apple.TCC.db")
    or FolderPath has_any ("/Library/Application Support/com.apple.TCC/",
                           "/Users/", "/private/var/")
        and (FileName endswith ".db" and FolderPath has "TCC")
| where ActionType in ("FileModified", "FileCreated")
| where InitiatingProcessFileName !in~ ("tccd", "syspolicyd", "mdmclient",
                                         "System Preferences", "SystemPreferences")
| extend DetectionType = "TCC_Database_Modified"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Part 2: Detect sqlite3 accessing TCC database
let TCCSQLite = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "sqlite3"
| where ProcessCommandLine has_any ("TCC.db", "com.apple.TCC", "kTCCService")
| extend DetectionType = "TCC_SQLite_Direct_Access"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Part 3: Detect process injection into TCC-privileged processes
let TCCProcessInject = DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ ("Finder", "Terminal", "Preview",
                                        "Safari", "Mail", "Calendar")
| where FileName in~ ("python", "python3", "perl", "ruby", "bash", "sh",
                      "osascript", "curl", "nc")
| where InitiatingProcessCommandLine !has ProcessCommandLine // Spawn not from parent's expected cmds
| extend DetectionType = "TCC_Privileged_Process_Spawn"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, DetectionType;
union TCCDBWrite, TCCSQLite, TCCProcessInject
| sort by Timestamp desc
high severity medium confidence

Data Sources

File: File Modification Process: Process Creation Microsoft Defender for Endpoint (macOS)

Required Tables

DeviceFileEvents DeviceProcessEvents

False Positives

  • System software updates that legitimately modify TCC database during migration
  • MDM enrollment processes modifying TCC settings via configuration profiles
  • tccd daemon (the TCC daemon) accessing its own database during normal operation
  • Privacy Reset operations during macOS upgrade or system migration

Unlock Pro Content

Get the full detection package for T1548.006 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections