You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to open .db files in the mac library

I downloaded the sqlite browser, but it doesn't seem able to open these files. I have attached error messages that appear when I attempt to do so. https://imgur.com/a/LUsB2lH

MacBook Air 13″, macOS 11.5

Posted on Jan 23, 2022 2:36 AM

Reply
Question marked as Top-ranking reply

Posted on Jan 23, 2022 11:12 AM

Safari History?


That isn’t saved on device, past the configured maximum.


And that data isn’t kept for private browsing.


External network services including web proxy servers and DNS servers can be configured to record browsing activity, though that usually also requires the device to explicitly reference those services.


Last I rummaged macOS forensics here, the history file was History.db. Seems still, too.


On at least Big Sur, the database is not encrypted, and can be directly accessed and viewed using DB Browser for SQLite.app.


If you hit an error while accessing it, use Finder to duplicate the file and copy the duplicate to (for instance) your Desktop, and see if accessing the duplicate copy works better. This duplicate avoids bumping into a file lock, of Safari is open.


”Online” sources can range from valid and correct info to conspiracy theories and utter rubbish, unfortunately.

10 replies
Question marked as Top-ranking reply

Jan 23, 2022 11:12 AM in response to fierce_bones

Safari History?


That isn’t saved on device, past the configured maximum.


And that data isn’t kept for private browsing.


External network services including web proxy servers and DNS servers can be configured to record browsing activity, though that usually also requires the device to explicitly reference those services.


Last I rummaged macOS forensics here, the history file was History.db. Seems still, too.


On at least Big Sur, the database is not encrypted, and can be directly accessed and viewed using DB Browser for SQLite.app.


If you hit an error while accessing it, use Finder to duplicate the file and copy the duplicate to (for instance) your Desktop, and see if accessing the duplicate copy works better. This duplicate avoids bumping into a file lock, of Safari is open.


”Online” sources can range from valid and correct info to conspiracy theories and utter rubbish, unfortunately.

Jan 23, 2022 7:52 AM in response to fierce_bones

Note to other readers: the question posted here is a subset of and—in its much simpler form here—has comparatively little relationship to the question and the details posted elsewhere; to the full question that was posted elsewhere.


The question posted elsewhere distills down to “how can I directly access an encrypted Safari bookmark database from SQLite tools (command-line or GUI tools), as the database is encrypted and I don’t know the decryption key?”


Check for the database password in Keychain, as a starting point. Apple tends to store passwords there.


Keychain data protection - Apple Support


The security in this area has reportedly changed recently circa iOS 15.2 and quite possibly also with Monterey based on some web search results, and I don’t have the newest combination handy right now to check.



Jan 23, 2022 9:30 AM in response to MrHoffman

Thank you for the help. I was able to find my database password there in Keychain, however to open it on SQLite tools I need to list the encryption specs: page size, KDF iterations, HMAC and KDF algorithms, and plaintext header size, whatever that means. Online I was able to find "41000 iterations" and "SHA256" for the HMAC and KDF algorithms but nothing else. My mac air is currently running on Big Sur. You stated security changed with Monterey, but luckily I am still on Big Sur, if you are more familiar with that os.

Jan 24, 2022 9:17 AM in response to fierce_bones

If one is to believe the following Safari information when a private browsing window is opened, then there is no history kept:


Safari will keep your browsing history private for all tabs in this window. After you close this window, Safari won't remember the pages you visited, your search history, or your AutoFill information. - Safari 15.2


There are no tables in the Safari History.db that refer to private content attributes when viewing them with the .schema operator.


I open a private browsing window and visit the National Weather Service site, and then visit the SQLite website. With that private browsing window remaining open, there are zero histories shown for those browsing events in my report writer.

Jan 24, 2022 9:53 AM in response to fierce_bones

fierce_bones wrote:

I suspect with the security upgrade in Monterey 12.1, it's even more doubtful that the History.db stores private browsing information, correct?


Somebody seemingly has you on a prove-a-negative quest, with all that implies.


Apple states no; that private browsing tabs are not saved.


Can somebody with existing and privileged or pervasive network access or with the ability to access log data or deleted record space in your databases gather some details of your browsing habits? Sure.


This whole discussion is one of digital forensics. But it's your time and focus and budget to expend here, of course.

How to open .db files in the mac library

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.