This endpoint is designed for educational purposes only to ensure complete data erasure after demonstrations or training sessions.
The /api/kill endpoint performs complete data destruction:
- Wipes all databases - Deletes
ragnar.db, CSV files, and JSON data - Clears all logs - Removes system and application logs
- Deletes temporary files - Cleans up cache and temp data
- Erases the repository - Completely removes the Ragnar installation
- Optional shutdown - Can power off the system after erasure
- Confirmation Required: Must send exact confirmation token
- POST-only: Cannot be triggered accidentally via GET
- Logged: All actions are logged before deletion
- Self-deleting: Repository deletion happens after API response
# Basic kill switch (wipe data and delete repo)
curl -X POST http://localhost:8000/api/kill \
-H "Content-Type: application/json" \
-d '{"confirmation": "ERASE_ALL_DATA"}'
# Kill switch with system shutdown
curl -X POST http://localhost:8000/api/kill \
-H "Content-Type: application/json" \
-d '{"confirmation": "ERASE_ALL_DATA", "shutdown": true}'import requests
# Basic kill switch
response = requests.post('http://localhost:8000/api/kill',
json={'confirmation': 'ERASE_ALL_DATA'})
print(response.json())
# With shutdown
response = requests.post('http://localhost:8000/api/kill',
json={'confirmation': 'ERASE_ALL_DATA', 'shutdown': True})
print(response.json())// Basic kill switch
fetch('http://localhost:8000/api/kill', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({confirmation: 'ERASE_ALL_DATA'})
})
.then(response => response.json())
.then(data => console.log(data));
// With shutdown
fetch('http://localhost:8000/api/kill', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
confirmation: 'ERASE_ALL_DATA',
shutdown: true
})
})
.then(response => response.json())
.then(data => console.log(data));{
"success": true,
"message": "Kill switch executed. All data wiped. Repository deleting in 5 seconds.",
"details": {
"database_wiped": true,
"repository_deleted": true,
"logs_cleared": true,
"temp_files_cleared": true,
"shutdown_scheduled": false,
"errors": []
},
"timestamp": "2025-11-14T12:30:45.123456"
}{
"success": false,
"error": "Invalid confirmation token. Use \"ERASE_ALL_DATA\" to confirm."
}data/ragnar.db- Main SQLite databasedata/netkb.csv- Legacy CSV databasedata/- Entire data directory
/var/log/ragnar.log/var/log/ragnar_wifi.log/var/log/ap.log/var/log/ragnar_failsafe.logvar/log/- Application log directory
/tmp/ragnar/- Temporary configuration files/tmp/ragnar_wifi_state.json/tmp/ragnar_wifi_manager.pid
- Entire Ragnar installation directory (deleted 5 seconds after response)
- T+0s: API called, confirmation validated
- T+1s: Database files wiped
- T+2s: Logs cleared
- T+3s: Temp files cleared
- T+4s: Self-delete script created and launched
- T+5s: API response sent
- T+10s: Repository completely deleted
- T+60s: System shutdown (if requested)
# Quick cleanup after showing Ragnar to students
curl -X POST http://localhost:8000/api/kill \
-H "Content-Type: application/json" \
-d '{"confirmation": "ERASE_ALL_DATA"}'# Wipe everything and power off
curl -X POST http://localhost:8000/api/kill \
-H "Content-Type: application/json" \
-d '{"confirmation": "ERASE_ALL_DATA", "shutdown": true}'# Trigger from remote location (if Ragnar is accessible)
curl -X POST http://192.168.1.100:8000/api/kill \
-H "Content-Type: application/json" \
-d '{"confirmation": "ERASE_ALL_DATA", "shutdown": true}'- No Undo: Once triggered, there is NO way to recover the data
- Backup First: If you need to preserve any data, back it up before using the kill switch
- Test Confirmation: Wrong confirmation token will be rejected (403 Forbidden)
- Network Required: Must have network access to Ragnar's web interface
- Root Not Required: Can be triggered without root privileges (repo deletion uses current user)
After triggering, you can verify deletion:
# Check if Ragnar directory exists
ls -la /path/to/Ragnar # Should not exist after ~10 seconds
# Check logs
ls -la /var/log/ragnar* # Should be empty or not exist
# Check database
ls -la /path/to/Ragnar/data/ # Should not existThis feature is specifically designed for:
- ✅ Cybersecurity training environments
- ✅ Penetration testing demonstrations
- ✅ CTF (Capture The Flag) competitions
- ✅ Research lab cleanup
- ✅ Temporary installations
NOT recommended for:
- ❌ Production environments
- ❌ Persistent monitoring systems
- ❌ Long-term deployments
This tool is provided for educational purposes only. Users must:
- Have proper authorization to use penetration testing tools
- Only use on networks they own or have explicit permission to test
- Follow all applicable laws and regulations
- Use the kill switch responsibly to protect privacy and data
Remember: The kill switch exists to ensure no sensitive data remains after educational use. Always verify complete deletion when handling sensitive networks.