Skip to main content
P-BitM exposes two extension models for adding authorized browser assessment behavior. Use a Firefox plugin for browser-level, campaign-scoped behavior and a client module for an operator-triggered action on one active session. Both can be created directly from their dedicated pages in the administrative dashboard. A repository contribution is required only when the attack vector should ship with P-BitM as a built-in Firefox extension, a seed module, or a change to the shared runtime contract.
Attack-vector contributions are active code. Develop and test them only with synthetic data and targets you control. Never include real credentials, cookies, session material, personal data, or third-party infrastructure in source, fixtures, screenshots, logs, or pull requests.

Choose the execution model

Firefox plugin

Installed when a target browser starts. Choose this model for Firefox WebExtension APIs, navigation lifecycle events, or behavior that must remain active throughout the session.

Client module

Executed by an authorized operator on a selected active session. Choose this model for a bounded HTML/JavaScript interaction that has a clear completion and cleanup path.

Dashboard library or repository contribution

Create a Firefox plugin

Open Browser Extensions, select New Plugin, enter its name and description, then choose Create & Edit. Add or upload manifest.json and every referenced source file in the plugin editor, then save. Use Import instead when a reviewed P-BitM plugin ZIP is already available.

Create a client module

Open Modules and select New Module. Define its metadata, category, optional icon and link, inputs, and HTML/JavaScript payload, then save. Existing modules can also be opened, cloned, edited, exported, or deleted from the same page.

Assign it to a campaign

Select the reviewed plugin or module in the campaign wizard. Plugins are installed when target browsers start; assigned modules become available to the operator for execution on an active session.
Dashboard-created records belong to that P-BitM deployment and are stored in its application database. Export them for review or backup. A plugin ZIP can be imported into another deployment; a module JSON export is a source definition and must be re-created or installed as a seed before the initial module-library population.

Create it in the dashboard

The Browser Extensions page supports two creation paths:
  • New Plugin creates an empty library record and opens the file editor, where you can create or upload manifest.json, scripts, and text assets;
  • Import accepts a reviewed ZIP using the P-BitM archive layout described below.
The editor’s upload control accepts .js, .json, and .md. Create other UTF-8 text paths directly in the editor, or include them in a reviewed import ZIP; binary plugin files are not supported.The editor saves the plugin name, description, and complete validated file set. Export produces the same portable ZIP layout used by import.

Runtime lifecycle

A plugin selected in the campaign wizard is copied into campaign-owned storage. When P-BitM creates a target browser, it packages the validated files as an XPI, replaces the supported VICTIM_ID placeholder in .js and .html files, and installs the XPI through Firefox enterprise policy.Use campaign-local routes for any approved communication. Do not send collected content to hard-coded public hosts or introduce a second, unaudited data path.

Extension source

A usable plugin normally contains a WebExtension manifest and every script or asset referenced by it:
The current P-BitM extensions use Firefox Manifest V2. Give every extension a unique Gecko ID, scope URL matches deliberately, and request only the browser permissions required by the documented behavior.
manifest.json

Library ZIP

Plugins imported through the dashboard use a wrapper archive. plugin.json contains P-BitM library metadata; files below files/ become the extension source and the runtime XPI.
plugin.json
Library plugin files must be UTF-8 text with canonical relative POSIX paths. The backend rejects absolute paths, backslashes, . or .. segments, duplicates, symlinks, encrypted ZIP members, and non-text content. The current limits are 128 files, 2 MiB per file, and 10 MiB total uncompressed content.
The archive wrapper is not part of the installed extension. Firefox receives the contents of files/, packaged by P-BitM as an XPI.

Library plugin or built-in extension

  • Add a library plugin when operators should explicitly import, review, and assign the behavior to selected campaigns.
  • Change a built-in extension only when the behavior is a platform default that every browser runtime requires. Built-ins live below bitm-images/common/firefox/bad_firefox_extensions/ and must remain aligned with the extension list in server/backend/routes/campaign_lifecycle.py and both VNC and Selkies startup scripts.
The packaging tests verify that each declared built-in has a manifest and that both browser runtimes package the same declared set.See the complete plugin format reference.

Repository contribution workflow

Define the assessment contract

Describe the authorized use case, execution trigger, required permissions, expected visible behavior, data produced, retention needs, and cleanup conditions. Explain why an existing plugin or module cannot provide it.

Choose the smallest extension surface

Prefer an operator-triggered module for a short page interaction. Use a Firefox plugin only when the behavior genuinely requires WebExtension APIs or continuous browser lifecycle access.

Implement against the contract

Follow the manifest or JSON format above. Keep permissions, files, inputs, output, and runtime duration as small as possible. Reuse campaign-local transport and the provided cleanup mechanism.

Test both success and cleanup

Test only against synthetic pages and data. Verify the intended behavior, malformed or missing inputs, repeated execution, navigation, session end, and cleanup. Firefox changes must work in both VNC and Selkies runtimes.

Add regression coverage and documentation

Update tests for validation, packaging, runtime integration, or UI changes. Document permissions, inputs, output, limitations, and operator-visible behavior without including real assessment data.

Submit a reviewable pull request

Include the problem, design choice, security and privacy impact, test results, third-party provenance, and any compatibility or migration effect.

Verification

Run the complete backend suite when packaging, campaign creation, container startup, or collection behavior changes.

Review standard

Before proposing the new attack vector, confirm:
  • the use case is limited to controlled, explicitly authorized assessments;
  • Firefox permissions and URL matches are no broader than required;
  • inputs are treated as untrusted and output is schema-valid and bounded;
  • all communication stays on documented campaign-local paths;
  • no secrets, identifiers, collected content, or personal data enter logs;
  • repeated execution and cleanup are deterministic;
  • VNC and Selkies compatibility is tested when browser behavior changes;
  • validation, packaging, runtime, and UI changes have regression coverage;
  • documentation states operator-visible behavior and limitations;
  • third-party code and assets have compatible licenses and attribution.

Read the contribution policy

Review repository-wide testing, licensing, documentation, and pull-request requirements.
Last modified on August 28, 2026