Giter VIP home page Giter VIP logo

spotlight_parser's Introduction

spotlight_parser

This code reads and extracts data from spotlight databases present on macOS and iOS.

License

GPL v3

Latest version

1.0.2 - Download here

It is recommended to use the mac_apt_artifact_only script/exe (from mac_apt) instead of this project as that uses this same code, but also offers a few extra features like SQLITE output, and creating separate views for ios apps.

Dependencies

If running from code, you will need python 3.7 and the following python packages installed:

  • lz4
  • pyliblzfse

These can be installed using the command pip3 install lz4 pyliblzfse

Usage

This script will process individual Spotlight database files which are always named store.db and .store.db. You will need to provide a path to this file and an output path, with syntax as shown below.

spotlight_parser.py [-p OUTPUT_PREFIX] <path_to_database> <output_folder>

Example:
python spotlight_parser.py c:\spot\store.db c:\output

Spotlight database locations and types

On macOS, under each volume at location /.Spotlight-V100/Store-V2/<UUID> where <UUID> represents a store id, you should find files named store and .store which are the Spotlight databases. Provide these as input to this script.

Since macOS 10.13, there are also spotlight databases for each user under ~/Library/Metadata/CoreSpotlight/index.spotlightV3/

iOS spotlight databases are also supported now. These can be found here:

  • /private/var/mobile/Library/Spotlight/CoreSpotlight/NSFileProtectionComplete/index.spotlightV2
  • /private/var/mobile/Library/Spotlight/CoreSpotlight/NSFileProtectionCompleteUnlessOpen/index.spotlightV2
  • /private/var/mobile/Library/Spotlight/CoreSpotlight/NSFileProtectionCompleteUntilFirstUserAuthentication/index.spotlightV2

For iOS databases, you will also need to have the files that begin with dbStr (which are available in the same folder as store.db). These files are specific to that instance of store.db. Ideally, just extract the whole folder (instead of a single file).

Spotlight resources by me

Thanks

Mason Bartle for porting the code to python3.

spotlight_parser's People

Contributors

mbartle avatar ydkhatri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotlight_parser's Issues

Metadata Block Check Should Use Equality

if compressed_block.block_type & BlockType.METADATA != BlockType.METADATA:

This does not seem like the right check. If the last byte of BlockType.METADATA is 00001001, and we're checking block_type & BlockType.METADATA, then we'll accept any block that happens to have its 0th and 3rd bits set. Should this be blocktype << 24 != BlockType.METADATA << 24?

Equality Check vs. Bit Mask When value_type == 0x07?

if prop_type == 0x42: #66 com_apple_mail_gmailLabels, com_microsoft_outlook_categories

Looking at Apple's documentation, there are three boolean values corresponding to each spotlight property, in addition to the property's type and name, multivalued, uniqued, and nosearch. It seems that, since prop_type & 0x02 == 0x02 when we want an array for most value_types, multivalued is represented by the second LSB. It seems odd to make an equality check on 0x02 in this case, then. Why not a bit mask on 0x02 (or on 0x42) instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.