mirror of
https://github.com/mvt-project/mvt.git
synced 2024-07-01 00:19:02 +00:00
Updated lookup modules to new format (closes: #175)
This commit is contained in:
parent
d43c8109d1
commit
b27047ed27
|
@ -27,12 +27,12 @@ def koodous_lookup(packages):
|
||||||
total_packages = len(packages)
|
total_packages = len(packages)
|
||||||
for i in track(range(total_packages), description=f"Looking up {total_packages} packages..."):
|
for i in track(range(total_packages), description=f"Looking up {total_packages} packages..."):
|
||||||
package = packages[i]
|
package = packages[i]
|
||||||
for file in package.files:
|
for file in package.get("files", []):
|
||||||
url = f"https://api.koodous.com/apks/{file['sha256']}"
|
url = f"https://api.koodous.com/apks/{file['sha256']}"
|
||||||
res = requests.get(url)
|
res = requests.get(url)
|
||||||
report = res.json()
|
report = res.json()
|
||||||
|
|
||||||
row = [package.name, file["local_name"]]
|
row = [package["package_name"], file["local_name"]]
|
||||||
|
|
||||||
if "package_name" in report:
|
if "package_name" in report:
|
||||||
trusted = "no"
|
trusted = "no"
|
||||||
|
|
|
@ -41,7 +41,7 @@ def virustotal_lookup(packages):
|
||||||
|
|
||||||
unique_hashes = []
|
unique_hashes = []
|
||||||
for package in packages:
|
for package in packages:
|
||||||
for file in package.files:
|
for file in package.get("files", []):
|
||||||
if file["sha256"] not in unique_hashes:
|
if file["sha256"] not in unique_hashes:
|
||||||
unique_hashes.append(file["sha256"])
|
unique_hashes.append(file["sha256"])
|
||||||
|
|
||||||
|
@ -74,8 +74,8 @@ def virustotal_lookup(packages):
|
||||||
table.add_column("Detections")
|
table.add_column("Detections")
|
||||||
|
|
||||||
for package in packages:
|
for package in packages:
|
||||||
for file in package.files:
|
for file in package.get("files", []):
|
||||||
row = [package.name, file["local_name"]]
|
row = [package["package_name"], file["local_name"]]
|
||||||
|
|
||||||
if file["sha256"] in detections:
|
if file["sha256"] in detections:
|
||||||
detection = detections[file["sha256"]]
|
detection = detections[file["sha256"]]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user