Code clean-ups

This commit is contained in:
Nex 2022-02-02 19:18:47 +01:00
parent a833dda581
commit ab63a02c9f
2 changed files with 3 additions and 7 deletions

View File

@ -6,9 +6,10 @@
import logging
import re
from .base import BugReportModule
from mvt.android.modules.adb.getprop import Getprop as GP
from .base import BugReportModule
log = logging.getLogger(__name__)
@ -50,4 +51,3 @@ class Getprop(BugReportModule):
self.results = GP.parse_getprop("\n".join(lines))
self.log.info("Extracted %d Android system properties", len(self.results))

View File

@ -85,7 +85,7 @@ class Indicators:
try:
data = json.load(handle)
except json.decoder.JSONDecodeError:
self.log.critical("Unable to parse STIX2 indicator file. " \
self.log.critical("Unable to parse STIX2 indicator file. "
"The file is corrupted or in the wrong format!")
return
@ -115,8 +115,6 @@ class Indicators:
# We loop through all indicators.
for indicator in indicators:
malware_id = None
malware_name = None
malware_description = None
# We loop through all relationships and find the one pertinent to
# the current indicator.
@ -127,8 +125,6 @@ class Indicators:
# Look for a malware definition with the correct identifier.
if relationship["target_ref"] in malware.keys():
malware_id = relationship["target_ref"]
malware_name = malware[relationship["target_ref"]].get("name", "")
malware_description = malware[relationship["target_ref"]].get("description", "")
break
# Now we look for the correct collection matching the malware ID we