안드로이드 루팅
IT 위키
(루팅에서 넘어옴)
리눅스 기반 OS인 안드로이드 운영체제에서 루트(root) 권한을 획득하는 행위
부트로더를 이용하여 su가 설치된 커스텀 시스템 이미지로 바꾸어 부팅
루트 권한을 가진 Recovery 모드를 이용하여 su 설치
리눅스 취약점을 이용하여 루트 권한을 취득
- su파일 존재여부 확인
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명령어 실행 확인
Runtime.getRuntime().exec("su");
- SuperSU 어플리케이션 확인
- 루트 권한을 요구하는 어플리케이션 확인
- 이미 알려진 유명 어플리케이션들을 리스팅 해 두고 설치 되어 있는지 확인
- Build.Tag 확인
- 시스템 이미지가 커스트마이징된 이미지인지 확인
if (Build.TAGS.equals("test-keys")) {
this.ec = true;
}
- SpapaSU
- SuperSU를 리패키징하여 SuperSU와 SU의 특징을 숨김
- Xposed RootCloak
- Xposed의 기능 사용
- 루팅 탐지에 대한 후킹을 수행하여 루팅을 숨김
