Dead Man Switch is a cross-platform security application written in Rust that automatically protects sensitive data in emergency situations. The application monitors multiple trigger mechanisms and executes immediate system lockdown procedures when activated, including encrypted volume dismounting and controlled system shutdown.
- Heartbeat Timer: Automatic trigger on missed check-in intervals
- Telegram Integration: Remote control via secure messaging
- Network Triggers: LAN broadcast-based activation
- USB Detection: Hardware-based triggering
- Flic Button Support: Physical activation mechanism
- VeraCrypt Integration: Automatic encrypted volume dismounting
- Cross-Platform: Windows, Linux, and macOS compatibility
- Rust 1.82.0 or later (Installation Guide)
- VeraCrypt (Download)
- Telegram Bot Token (optional, for remote features)
Edit src/config.rs to customize settings:
pub fn default() -> Result<Self> {
Self::new(
"YOUR_TELEGRAM_BOT_TOKEN".to_string(),
3600, // Heartbeat timeout (seconds)
45370, // Network broadcast port
"trigger_dms".to_string(), // Network trigger message
"execute".to_string(), // Manual trigger command
0x090c, // USB vendor ID
0x1000, // USB product ID
"auto".to_string(), // Flic IP (auto-detected)
5551, // Flic port
)
}- Contact
@BotFatheron Telegram - Execute
/newbotcommand - Follow setup instructions
- Copy provided API token
- Insert token into configuration file
Basic form:
./DeadManSwitch --mode <modes> [--trigger]
--mode: comma-separated list of modes. If omitted,allis used.--trigger: execute actions immediately and show the alert UI, without waiting for any external trigger.
Available modes:
timer– Telegram heartbeat timerbot– Telegram manual triggernet– UDP broadcast listenerusb– USB VID/PID triggerflic– Flic button triggerall– All of the above
Examples:
# All triggers (default)
./DeadManSwitch
# Only Telegram heartbeat + USB
./DeadManSwitch --mode timer,usb
# Only network broadcast
./DeadManSwitch --mode net
# Manual trigger only
./DeadManSwitch --trigger
Automatically triggers after specified timeout period without check-in.
Configuration:
telegram_heartbeat_timeout: 3600 // secondsExecution:
./DeadManSwitch --mode timerTelegram Commands:
/alive- Reset countdown timer/status- Query time remaining
Behavior:
- Monitors for periodic heartbeat signals
- Sends Telegram alert on timeout
- Executes lockdown procedures automatically
Remote manual control interface.
Setup:
- Create bot via @BotFather
- Add bot to channel with "Post Messages" permission
- Update configuration with token
Execution:
./DeadManSwitch --mode botCommand:
/dms execute- Manual trigger activation
LAN-based triggering mechanism.
Configuration:
broadcast_port: 45370
broadcast_message: "trigger_dms"Execution:
# Protected machine
./DeadManSwitch --mode net
# Trigger from network
echo "trigger_dms" | nc -u -b 255.255.255.255 45370Hardware-based activation on device connection.
Identifying Device IDs:
git clone https://github.com/BlackSnufkin/Rusty-Playground.git
cd Rusty-Playground/USB_mon
cargo run
# Connect device and note vendor:product IDsConfiguration:
usb_vendor_id: 0x090c
usb_product_id: 0x1000Execution:
./DeadManSwitch --mode usbPhysical button activation mechanism.
Server Installation:
- Linux: Flic SDK for Linux
- Windows: Flic Windows SDK
Button Pairing:
./simpleclient scan
./simpleclient connect <button_address>Configuration:
flic_ip: "192.168.1.242".to_string() // or "auto" for detectionExecution:
./DeadManSwitch --mode flicActivation: Press and hold button
- Encrypt your volumes/partitions with VeraCrypt
- Configure
ActionExecutorto dismount and shutdown on trigger - Test everything on non-critical systems before using it on real data
- Provided without any warranty
- You are responsible for any data loss or damage
- Always keep backups and test configuration before using this on important systems
