示例#1
0
def apkid_analysis(app_dir):
    """APKiD Analysis of DEX file"""
    if settings.APKID_ENABLED:
        dex_file = app_dir + 'classes.dex'
        if not os.path.exists(dex_file):
            print "[INFO] APKiD - Package does not contains classes.dex file!"
            return {'error': True}
        from StaticAnalyzer.tools.apkid import apkid
        apkid_dict = {}
        print "[INFO] APKiD Analysis on Dex file"
        result = apkid.scan(dex_file, 30, True)
        if "files" in result:
            apkid_dict["result"] = result["files"][0]["results"]
        if "apkid_version" in result:
            apkid_dict["apkid_version"] = result["apkid_version"]

        if "anti_vm" in apkid_dict["result"]:
            apkid_dict["anti_vm"] = apkid_dict["result"]["anti_vm"]
        else:
            apkid_dict["anti_vm"] = ""

        if "compiler" in apkid_dict["result"]:
            apkid_dict["compiler"] = apkid_dict["result"]["compiler"]
        else:
            apkid_dict["compiler"] = ""

        if "packer" in apkid_dict["result"]:
            apkid_dict["packer"] = apkid_dict["result"]["packer"]
        else:
            apkid_dict["packer"] = ""

        if "obfuscator" in apkid_dict["result"]:
            apkid_dict["obfuscator"] = apkid_dict["result"]["obfuscator"]
        else:
            apkid_dict["obfuscator"] = ""

        if "abnormal" in apkid_dict["result"]:
            apkid_dict["abnormal"] = apkid_dict["result"]["abnormal"]
        else:
            apkid_dict["abnormal"] = ""

        if "anti_disassembly" in apkid_dict["result"]:
            apkid_dict["anti_disassembly"] = apkid_dict["result"][
                "anti_disassembly"]
        else:
            apkid_dict["anti_disassembly"] = ""

        if "dropper" in apkid_dict["result"]:
            apkid_dict["dropper"] = apkid_dict["result"]["dropper"]
        else:
            apkid_dict["dropper"] = ""

        if "manipulator" in apkid_dict["result"]:
            apkid_dict["manipulator"] = apkid_dict["result"]["manipulator"]
        else:
            apkid_dict["manipulator"] = ""

        apkid_dict["result"] = ""
        return apkid_dict
    return {}
def apkid_analysis(app_dir):
    """APKiD Analysis of DEX file"""
    if settings.APKID_ENABLED:
        dex_file = app_dir + 'classes.dex'
        if not os.path.exists(dex_file):
            print "[INFO] APKiD - Package does not contains classes.dex file!"
            return {'error': True}
        from StaticAnalyzer.tools.apkid import apkid
        apkid_dict = {}
        print "[INFO] APKiD Analysis on Dex file"
        result = apkid.scan(dex_file, 30, True)
        if "files" in result:
            apkid_dict["result"] = result["files"][0]["results"]
        if "apkid_version" in result:
            apkid_dict["apkid_version"] = result["apkid_version"]

        if "anti_vm" in apkid_dict["result"]:
            apkid_dict["anti_vm"] = apkid_dict["result"]["anti_vm"]
        else:
            apkid_dict["anti_vm"] = ""

        if "compiler" in apkid_dict["result"]:
            apkid_dict["compiler"] = apkid_dict["result"]["compiler"]
        else:
            apkid_dict["compiler"] = ""

        if "packer" in apkid_dict["result"]:
            apkid_dict["packer"] = apkid_dict["result"]["packer"]
        else:
            apkid_dict["packer"] = ""

        if "obfuscator" in apkid_dict["result"]:
            apkid_dict["obfuscator"] = apkid_dict["result"]["obfuscator"]
        else:
            apkid_dict["obfuscator"] = ""

        if "abnormal" in apkid_dict["result"]:
            apkid_dict["abnormal"] = apkid_dict["result"]["abnormal"]
        else:
            apkid_dict["abnormal"] = ""

        if "anti_disassembly" in apkid_dict["result"]:
            apkid_dict["anti_disassembly"] = apkid_dict[
                "result"]["anti_disassembly"]
        else:
            apkid_dict["anti_disassembly"] = ""

        if "dropper" in apkid_dict["result"]:
            apkid_dict["dropper"] = apkid_dict["result"]["dropper"]
        else:
            apkid_dict["dropper"] = ""

        if "manipulator" in apkid_dict["result"]:
            apkid_dict["manipulator"] = apkid_dict["result"]["manipulator"]
        else:
            apkid_dict["manipulator"] = ""

        apkid_dict["result"] = ""
        return apkid_dict
    return {}
示例#3
0
def apkid_analysis(app_dir):
    """APKiD Analysis of DEX file"""
    if settings.APKID_ENABLED:
        apkid_dict = {}
        print "[INFO] APKiD Analysis on Dex file"
        dex_file = app_dir + 'classes.dex'
        result = apkid.scan(dex_file, 30, True)
        if "files" in result:
            apkid_dict["result"] = result["files"][0]["results"]
        if "apkid_version" in result:
            apkid_dict["apkid_version"] = result["apkid_version"]

        if "anti_vm" in apkid_dict["result"]:
            apkid_dict["anti_vm"] = apkid_dict["result"]["anti_vm"]
        else:
            apkid_dict["anti_vm"] = ""

        if "compiler" in apkid_dict["result"]:
            apkid_dict["compiler"] = apkid_dict["result"]["compiler"]
        else:
            apkid_dict["compiler"] = ""

        if "packer" in apkid_dict["result"]:
            apkid_dict["packer"] = apkid_dict["result"]["packer"]
        else:
            apkid_dict["packer"] = ""

        if "obfuscator" in apkid_dict["result"]:
            apkid_dict["obfuscator"] = apkid_dict["result"]["obfuscator"]
        else:
            apkid_dict["obfuscator"] = ""

        if "abnormal" in apkid_dict["result"]:
            apkid_dict["abnormal"] = apkid_dict["result"]["abnormal"]
        else:
            apkid_dict["abnormal"] = ""

        if "anti_disassembly" in apkid_dict["result"]:
            apkid_dict["anti_disassembly"] = apkid_dict[
                "result"]["anti_disassembly"]
        else:
            apkid_dict["anti_disassembly"] = ""

        if "dropper" in apkid_dict["result"]:
            apkid_dict["dropper"] = apkid_dict["result"]["dropper"]
        else:
            apkid_dict["dropper"] = ""

        if "manipulator" in apkid_dict["result"]:
            apkid_dict["manipulator"] = apkid_dict["result"]["manipulator"]
        else:
            apkid_dict["manipulator"] = ""

        apkid_dict["result"] = ""
        return apkid_dict
    return {}
示例#4
0
def apkid_analysis(app_dir, apk_file):
    """APKiD Analysis of DEX file"""
    if settings.APKID_ENABLED:
        dex_file = app_dir + 'classes.dex'
        if not os.path.exists(dex_file):
            print("[INFO] APKiD - Package does not contains classes.dex file!")
            return {'error': True}
        from StaticAnalyzer.tools.apkid import apkid
        apkid_dict = {}
        apkid_dict2 = {}
        print("[INFO] APKiD Analysis on Dex file")
        result = apkid.scan(app_dir, 30, True)
        if "files" in result:
            apkid_dict["result"] = result["files"][0]["results"]
        if "apkid_version" in result:
            apkid_dict["apkid_version"] = result["apkid_version"]

        apkid_dict['anti_vm'] = apkid_dict['result'].get('anti_vm', '')
        apkid_dict['compiler'] = apkid_dict['result'].get('compiler', '')
        apkid_dict['packer'] = apkid_dict['result'].get('packer', '')
        apkid_dict['obfuscator'] = apkid_dict['result'].get('obfuscator', '')
        apkid_dict['abnormal'] = apkid_dict['result'].get('abnormal', '')
        apkid_dict['anti_disassembly'] = apkid_dict["result"].get(
            'anti_disassembly', '')
        apkid_dict['anti_debug'] = apkid_dict['result'].get('anti_debug', '')
        apkid_dict['dropper'] = apkid_dict['result'].get('dropper', '')
        apkid_dict['manipulator'] = apkid_dict['result'].get('manipulator', '')
        apkid_dict['result'] = ''

        if "files" in result:
            apkid_dict2["result"] = result["files"][1]["results"]

        print("[INFO] APKiD Analysis on Apk file")
        apkid_dict['packer'] = apkid_dict2['result'].get('packer', '')
        apkid_dict2['result'] = ''

        return apkid_dict
    return {}
def apkid_analysis(app_dir, apk_file):
    """APKiD Analysis of DEX file"""
    if settings.APKID_ENABLED:
        dex_file = app_dir + 'classes.dex'
        if not os.path.exists(dex_file):
            print("[INFO] APKiD - Package does not contains classes.dex file!")
            return {'error': True}
        from StaticAnalyzer.tools.apkid import apkid
        apkid_dict = {}
        apkid_dict2 = {}
        print("[INFO] APKiD Analysis on Dex file")
        result = apkid.scan(app_dir, 30, True)
        if "files" in result:
            apkid_dict["result"] = result["files"][0]["results"]
        if "apkid_version" in result:
            apkid_dict["apkid_version"] = result["apkid_version"]

        apkid_dict['anti_vm'] = apkid_dict['result'].get('anti_vm', '')    
        apkid_dict['compiler'] = apkid_dict['result'].get('compiler', '')
        apkid_dict['packer'] = apkid_dict['result'].get('packer', '')
        apkid_dict['obfuscator'] = apkid_dict['result'].get('obfuscator', '')
        apkid_dict['abnormal'] = apkid_dict['result'].get('abnormal', '')
        apkid_dict['anti_disassembly'] = apkid_dict[
                "result"].get('anti_disassembly', '')
        apkid_dict['anti_debug'] = apkid_dict['result'].get('anti_debug', '')
        apkid_dict['dropper'] = apkid_dict['result'].get('dropper','')
        apkid_dict['manipulator'] = apkid_dict['result'].get('manipulator', '')
        apkid_dict['result'] = ''
        
        if "files" in result:
            apkid_dict2["result"] = result["files"][1]["results"]
            
        print("[INFO] APKiD Analysis on Apk file")
        apkid_dict['packer'] = apkid_dict2['result'].get('packer', '')
        apkid_dict2['result'] = ''
        
        return apkid_dict
    return {}