Skip to content

gh0st-bit/PhishNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎣 PhishNet - Advanced Phishing Simulation Platform

Node.js TypeScript PostgreSQL

πŸš€ One-Command Setup β€’ πŸ”’ Enterprise Grade


🌟 Overview

PhishNet is a professional phishing simulation platform designed for cybersecurity training and awareness. Features advanced templates, real-time analytics, and enterprise-grade security.

✨ Key Features

  • 🎣 Advanced Phishing Campaigns with professional templates
  • πŸ“Š Real-Time Analytics and detailed reporting
  • 🏒 Multi-Tenant Support for organizations
  • πŸ”’ Role-Based Access Control and security features

⚑ Quick Setup

πŸš€ One-Command Deployment

Linux/macOS:

git clone https://github.com/gh0st-bit/PhishNet.git
cd PhishNet/phisnet
chmod +x deploy.sh
./deploy.sh

Windows PowerShell:

git clone https://github.com/gh0st-bit/PhishNet.git
cd PhishNet\phisnet
# Fix PowerShell execution policy if needed
Set-ExecutionPolicy Bypass -Scope Process -Force
# Run the deployment script
.\deploy.ps1

Windows (Easiest Method):

git clone https://github.com/gh0st-bit/PhishNet.git
cd PhishNet\phisnet
universal-setup.bat

This universal setup script automatically handles:

  • Execution policy issues
  • Deployment and startup in one command
  • Error recovery with fallback options
  • Both development and production modes

Run universal-setup.bat --help to see all options.

Note: Legacy container quick start removed. Use the platform scripts above for local setup.


πŸ”‘ Default Access

  • URL: http://localhost:3000
  • Email: admin@phishnet.local
  • Password: admin123

⚠️ Change the default password immediately after first login!


πŸ› οΈ Manual Setup (If Needed)

If automatic deployment fails, you can set up manually:

Prerequisites

  • Node.js 18+
  • PostgreSQL 15+
  • Redis
  • Git

πŸ—„οΈ Automatic Database Setup

The deployment scripts automatically handle database creation and setup:

# 1. Clone repository
git clone https://github.com/gh0st-bit/PhishNet.git
cd PhishNet/phisnet

# 2. Install dependencies
npm install

# 3. Complete Automated Setup (NEW ENHANCED VERSION!)
# The deploy scripts now automatically handle:
# βœ… Database creation with proper user permissions
# βœ… Complete environment configuration with secure defaults
# βœ… Required directory creation (logs, uploads, temp, exports, backups)
# βœ… Database schema application from SQL files
# βœ… Sample data import with admin user creation
# βœ… Fallback to manual SQL import if npm scripts fail
# βœ… Database connection verification and table counting
# βœ… Security settings with auto-generated secrets

# Run the complete setup (everything automated):
npm run setup

# Or run individual steps:
npm run db:push        # Create/update database schema
npm run import-data    # Import sample data and admin user

# 4. Environment Auto-Configuration (NEW!)
# .env file is automatically created with:
# - Database URL (postgresql://postgres@localhost:5432/phishnet)
# - Redis configuration for sessions
# - Auto-generated security secrets
# - Complete application settings
# - Email configuration (optional)
# - Upload and logging settings
# - Feature toggles and admin account details

# 5. Verify Everything Works (NEW!)
./verify-setup.sh      # Linux/macOS
.\verify-setup.ps1     # Windows
# This checks: Node.js, PostgreSQL, Redis, database tables, 
# environment files, project structure, and connections

# 6. Start application
npm run dev

πŸ”„ Database Management Commands

# Reset database completely (removes all data)
./reset-db.sh          # Linux/macOS
.\reset-db.ps1         # Windows (if available)

# Or use npm scripts:
npm run db:push        # Update schema only
npm run import-data    # Re-import sample data
npm run setup          # Complete setup (schema + data)

# Check database status
psql -U postgres -d phishnet -c "\dt"  # List tables

πŸ“Š Database Configuration

Automatic Setup Includes:

  • βœ… Database: phishnet
  • βœ… User: postgres (default PostgreSQL user)
  • βœ… Schema: Complete PhishNet tables and relationships
  • βœ… Sample Data: Templates, campaigns, and admin user
  • βœ… Extensions: Required PostgreSQL extensions
  • βœ… Permissions: Proper access controls

Default Admin Account:

  • Email: admin@phishnet.local
  • Password: admin123
  • Role: Super Administrator

πŸ“¦ Package for Friends

Create a complete package with your data for easy sharing:

./create-package.sh

This creates a package containing:

  • Complete PhishNet source code
  • Your database with campaigns and templates
  • Automated setup scripts
  • All configuration files

�️ Supported Platforms

Automatically Detected:

  • πŸ‰ Kali Linux (with auto-fixes)
  • 🐧 Ubuntu/Debian
  • 🎩 CentOS/RHEL/Rocky
  • 🎁 Fedora
  • ⚑ Arch/Manjaro
  • πŸͺŸ Windows 10/11
  • 🍎 macOS (Intel/ARM)

Database Configuration

  • πŸ—„οΈ Automatic Database Creation: Creates phishnet database with postgres user
  • πŸ“Š Schema Management: Uses Drizzle ORM with automated migrations
  • πŸ”’ Secure Setup: Proper permissions and PostgreSQL extensions
  • πŸ“ˆ Sample Data: Pre-loaded templates, campaigns, and admin account
  • πŸ”„ Easy Reset: Simple database reset and restoration commands

πŸ“š Quick Commands

# Start development server
./start.sh              # Linux/macOS
.\start.ps1             # Windows

# Deploy production
./deploy.sh --production

# Database Management
./reset-db.sh           # Complete database reset
npm run setup           # Schema + sample data
npm run db:push         # Update schema only
npm run import-data     # Import sample data

# Verify Setup (NEW!)
./verify-setup.sh       # Linux/macOS - Check installation
.\verify-setup.ps1      # Windows - Check installation

# Create shareable package
./create-package.sh

# Fix Kali Linux issues
./kali-quick-fix.sh

# Database Troubleshooting
psql -U postgres -d phishnet -c "\l"    # List databases
psql -U postgres -d phishnet -c "\dt"   # List tables
psql -U postgres -d phishnet -c "\du"   # List users

πŸ› οΈ Troubleshooting Common Issues

PowerShell Execution Policy Errors

If you see errors like "File cannot be loaded because running scripts is disabled on this system":

# Method 1: Use our universal setup script (recommended)
universal-setup.bat    # For cmd.exe users
.\universal-setup.ps1  # For PowerShell users

# Method 2: Use our safe batch files
deploy-safe.bat   # Instead of deploy.bat
start-safe.bat    # Instead of start.bat

# Method 3: Run this command in PowerShell as Administrator
Set-ExecutionPolicy Bypass -Scope Process -Force

# Method 4: For a more permanent solution
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force

See POWERSHELL-EXECUTION-FIX.md for detailed troubleshooting steps.

Database Connection Issues

If the application can't connect to the database:

# Check if PostgreSQL is running
# Windows:
Get-Service postgresql*

# Linux/macOS:
sudo systemctl status postgresql

# Verify database exists:
psql -U postgres -c "SELECT datname FROM pg_database WHERE datname='phishnet';"

Node.js Version Issues

The application works best with Node.js LTS versions (preferably Node 20):

# Check Node version
node -v

# If using nvm, switch to Node 20
nvm install 20
nvm use 20

πŸ—„οΈ Database Details

Automatic Database Setup

PhishNet automatically creates and configures a complete PostgreSQL database:

Database Structure:

  • Database Name: phishnet
  • User: postgres (default system user)
  • Tables: 15+ tables for campaigns, templates, users, analytics
  • Extensions: plpgsql, uuid-ossp (auto-installed)
  • Sample Data: Ready-to-use templates and admin account

Schema Files:

  • migrations/00_phishnet_schema.sql - Complete database schema
  • migrations/01_sample_data.sql - Sample templates and admin user
  • migrations/create_notifications.sql - Notification system
  • migrations/fix-missing-columns.sql - Schema updates

Database Reset Process:

# Automated reset (recommended)
./reset-db.sh

# Manual reset process:
sudo -u postgres psql -c "DROP DATABASE IF EXISTS phishnet;"
sudo -u postgres psql -c "CREATE DATABASE phishnet;"
npm run db:push         # Apply schema
npm run import-data     # Load sample data

🎯 Architecture

  • Frontend: React + TypeScript + Tailwind CSS
  • Backend: Node.js + Express + TypeScript
  • Database: PostgreSQL with Drizzle ORM
  • Cache: Redis for sessions
  • Deployment: Universal scripts

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❀️ for the cybersecurity community

Report Issues β€’ Documentation β€’ Support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •