config.json and various DNS configurations. This guide covers all configuration options in detail.
Configuration File (config.json)
Theconfig.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
set_admin (Required)
Controls the first-time admin cookie setup mechanism. Parameters:- switch (boolean): Set to
truefor first-time setup, automatically changes tofalseafter first use - search_string (string): URL parameter value that triggers admin cookie creation
- Visit
https://yourdomain.com/?SetMeAdmin(using your configured search_string) - Server sets the admin cookie
switchautomatically changes tofalsein config.json- Subsequent visits to the URL have no effect
admin_cookie (Required)
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
- Cookie flags:
secure,httponly,max-age=31536000(1 year) - All routes except
/documentationandset_adminURLs require this cookie - Cookie value is checked on every request
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
EMAIL_SENT: Email successfully sentCLICK: Target clicked phishing linkPOST_DATA: Target submitted form dataERROR: Email delivery failure
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
- Access pre-built phishing templates
- Import templates directly into campaigns
- Track template usage via
market_idfield
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:@(root domain): Main domain resolution*(wildcard): All subdomain resolutionmx: Mail exchanger hostname
MX Record
Defines the mail server for your domain: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:v=spf1: SPF version 1mx: Mail from servers listed in MX records is authorizeda: Mail from servers listed in A records is authorizedptr: Reverse DNS lookup authorizationip4:<server-ip>/32: Explicit IP authorization-all: Fail all other sources (hard fail)
-all: Hard fail (reject unauthorized)~all: Soft fail (accept but mark as suspicious)?all: Neutral (no policy)
~all, but production should use -all.
DMARC Record (TXT)
Domain-based Message Authentication, Reporting & Conformance policy:p=none: Monitor mode (no action taken, reports only)p=quarantine: Suspicious emails go to spamp=reject: Reject unauthorized emails
rua: Aggregate report email addresspct: Percentage of messages to apply policy tofo: 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:dkim_private.pem: Private key (keep secure, used for signing)dkim_public.pem: Public key (published in DNS)
default. This is configured in the nodemailer DKIM settings in index.js:
Verify DNS Configuration
After configuring DNS records, verify them: Check A Record:DNS Propagation
DNS changes can take time to propagate:- Minimum: 5-15 minutes
- Typical: 1-4 hours
- Maximum: 24-48 hours
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
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
- 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
DKIM Signing
Options: Enable/Disable per campaign When Enabled:- Phishmonger signs outgoing emails with
setup/dkim_private.pem - Uses selector
defaultand domain from SMTP From address - Adds
DKIM-Signatureheader to email
dkim_private.pemmust exist insetup/directory- Corresponding public key published in DNS
- SMTP From domain must match DKIM domain
- 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 atdb/aquarium.db.
Database Schema
campaigns Table:Database Backup
Regular backups are recommended:Database Queries
Access the database directly:Port Configuration
Phishmonger uses specific ports for different functions:| Port | Purpose | Protocol | Notes |
|---|---|---|---|
| 25 | SMTP (send/receive) | TCP | Required for email operations |
| 80 | HTTP | TCP | NGINX redirect to HTTPS |
| 443 | HTTPS | TCP | NGINX reverse proxy |
| 4005 | Application | TCP | Node.js (localhost only) |
Firewall Configuration
Configure firewall to allow required ports: UFW (Ubuntu/Debian):Application Configuration (index.js)
Advanced configuration options are set directly inindex.js:
Server Port
Change the listening port (default: 4005):Body Size Limit
Controls maximum request body size (default: ~19 MB):SMTP Timeout
Modify SMTP connection timeout in thesendMail 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:File Permissions
Secure sensitive files:Cookie Security
Admin cookie is set with secure flags:secure: Only sent over HTTPShttponly: Not accessible via JavaScriptmax-age: Valid for 1 year