# Get permissionsplutil-convertxml1.com.apple.containermanagerd.metadata.plist-o-# Binary sandbox profile<key>SandboxProfileData</key><data>AAAhAboBAAAAAAgAAABZAO4B5AHjBMkEQAUPBSsGPwsgASABHgEgASABHwEf...# In this file you can find the entitlements:<key>Entitlements</key><dict><key>com.apple.MobileAsset.PhishingImageClassifier2</key><true/><key>com.apple.accounts.appleaccount.fullaccess</key><true/><key>com.apple.appattest.spi</key><true/><key>keychain-access-groups</key><array><string>6N38VWS5BX.ru.keepcoder.Telegram</string><string>6N38VWS5BX.ru.keepcoder.TelegramShare</string></array>[...]# Some parameters<key>Parameters</key><dict><key>_HOME</key><string>/Users/username</string><key>_UID</key><string>501</string><key>_USER</key><string>username</string>[...]# The paths it can access<key>RedirectablePaths</key><array><string>/Users/username/Downloads</string><string>/Users/username/Documents</string><string>/Users/username/Library/Calendars</string><string>/Users/username/Desktop</string><key>RedirectedPaths</key><array/>[...]
(version 1) ; First you get the version(deny default) ; Then you shuold indicate the default action when no rule applies(allow network*) ; You can use wildcards and allow everything(allow file-read* ; You can specify where to apply the rule(subpath "/Users/username/")(literal "/tmp/afile")(regex #"^/private/etc/.*"))(allow mach-lookup(global-name "com.apple.analyticsd"))
(version 1)(deny default)(allow file* (literal "/private/tmp/hacktricks.txt"))(allow process* (literal "/usr/bin/touch"))(allow file-read-data (literal "/")); This one will work
sbtool<pid>mach#Check mac-ports (got from launchd with an api)sbtool<pid>file/tmp#Check file accesssbtool<pid>inspect#Gives you an explaination of the sandbox profilesbtool<pid>all
App Store 应用中的自定义 SBPL
公司可能会使他们的应用程序 使用自定义沙盒配置文件(而不是默认配置文件)。他们需要使用权限 com.apple.security.temporary-exception.sbpl,该权限需要得到 Apple 的授权。