Add macOS rule for sensitive data archived via ditto - #6234
Open
clivoa wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a macOS
process_creationrule fordittoarchiving a path that holds credentials, browser secrets or wallet data.Why
dittohas no coverage anywhere in the repo. Grepping current master returns zero hits acrossrules/,rules-threat-hunting/andrules-emerging-threats/. The LOOBins entry for the binary says the same thing in its own Detections section: "No detection content at time of writing."It is not an obscure technique. CyberProof's AMOS analysis describes the malware gathering Keychain files, browser credentials and wallet data, then compressing them "into a single archive named
osalogging.zipwithin the/tmpdirectory using native macOS utilities likeditto". LOOBins lists the staging form under Collection and Exfiltration:The reason stealers pick
dittooverziportaris that it preserves resource forks and extended attributes, so macOS metadata survives the round trip./usr/bin/dittois also signed by Apple (Identifier=com.apple.ditto), so it does not trip anything watching for unsigned binaries.The rule matches on the archived path rather than on
dittoalone. A bare "ditto was executed" rule would be noise, since the binary is in ordinary use for copying application bundles.Path selection
I followed the approach in
Access To Crypto Currency Wallets By Uncommon Applications(f41b0311) and used specific paths rather than a generic keyword. A barewalletsubstring was deliberately left out: it matches ordinary user directories and would have driven the false positive rate up for little gain.Testing
Real process telemetry, captured on macOS 26.5.2 (arm64) while the command ran. Home directory redacted:
The first archived a real 25 MB Keychains directory into a 7.5 MB zip. The second archived an ordinary directory holding a text file, as a control.
Rule logic checked against both captures and six further cases:
dittoon~/.sshdittoon a ChromeCookiespathdittoon an Exodus wallet directorydittocopying an app bundle to a backup volumeditto -c -k unsigned.app app.zip, the LOOBins Gatekeeper trickzip -rover the same Keychains pathThe Gatekeeper case is worth calling out. It is the other documented offensive use of
ditto, it is a different tactic, and it does not match this rule. Anyone wanting to cover it would need a separate rule keyed on the extended attribute behaviour rather than on the path.Repository checks, all clean:
There is a companion Atomic Red Team test for the same technique under T1560.001, so the emulation side is reproducible too.