A Bash-based Privacy & VPN Management Suite for Linux
TraceProtocol is a comprehensive Bash-based command-line tool for secure network configuration, privacy enhancement, and system automation on Linux systems. Built with security in mind, it provides a unified interface for managing VPN connections, DNS encryption, MAC address randomization, and advanced privacy tools.
Watch the video tutorial to see TraceProtocol in action:
- Video Tutorial
- Features
- Installation
- Usage
- Technologies Used
- Project Structure
- Security Features
- Monitoring
- Configuration
- Logs
- Troubleshooting
- Contributing
- License
- Acknowledgments
- Support
- Automated VPN Management - ProtonVPN CLI with automatic server selection and connection management
- Local DNS Caching - High-performance DNS caching using dnsmasq for faster domain resolution
- Encrypted DNS Queries - Secure DNS resolution via dnscrypt-proxy to prevent DNS leaks and surveillance
- MAC Address Randomization - Hardware address anonymization using macchanger to prevent device tracking
- Tor Integration - Anonymous browsing and traffic routing through the Tor network
- Kill Switch Protection - iptables-based network blocking when VPN disconnects to prevent IP leaks
- Application Sandboxing - Firejail integration for running untrusted applications in isolated environments
- AppArmor Integration - Mandatory access control for enhanced system security
- System Cleaner - BleachBit integration for privacy-focused system maintenance
- Real-time Status Monitor - Command-line script showing all privacy tools status
- Desktop Widget - Conky-based desktop widget for continuous system monitoring
- VPN Connection Manager - One-command VPN connect/disconnect with server selection
- Kill Switch Management - Enable/disable iptables-based kill switch protection
- MAC Address Control - Randomize or restore MAC addresses on demand
- Detailed Logging - Complete audit trail of all system changes and operations
- Configuration Management - Centralized configuration file for easy customization
- Linux system (Debian/Ubuntu-based distributions recommended)
- Root/sudo access for system-level configurations
- Internet connection for package installation and VPN connectivity
- ProtonVPN account (free or paid)
git clone https://github.com/mrxcherif/traceprotocol.git
cd traceprotocolchmod +x trace-protocol.sh
chmod +x scripts/*.shsudo ./trace-protocol.sh installWhat this Bash script does:
- Updates your system package manager
- Installs required privacy and security packages (ProtonVPN CLI, Tor, dnscrypt-proxy, dnsmasq, macchanger, AppArmor, Firejail, BleachBit, iptables)
- Configures Tor service
- Installs and configures DNSCrypt-Proxy (listens on 127.0.0.1:5300)
- Configures dnsmasq to forward to DNSCrypt-Proxy and enables caching
- Sets up MAC address randomization (boot and network events)
- Enables AppArmor and creates Conky dashboard helpers
- Creates iptables-based kill switch manager
- Creates configuration files and log directories
./trace-protocol.sh [COMMAND]| Command | Description |
|---|---|
install |
Install all privacy tools and ProtonVPN |
uninstall |
Uninstall all privacy tools |
monitor |
Check status of all privacy tools |
vpn-connect |
Connect to ProtonVPN (fastest server) |
vpn-disconnect |
Disconnect from ProtonVPN |
vpn-status |
Show ProtonVPN connection status |
vpn-login |
Login to ProtonVPN account |
vpn-logout |
Logout from ProtonVPN account |
killswitch-on |
Enable VPN kill switch (iptables-based) |
killswitch-off |
Disable VPN kill switch |
killswitch-status |
Check kill switch status |
mac-randomize |
Randomize MAC address immediately |
mac-restore |
Restore MAC address to original |
clean-logs |
Clean all log files |
help |
Show help message |
version |
Show version information |
# Login to ProtonVPN
./trace-protocol.sh vpn-login
# Connect to VPN
./trace-protocol.sh vpn-connect
# Enable kill switch for safety
./trace-protocol.sh killswitch-on
# Check everything is working
./trace-protocol.sh monitor# Check VPN status only
./trace-protocol.sh vpn-status
# Disconnect from VPN
./trace-protocol.sh vpn-disconnect
# Check kill switch status
./trace-protocol.sh killswitch-status
# Randomize MAC address manually
./trace-protocol.sh mac-randomize
# Restore original MAC address
./trace-protocol.sh mac-restore
# Clean all logs
./trace-protocol.sh clean-logsTraceProtocol combines Bash as the core scripting language with powerful privacy and security tools:
Core Architecture:
- Bash Scripts - Linux-focused shell scripts for Debian/Ubuntu systems
- ProtonVPN CLI - Secure VPN connections with automatic server selection and kill switch
- dnsmasq - High-performance DNS caching for faster domain resolution
- dnscrypt-proxy - Encrypted DNS queries to prevent DNS leaks and surveillance
- macchanger - Hardware address anonymization to prevent device tracking
- Tor - Installed and managed as a service; monitored by the desktop widget
- iptables - Network filtering for kill switch protection
- AppArmor - Enabled to harden the system; status reported by monitor
- Firejail - Available for sandboxing applications
- BleachBit - Available for privacy cleaning
- Conky - Desktop widget for real-time system monitoring
traceprotocol/
βββ trace-protocol.sh # Main control script
βββ scripts/
β βββ install.sh # Installation script
β βββ monitor.sh # Monitoring script
β βββ mac-changer.sh # MAC randomization (manual)
β βββ mac-randomize-boot.sh # Boot-time MAC randomization
β βββ vpn-login.sh # ProtonVPN login helper
β βββ killswitch-manager.sh # iptables-based kill switch manager
β βββ uninstall.sh # Uninstaller
βββ logs/ # Log files directory
βββ docs/ # Documentation directory
βββ privacy-tools.conf # Configuration file (created after install)
βββ README.md # This file
βββ LICENSE # MIT License
βββ CONTRIBUTING.md # Contribution guidelines
βββ .gitignore # Git ignore rules
tor- The Onion Routerdnscrypt-proxy- DNS encryptiondnsmasq- DNS caching and forwardingmacchanger- MAC address randomizationprotonvpn-cli- ProtonVPN CLI
apparmor- Mandatory access controlapparmor-utils- AppArmor utilitiesiptables- Network filtering (used for kill switch)firejail- Sandboxing tool
bleachbit- System cleanertorbrowser-launcher- Tor Browser installer
curl- Data transfer toolwget- File downloaderdnsutils- DNS utilitiescoreutils- Core utilitiesconky-all- Desktop widget system
Prevents all network traffic if VPN disconnects, protecting against IP leaks. Uses iptables rules to block all traffic except VPN connections.
./trace-protocol.sh killswitch-onRoutes DNS queries through encrypted channels (dnsmasq β DNSCrypt-Proxy β Encrypted DNS).
Randomizes hardware addresses to prevent tracking. Automatically configured for boot-time and network events.
./trace-protocol.sh mac-randomizeFirejail available to run untrusted applications in isolated environments.
AppArmor mandatory access control enabled for enhanced system security.
Real-time monitoring and protection against IP address exposure when VPN disconnects.
The monitor provides real-time status of:
- β Package Status - All installed privacy tools
- β Service Status - Running services and uptime
- β VPN Status - Connection status, server, IP
- β Kill Switch - Enabled/disabled status (iptables-based)
- β DNS Configuration - Local/remote DNS
- β DNS Leak Test - DNS server verification
- β MAC Randomization - Configuration status
- β Public IP - Current public IP address
- β IP Protection - VPN protection status
- β Tor Status - Tor service monitoring
- β AppArmor Status - Security framework status
βββ ProtonVPN Status βββ
β ProtonVPN CLI is installed
β ProtonVPN is connected
βΉ Server: US-FREE#1 | IP: 1.2.3.4
β Kill switch is enabled
βββ Network Information βββ
βΉ Public IP address: 1.2.3.4
β IP is protected by VPN
After installation, a configuration file is created at privacy-tools.conf:
# VPN Settings
VPN_ENABLED=true
VPN_AUTOCONNECT=false
# Privacy Settings
TOR_ENABLED=true
DNSCRYPT_ENABLED=true
MAC_RANDOMIZATION=true
# Monitoring Settings
MONITOR_INTERVAL=60
LOG_RETENTION_DAYS=30Edit this file to customize your setup.
All operations are logged to the logs/ directory:
install_YYYYMMDD_HHMMSS.log- Installation logsmonitor_YYYYMMDD.log- Daily monitoring logs
Clean all logs with:
./trace-protocol.sh clean-logsContributions are welcome! This project is built entirely with Bash scripts for Linux systems, so we follow strict shell scripting best practices.
Code Standards:
- Use Linux-focused Bash syntax for Debian/Ubuntu compatibility
- Always include proper shebang (
#!/bin/bash) at the top of scripts - Use
set -euo pipefailfor strict error handling - Follow consistent indentation (4 spaces, no tabs)
- Use meaningful variable names and add comments for complex logic
- Quote all variables to prevent word splitting (
"$variable")
Script Structure:
#!/bin/bash
set -euo pipefail
# Script description and usage
# Author: Mr Cherif
# Version: 1.0
# Configuration
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly LOG_FILE="/var/log/traceprotocol.log"
# Functions
log_info() {
echo "[INFO] $(date): $*" | tee -a "$LOG_FILE"
}
# Main script logic
main() {
log_info "Starting TraceProtocol operation"
# Your code here
}
# Script execution
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
main "$@"
fiTesting Requirements:
- Test scripts on Linux systems (Debian/Ubuntu-based distributions)
- Use shellcheck for static analysis:
shellcheck script.sh - Test error handling with invalid inputs and edge cases
- Verify Linux compatibility with apt, systemctl, iptables commands
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Follow Bash best practices (see guidelines above)
- Test thoroughly on multiple systems
- Run shellcheck on your scripts
- Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request with detailed description
# Install development tools
sudo apt-get install shellcheck bash-completion
# Run static analysis
shellcheck trace-protocol.sh scripts/*.sh
# Test Linux compatibility
bash -n trace-protocol.sh- Check login:
./trace-protocol.sh vpn-login - Check status:
./trace-protocol.sh vpn-status - Check logs:
tail -f logs/install_*.log
# Check service status
sudo systemctl status tor
sudo systemctl status dnscrypt-proxy
sudo systemctl status dnsmasq
# Restart services manually
sudo systemctl restart tor
sudo systemctl restart dnscrypt-proxy
sudo systemctl restart dnsmasqIf kill switch is blocking your internet when VPN is off:
./trace-protocol.sh killswitch-offThis will restore normal internet access by removing iptables rules.
If DNSCrypt-Proxy is not responding or configured:
# Check monitor - it will automatically fix DNSCrypt issues
./trace-protocol.sh monitor
# The monitor will:
# - Start DNSCrypt-Proxy service if stopped
# - Start dnsmasq service if stopped
# - Test DNS encryption chain
# - Fix configuration issues automaticallyMake sure scripts are executable:
chmod +x trace-protocol.sh
chmod +x scripts/*.sh-
ProtonVPN Account Required - You need a ProtonVPN account (free or paid) to use the VPN features.
-
System Reboot Recommended - After installation, reboot your system to apply all changes and ensure MAC randomization works properly.
-
Kill Switch Warning - When enabled, kill switch will block all internet if VPN disconnects. Disable it if you need internet access without VPN.
-
MAC Randomization - Automatically configured for boot-time and network events. Use
./trace-protocol.sh mac-randomizeto change immediately. -
Linux Only - This tool only works on Linux systems (Debian/Ubuntu-based distributions). Not compatible with macOS or Windows.
-
Root/Sudo Required - Installation and kill switch management require root privileges for system-level configurations.
-
DNS Encryption - Monitor automatically fixes DNSCrypt issues. Run
./trace-protocol.sh monitorif DNS problems occur.
Stay tuned for upcoming updates that will include:
- Multi-OS Support - macOS and Windows compatibility with native implementations
- Advanced VPN Management - Support for multiple VPN providers beyond ProtonVPN
- Enhanced Privacy Features - Additional privacy tools and security enhancements
- Cross-Platform Monitoring - Unified monitoring system across all supported operating systems
- Privacy Analytics Dashboard - Comprehensive privacy metrics and leak detection reports
- Automated Privacy Hardening - One-click system security optimization
Follow the project on GitHub to get notified of new releases!
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License Summary:
- β Commercial use allowed
- β Modification allowed
- β Distribution allowed
- β Private use allowed
- β No liability or warranty provided
TraceProtocol is built on top of these excellent privacy and security tools:
- ProtonVPN - Secure VPN service
- Tor Project - Anonymity network
- DNSCrypt - DNS encryption
- dnsmasq - DNS caching and forwarding
- macchanger - MAC address randomization
- AppArmor - Mandatory access control
- Firejail - Application sandboxing
- BleachBit - System cleaner
- Conky - Desktop widget system
- Privacy and open-source community
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing issues and documentation
- Contribute to the project
- Connect on LinkedIn for professional discussions
TraceProtocol - Stay Private. Stay Secure. Stay Anonymous. π
Protecting your digital footprint, one connection at a time.


