mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-07 10:17:38 +02:00
Merge pull request #1025 from Abyss-W4tcher/remote_isf
Core: Remote ISF - correct sql query and strip identifier
This commit is contained in:
@@ -429,7 +429,7 @@ class SqliteCache(CacheManagerInterface):
|
||||
progress_callback(0, "Reading remote ISF list")
|
||||
cursor = self._database.cursor()
|
||||
cursor.execute(
|
||||
f"SELECT cached FROM cache WHERE local = 0 and cached < datetime('now', {self.cache_period})"
|
||||
f"SELECT cached FROM cache WHERE local = 0 and cached < datetime('now', '{self.cache_period}')"
|
||||
)
|
||||
remote_identifiers = RemoteIdentifierFormat(constants.REMOTE_ISF_URL)
|
||||
progress_callback(50, "Reading remote ISF list")
|
||||
@@ -438,9 +438,13 @@ class SqliteCache(CacheManagerInterface):
|
||||
{}, operating_system=operating_system
|
||||
)
|
||||
for identifier, location in identifiers:
|
||||
identifier = identifier.rstrip()
|
||||
identifier = (
|
||||
identifier[:-1] if identifier.endswith(b"\x00") else identifier
|
||||
) # Linux banners dumped by dwarf2json end with "\x00\n". If not stripped, the banner cannot match.
|
||||
cursor.execute(
|
||||
"INSERT OR REPLACE INTO cache(identifier, location, operating_system, local, cached) VALUES (?, ?, ?, ?, datetime('now'))",
|
||||
(location, identifier, operating_system, False),
|
||||
(identifier, location, operating_system, False),
|
||||
)
|
||||
progress_callback(100, "Reading remote ISF list")
|
||||
self._database.commit()
|
||||
|
||||
Reference in New Issue
Block a user