Skip to content

hacketthadwin/CF-Guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExamProctor - Secure Examination Environment System

.NET Platform License Status

A comprehensive network and application blocking system for secure examination environments. Permits network access exclusively to Codeforces.com while preventing unauthorized application execution during competitive programming assessments.


🎯 What Makes This Different?

  • OS-Level Security - Leverages Windows infrastructure without browser plugins or video surveillance
  • User-Mode Implementation - No expensive EV certificates or kernel drivers required
  • Three-Layer Defense - Enhanced process verification prevents executable renaming bypasses
  • Dynamic IP Management - Automatic CDN rotation handling with periodic DNS updates
  • Detection Systems - Identifies VPN connections and virtual machine environments

✨ Key Features

🔒 Application Blocking (Process Watchdog)

Three-Layer Defense Against Masquerading:

  • PID Blacklist - Tracks terminated processes, prevents race conditions
  • Process Refresh - Eliminates stale cached data
  • PE Header Verification - Validates true executable identity

Detects renamed executables (e.g., cmd.exemsedge.exe) by reading OriginalFilename from Windows PE metadata. Scans every 2 seconds, terminates unauthorized apps including child processes.

🌐 Network Filtering (Firewall Manager)

IP-Based Whitelisting:

  • Default-Deny Policy - Blocks all traffic except whitelisted IPs
  • Dynamic DNS Resolution - Updates Codeforces IPs every 3 minutes
  • CDN Support - Handles Cloudflare IP rotation automatically
  • Multi-Domain - Main site, mirrors, static servers, CDN infrastructure

Only HTTP/HTTPS (ports 80/443) allowed to Codeforces IP addresses.

🛡️ VPN Detection

Real-Time Monitoring:

  • Network adapter analysis (TAP/TUN interfaces)
  • VPN service detection (OpenVPN, WireGuard, NordVPN, etc.)
  • Process scanning for VPN executables

Scans every 2 seconds. Detections logged to Event Viewer for audit.

🖥️ Virtual Machine Detection

Environment Analysis:

  • BIOS manufacturer strings (VirtualBox, VMware, Hyper-V)
  • Guest addition processes (vboxservice, vmtoolsd)
  • MAC address vendor identification
  • System property validation

Runs once at startup. Detections logged to Event Viewer.

🔄 Inter-Process Communication

Two-Pipe Architecture:

  • Separate command/response channels prevent deadlocks
  • Named Pipes with access control for Session 0
  • Asynchronous command processing
  • Simple protocol: ENTER, EXIT, STATUS, REFRESH

🚀 Quick Start

Prerequisites

  • Windows 10 (1809+) or Windows 11 (x64)
  • .NET 10.0 Runtime (Download)
  • Administrator privileges
  • ⚠️ Test in Virtual Machine first

Usage

  1. Navigate to ExamProctor_2 folder
  2. Right-click ProctorLauncher.exeRun as administrator
  3. Click "Start Exam" to activate
  4. Click "Stop Exam" to deactivate

During Exam Mode:

  • ✅ Codeforces.com accessible
  • ❌ Other websites blocked
  • ❌ Unauthorized apps terminated within 2 seconds
  • 📋 VPN/VM detections logged

📂 Project Structure

ExamProctor/ ├── ExamProctor_2/ # Main application folder │ └── ProctorLauncher.exe # Launch this (as admin) ├── ProctorAppGUI/ # GUI source ├── ProctorLauncher/ # Launcher source ├── ProctorService/ # Windows Service source │ ├── ProcessWatchdog.cs # App blocking (3-layer) │ ├── FirewallManager.cs # Network filtering │ ├── DynamicIPResolver.cs # DNS updates │ ├── VPNDetector.cs # VPN detection │ └── VMDetector.cs # VM detection └── ProctoringSolution.slnx # VS solution 

🛠️ System Architecture

ProctorLauncher.exe (GUI) ↓ Named Pipes IPC ProctorService.exe (Windows Service) ├── Process Watchdog (3-layer, 2-sec scans) ├── Firewall Manager (IP whitelist) ├── IP Resolver (3-min DNS updates) ├── VPN Detector (2-sec scans) └── VM Detector (startup check) 

⚙️ Technical Stack

  • .NET 10.0 / C# 10.0
  • Windows Service (Session 0, LocalSystem)
  • Windows Filtering Platform APIs
  • Named Pipes for IPC
  • WMI for detection
  • FileVersionInfo for PE headers

Scan Intervals:

  • Process watchdog: 2 seconds
  • VPN detection: 2 seconds
  • IP resolution: 3 minutes
  • VM detection: Once at startup

⚠️ Important Notes

Testing Warning

🔴 Always test in VM first (VirtualBox, VMware, Hyper-V)

System modifies:

  • Windows Firewall (default-deny)
  • Process management
  • Network configuration

Current Behavior

  • VPN/VM Detection: Logged only (not blocked)
  • Service: Can be stopped by administrators
  • Internet: Required for DNS resolution

🤝 Contributing

Contributions welcome for:

  • Process whitelist improvements
  • Detection enhancements
  • Codeforces/Cloudflare issues
  • Documentation

⭐ Star this repo if you find it useful!

Report Bug · Request Feature

About

A comprehensive network and application blocking system for secure examination environments. Permits network access exclusively to Codeforces.com while preventing unauthorized application execution during competitive programming assessments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages