Automated Setup: For faster deployment, check out Flik to automate Phishmonger setup. Using a Gandi.net account makes DNS setup particularly streamlined.
Prerequisites
Before beginning installation, ensure you have:- A Linux server (Debian/Ubuntu recommended) with root or sudo access
- A registered domain name with DNS control
- Public IP address
- Node.js 12+ and npm installed
- Port 25 open for SMTP (both inbound and outbound)
- Ports 80 and 443 available for web interface
Step 1: Clone Repository
Clone the Phishmonger repository to your server:Step 2: Install Node.js Dependencies
Install the required Node.js packages:Key Dependencies Installed
The installation includes: Core Framework- fastify: High-performance web framework
- express: Compatibility layer
- fastify-socket.io: WebSocket support for real-time updates
- fastify-cookie: Cookie parsing and handling
- fastify-oas: OpenAPI documentation
- nodemailer: SMTP client for sending emails
- smtp-server: SMTP server for capturing emails
- smtp-client: Low-level SMTP protocol control
- better-sqlite3: SQLite database
- bunyan: Structured logging
- dateformat: Date formatting for email headers
- node-schedule: Campaign scheduling
- prompts: Interactive CLI prompts
- node-rsa: RSA key generation for DKIM
- got: HTTP client for API calls
Step 3: Configure DNS Records
Proper DNS configuration is critical for email deliverability. You need to configure several DNS records for your phishing domain.Manual DNS Configuration
Configure the following DNS records at your domain registrar: A RecordsThe DKIM public key will be generated in the next step. You’ll need to update this record after generating your DKIM keypair.
Automated DNS Configuration (Gandi)
If using Gandi.net as your domain registrar, Phishmonger includes an automated setup script:- Your Gandi domain
- Gandi API key
- Server IP address (defaults to current server’s public IP)
- Generates or uses existing DKIM keypair (dkim_private.pem, dkim_public.pem)
- Queries existing DNS records via Gandi API
- Creates/updates all required DNS records (A, MX, SPF, DMARC, DKIM)
- Deletes any conflicting stock records
Generate DKIM Keypair
If not using the Gandi automated script, generate a DKIM keypair manually:- dkim_private.pem: Private key for signing (keep secure)
- dkim_public.pem: Public key for DNS TXT record
Step 4: Configure Reverse Proxy
Phishmonger runs on port 4005 by default. Configure a reverse proxy with TLS termination.NGINX Configuration
The includeddomain_setup.sh script generates an NGINX configuration:
- NGINX installed (
apt install nginx) - Let’s Encrypt certificates already obtained
- Certificates located at
/etc/letsencrypt/live/yourdomain.com/
Obtain Let’s Encrypt Certificates
Before running the setup script, obtain TLS certificates:Alternative: Manual Certificate with DNS Challenge
Alternative: Manual Certificate with DNS Challenge
For wildcard certificates without NGINX pre-configuration:Follow the prompts to create required TXT records for domain verification.
Generated NGINX Configuration
The script creates/etc/nginx/sites-available/yourdomain.com.conf:
Enable and Restart NGINX
Step 5: Configure Phishmonger
Create aconfig.json file in the Phishmonger root directory. An example configuration:
Configuration Parameters
timezone (required)- Server timezone for campaign scheduling
- Use IANA timezone format (e.g., “America/New_York”, “Europe/London”)
- switch: Set to
truefor first-time setup - search_string: URL parameter to set admin cookie on first visit
- After accessing
https://yourdomain.com/?SetMeAdmin, the switch sets tofalse
- cookie_name: Name of the authentication cookie (default: “admin_cookie”)
- cookie_value: Secret value for admin authentication (CHANGE THIS!)
- bot_id: Telegram bot ID for notifications
- chat_id: Telegram chat ID for notifications
- Sends notifications on EMAIL_SENT, CLICK, POST_DATA, and ERROR events
- url: Phishmarket server URL for remote template integration
- token: API authentication token
Step 6: Launch Phishmonger
Start the Phishmonger server in a screen or tmux session:Ctrl+A then D to detach from the screen session.
Expected Console Output
Successful startup shows:Verify Server Status
Check that the server is running:Step 7: Access Admin Interface
Set Admin Cookie
On first access, visit:SetMeAdmin with the value specified in config.json under set_admin.search_string.
This sets the admin cookie and redirects to /admin. The set_admin.switch automatically sets to false in the config file after first use.
Access Admin Dashboard
Navigate to:- Create Campaign
- View Campaigns
- Manage Templates
- Access Phishmarket (if configured)
File Structure
After installation and configuration, your directory structure should include:Verification
Test Web Interface
- Access homepage:
https://yourdomain.com/ - Access admin interface:
https://yourdomain.com/admin - Access API documentation:
https://yourdomain.com/documentation
Test Email Capture
From a local machine running Outlook:- Navigate to
https://yourdomain.com/create_campaign - Click “Capture Email” button
- Send an email from Outlook to
test@yourdomain.com - Verify the email appears in the web interface
Test Database
Verify the SQLite database was created:templates, campaigns, targets, events
Post-Installation Steps
After successful installation:- Review the Configuration guide for advanced settings
- Review Creating Campaigns to create your first phishing campaign
- Review Templates for email templating
- Configure Integrations for Humble Chameleon or Phishmarket
- Set up Telegram notifications for real-time alerts
Troubleshooting Installation
Port 25 Blocked
If port 25 is blocked:NGINX Fails to Start
Check for port conflicts:Node.js Server Fails to Start
Check if port 4005 is already in use:Cannot Access Admin Interface
Verify admin cookie is set:- Clear browser cookies
- Re-visit
https://yourdomain.com/?SetMeAdmin - Check
config.jsonto verifyset_admin.switchis nowfalse
Security Recommendations
After installation:- Firewall Configuration: Restrict port 4005 to localhost only
- Admin Cookie: Use a cryptographically random value for
admin_cookie.cookie_value - HTTPS Only: Ensure all traffic uses HTTPS via NGINX redirect
- Regular Updates: Keep Node.js dependencies updated with
npm audit - Log Monitoring: Regularly review NGINX and application logs
- Backup Database: Regularly backup
db/aquarium.db - DKIM Private Key: Protect
setup/dkim_private.pemwith appropriate file permissions