บทนำ (Overview)
โปรแกรม “Drozer” เป็นโปรแกรมที่ติดตั้งบนเครื่อง Android (.apk) เป็นโปรแกรมที่ใช้เป็นเครื่องมือสำหรับการหาช่องโหว่สำหรับ “Application” ที่ติดตั้งบนเครื่อง “Android” ทำให้ใช้ทดสอบง่ายขึ้น โดยโปรแกรม “Drozer” นั้นสามารถหาได้จากโปรแกรม Appie2 จากบทความที่แล้ว How to set Genymotion (Android emulator) และ How to use ADB via Appie2
ขั้นตอน (Steps)
- หาโปรแกรม “Drozer” ในโฟลเดอร์ ของ “Appie2” พิมพ์ค้นหาว่า “agent.apk” จะพบไฟล์ “standard-agent.apk”
- เปิด “Emulator” ผ่านโปแกรม “Genymotion”
- จากนั้น “Copy” โปรแกรมไว้ที่หน้า “Desktop” เพื่อจะ “Install” ผ่านโปรแกรม “Appie.exe” โดยใช้คำสั่ง install ดังนี้
C:\Users\[user]\Desktop λ adb install standard-agent.apk 813 KB/s (634256 bytes in 0.761s) pkg: /data/local/tmp/standard-agent.apk Success
- ทดลองเปิดโปรแกรม “Drozer” บน “Emulator”
- จากภาพข้างต้นให้กดปุ่ม “OFF” ให้เป็น “ON”
- เมื่อคลิก “ON” จะหมายถึงเปิดใช้งาน Server ของ “Drozer” โดยจากรูปจะเปิด “Port” หมายเลข “31415”
- จากนั้นใช้คำสั่ง “Forward” เพื่อให้สามารถให้ใช้งานคำสั่งจาก “Drozer client” ไปยัง “Drozer Server” ผ่าน ADB ดังนี้
C:\Users\[user]\Desktop λ adb forward tcp:31415 tcp:31415
- จากนั้นเรียก “Drozer console” โดยใช้คำสั่งข้างล่าง หน้าจอจะถูกแบ่งออกเป็นสองฝั่งรอโหลดสักครู่
C:\Users\[user]\Desktop λ drozer console connect
- ทดลองใช้คำสั่ง “list” บน “Drozer console” เพื่อดูว่ามี “Module” อะไรบ้างที่เรียกใช้งานได้
dz> list app.activity.forintent Find activities that can handle the given intent app.activity.info Gets information about exported activities. app.activity.start Start an Activity app.broadcast.info Get information about broadcast receivers app.broadcast.send Send broadcast using an intent app.broadcast.sniff Register a broadcast receiver that can sniff particular intents app.package.attacksurface Get attack surface of package app.package.backup Lists packages that use the backup API (returns true on FLAG_ALLOW_BACKUP) app.package.debuggable Find debuggable packages app.package.info Get information about installed packages app.package.launchintent Get launch intent of package app.package.list List Packages app.package.manifest Get AndroidManifest.xml of package app.package.native Find Native libraries embedded in the application. app.package.shareduid Look for packages with shared UIDs app.provider.columns List columns in content provider app.provider.delete Delete from a content provider app.provider.download Download a file from a content provider that supports files app.provider.finduri Find referenced content URIs in a package app.provider.info Get information about exported content providers app.provider.insert Insert into a Content Provider app.provider.query Query a content provider app.provider.read Read from a content provider that supports files app.provider.update Update a record in a content provider app.service.info Get information about exported services app.service.send Send a Message to a service, and display the reply app.service.start Start Service app.service.stop Stop Service auxiliary.webcontentresolver Start a web service interface to content providers. exploit.jdwp.check Open @jdwp-control and see which apps connect exploit.pilfer.general.apnprovider Reads APN content provider exploit.pilfer.general.settingsprovider Reads Settings content provider information.datetime Print Date/Time information.deviceinfo Get verbose device information information.permissions Get a list of all permissions used by packages on the device scanner.activity.browsable Get all BROWSABLE activities that can be invoked from the web browser scanner.misc.native Find native components included in packages scanner.misc.readablefiles Find world-readable files in the given folder scanner.misc.secretcodes Search for secret codes that can be used from the dialer scanner.misc.sflagbinaries Find suid/sgid binaries in the given folder (default is /system). scanner.misc.writablefiles Find world-writable files in the given folder scanner.provider.finduris Search for content providers that can be queried from our context. scanner.provider.injection Test content providers for SQL injection vulnerabilities. scanner.provider.sqltables Find tables accessible through SQL injection vulnerabilities. scanner.provider.traversal Test content providers for basic directory traversal vulnerabilities. shell.exec Execute a single Linux command. shell.send Send an ASH shell to a remote listener. shell.start Enter into an interactive Linux shell. tools.file.download Download a File tools.file.md5sum Get md5 Checksum of file tools.file.size Get size of file tools.file.upload Upload a File tools.setup.busybox Install Busybox. tools.setup.minimalsu Prepare 'minimal-su' binary installation on the device.