[cookies:firefox] extract only cookies without container by default (#5957)

add support for 'all' to extract all cookies regardless of container
pull/4768/head
Mike Fährmann 1 month ago
parent e92a9ae343
commit 2d55521582
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -106,7 +106,7 @@
optional domain prefixed with '/', keyring name optional domain prefixed with '/', keyring name
prefixed with '+', profile prefixed with ':', prefixed with '+', profile prefixed with ':',
and container prefixed with '::' ('none' for no and container prefixed with '::' ('none' for no
container) container (default), 'all' for all containers)
## Selection Options: ## Selection Options:
-A, --abort N Stop current extractor run after N consecutive -A, --abort N Stop current extractor run after N consecutive

@ -179,11 +179,14 @@ def _firefox_cookies_database(profile=None, container=None):
"{}".format(search_root)) "{}".format(search_root))
_log_debug("Extracting cookies from %s", path) _log_debug("Extracting cookies from %s", path)
if container == "none": if not container or container == "none":
container_id = False container_id = False
_log_debug("Only loading cookies not belonging to any container") _log_debug("Only loading cookies not belonging to any container")
elif container: elif container == "all":
container_id = None
else:
containers_path = os.path.join( containers_path = os.path.join(
os.path.dirname(path), "containers.json") os.path.dirname(path), "containers.json")
@ -207,8 +210,6 @@ def _firefox_cookies_database(profile=None, container=None):
container)) container))
_log_debug("Only loading cookies from container '%s' (ID %s)", _log_debug("Only loading cookies from container '%s' (ID %s)",
container, container_id) container, container_id)
else:
container_id = None
return path, container_id return path, container_id

@ -526,7 +526,8 @@ def build_parser():
"domain prefixed with '/', " "domain prefixed with '/', "
"keyring name prefixed with '+', " "keyring name prefixed with '+', "
"profile prefixed with ':', and " "profile prefixed with ':', and "
"container prefixed with '::' ('none' for no container)"), "container prefixed with '::' "
"('none' for no container (default), 'all' for all containers)"),
) )
selection = parser.add_argument_group("Selection Options") selection = parser.add_argument_group("Selection Options")

Loading…
Cancel
Save