안드로이드 루팅

IT위키
211.42.204.119 (토론)님의 2018년 7월 17일 (화) 14:39 판

리눅스 기반 OS인 안드로이드 운영체제에서 루트(root) 권한을 획득하는 행위

Pre-boot

Fastboot

부트로더를 이용하여 su가 설치된 커스텀 시스템 이미지로 바꾸어 부팅

Custom Recovery

루트 권한을 가진 Recovery 모드를 이용하여 su 설치

Post-boot

리눅스 취약점을 이용하여 루트 권한을 취득

루팅 확인

  • su파일 존재여부 확인\
  • 예시

<syntaxhighlight lang="java" line='line'> public String[] RootFilesPath = { ROOT_PATH + "/system/bin/su", ROOT_PATH + "/system/xbin/su", ROOT_PATH + "/system/app/SuperUser.apk", ROOT_PATH + "/data/data/com.noshufou.android.su" }; private boolean checkRootingFiles(File... paramVarArgs)

 {
   int j = paramVarArgs.length;
   int i = 0;
   for (;;)
   {
     boolean bool = false;
     if (i < j)
     {
       File localFile = paramVarArgs[i];
       if ((localFile != null) && (localFile.exists()) && (localFile.isFile())) {
         bool = true;
       }
     }
     else
     {
       return bool;
     }
     i += 1;
   }
 }

protected void onCreate(Bundle paramBundle)

 {

... this.isRootingFlag = true;

         if (!this.isRootingFlag) {
           this.isRootingFlag = checkRootingFiles(createFiles(this.RootFilesPath));
         }
         Log.d("test", "isRootingFlag = " + this.isRootingFlag);

... }

  • su명령어 실행 확인
  • SuperSU 어플리케이션 확인
  • 루트 권한을 요구하는 어플리케이션 확인
    • 이미 알려진 유명 어플리케이션들을 리스팅 해 두고 설치 되어 있는지 확인
  • Build.Tag 확인
    • 시스템 이미지가 커스트마이징된 이미지인지 확인

루팅 탐지 우회

  • SpapaSU
    • SuperSU를 리패키징하여 SuperSU와 SU의 특징을 숨김
  • Xposed RootCloak
    • Xposed의 기능 사용
    • 루팅 탐지에 대한 후킹을 수행하여 루팅을 숨김