วิธีการติดตั้งและใช้งาน Drozer เครื่องมือสำหรับการทำ Mobile App Security Analysis
Drozer เป็นเครื่องมือสำหรับการตรวจสอบความปลอดภัยของ Mobile Application โดยจะเป็นการตรวจสอบแบบ Dynamic Analysis ครับ โดยวิธีการติดตั้งมีดังนี้
1. Download deb และ whl จาก https://github.com/mwrlabs/drozer/releases
2. ติดตั้ง Required Package
1 |
apt-get install python-protobuf |
3. ติตตั้ง Drozer App
1 2 |
dpkg -i drozer_2.4.4.deb pip install drozer-2.4.4-py2-none-any.whl |
4. สร้าง agent app
1 |
drozer agent build |
5. ติดตั้ง Agent
1 |
adb install <path of apk> |
6. [ที่เครื่อง android] ให้ทำการเปิด Drozer Agent ขึ้นมาแล้วกด Embed Server เป็น On
7. ทำ port forward ภายในเครื่องไปยัง drozer
1 |
adb forward tcp:31415 tcp:31415 |
8. ทำการ connect เข้าไปที่ drozer ในเครื่อง
1 |
drozer console connect |
ใช้คำสั่ง list เพื่อทำการ list drozer module ทั้งหมดที่ได้ติดตั้งไว้
Commands | Description |
list | Shows a list of all drozer modules that can be executed in the current session. This hides modules that you don’t have appropriate permissions to run. |
shell | Start an interactive Linux shell on the device, in the context of the Agent. |
clean | Remove temporary files stored by drozer on the Android device. |
load | Load a file containing drozer commands and execute them in sequence. |
module | Find and install additional drozer modules from the Internet. |
unset | Remove a named variable that drozer passes to any Linux shells that it spawns. |
set | Stores a value in a variable that will be passed as an environmental variable to any Linux shells spawned by drozer. |
shell | Start an interactive Linux shell on the device, in the context of the Agent |
run MODULE | Execute a drozer module |
ใช้คำสั่ง run app.package.list เพื่อทำการ list package ทั้งหมด
ใช้คำสั่ง run app.package.attacksurface <package> เพื่อหาว่ามีรายละเอียดอะไรบ้าง
ใช้คำสั่ง run app.package.info <package> เพื่อดูรายละเอียดของ package
ใช้คำสั่ง run scanner.provider.finduris -a <package> เพื่อดูว่ามี content provider ไหนบ้างที่เราจะดึงข้อมูลออกมาได้ หากเจอให้ใช้คำสั่งเป็น
1 |
run app.provider.query content://<Path of content provider> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
Starting a session adb forward tcp:31415 tcp:31415 drozer console connect Retrieving package information run app.package.list -f <app name> run app.package.info -a <package name> Identifying the attack surface run app.package.attacksurface <package name> Exploiting Activities run app.activity.info -a <package name> -u run app.activity.start --component <package name> <component name> Exploiting Content Provider run app.provider.info -a <package name> run scanner.provider.finduris -a <package name> run app.provider.query <uri> run app.provider.update <uri> --selection <conditions> <selection arg> <column> <data> run scanner.provider.sqltables -a <package name> run scanner.provider.injection -a <package name> run scanner.provider.traversal -a <package name> Exploiting Broadcast Receivers run app.broadcast.info -a <package name> run app.broadcast.send --component <package name> <component name> --extra <type> <key> <value> run app.broadcast.sniff --action <action> Exploiting Service run app.service.info -a <package name> run app.service.start --action <action> --component <package name> <component name> run app.service.send <package name> <component name> --msg <what> <arg1> <arg2> --extra <type> <key> <value> --bundle-as-obj |
Source::
- https://resources.infosecinstitute.com/android-hacking-security-part-13-introduction-drozer/#gref
- https://pentestlab.blog/category/mobile-pentesting/
- https://gbhackers.com/mobile-application-penetration-testing/