diff --git a/mvt/android/lookups/koodous.py b/mvt/android/lookups/koodous.py index 5498bfe..bb9ee03 100644 --- a/mvt/android/lookups/koodous.py +++ b/mvt/android/lookups/koodous.py @@ -27,12 +27,12 @@ def koodous_lookup(packages): total_packages = len(packages) for i in track(range(total_packages), description=f"Looking up {total_packages} packages..."): package = packages[i] - for file in package.files: + for file in package.get("files", []): url = f"https://api.koodous.com/apks/{file['sha256']}" res = requests.get(url) report = res.json() - row = [package.name, file["local_name"]] + row = [package["package_name"], file["local_name"]] if "package_name" in report: trusted = "no" diff --git a/mvt/android/lookups/virustotal.py b/mvt/android/lookups/virustotal.py index 4fb949f..23dba9b 100644 --- a/mvt/android/lookups/virustotal.py +++ b/mvt/android/lookups/virustotal.py @@ -41,7 +41,7 @@ def virustotal_lookup(packages): unique_hashes = [] for package in packages: - for file in package.files: + for file in package.get("files", []): if file["sha256"] not in unique_hashes: unique_hashes.append(file["sha256"]) @@ -74,8 +74,8 @@ def virustotal_lookup(packages): table.add_column("Detections") for package in packages: - for file in package.files: - row = [package.name, file["local_name"]] + for file in package.get("files", []): + row = [package["package_name"], file["local_name"]] if file["sha256"] in detections: detection = detections[file["sha256"]]