com.apple.security.app-sandbox権限を持つアプリケーションは、サンドボックス内で実行されます。Apple バイナリは通常、サンドボックス内で実行され、App Store に公開するためには、この権限が必須です。したがって、ほとんどのアプリケーションはサンドボックス内で実行されます。
# 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/>[...]
Sandboxプロファイルは、そのSandboxで何が許可/禁止されるかを示す構成ファイルです。これは**Sandbox Profile Language (SBPL)**を使用し、Schemeプログラミング言語を使用しています。
ここに例を示します:
(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