firefox

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package firefox is responsible for running checks on Firefox.

Exported function(s): CookieFirefox, ExtensionFirefox, HistoryFirefox, PasswordFirefox

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CookieFirefox

func CookieFirefox() checks.Check

CookieFirefox inspects the cookies stored in the Firefox browser.

Parameters: None

Returns:

  • A checks.Check object representing the result of the check. The result contains a list of cookies stored in the Firefox browser. Each cookie is represented as a string that includes the name, host, and creation time of the cookie. If an error occurs during the check, the result will contain a description of the error.

This function works by locating the Firefox profile directory and copying the cookies.sqlite database to a temporary location. It then opens this database and queries it for the name, host, and creation time of each cookie. The results are returned as a list of strings, each string representing a cookie. If any error occurs during this process, such as an error copying the file or querying the database, this error is returned as the result of the check.

func ExtensionFirefox

func ExtensionFirefox() (checks.Check, checks.Check)

ExtensionFirefox inspects the extensions installed in the Firefox browser and checks for the presence of an adblocker.

Parameters: None

Returns:

  • A checks.Check object representing the result of the check. The result contains a list of installed extensions in the Firefox browser. Each extension is represented as a string that includes the name, type, creator, and its active status.
  • A checks.Check object representing the result of the adblocker check. The result is a boolean indicating whether an adblocker is installed or not.

This function works by locating the Firefox profile directory and opening the extensions.json file, which contains a list of all installed Firefox extensions. It decodes the JSON file into a struct and iterates over the addons in the struct. For each addon, it appends a string to the result list that includes the name, type, creator, and active status of the addon. It also checks if the addon is an adblocker by calling the adblockerFirefox function with the addon's name. If an adblocker is found, it sets a boolean variable to true. The function returns two checks.Check objects: one with the list of extensions and one with the boolean indicating the presence of an adblocker.

func HistoryFirefox

func HistoryFirefox() checks.Check

HistoryFirefox inspects the user's browsing history in the Firefox browser for any visits to known phishing domains within the last week.

Parameters: None

Returns:

  • A checks.Check object representing the result of the check. The result contains a list of phishing domains that the user has visited in the last week. Each domain is represented as a string that includes the domain name and the time of the visit. If no visits to phishing domains are found, the result will be a string stating "No phishing domains found in the last week".

This function works by locating the Firefox profile directory and copying the places.sqlite database to a temporary location. It then opens this database and queries it for the URLs visited in the last week. It processes the results of the query by checking each URL against a list of known phishing domains. If a match is found, a string is generated that includes the domain name and the time of the visit, and this string is added to the results. If any error occurs during this process, such as an error copying the file or querying the database, this error is returned as the result of the check.

func PasswordFirefox

func PasswordFirefox() checks.Check

PasswordFirefox is a function that checks the passwords stored in the Firefox browser.

Parameters: None

Returns:

  • checks.Check: A Check object that encapsulates the results of the password check. The Check object includes a list of strings, where each string represents a saved password in the Firefox browser. If an error occurs during the password check, the Check object will encapsulate this error.

This function first determines the directory in which the Firefox profile is stored. It then opens the 'logins.json' file, which contains a list of all saved Firefox passwords. The function decodes the JSON file into a struct, and then iterates over the struct to extract the saved passwords. These passwords are added to the results, which are returned as a Check object. If an error occurs at any point during this process, it is encapsulated in the Check object and returned.

func SearchEngineFirefox

func SearchEngineFirefox() checks.Check

SearchEngineFirefox is a function that retrieves the default search engine used in the Firefox browser.

Parameters: None

Returns:

  • checks.Check: A Check object that encapsulates the result of the search engine check. The Check object includes a string that represents the default search engine in the Firefox browser. If an error occurs during the check, the Check object will encapsulate this error.

This function first determines the directory in which the Firefox profile is stored. It then opens and reads the 'search.json.mozlz4' file, which contains information about the default search engine. The function decompresses the file, extracts the default search engine information, and returns this information as a Check object. If an error occurs at any point during this process, it is encapsulated in the Check object and returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL