๐ก Frida๋?
DBI(Dynamic Binary Instrumentation)๋๊ตฌ
์ฆ, ๋ฐ์ด๋๋ฆฌ๋ฅผ ๋์ ์ผ๋ก ์คํํ๋ฉด์ ๋ถ์ํ ์ ์๊ฒ ํด์ฃผ๋ ์ง๋จ ๋๊ตฌ์ด๋ค.
STEP 1) ํ์ด์ฌ ๋ค์ด๋ก๋ (Python3 ๋ฒ์ )
https://www.python.org/downloads/
Download Python
The official home of the Python Programming Language
www.python.org
- Python 2.7.6 ๋ฒ์ ์ด์๋ถํฐ ์ค์น์ pip๊ฐ ์๋์ผ๋ก ์ค์น๋๋ฏ๋ก, pip๋ ๋ณ๋๋ก ์ค์นํ์ง ์์๋ ๋๋ค.
STEP 2) Frida ์ค์น
C:\> pip install frida
pip๋ฅผ ์ด์ฉํด frida๋ฅผ ์ค์นํด์ค๋ค.
์์ ๊ฐ์ด ๋ณ๋๋ก ๋ฒ์ ์ ์ง์ ํ์ฌ ์ค์นํ๋ ๊ฒ๋ ๊ฐ๋ฅํ๋ค.
์ด๋ฏธ ์ค์น๊ฐ ๋์๋ค๋ฉด ์์ ๊ฐ์ ๋ฉ์์ง๊ฐ ์ถ๋ ฅ๋๋ค.
STEP 3) Frida Tools ์ค์น
์ต์ frida ๋ฒ์ ์์๋ frida์ frida-tools์ด ๋ถ๋ฆฌ๋์ด ์๋ค.
๋ฐ๋ผ์, frida-tools๋ฅผ ์ถ๊ฐ๋ก ์ค์นํด์ผ frida ๋ฐ frida-ps ๋ฑ์ ๊ธฐ๋ฅ์ ์ด์ฉํ ์ ์๋ค.
C:\> pip install frida-tools
STEP 4-1) Frida-server ๋ค์ด๋ก๋(1)
https://github.com/frida/frida/releases
Releases · frida/frida
Clone this repo to build Frida. Contribute to frida/frida development by creating an account on GitHub.
github.com
์์ ๋งํฌ์์ ๊ธฐ๊ธฐ ํ์ ์ ๋ง๋ frida-server ๋ฅผ ๋ค์ด๋ก๋ํ๋ค.
- ํ์ผ๋ช : frida-server-[๊ธฐ๊ธฐ CPU ํ์ ]
๐TIP) ๋ชจ๋ฐ์ผ ๊ธฐ๊ธฐ CPU ํ์ ํ์ธ ๋ฐฉ๋ฒ
- Bit : adb shell getprop ro.product.cpu.abi
- Type : adb shell getprop ro.product.cpu.abi2
STEP 4-2) Frida-server ๋ค์ด๋ก๋(2)
ํธ์๋ฅผ ์ํด ๋ค์ด๋ก๋ ๋ฐ์ ์์ถ ํ์ผ(*.xz)๋ช ์ ๋ณ๊ฒฝํ ๋ค, ์์ถ ํด์ ํ๋ค.
frida-server-15.1.8-android-arm64.xz (๋ณ๊ฒฝ ์ ) โข frida-server.xz (๋ณ๊ฒฝ ํ) โข frida-server (์์ถ ํด์ ํ) |
STEP 5) ๋ชจ๋ฐ์ผ ๊ธฐ๊ธฐ๋ก ํ์ผ ์ด๋
adb ๋ช ๋ น์ด๋ฅผ ์ด์ฉํด ๋ชจ๋ฐ์ผ ๊ธฐ๊ธฐ์ ํด๋น ํ์ผ์ ์ฎ๊ธด๋ค.
C:\> adb push frida-server /data/local/tmp
STEP 6) ๊ถํ ๋ถ์ฌ ๋ฐ ์์ ์ ๋ณ๊ฒฝ
๊ทธ ๋ค, adb ์ ์ ํ /data/local/tmp ๋๋ ํ ๋ฆฌ๋ก ์ด๋ํ์ฌ frida-server ์ ์คํ๊ถํ์ ๋ถ์ฌํ๋ค.
@root:/ # cd /data/local/tmp
@root:/ # chmod 777 frida-server
@root:/ # chown root.root frida-server
STEP 7) Frida-server ์คํ
๋ฐฑ๊ทธ๋ผ์ด๋๋ก frida-server๋ฅผ ์คํํด์ค๋ค.
C:\> ./ frida-server &
STEP 8) device์ ํ๋ก์ธ์ค ๋ชฉ๋ก ํ์ธ
์ ์ฐฝ์ ์ด๊ณ "frida-ps -U" ๋ช ๋ น์ด๋ฅผ ํตํด usb๋ก ์ฐ๊ฒฐ๋ device์ ํ๋ก์ธ์ค ๋ชฉ๋ก์ ํ์ธํ๋ค.
๐ค Frida ๊ด๋ จ ์ถํ ๊ณํ
- SSL ํผ๋ ์ฐํ ์ ๋ฆฌ
- FridaLab ๋ฌธ์ ํ์ด ๋ฐ ์ ๋ฆฌ
'Security > Mobile' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Android / iOS] Frida Hooking Code Sample (0) | 2021.10.29 |
---|---|
[Android] FridaLab(1) (0) | 2021.10.28 |
[Android] apktool ๋ฆฌํจํค์ง ์ค๋ฅ ํด๊ฒฐ (0) | 2021.09.13 |
[Android] ๊ฐค๋ญ์ ๋ฃจํ ๊ธฐ๋ณธ (Odin/TWRP/Magisk) (0) | 2021.09.10 |
[iOS] ์์ดํฐ ํ์ฅ(Unc0ver) (0) | 2021.09.09 |