【Android安全】insecureshop漏洞挖掘(上)

漏洞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(

猜你喜欢

转载自blog.csdn.net/tyty2211/article/details/134126628