Skip to content

Getting Started ​

What Is Famir ​

Famir (Fake Mirrors) is an open-source platform for creating a multi-tenant reverse proxy servers with dynamic configuration.

The platform is intended for authorized security research, including the analysis of web application behavior, HTTP interactions, and security mechanisms in a controlled environment.

Famir receives traffic through mirror domains, forwards it to the corresponding donor websites, and allows request and response processing to be customized. A separate famir-demo project is available as a demonstration and starting point.

Campaign and tenant model ​

The main Famir configuration unit is a campaign. One campaign combines the settings of an individual scenario and its related entities: proxy, target, redirector, lure, session, and message.

One backend can serve a large number of independent campaigns. Each campaign can have its own mirror domains, targets, session parameters, and processing rules. As a result, several isolated scenarios can run simultaneously on the same platform.

Separate tenants are used for campaigns with custom behavior. TypeScript hooks can be attached to a tenant and applied to one or more specific target entities.

Customization ​

Famir supports two complementary configuration approaches.

YAML presets ​

YAML presets define campaign and target configuration declaratively. They are designed for parameters and rules that can be described as data and reused across scenarios.

Presets keep scenario-specific configuration separate from platform code.

TypeScript hooks in tenants ​

TypeScript hooks implement custom processing logic for a specific tenant and can be associated with selected target entities.

HTTP request processing is organized as a middleware chain, with each stage performed by a corresponding controller. A hook is invoked after its associated controller—that is, after the corresponding middleware stage. This makes it possible to add target-specific logic at a particular processing stage without replacing the platform's general processing logic.

YAML presets and hooks serve different purposes: presets define configuration, while hooks implement programmable behavior.

Request flow ​

Famir runs behind an external edge server. Incoming traffic is first accepted by the edge server and then forwarded to one of the Famir backend instances.

The general request flow is as follows:

  1. The client connects to a mirror domain.
  2. The edge server accepts the connection. It may terminate TLS, apply routing rules, and balance requests across Famir instances.
  3. The edge server forwards the request to Famir. It sends the original host and protocol through X-Forwarded-Host and X-Forwarded-Proto.
  4. Famir identifies the campaign and target matching the mirror domain and starts processing the request through the middleware chain.
  5. Controllers execute the processing stages. After the corresponding controller finishes, its associated TypeScript hook is invoked when configured for the tenant and target.
  6. Famir forwards the request to the donor website according to the target configuration and the available outgoing proxy.
  7. Famir processes the returned response and sends it to the client through the edge server.

The edge server is an external component in front of Famir, not part of the backend reverse proxy. It accepts traffic and performs load balancing, while Famir handles campaign routing and application-level request and response processing.

The X-Forwarded-Host and X-Forwarded-Proto headers should be set or validated by a trusted edge server. Values received directly from clients should not be trusted without validation.

Supported connection types ​

Famir supports several types of HTTP interaction:

  • Standard HTTP requests and responses — processing of requests with complete request and response body handling.
  • WebSocket — upgrading an HTTP connection to WebSocket when enabled by the target configuration.
  • Stream upload — streaming request bodies, for example for large uploads.
  • Stream download — streaming response bodies for large files and other high-volume data.

Streaming modes transfer large bodies incrementally without loading them entirely into memory. Actual behavior depends on the target configuration and the capabilities of the edge server.

Scalability ​

Famir consists of separate applications and infrastructure components. This makes it possible to run several backend instances behind an edge server and distribute incoming requests among them.

Campaigns are independent configuration units: a single backend can serve many campaigns, while backend instances can be scaled horizontally as traffic grows. Background workers are also separated from HTTP traffic processing and can be scaled independently.

Actual scaling limits depend on server resources, network capacity, edge-server configuration, Redis, and object storage.

Infrastructure and technology stack ​

A Famir deployment uses:

  • Node.js — runtime for backend applications;
  • An edge server and load balancer — accepts incoming connections and distributes requests across Famir backend instances;
  • Redis — stores operational data and provides infrastructure for background job queues;
  • MinIO or S3-compatible object storage — stores file data;
  • libcurl and build tools — system dependencies for the outgoing node-libcurl HTTP client;
  • DNS, domains, and TLS certificates — make mirror domains available over secure connections.

Suitable edge servers include Nginx, Caddy, Traefik, Angie, and other similar solutions. The choice depends on infrastructure and TLS, load-balancing, and routing requirements. The edge server should forward valid X-Forwarded-Host and X-Forwarded-Proto values to Famir.

Background jobs use BullMQ with Redis. Workers can run separately from Famir instances that handle incoming HTTP traffic.

Additional configuration details and component startup instructions are covered in the following documentation sections.