androguard를 사용한 APK 쉽게 권한 추출하기
APK에서 권한은 굉장히 많은 역할을 하며 진단에도 필수요소가 될 수 있다
그리고 이 포스팅은 APK권한을 최소한의 작업으로 쉽게 추출하는 방법을 설명하려한다.
먼저 android apk파일에서 권한(permission)은 androidmanifest.xml에 저장되어 있다.
해당부분은 manifest.xml파일에 다음과 같이 표시되는 것을 확인할 수 있다)
https://developer.android.com/guide/topics/manifest/manifest-intro?hl=ko
하지만 복호화가 필요한 경우도 존재하고(난독화 설정되어있을 시)
직접 manifest의 줄을 확인하며 추출하기에 androguard를 이용해 이보다 더 쉬운 방법을 사용해보려한다.
먼저 Androguard가 필요하며 다음 사이트에서 쉽게 설치할 수 있다
https://androguard.readthedocs.io/en/latest/
Welcome to Androguard’s documentation! — Androguard 3.4.0 documentation
© Copyright 2012-2018, Anthony Desnos, Geoffroy Gueguen, Sebastian Bachmann Revision eef97351.
androguard.readthedocs.io
https://docs.anaconda.com/anaconda/install/index.html
Installation — Anaconda documentation
Installation Review the system requirements listed below before installing Anaconda Individual Edition. If you don’t want the hundreds of packages included with Anaconda, you can install Miniconda, a mini version of Anaconda that includes just conda, its
docs.anaconda.com
from androguard.misc import AnalyzeAPK
a, d, dx = AnalyzeAPK("C:\\Users\\test\\Downloads\\test.apk") **오랜시간 필요***
***Windows 기준***(Linux 계열은 / 그대로 사용***
C:\Users\test\Downloads\test.apk -> C:\\Users\\test\\Downloads\\test.apk
a.get_permissions()