dotfiles/scripts/randomize-mac
rpriven 5b6af65def
Organize scripts and clean up dotfiles
Changes:
- Added 80+ scripts with organized structure
  - payloads/ for third-party pentesting tools
  - pentesting/ for custom security scripts
  - Daily drivers remain flat for fast access
- Converted wes() function to proper script
- Removed .sh extensions from pentesting scripts
- Cleaned up aliases (removed 31 redundant lines)
- Added kanata/, build artifacts to gitignore
- Removed old fre.sh scripts and empty a.out
- Updated configs: helix, tmux, zsh, ulauncher, redshift

Security: All sensitive data excluded via gitignore
2025-11-07 14:48:21 -07:00

53 lines
1.6 KiB
Bash
Executable file

#!/bin/bash
# randomize-mac - Randomize MAC addresses for privacy
# Usage: sudo randomize-mac
set -euo pipefail
ETHERNET="enp3s0"
WIFI="wlp4s0"
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "❌ This script must be run as root (use sudo)"
exit 1
fi
echo "🔄 Randomizing MAC addresses..."
echo ""
# Randomize Ethernet
echo "📡 Ethernet ($ETHERNET):"
if ip link show $ETHERNET &>/dev/null; then
echo " └─ Before: $(ip link show $ETHERNET | grep ether | awk '{print $2}')"
if macchanger -r $ETHERNET 2>/dev/null; then
echo " └─ After: $(ip link show $ETHERNET | grep ether | awk '{print $2}')"
echo " └─ ✅ Randomized successfully"
else
echo " └─ ⚠️ Failed (interface may be in use)"
fi
else
echo " └─ ⚠️ Interface not found"
fi
echo ""
# Randomize WiFi
echo "📶 WiFi ($WIFI):"
if ip link show $WIFI &>/dev/null; then
echo " └─ Before: $(ip link show $WIFI | grep ether | awk '{print $2}')"
if macchanger -r $WIFI 2>/dev/null; then
echo " └─ After: $(ip link show $WIFI | grep ether | awk '{print $2}')"
echo " └─ ✅ Randomized successfully"
else
echo " └─ ⚠️ Failed (interface may be disabled or in use)"
fi
else
echo " └─ ⚠️ Interface not found"
fi
echo ""
echo "⚠️ NOTE: You may need to reconnect to your network after randomization!"
echo ""
echo "💡 TIP: WiFi ($WIFI) is currently disabled. This script will randomize it"
echo " when you enable WiFi, preventing tracking on public networks."