Add macOS rule for browser credential database query via a database CLI utility - #6233
Open
clivoa wants to merge 1 commit into
Open
Add macOS rule for browser credential database query via a database CLI utility#6233clivoa wants to merge 1 commit into
clivoa wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Welcome @clivoa 👋
It looks like this is your first pull request on the Sigma rules repository!
Please read the SigmaHQ conventions to ensure your contribution adheres to best practices and includes all the necessary elements for a successful review.
Also check CONTRIBUTING.md for more information on how to contribute to the Sigma rules repository, specifically proper testing and validation of your rules.
Thanks again, and welcome to the Sigma community! 😃
If you want to engage more with the community for official support, general discussions or announcements:
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 for a command line database client reading a browser credential, cookie or autofill database.Why
Windows already has coverage for this.
SQLite Chromium Profile Data DB Access(24c77512) andSQLite Firefox Profile Data DB Access(4833155a) both watch for thesqlitebinary against browser profile databases, and five more Windows rules referenceLogin Dataorkey4.dbthrough file access or PowerShell. On macOS there is nothing. Grepping the current master forLogin Data,logins.json,key4.dbandcookies.sqlitereturns seven rules, all of them Windows, and no macOS rule anywhere in the repo matchessqlite3at all.That gap matters more on macOS than on Windows, because
/usr/bin/sqlite3is present on every install and signed by Apple:An attacker reading the credential database with it never drops an unsigned binary, so controls keyed on code signing trust or on an unknown process touching the profile directory do not fire.
The LOOBins entry for
sqlite3documents the same binary being used against browser cookie databases, tagged for credential access and cookie theft. I linked the two Windows rules withrelated: similar.The immutable=1 detail
The LOOBins one-liner for Firefox starts with
killall firefox, and the existing Atomic Red Team macOS test for T1555.003 copies the database to/tmpfirst. Both are working around the same thing: Chrome holds a lock on the database while it runs.Measured on macOS 26.5.2, with Chrome running:
Opening it through a
file:URI withimmutable=1reads it without taking a lock, so the browser stays up and nothing gets copied. The rule matches both forms, since the database name is on the command line either way.Testing
Real process telemetry, captured on macOS 26.5.2 (arm64) while the query ran. Home directory redacted:
Checking the rule logic against that capture and against five other cases:
Login Dataquery abovesqlite3onCookies, plain path, noimmutablesqlite3on a Firefoxkey4.dbsqlite3oncom.apple.LaunchServices.QuarantineEventsV2(captured)sqlite3oncom.apple.TCC/TCC.dbgrep -r 'Login Data' .The two quarantine and TCC cases are the other documented LOOBins uses of
sqlite3, so they are the ones most likely to be confused with this rule. Neither matches.Repository checks, all clean:
One design choice worth a second opinion
The Windows Chromium rule requires a profile path (
\User Data\) as well as a database name. I did not require a path here, so thatcdinto the profile directory followed bysqlite3 Cookies ...still matches. The cost is a wider surface, which is why this ismediumwith two concrete false positives rather thanhighwithUnknown. Happy to add a path selection and raise the level if you would rather keep it consistent with the Windows rules.