各个安卓漏洞检测框架是怎么检测allowBackup的?

AndroBugs_Framework是怎么检测?
方法:直接获取AndroidManifest文件中allowBackup的属性,是否为true。(若没有,安卓系统是默认为true的)

    def is_adb_backup_enabled(self):
        """
            Return true if the APK can be backed up
            :rtype: boolean
        """
        adb_backup = self.get_element("application", "allowBackup")
        if adb_backup is None:
            #If the default value is not set, the default is True.
            return True
        else:
            if adb_backup.lower() == 'true':
                return True 
            else:
return False

QARK:

class ManifestBackupAllowed(ManifestPlugin):
    def __init__(self):
        super(ManifestBackupAllowed, self).__init__(category="manifest", name="Backup is allowed in manifest",
                                                    description=(
                                                        "Backups enabled: Potential for data theft via local attacks via adb "
                                                        "backup, if the device has USB debugging enabled (not common). "
                                                        "More info: "
                                                        "http://developer.android.com/reference/android/R.attr.html#allowBackup"))

        self.severity = Severity.WARNING

    def run(self):
        application_sections = self.manifest_xml.getElementsByTagName("application")

        for application in application_sections:
            if "android:allowBackup" in application.attributes.keys():
                self.issues.append(Issue(category=self.category, severity=self.severity,
                                         name=self.name, description=self.description,
                                         file_object=self.manifest_path))


plugin = ManifestBackupAllowed()

其他的框架或工具还有360显危镜,腾讯金刚,mafia等,都是基于manifest对allowBackup属性做判断,来确定风险。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值