Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Opera Stable and GX browser for reading history/cookies #744

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions dissect/target/plugins/apps/browser/opera.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from typing import Iterator

from dissect.target.helpers.descriptor_extensions import UserRecordDescriptorExtension
from dissect.target.helpers.record import create_extended_descriptor
from dissect.target.plugin import export
from dissect.target.plugins.apps.browser.browser import (
GENERIC_COOKIE_FIELDS,
GENERIC_HISTORY_RECORD_FIELDS,
BrowserPlugin,
)
from dissect.target.plugins.apps.browser.chromium import (
ChromiumMixin,
)

class OperaPlugin(ChromiumMixin, BrowserPlugin):
"""Opera (Stable and Opera GX) browser plugin."""

__namespace__ = "opera"

DIRS = [
# Windows (Stable)
"AppData/Roaming/Opera Software/Opera Stable/Default",
"AppData/Local/Opera Software/Opera Stable/Default",
# Windows (GX)
"AppData/Roaming/Opera Software/Opera GX Stable",
"AppData/Local/Opera Software/Opera GX Stable",
# MacOS (Stable)
"Library/Application Support/com.operasoftware.Opera/Default",
# MacOS (GX)
"Library/Application Support/com.operasoftware.OperaGX",
]

BrowserHistoryRecord = create_extended_descriptor([UserRecordDescriptorExtension])(
"browser/opera/history", GENERIC_HISTORY_RECORD_FIELDS
)

BrowserCookieRecord = create_extended_descriptor([UserRecordDescriptorExtension])(
"browser/opera/cookie", GENERIC_COOKIE_FIELDS
)

@export(record=BrowserHistoryRecord)
def history(self) -> Iterator[BrowserHistoryRecord]:
"""Return browser history records for Opera (and Opera GX)."""
yield from super().history("opera")

@export(record=BrowserCookieRecord)
def cookies(self) -> Iterator[BrowserCookieRecord]:
"""Return browser cookie records for Opera (and Opera GX)."""
yield from super().cookies("opera")