项目作者: 0xbf00

项目描述 :
Mac App Analysis Platform
高级语言: Python
项目地址: git://github.com/0xbf00/maap.git
创建时间: 2020-04-09T13:52:06Z
项目社区:https://github.com/0xbf00/maap

开源协议:

下载


maap

The Mac App Analysis Platform (maap) consists of four distinct tools: appxtractor, appdater, appstaller and appnalyser. In combination with mas-crawl, the first three tools can be run in an infinite loop to automatically identify, download and process new apps and updates on macOS.

Installation

  1. # Clone the repository
  2. $ git clone https://github.com/0xbf00/maap.git
  3. $ cd maap/
  4. # Install requirements
  5. $ pip3 install -r requirements.txt
  6. # Initialize external / helper tools.
  7. # Note: This downloads prebuilt macOS binaries
  8. $ cd extern/
  9. $ make
  10. $ cd ..

Usage

appxtractor

The appxtractor tool summarises installed applications, extracting useful information from the app into an output folder. It organises and groups these results by bundle identifier and version number, such that calling appxtractor with updated apps does not overwrite any existing data.

All extractors are located in extractors/ and extend the AbstractExtractor class. Please refer to the source code for more information. Currently, there are extractors for

  • dependencies: Creates JSON file listing the dependencies of an app
  • executable: Saves the main executable for an app
  • info: Extracts the Info.plist file for an app
  • internet_access_policy: Extracts the Internet Access Policy, if it exists.
  • itunes_metadata: Uses the iTunes API to extract up-to-date metadata for the app
  • manifest: Generates a file containing the file name, file size and hash of every file in the app bundle
  • xpc_services: Saves main executable and Info.plist for embedded XPC services

To use appxtractor, refer to its --help output. Generally, you’d invoke it as follows

  1. $ ./appxtractor.py -i /path/to/app_folder -o /output_dir

Results under /output_dir have this structure:

  1. $ tree /output_dir
  2. /output_dir
  3. ├── com.apple.dt.Xcode # Bundle ID of app
  4. └── 11.3.1 # Version of app
  5. ├── Info.plist
  6. ├── dependencies.json
  7. ├── executable.bin
  8. ├── itunes_metadata.json
  9. ├── manifest.json
  10. └── xpc_services
  11. ├── com.apple.dt.IDESceneKitEditor.Bakery
  12. ├── Info.plist
  13. └── executable.bin
  14. ├── com.apple.dt.Xcode.LicenseAgreementXPCService
  15. ├── Info.plist
  16. └── executable.bin
  17. ├── com.apple.dt.Xcode.PlaygroundLiveViewHost
  18. ├── Info.plist
  19. └── executable.bin
  20. ├── com.apple.dt.Xcode.PlaygroundStub-macosx
  21. ├── Info.plist
  22. └── executable.bin
  23. ├── com.apple.dt.Xcode.SymbolicateXPCService
  24. ├── Info.plist
  25. └── executable.bin
  26. ├── com.apple.dt.Xcode.XcodeSelectXPCService
  27. ├── Info.plist
  28. └── executable.bin
  29. └── com.apple.dt.XcodeMacLocationSimulation
  30. ├── Info.plist
  31. └── executable.bin
  32. ...

appdater

By comparing all previously seen versions (those that appxtractor processed) with an up-to-date iTunes metadata dump obtained using mas-crawl, appdater identifies apps that can be updated and apps that are free and not yet part of the dataset.

Use it as follows:

  1. $ ./appdater.py \
  2. --results /path/to/appxtractor_files \
  3. --itunes-dump /path/to/recent_itunes_dump.jsonlines \
  4. --output /path/to/basename

Its output files can be fed to appstaller, which then installs these apps and updates automatically.

appstaller

Uses a modified version of the mas tool to install a list of apps. Usage:

  1. $ ./appstaller.py --new-apps /path/to/new_apps_file --updates /path/to/updates_file

appnalyser

The appnalyser tool starts the target app and verifies that static (entitlements) and dynamic (runtime) sandboxing information agree. In addition, it checks whether the app can access camera or microphone and, if so, whether it has the required entitlements. Consider using asctl instead nowadays.