forked from fox-it/dissect.target
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parsing of Firefox extensions to firefox plugin (fox-it#689)
- Loading branch information
Showing
3 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Git LFS file not shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,6 @@ | |
) | ||
from tests._utils import absolute_path | ||
|
||
# NOTE: Missing extensions tests for Firefox. | ||
|
||
|
||
@pytest.fixture | ||
def target_firefox_win(target_win_users: Target, fs_win: VirtualFilesystem) -> Iterator[Target]: | ||
|
@@ -109,6 +107,38 @@ def test_firefox_cookies(target_platform: Target, request: pytest.FixtureRequest | |
] | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"target_platform", | ||
["target_firefox_win", "target_firefox_unix"], | ||
) | ||
def test_firefox_extensions(target_platform: Target, request: pytest.FixtureRequest) -> None: | ||
target_platform = request.getfixturevalue(target_platform) | ||
|
||
records = list(target_platform.firefox.extensions()) | ||
|
||
assert set(["firefox"]) == set(record.browser for record in records) | ||
assert len(records) == 2 | ||
assert records[0].id == "[email protected]" | ||
assert records[0].ts_install == dt("2024-04-23 07:07:21+00:00") | ||
assert records[0].ts_update == dt("2024-04-23 07:07:21+00:00") | ||
assert ( | ||
records[0].ext_path == "C:\\Users\\Win11\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles" | ||
"\\9nxit8q0.default-release\\extensions\\[email protected]" | ||
) | ||
assert records[0].permissions == [ | ||
"alarms", | ||
"dns", | ||
"menus", | ||
"privacy", | ||
"storage", | ||
"tabs", | ||
"unlimitedStorage", | ||
"webNavigation", | ||
"webRequest", | ||
"webRequestBlocking", | ||
] | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"target_platform", | ||
["target_firefox_win", "target_firefox_unix"], | ||
|