Skip to main content
Phishmonger’s behavior is controlled through config.json and various DNS configurations. This guide covers all configuration options in detail.

Configuration File (config.json)

The config.json file in the Phishmonger root directory controls server behavior, authentication, and integrations.

Complete Configuration Example

Configuration Parameters

timezone (Required)

Specifies the server’s timezone for campaign scheduling and timestamp display. Format: IANA timezone database format Examples:
  • "America/New_York" - Eastern Time
  • "America/Chicago" - Central Time
  • "America/Los_Angeles" - Pacific Time
  • "Europe/London" - GMT/BST
  • "UTC" - Coordinated Universal Time
Usage: All scheduled campaigns use this timezone. The campaign scheduling interface displays the current server time based on this setting.

set_admin (Required)

Controls the first-time admin cookie setup mechanism. Parameters:
  • switch (boolean): Set to true for first-time setup, automatically changes to false after first use
  • search_string (string): URL parameter value that triggers admin cookie creation
How It Works:
  1. Visit https://yourdomain.com/?SetMeAdmin (using your configured search_string)
  2. Server sets the admin cookie
  3. switch automatically changes to false in config.json
  4. Subsequent visits to the URL have no effect
One-Time Setup: After the admin cookie is set, manually change switch back to true if you need to set the cookie again (e.g., after clearing browser cookies).
Defines the authentication cookie used for admin interface access. Parameters:
  • cookie_name (string): Name of the HTTP cookie
  • cookie_value (string): Secret value for authentication
Security Characteristics:
  • Cookie flags: secure, httponly, max-age=31536000 (1 year)
  • All routes except /documentation and set_admin URLs require this cookie
  • Cookie value is checked on every request
Critical Security Setting: This is the primary authentication mechanism. Use a cryptographically random value. Anyone with this cookie value has full admin access.
Generate a Secure Value:

signal_bot (Optional)

Configures Telegram bot notifications for campaign events. Parameters:
  • bot_id (string): Telegram bot token from @BotFather
  • chat_id (string): Telegram chat ID to receive notifications
Events That Trigger Notifications:
  • EMAIL_SENT: Email successfully sent
  • CLICK: Target clicked phishing link
  • POST_DATA: Target submitted form data
  • ERROR: Email delivery failure
Notification Format:
Setup Instructions:
1

Create Telegram Bot

Message @BotFather on Telegram and use /newbot command to create a bot. Save the bot token.
2

Get Chat ID

Start a conversation with your bot, then visit:
Look for the chat.id field in the response.
3

Add to Config

Add the bot token and chat ID to your config.json

phishmarket (Optional)

Configures integration with a Phishmarket server for remote template management. Parameters:
  • url (string): Base URL of Phishmarket server
  • token (string): API authentication token
Functionality:
  • Access pre-built phishing templates
  • Import templates directly into campaigns
  • Track template usage via market_id field
When configured, the admin interface displays a “Phishmarket” button providing access to remote templates.

DNS Configuration

Proper DNS configuration is critical for email deliverability and avoiding spam filters.

Required DNS Records

A Records

Point your domain and subdomains to your server IP:
Purpose:
  • @ (root domain): Main domain resolution
  • * (wildcard): All subdomain resolution
  • mx: Mail exchanger hostname

MX Record

Defines the mail server for your domain:
Priority: 10 (lower numbers have higher priority)
The trailing dot after mx.yourdomain.com. is important - it indicates a fully qualified domain name.

SPF Record (TXT)

Sender Policy Framework record authorizes your server to send email for your domain:
Record Breakdown:
  • v=spf1: SPF version 1
  • mx: Mail from servers listed in MX records is authorized
  • a: Mail from servers listed in A records is authorized
  • ptr: Reverse DNS lookup authorization
  • ip4:<server-ip>/32: Explicit IP authorization
  • -all: Fail all other sources (hard fail)
SPF Policy Options:
  • -all: Hard fail (reject unauthorized)
  • ~all: Soft fail (accept but mark as suspicious)
  • ?all: Neutral (no policy)
For testing, you might use ~all, but production should use -all.

DMARC Record (TXT)

Domain-based Message Authentication, Reporting & Conformance policy:
Policy Options:
  • p=none: Monitor mode (no action taken, reports only)
  • p=quarantine: Suspicious emails go to spam
  • p=reject: Reject unauthorized emails
Extended DMARC Example:
Parameters:
  • rua: Aggregate report email address
  • pct: Percentage of messages to apply policy to
  • fo: Failure reporting options
Start with p=none to monitor email flow, then tighten to p=quarantine or p=reject after verifying configuration.

DKIM Record (TXT)

DomainKeys Identified Mail provides cryptographic authentication:
Generate DKIM Keys:
The output is your public key for the DNS record. Key Files:
  • dkim_private.pem: Private key (keep secure, used for signing)
  • dkim_public.pem: Public key (published in DNS)
DKIM Selector: Phishmonger uses the selector default. This is configured in the nodemailer DKIM settings in index.js:

Verify DNS Configuration

After configuring DNS records, verify them: Check A Record:
Check MX Record:
Check SPF Record:
Check DMARC Record:
Check DKIM Record:

DNS Propagation

DNS changes can take time to propagate:
  • Minimum: 5-15 minutes
  • Typical: 1-4 hours
  • Maximum: 24-48 hours
Check propagation globally: https://www.whatsmydns.net/

SMTP Configuration

Phishmonger provides granular SMTP configuration per campaign.

Transport Settings

Configured via the campaign creation interface, SMTP settings include:

Mail Server

Purpose: Destination mail server for email delivery Options:
  • Target’s MX Server: Direct server-to-server delivery
  • SMTP Relay: Route through an authenticated relay
Finding Target MX Servers:
Example for Gmail:
Use the lowest priority server (5 in this example).

SMTP From

Purpose: Envelope sender (MAIL FROM in SMTP protocol) Format: sender@yourdomain.com Considerations:
  • Must match a domain you control for SPF/DKIM alignment
  • Can differ from the From: header in the email
  • Used for bounce messages

Secure Mail (TLS)

Options:
  • Enabled (port 465): Use SMTPS with TLS encryption
  • Disabled (port 25): Use unencrypted SMTP with optional STARTTLS
When to Use:
  • Port 465: Authenticated relays, commercial SMTP services
  • Port 25: Direct server-to-server delivery, most common for phishing

Authentication

Username/Password: Required for authenticated SMTP relays Relay Examples:
  • SendGrid
  • AWS SES
  • Mailgun
  • Office 365 SMTP
  • Gmail SMTP
Configuration for Relay:
Configuration for Direct Delivery:

DKIM Signing

Options: Enable/Disable per campaign When Enabled:
  • Phishmonger signs outgoing emails with setup/dkim_private.pem
  • Uses selector default and domain from SMTP From address
  • Adds DKIM-Signature header to email
Requirements:
  • dkim_private.pem must exist in setup/ directory
  • Corresponding public key published in DNS
  • SMTP From domain must match DKIM domain
Disable DKIM When:
  • Sending through a relay that does its own signing
  • Testing without proper DNS configuration
  • The SMTP From domain doesn’t match your configured DKIM domain

Database Configuration

Phishmonger uses SQLite for data storage. The database is created automatically on first run at db/aquarium.db.

Database Schema

campaigns Table:
templates Table:
targets Table:
events Table:

Database Backup

Regular backups are recommended:

Database Queries

Access the database directly:
Useful Queries:

Port Configuration

Phishmonger uses specific ports for different functions:

Firewall Configuration

Configure firewall to allow required ports: UFW (Ubuntu/Debian):
iptables:
Important: Port 4005 should NOT be exposed externally. NGINX handles external traffic and proxies to port 4005 locally.

Application Configuration (index.js)

Advanced configuration options are set directly in index.js:

Server Port

Change the listening port (default: 4005):
Note: If changing this, update the NGINX proxy_pass configuration accordingly.

Body Size Limit

Controls maximum request body size (default: ~19 MB):
Increase this value if capturing very large emails with many attachments.

SMTP Timeout

Modify SMTP connection timeout in the sendMail function:

Campaign Delay

Email sending delay is configured per-campaign in the database (default: 30 seconds). Access via the campaign settings interface or directly in the database:

Logging Configuration

Phishmonger uses Bunyan for structured logging during email operations.

SMTP Command Logging

SMTP protocol commands are logged in real-time and sent to the web interface via WebSockets. View them in the campaign creation interface during test sends.

NGINX Logs

Access Log: /var/log/nginx/vhosts/yourdomain.com/access.log Error Log: /var/log/nginx/vhosts/yourdomain.com/error.log Tail Logs:

Application Logs

Fastify logs to stdout. Capture logs when running:

Security Hardening

HTTPS Configuration

The generated NGINX configuration includes secure TLS settings:
Enable TLSv1.3 Only (Most Secure):

File Permissions

Secure sensitive files:
Admin cookie is set with secure flags:
  • secure: Only sent over HTTPS
  • httponly: Not accessible via JavaScript
  • max-age: Valid for 1 year

Database Security

Restrict database access: