ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๊ฐœ์š”

iOS ์•ฑ์„ ์ง„๋‹จ์„ ํ•˜๊ธฐ ์œ„ํ•ด์„  ๋ณ„๋„์˜ iPA ํŒŒ์ผ์„ ์ „๋‹ฌ๋ฐ›์•„ ๋ถ„์„์„ ํ•˜๊ฑฐ๋‚˜ ๊ทธ๋ ‡์ง€ ๋ชปํ•  ๊ฒฝ์šฐ ์„œ๋น„์Šค์— ๋“ฑ๋ก๋˜์–ด ์žˆ๋Š” ์•ฑ ์Šคํ† ์–ด์—์„œ ์ง์ ‘ ๋‹ค์šด๋กœ๋“œํ•˜์—ฌ ์ง„ํ–‰ํ•ด์•ผ ๋˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ง์ ‘ ์ „๋‹ฌ๋ฐ›์œผ๋ฉด ๋ฌธ์ œ๊ฐ€ ์—†์ง€๋งŒ ์•ฑ ์Šคํ† ์—์„œ ๋‚ด๋ ค๋ฐ›์„ ๊ฒฝ์šฐ์—๋Š” ์•ฑ ๋‚ด๋ถ€์˜ ์ฝ”๋“œ ๋ฐ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณดํ˜ธํ•˜๊ธฐ ์œ„ํ•œ "FairPlay Code" ์•”ํ˜ธํ™”๊ฐ€ ์ ์šฉ๋˜์–ด ์žˆ๋Š”๋ฐ ์•”ํ˜ธํ™”๋œ ๋ฐ”์ด๋„ˆ๋ฆฌ ํŒŒ์ผ์€ ์ปค๋„์˜ "Match-O"๋กœ๋”์— ์˜ํ•ด ๋Ÿฐํƒ€์ž„ ์ค‘์— ํ•ด๋…์ด ๋ฉ๋‹ˆ๋‹ค. ๊ฒฐ๋ก ์ ์œผ๋กœ ์•ฑ ์Šคํ† ์—์„œ ๋ฐ›์€ ์•ฑ์˜ ๋ฆฌ๋ฒ„์‹ฑ ๊ณผ์ •์„ ๊ฑฐ์น˜๊ธฐ ์œ„ํ•ด์„  ์‚ฌ์ „์— ๋ณตํ˜ธํ™” ์ž‘์—…์„ ์ง„ํ–‰ํ•ด์•ผ ๋œ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

 

otool -l Binaryname | grep -A4 LC_ENCRYPTION_INFO

otool์„ ํ†ตํ•ด ์•ฑ์˜ FairPlay DRM ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ด๋ณด๋ฉด "cyptid: 0" ํ•ญ๋ชฉ์ด ๋ณด์ž…๋‹ˆ๋‹ค. ์ด๋Š” ์•”ํ˜ธํ™”๊ฐ€ ๋˜์–ด ์žˆ์ง€ ์•Š๋‹ค๋Š”๊ฒƒ์„ ์˜๋ฏธํ•˜๊ธฐ์— ํ•ด๋‹น ํŒŒ์ผ์„ ๋กœ์ปฌ๋กœ ์ถ”์ถœํ•˜์—ฌ ๋ฐ”๋กœ ๋ถ„์„์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

 

Windows ํ™˜๊ฒฝ

์•ฑ์„ ๋ณตํ˜ธํ™” ํ•˜๊ธฐ ์œ„ํ•ด์„  ๋Œ€ํ‘œ์ ์œผ๋กœ "Class-dump, CrackerXI, frida-ios-dump"๊ฐ€ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ์ €๋Š” ๋ณดํ†ต CrackerXI๋ฅผ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ frida-ios-dump๋ฅผ ํ†ตํ•ด ๋ณตํ˜ธํ™”๋ฅผ ์ง„ํ–‰ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

https://github.com/AloneMonkey/frida-ios-dump

 

GitHub - AloneMonkey/frida-ios-dump: pull decrypted ipa from jailbreak device

pull decrypted ipa from jailbreak device. Contribute to AloneMonkey/frida-ios-dump development by creating an account on GitHub.

github.com

 

๋‹ค์šด๋กœ๋“œ ํ›„ ๋‚ด๋ถ€ ๊ฒฝ๋กœ๋กœ ์ด๋™ํ•˜์—ฌ ์‹ค์งˆ์ ์œผ๋กœ ์‚ฌ์šฉ๋˜๋Š” dump.py ์™€ ํ•„์ˆ˜ ์„ค์น˜ ๋ช…๋ น์–ด๋“ค์ด ๋‹ด๊ธด requirements.txt ํŒŒ์ผ์ด ํ™•์ธ๋ฉ๋‹ˆ๋‹ค.

 

pip install -r requirements.txt –upgrade

์œ„์˜ ๋ช…๋ ค์–ด๋ฅผ ํ†ตํ•ด ํ•„์ˆ˜ ๋ช…๋ น์–ด๋“ค์„ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

 

์„ค์น˜ ํ›„ USB๋ฅผ ์—ฐ๊ฒฐํ•˜์—ฌ ๋””๋ฐ”์ด์Šค ๋‚ด๋ถ€์˜ ์•ฑ ๋ฆฌ์ŠคํŠธ๋“ค์„ ์ถœ๋ ฅํ•ด์ฃผ๋Š”์ง€ ํ™•์ธํ•ด์ฃผ์‹œ๊ณ  Google Maps๋ฅผ ๋Œ€์ƒ์œผ๋กœ ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

https://code.google.com/archive/p/iphonetunnel-usbmuxconnectbyport/downloads

 

Google Code Archive - Long-term storage for Google Code Project Hosting.

 

code.google.com

์ด์ œ ์œ„์˜ ๊ฒฝ๋กœ๋กœ ๋„˜์–ด๊ฐ€ ๋กœ์ปฌ PC์— ํ„ฐ๋„๋ง์„ ์ง„ํ–‰ํ•ด์ค„ iTUNNEL์„ ์„ค์น˜ํ•ด์ฃผ์…”์•ผ ๋ฉ๋‹ˆ๋‹ค. itunnel_mux_rev71 ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œํ•ด์ฃผ์‹œ๋ฉด ์œ„์ฒ˜๋Ÿผ. exeํŒŒ์ผ์ด ํ™•์ธ๋˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

itunnel_mux.exe --iport 22 --lport 2222

.exe ๊ฒฝ๋กœ๋กœ ์ด๋™ํ•˜์—ฌ ์‚ฌ์ „์— ์‚ฌ์šฉ ์ค‘์ธ SSH 22๋ฒˆ ํฌํŠธ์™€ ์ถ”๊ฐ€์ ์œผ๋กœ ๋กœ์ปฌ ํฌํŠธ 2222๋ฅผ ์ง€์ •ํ•ด ์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

๋งŒ์•ฝ ์—๋Ÿฌ๊ฐ€๋ฐœ์ƒํ•  ๊ฒฝ์šฐ ์•„๋ž˜์˜ ํŒŒ์ผ์„ ์ถ”๊ฐ€์ ์œผ๋กœ ์„ค์น˜ํ•ด์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค. ๋ณดํ†ต iTunes๋“œ๋ผ์ด๋ฒ„ ๊ด€๋ จ ๋ฌธ์ œ๋‚˜ ๋ณตํ˜ธํ™” ์ง„ํ–‰ ์‹œ ์œˆ๋„์šฐ ํ™˜๊ฒฝ์˜ ๋ฌธ์ œ(chmod, ls ๋ช…๋ น์–ด ๋“ฑ)๋กœ ์ธํ•ด ๋ฐœ์ƒ๋ฉ๋‹ˆ๋‹ค.

1. "iTunesDriver64_0205.exe" ๊ฒ€์ƒ‰ ํ›„ ์„ค์น˜

2. gow์„ค์น˜(https://github.com/bmatzelle/gow/releases/download/v0.8.0/Gow-0.8.0.exe)

 

C:\Users\{์ง€์ •ํ•œ ์‚ฌ์šฉ์ž ์ด๋ฆ„}\AppData\Local\Temp

๋งŒ์•ฝ ๋“œ๋ผ์ด๋ฒ„์™€ gow๋ฅผ ๋ชจ๋‘ ์„ค์น˜ํ–ˆ๋Š”๋ฐ๋„ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋ฉด ํ„ฐ๋ฏธ๋„ ์ฐฝ์„ ๋‹ซ์€ ํ›„ ๋‹ค์‹œ ์‹œ๋„ํ•ด ๋ณด์‹œ๊ณ  ํ•ด๋‹น ๊ฒฝ๋กœ๋ฅผ ํƒ€๊ณ  ๋„˜์–ด๊ฐ€ "Payload"๋ผ๋Š” ์ž”์—ฌ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•ด์ฃผ์‹œ๊ณ  ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

 

python dump.py com.google.Maps

์ด์ œ dump.py ํŒŒ์ผ์„ ํ™œ์šฉํ•˜์—ฌ DRM ๋ณตํ˜ธํ™” ์ž‘์—…์„ ์‹œ์ž‘ํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๋กœ๋”ฉ ๋ฐ”๊ฐ€ 100%๊ฐ€ ๋ ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ ค์ฃผ์„ธ์š”

 

๋ณตํ˜ธํ™” ์ž‘์—…์ด ๋ชจ๋‘ ์™„๋ฃŒ๋˜๋ฉด ์œ„์ฒ˜๋Ÿผ ์ œ์ผ ํ•˜๋‹จ ์ฝ˜์†”์— "Generating "Google Maps.ipa" ๋ผ๋Š” ๋ฌธ๊ตฌ๊ฐ€ ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค.

 

FairPlay DRM ๋ณตํ˜ธํ™”๊ฐ€ ์ž‘์—…๋œ ipaํŒŒ์ผ์€ ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ์ธ frida-ios-dump-master ํด๋” ์•ˆ์—. ipa ํ™•์žฅ์ž๋กœ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค. ์ด์ œ ํ•ด๋‹น ํŒŒ์ผ์˜ ์••์ถ•์„ ํ•ด์ œํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

 

์••์ถ• ํ•ด์ œ ํด๋”๋กœ ๋“ค์–ด๊ฐ€๋ณด๋ฉด ๊ธฐ์กด์— ์•”ํ˜ธํ™”๋œ ๋ฐ”์ด๋„ˆ๋ฆฌ๊ฐ€ ๋ชจ๋‘ ๋ณตํ˜ธํ™”๋˜์–ด ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค. ์ถ”๊ฐ€์ ์œผ๋กœ ๋กœ์ง์„ ๋ถ„์„ ํ›„ ์ž‘๋™ ๋ฐฉ์‹, ๋‚ด๋ถ€ ํด๋ž˜์Šค ๊ตฌ์กฐ๋ฅผ ํ™•์ธํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

Linux ํ™˜๊ฒฝ

์œˆ๋„์šฐ ํ™˜๊ฒฝ์—์„œ ์ง„ํ–‰ํ•œ ๊ฒƒ์ฒ˜๋Ÿผ frida-ios-dump ํŽ˜์ด์ง€์—์„œ ๋ฆฌ๋ˆ…์Šค ํ™˜๊ฒฝ์œผ๋กœ Clone ํ•˜์—ฌ ๋‹ค์šด๋กœ๋“œํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

ํ™•์žฅ์ž๊ฐ€ “zip”์ธ ํŒŒ์ผ์ด ๋‹ค์šด๋กœ๋“œ๋œ๊ฒƒ์„ ํ™•์ธํ•˜๊ณ  "unzip" ํ•ด์ฃผ์‹œ๋ฉด dump.py ๋‚˜ requirements.txt๊ฐ€ ์žˆ๋˜ ํด๋”๊ฐ€ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

 

frida-ios-dump ํŒŒ์ผ ๋‚ด๋ถ€์— ์กด์žฌํ•˜๋Š” dump.py ํŒŒ์ผ์€ ํŒŒ์ด์ฌ 3.x ๋ฒ„์ „์—์„œ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค. Kali Linux์—๋Š” python2.x ๊ณผ 3.x ๋ฒ„์ „์ด ๊ณต์กดํ•˜๋ฏ€๋กœ ๋ช…๋ น์–ด ์‹คํ–‰ ์‹œ python3๋กœ ๋ช…์‹œํ•˜์—ฌ ์‹คํ–‰ํ•˜๊ฑฐ๋‚˜ Linux์šฉ anaconda ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•˜์—ฌ ์‚ฌ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

# sudo apt update && sudo apt install python3-pip
# sudo pip3 ์ž…๋ ฅํ•˜์—ฌ ์„ค์น˜ํ™•์ธ
# pip3 install -r requirements.txt => ๋ฆฌ๋ˆ…์Šค์— anaconda ์—†์ด ๊ทธ๋ƒฅ ์„ค์น˜ํ•˜๊ณ ์ž ํ•  ๊ฒฝ์šฐ pip3 ๋ช…์‹œ

๋งŒ์•ฝ ๋ฆฌ๋ˆ…์Šค ํ™˜๊ฒฝ์—์„œ "pip" ๋ช…๋ น์–ด๊ฐ€ ์—†๋‹ค๊ณ  ๋‚˜์˜ฌ๊ฒฝ์šฐ ์œ„์˜ ๋ช…๋ น์–ด๋ฅผ ์šฐ์„ ์ ์œผ๋กœ ์„ ์–ธํ•˜์—ฌ pip์‚ฌ์šฉ์„ ํ™•๋ณด ํ›„ requirements.txt๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

 

# apt install libusmuxd-tools

์œˆ๋„์šฐ ํ™˜๊ฒฝ์—์„œ itunnel์„ ์‚ฌ์šฉํ–ˆ๋‹ค๋ฉด ๋ฆฌ๋ˆ…์Šค์—์„œ๋Š” “iproxy”๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ํ˜„์žฌ ํŒจํ‚ค์ง€๊ฐ€ ๋‹ซํ˜”๊ธฐ ๋•Œ๋ฌธ์— apt install iproxy ํ•  ๊ฒฝ์šฐ ์กด์žฌํ•˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ๋‚˜ํƒ€๋‚œ๋‹ค.

 

์„ค์น˜๋ฅผ ๋งˆ์ณค๋‹ค๋ฉด itunnel์—์„œ ํ–ˆ๋˜ ๊ฒƒ๊ณผ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ iPHONE์— ์—ด๋ฆฌ 22๋ฒˆ ํฌํŠธ๋ฅผ ๋กœ์ปฌ 2222 ํฌํŠธ๋กœ ํ„ฐ๋„๋ง์„ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

iPHONE ๋‹จ๋ง์„ ์—ฐ๊ฒฐํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ํŒ์—…์ฐฝ์ด ๋‚˜ํƒ€๋‚œ๋‹ค. ํ•˜๋‹จ์˜ “Connect to a virtual machine”์œผ๋กœ ์„ ํƒ ํ›„ ์ž์‹ ์˜ ๊ฐ€์ƒ ์ด๋ฏธ์ง€์— ์—ฐ๊ฒฐ์‹œํ‚ค๋ฉด ๋””๋ ‰ํ† ๋ฆฌ ๋ฆฌ์ŠคํŠธ์— “iPhone”์ด ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

 

Kali Linux์™€ iPhone์ด ์ •์ƒ์ ์œผ๋กœ attaching ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด ์•ฑ์— ์„ค์น˜๋œ ๋ฆฌ์ŠคํŠธ๋ฅผ ํ™•์ธํ•˜๋Š” ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•ด๋ด…๋‹ˆ๋‹ค.

 

๋ฐ”์ด๋„ˆ๋ฆฌ ํŒŒ์ผ์ด ํ•œ๊ธ€๋กœ ๋˜์–ด์žˆ์„ ๊ฒฝ์šฐ ์œˆ๋„์šฐ ํ™˜๊ฒฝ์—์„œ ๋ณตํ˜ธํ™” ์‹œ ์•ก์„ธ์Šค๊ฐ€ ๊ฑฐ๋ถ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค.” ๋“ฑ ๊ธฐํƒ€ ์—๋Ÿฌ๊ฐ€ ๋‹ค์–‘ํ•˜๊ฒŒ ๋ฐœ์ƒํ•˜๋Š”๋ฐ, ์ด๋Ÿด๋•Œ๋Š” Linuxํ™˜๊ฒฝ์—์„œ Dump๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด ์—๋Ÿฌ ์—†์ด ๋ณตํ˜ธํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

iproxy์—์„œ ์ถœ๋ ฅ ๋ฌธ๊ตฌ๊ฐ€ ์ƒ์„ฑ๋˜๋ฉด์„œ ๋Œ€์ƒ ์•ฑ์—attach ๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๋ณตํ˜ธํ™”๋œ ipaํŒŒ์ผ์ด ์ƒ์„ฑ๋œ ๊ฒƒ์„ ํ™•์ธํ–ˆ์œผ๋ฉด ์ด์ œ ๋กœ์ปฌ PC๋กœ ์˜ฎ๊ฒจ ๋ถ„์„์„ ์ง„ํ–‰ํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ •์ƒ์ ์œผ๋กœ ๋ณตํ˜ธํ™”๊ฐ€ ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด์„  ๋‚ด๋ถ€์— ์กด์žฌํ•˜๋Š” ๋‹ค์–‘ํ•œ ํด๋ž˜์Šค๋ช…์ด ์–ด๋–ป๊ฒŒ ๋‚˜ํƒ€๋‚˜๋Š”์ง€ ํ™•์ธํ•ด๋ณด์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๋งŒ์•ฝ ํด๋ž˜์Šค๋ช…์ด ๋Œ€๋Ÿ‰์˜ ๋ฌธ์ž์—ด๋กœ ์‹๋ณ„์ด ํž˜๋“ค๊ฒŒ๋” ๋˜์–ด ์žˆ๋‹ค๋ฉด ๋ณตํ˜ธํ™”๊ฐ€ ์ œ๋Œ€๋กœ ์ด๋ฃจ์–ด์ง€์ง€ ์•Š์€ ๊ฒƒ์ด๋ผ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ณต์œ ํ•˜๊ธฐ ๋งํฌ
Comment