Assets

Assets are files such as images, stylesheets, scripts and documents that Phishing Club serves from your domains. Use them in pages, emails and domain websites.

Overview

Where: Domains > Assets

Assets by domain lists your domains. Click a domain to manage the assets that are only served on that domain. The Assets item in the row menu on the Domains page opens the same view.

  • Open shared assets (shown without a company selected) manages shared assets. A shared asset is served at its path on every domain.
  • Open company assets (shown with a company selected) manages the company asset folder. These files are served on every domain under a folder named by the company key. The row menu item Copy path copies a reference like {{.BaseURL}}/<key>/<path> to use in templates and emails.

Asset Priority and Resolution

When a domain asset and a shared asset have the same path, the domain asset is served. The shared asset is only used when the domain has no file at that path.

Asset actions

The row menu of an asset has these actions:

Asset actions
Action Description
View Preview the file. Clicking the asset name does the same.
Update Change name, description, path and content type. Changing the path renames or moves the file. Text files (such as .html, .css, .js, .json, .svg and .txt) can also be edited in place. HTML files open in the page editor with a live preview.
Response headers Headers sent when the file is served. See Response headers.
Filters Allow or deny lists that decide who can get the file. See Filters.
Replace file Upload new content for the file and keep its path and settings.
Delete Remove the file. Select several rows to delete them at once.

Assets are served as stored. Template variables in an asset are not replaced.

Create new asset

Click New asset to upload one or more files to a folder. An empty path uploads to the root / of the domain. The maximum file size is set under Settings > General in Upload max file size (MB).

Asset
Field Description
Name Optional name, up to 127 characters. Used for reference only, not in the URL.
Description Optional description, up to 255 characters.
Path Folder from the web root where the files are placed, for example images. Letters, digits, ., _, / and - only.
Files Select one or more files to upload.

Content type

By default an asset is served with the content type that matches its file extension, for example image/png for a .png file.

To serve it with another type, edit the asset and set Content type. The field shows the type found from the extension as a placeholder. Leave it empty to keep using the type from the extension.

The value must be a type and subtype, such as text/plain or application/pdf, and can include parameters like text/html; charset=utf-8.

Response headers

Each asset can be served with its own response headers. Open the menu on the asset row and select Response headers to add or remove them. Headers are saved as soon as they are added.

Response header
Field Description
Key Header name without the trailing :, for example Cache-Control. Up to 127 characters.
Value Header value, up to 2048 characters.

How headers are sent

  • Custom headers replace any default header with the same name.
  • A name added more than once is sent once per value, for example two Set-Cookie headers.
  • Headers on a shared asset are sent on every domain that serves it.
  • A file without custom headers is sent with only the default headers.

Headers that can not be set

These headers control how the response itself is sent and are rejected: Content-Length, Transfer-Encoding, Connection, Keep-Alive, Upgrade, TE, Trailer and Proxy-Connection. Use the content type field instead of a Content-Type header.

Examples

Example headers
Key Value Effect
Content-Disposition attachment; filename="invoice.pdf" The browser downloads the file under the given name instead of showing it.
Cache-Control no-store The browser fetches the file again on every visit.
Access-Control-Allow-Origin * Pages on other domains can load the file with scripts.

Filters

Assets can use the same allow and deny lists as campaigns, so a file is only served to the visitors you choose. Open the menu on the asset row and select Filters. Set Filtering to Allow or Deny and select one or more filters under Lists. Pick None to remove all lists.

An asset uses either allow lists or deny lists, not both. Filtered assets are marked Filtered in the asset table.

Which lists can be used

  • Shared assets can use global lists.
  • Assets that belong to a company, on its domains or in its asset folder, can use that company's lists and global lists.

What a filtered visitor sees

  • A visitor that does not pass the lists gets the same response as if the file did not exist. A shared file with the same path is not served in its place.
  • Filtered files are sent with Cache-Control: private, no-store so browsers, proxies and CDNs do not store them and hand them to other visitors. A Cache-Control response header set on the asset replaces it.
  • If the filters can not be checked, for example because of a database error, the file is not served.
  • Filters on a shared asset apply on every domain that serves it.

Things to know

  • Deleting a list removes it from the campaigns and assets that use it. An asset with no lists left is served to everyone again.
  • Filters match on the visitor's IP, the same way campaign filters do. When Phishing Club runs behind a proxy or CDN, set ip_security.trusted_proxies so the real visitor IP is used. See Filtering.
  • Header rules can behave differently for files than for pages. Browsers send other headers when loading an image or script than when opening a page.
  • File paths are case sensitive. Run Phishing Club on a case sensitive filesystem, such as Linux, so a request with different letter case can not reach a filtered file.