코드 한 줄

[Solution] 안드로이드 사용자 인증서를 시스템 인증서로 설치하기 [2/3] 본문

Develop -/Android

[Solution] 안드로이드 사용자 인증서를 시스템 인증서로 설치하기 [2/3]

Ahntenna 2025. 3. 4. 10:57
반응형

인증서를 만들지 않으신 분들은 이전 포스팅을 참고해주시기 바랍니다.

해당 포스트에서는 생성한 인증서를 안드로이드 단말기에 설치하는 내용을 담고 있으며, 루팅된 환경에서 진행했습니다.

 

 

 

가장 먼저, 생성해둔 인증서를 단말기로 옮깁니다.

cmd)

adb push 1127f18c.0 /sdcard/

 

 

 

설치 과정은 Android 14 를 기준으로 나뉩니다.

 

 

Android 14 미만 단말기에서의 설치

 

먼저, 기존에 설치되어 있는 인증서를 백업합니다.

(백업할 위치는 적절히 수정해줍니다)

adb shell)

cp /system/etc/security/cacerts/* /data/local/tmp/mycerts/

 

 

미리 생성해두었던 인증서를 옮깁니다.

(인증서의 파일명은 다를 수 있습니다)

adb shell)

mv /sdcard/1127f18c.0 /data/local/mycerts

 

 

인증서 영역을 mount 합니다.

adb shell)

mount -t tmpfs tmpfs /system/etc/security/cacerts

 

 

백업한 인증서와 새로 설치할 인증서가 담긴 경로를 덮어씌웁니다.

adb shell)

cp -f /data/local/tmp/mycerts/* /system/etc/security/cacerts/

 

 

권한을 설정해줍니다.

adb shell)

chown root:root /system/etc/security/cacerts/*
chmod 644 /system/etc/security/cacerts/*
chcon u:object_r:system_file:s0 /system/etc/security/cacerts/*

 

 

 

Android 14 이상 단말기에서의 설치

 

 

Android 14 이상 단말기부터는 아래 Maigsk Module 을 이용해서 설치하면 간단합니다.

 

https://github.com/WindSpiritSR/CustomCACert

 

GitHub - WindSpiritSR/CustomCACert

Contribute to WindSpiritSR/CustomCACert development by creating an account on GitHub.

github.com

 

간단히 과정을 설명해드리자면, 생성한 인증서를 모듈의 system/etc/security/cacerts 경로에 넣고 Magisk 앱을 통해 모듈을 설치하면 됩니다.

 

 

다음 포스팅은 Burp Suite 에서 위 인증서를 사용하는 방법을 담겠습니다 :)

반응형
Comments