Skip to content

Commit

Permalink
Add 'Snapshots' to history_dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
Poeloe committed Feb 9, 2024
1 parent fbd271e commit 8c568dd
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions acquire/acquire.py
Expand Up @@ -1096,35 +1096,36 @@ class QuarantinedFiles(Module):
@register_module("--history")
class History(Module):
DESC = "browser history from IE, Edge, Firefox, and Chrome"
BROWSER_ROOT_DIRS = namedtuple("BrowserRootDirs", ["root_dirs", "history_dirs"])
BROWSER_ROOT_DIRS = namedtuple("BrowserRootDirs", ["root_dirs", "dir_extensions", "history_dirs"])
COMMON_DIRS = {
"default": BROWSER_ROOT_DIRS(
[
# Chromium - RHEL/Ubuntu - DNF/apt
".config/chromium/*",
".config/chromium",
# Chrome - RHEL/Ubuntu - DNF
".config/google-chrome/*",
".config/google-chrome",
# Edge - RHEL/Ubuntu - DNF/apt
".config/microsoft-edge/*",
".config/microsoft-edge",
# Chrome - RHEL/Ubuntu - Flatpak
".var/app/com.google.Chrome/config/google-chrome/*",
".var/app/com.google.Chrome/config/google-chrome",
# Edge - RHEL/Ubuntu - Flatpak
".var/app/com.microsoft.Edge/config/microsoft-edge/*",
".var/app/com.microsoft.Edge/config/microsoft-edge",
# Chromium - RHEL/Ubuntu - Flatpak
".var/app/org.chromium.Chromium/config/chromium/*",
".var/app/org.chromium.Chromium/config/chromium",
# Chrome
"AppData/Local/Google/Chrom*/User Data/*",
"AppData/Local/Google/Chrom*/User Data",
# Edge
"AppData/Local/Microsoft/Edge/User Data/*",
"Library/Application Support/Microsoft Edge/*",
"Local Settings/Application Data/Microsoft/Edge/User Data/*",
"AppData/Local/Microsoft/Edge/User Data",
"Library/Application Support/Microsoft Edge",
"Local Settings/Application Data/Microsoft/Edge/User Data",
# Chrome - Legacy
"Library/Application Support/Chromium/*",
"Library/Application Support/Google/Chrome/*",
"Local Settings/Application Data/Google/Chrom*/User Data/*",
"Library/Application Support/Chromium",
"Library/Application Support/Google/Chrome",
"Local Settings/Application Data/Google/Chrom*/User Data",
# Chromium - RHEL/Ubuntu - snap
"snap/chromium/common/chromium/*",
"snap/chromium/common/chromium",
],
["*", "Snapshots/*/*"],
[
"Archived History",
"Bookmarks",
Expand All @@ -1139,6 +1140,7 @@ class History(Module):
"Login Data",
"Login Data For Account",
"Shortcuts",
"Snapshots",
"Top Sites",
"Web Data",
],
Expand Down Expand Up @@ -1189,9 +1191,9 @@ class History(Module):
@classmethod
def get_spec_additions(cls, target: Target, cli_args: argparse.Namespace) -> Iterator[tuple]:
spec = set()
for root_dirs, history_dirs in cls.COMMON_DIRS.values():
for root_dir, history_dir in product(root_dirs, history_dirs):
full_path = f"{root_dir}/{history_dir}"
for root_dirs, extension_dirs, history_dirs in cls.COMMON_DIRS.values():
for root_dir, extension_dir, history_dir in product(root_dirs, extension_dirs, history_dirs):
full_path = f"{root_dir}/{extension_dir}/{history_dir}"
search_type = "glob" if "*" in full_path else "file"

Check warning on line 1197 in acquire/acquire.py

View check run for this annotation

Codecov / codecov/patch

acquire/acquire.py#L1193-L1197

Added lines #L1193 - L1197 were not covered by tests

spec.add((search_type, full_path, from_user_home))

Check warning on line 1199 in acquire/acquire.py

View check run for this annotation

Codecov / codecov/patch

acquire/acquire.py#L1199

Added line #L1199 was not covered by tests
Expand Down

0 comments on commit 8c568dd

Please sign in to comment.