This post will introduce a simple udev
rule and ~$20 in USB hardware that effectively implements a kill cord Dead Man Switch to trigger your machine to self-destruct in the event that you’re kicked out of the helm position.
Let’s consider a scenario: You’re at a public location (let’s say a cafe) while necessarily authenticated into some super important service (let’s say online banking). But what if–after you’ve carefully authenticated–someone snatch-and-runs with your laptop?
Maybe you can call your bank to freeze your accounts before they’ve done significant financial harm. Maybe you can’t.
Or maybe your laptop was connected to your work VPN. In less than 60 seconds and with the help of a rubber ducky, the thief could literally cause millions of dollars in damages to your organization.
Surely there must be some solution to trigger your computer to lock, shutdown, or self-destruct when it’s physically separated from you! There is: I call it BusKill.
Surprisingly, I couldn’t find a low-tech solution that implements a laptop kill cord, so I decided to build one myself for ~$20 and a simple udev
rule.
Note: Due to overwhelming popular demand, BusKill now has a website! Check it out 🙂
https://www.buskill.in
For updates, you can also:
- signup for the BusKill newsletter,
- follow @BusKillin on twitter,
- like the @BusKill.in page on facebook,
- subscribe to the BusKill Youtube Channel,
- give BusKill a star on Github, and
- follow BusKillin@mastodon.social.
This is an old article that is out-of-date. To learn how to install BusKill, see our BusKill GUI App Documentation.
Demo
Here’s a quick video demo showing BusKill triggering a kill signal when the magnetic breakaway is tripped.
Hardware
The key to BusKill is using a cable that will trigger a udev remove
action when your laptop is stolen. You could just have a usb thumb drive on a retractable lanyard (think RFID badges or DoD Common Access Cards), but what if that thin retractable cord just snaps–leaving the USB drive snugly in-place in the laptop?
A better solution is to attach the USB device as close & snugly connected to your body as possible and run a data cable all the way to the computer. This can further be improved using a break-away magnet connector as close to the machine as possible. For example, the following items are sufficient to build this USB kill cord:
- A cheap $4 USB drive with durable keyring hole
- A small & strong carabiner keyring for attaching the above drive to your belt loop (I like this $6 one because it’s small, well-made, and has a clever locking mechanism)
- A $7 USB magnetic breakaway adapter to plug into the computer’s USB-A port
- And finally, a $3 1-meter USB extension cable to connect them
It’s 2020, and a lot of laptops no longer have USB-A ports on them. If you only have a USB-C, you can either go hybrid by adding this:
Or go full USB-C with:
- A cheap $9 USB-C drive
- A $24 USB-C magnetic breakaway adapter
- And a $13 1-meter USB-C extension cable
ⓘ Note: If you’d prefer to buy a BusKill cable than make your own, you can buy one fully assembled here.
Software
To set this up, we need to add a new udev rule file to /etc/udev/rules.d/
. Here’s a simple rule that will trigger xscreensaver to lock the screen every time any USB drive is removed:
cat << EOF | sudo tee /etc/udev/rules.d/busKill.rules ACTION=="remove", SUBSYSTEM=="usb", RUN+="DISPLAY=:0 xscreensaver-command -lock" EOF sudo udevadm control --reload
But that rule may be a bit too broad. If you want to have a specific brand of USB drive trigger the lockscreen, first we need to do some debugging to find some properties that are triggered by your BusKill-specific usb drive when it’s ejected. To get those, follow this procedure
Step 1: Insert your USB drive
Step 2: Runudevadm monitor --environment --udev
Step 3: Remove your USB drive
Check the output of the udevadm
command. You should see a bunch of potentially uniquely identifiable properties about your drive, such as the manufacturer, model, filesystem uuid, etc. For example, let’s say we see the following line indicating that the ID_MODEL
property of your USB drive is Micromax_A74
.
$ udevadm monitor --environment --udev ... ACTION=remove ... ID_MODEL="Micromax_A74" ... SUBSYSTEM=usb ...
Then we can update the udev rule to be:
cat << EOF | sudo tee /etc/udev/rules.d/busKill.rules ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_MODEL}=="Micromax_A74", RUN+="DISPLAY=:0 xscreensaver-command -lock" EOF sudo udevadm control --reload
And, of course–depending on the risk model–you may want the kill signal to actually shut down your machine:
cat << EOF | sudo tee /etc/udev/rules.d/busKill.rules ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_MODEL}=="Micromax_A74", RUN+="shutdown -h now" EOF sudo udevadm control --reload
Conclusion
We do what we can to increase our OpSec when using our laptop in public–such as using a good VPN provider, 2FA, and password database auto-fill to prevent network or shoulder-based eavesdropping. But even then, there’s always a risk that someone could just steal your laptop after you’ve authenticated! As of yesterday, that’s a hard attack to defend against.
As of today, we have BusKill. The BusKill solution described in this article can trigger your laptop to self-destruct if it’s physically separated from you. Because the data cable runs all-the-way from your body to the laptop, cutting the cable will still result in BusKill triggering.
BusKill is simple. There is no need for anything to actually be stored on the USB drive. And if the USB drive suddenly failed, BusKill would still be triggered. If an attacker quickly inserted a clone of your USB drive before or after stealing your laptop, BusKill would still be triggered.
And because it’s just a cable, there’s no risks of the attacker using some complex vector of attack over bluetooth, RFID, etc.
If you’d like to purchase a BusKill cable, click here.
Related Posts
Hi, I’m Michael Altfield. I write articles about opsec, privacy, and devops ➡
[…] submitted by /u/maltfield [link] [comments]Post […]
On systemd enabled systems, try “loginctl lock-sessions” as udev cmd. It should work on common desktop environments.
If you have something custom try xss-lock to react on the lock-sessions signal.
[…] https://tech.michaelaltfield.net/2020/01/02/buskill-laptop-kill-cord-dead-man-switch/ […]
[…] BusKill: A kill cord for your laptop 66 by maltfield | 65 comments on Hacker News. […]
Excellent project! How is this different from the existing USBKill? UDEV?
I can do better with 3 euros. A microcontroller and a sensor…
That’s a killer cord!
[…] triggered if someone physically yanks your laptop away submitted by /u/maltfield to r/netsec [link] [comments] top scoring links : multi netsec, […]
Why not just make it “buskill” when it leaves the current wifi hotspot while still engaged? No hwdware, no mess.
Because the WiFi SSID could be cloned just using a smartphone.
The thief would have to know ahead of time that you’re doing that and act preemptively, which I find extraordinarily implausible. You could regularly poll the gateway IP though if you’re concerned about it. This might be a good idea anyway as it would alert you if someone else is trying to spoof the free wifi to capture packets.
[…] is not selling ready-made BusKill cables, at least, not for now. On his website, the Linux IT expert published instructions on how everyone can build their own BusKill […]
[…] is not selling ready-made BusKill cables, at least, not for now. On his website, the Linux IT expert published instructions on how everyone can build their own BusKill […]
On macOS/OS X you can get the same effect using the following launchd script from 2012 – https://stackoverflow.com/a/12259762
[…] no está vendiendo cables BusKill confeccionados, al menos, no por ahora. En su sitio net, el experto en TI de Linux publicó instrucciones sobre cómo todos pueden construir sus propios […]
[…] is not selling ready-made BusKill cables, at least, not for now. On his website, the Linux IT expert published instructions on how everyone can build their own BusKill […]
[…] 不過目前為止,Altfield暫時不會出售現成的BusKill數據線。Linux IT專家在其網站上發布了有關每個人如何構建自己的BusKill數據線的說明。 […]
[…] indicating that you do not want to sell Buskill, its creator gives everyone the possibility to create yours. For only $ 20 or $ 45, you can create these devices. Just one USB stick, one USB […]
[…] isn’t promoting ready-made BusKill cables, no less than, no longer for now. On his website, the Linux IT skilled printed directions on how everybody can construct their very own BusKill […]
[…] programmer has come up with a potential solution. On Thursday, Michael Altfield published a blog post on how Linux laptop owners can build a $20 killswitch to automatically shut down or erase their […]
[…] is not selling ready-made BusKill cables, at least, not for now. On his website, the Linux IT expert published instructions on how everyone can build their own BusKill […]
[…] is not selling ready-made BusKill cables, at least, not for now. On his website, the Linux IT expert published instructions on how everyone can build their own BusKill […]
[…] is just not promoting ready-made BusKill cables, at the least, not for now. On his website, the Linux IT professional revealed directions on how everybody can construct their very own […]
[…] details and the rules can be found in Michael Altfield’s blog post, here is the video […]
Noice! This seems like an interesting, yet simple enough, project for me to do. Wanted that business card that boots Linux but that’s gonna take a while. ?
[…] probably have to pay more if you are making the BusKill cable for a USB-C laptop. Altfield’s blog posting explains the construction in detail and includes a video of the dead man’s switch in […]
[…] indicating that you do not want to sell Buskill, its creator gives everyone the possibility to create yours. For only $ 20 or $ 45, you can create these devices. Just one USB stick, one USB […]
[…] pensar nisso mesmo, o programador Michael Altfield desenvolveu um novo cabo USB que, quando se deteta a sua remoção repentina de um sistema, poderá […]
[…] pensar nisso mesmo, o programador Michael Altfield desenvolveu um novo cabo USB que, quando se deteta a sua remoção repentina de um sistema, poderá […]
[…] Fonte: Michael Altfield […]
[…] terwijl je op allerlei accounts bent ingelogd. Aanleiding voor engineer Michael Altfield om “BusKill” te […]
[…] triggered if someone physically yanks your laptop away submitted by /u/maltfield to r/privacy [link] [comments] top scoring links : multi privacyencryption, privacy, security, […]
Use this, instead of shutdown -h now
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
[…] He outlines the DIY hack on his website. […]
[…] Source: Introducing BusKill: A Kill Cord for your Laptop – Michael Altfield’s Tech Blog […]
[…] You’ll be able to try the complete tutorial on Michael Altfield’s weblog. […]
[…] He outlines the DIY hack on his website. […]
[…] You can check out the full tutorial on Michael Altfield’s blog. […]
[…] programmer has come up with a potential solution. On Thursday, Michael Altfield published a blog post on how Linux laptop owners can build a $20 killswitch to automatically shut down their machine if […]
[…] laptop programmer has give you a possible answer. On Thursday, Michael Altfield printed a blog post on how Linux laptop computer house owners can construct a $20 killswitch to mechanically shut down […]
[…] nada en la recuerdo USB. Simplemente se activa BusKill en caso de necesidad. ©Os dejamos el link con toda la indagación técnica de este dispositivo, así según el funcionamiento que […]
[…] You can check out the full tutorial on Michael Altfield’s blog. […]
[…] programmer has come up with a potential solution. On Thursday, Michael Altfield published a blog post on how Linux laptop owners can build a $20 killswitch to automatically shut down their machine if […]
Just saying, a better approach would have been adding a G sensor from a mobile phone and use this to trigger the locking functionality.
[…] Introducing BusKill: A kill cord for your laptop […]
[…] a laptop kill cord, so I decided to build one myself for ~$20 and a simple udev rule.” wrote the expert in a blog […]
[…] a laptop kill cord, so I decided to build one myself for ~$20 and a simple udev rule.” wrote the expert in a blog […]
[…] You can check out the full tutorial on Michael Altfield’s blog. […]
How can this be done on Windows PC’s?
Like this:
1) Open Event Viewer, and drill down to “Application and Service Logs – Microsoft – Windows – DriverFrameworks-UserMode”
2) We need the “Operational” log which is disabled; to enable, right click -> Properties, tick “Enable Logging”, OK
3) Find a spare memory stick of a make/model that you don’t otherwise use. Plug it in, wait a few seconds and unplug.
4) Refresh the view, then open the latest entry with EventID 2102
5) Switch to the “Details” tab, then “XML View”. You will need the the data from the “InstanceID” field
6) Paste the following XML into your editor of choice (you can remove the extra white lines; the forum inserts those automatically on line-breaks):
***Begin XML***
*[System[(EventID=2102)]]
and
*[UserData/UMDFHostDeviceRequest/InstanceId=”Your Instance ID”]
and
*[UserData/UMDFHostDeviceRequest/RequestMinorCode=”23″]
***End XML***
Replace “Your Instance ID” with your InstanceID data from the event log, then replace all special characters with their ASCII hex codes. For example, my InstanceID of:
SWD\WPDBUSENUM\_??_USBSTOR#DISK&VEN_KINGSTON&PROD_DATATRAVELER_2.0&REV_PMAP#50E549C695A4BF10698DA240&0#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}
Became:
“SWD\WPDBUSENUM\_??_USBSTOR#DISK&VEN_KINGSTON&PROD_DATATRAVELER_2.0&REV_PMAP#50E549C695A4BF10698DA240&0#{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}”
7) Copy your completed XML. Open Task Scheduler, create a new task. Create a new “Trigger” and from the “Begin the Task” drop-down, select “On an event”, Select “Custom” and click the new event filter button. Switch to the XML tab and tick the “Edit query manually box”. Paste in your XML from above.
8) OK back out a couple of times, and finish setting up your task. I set my Action to lock my computer: Action: start a program; program: “rundll32.exe”; Add arguments: “user32.dll, LockWorkStation”
9) Tweak final settings, mainly allowing the task to run if not on AC power, and you’re done 🙂
Same functionality is achieved with Bluetooth lock.. At least on Windows. When ie a paired phone gets out of range, the computer is locked. No extra components needed.
Any basic nerd knows the value of the laptop is not the computer, its the hard drive. Passwords, web links, history, etc are stored on the drive. PULL the drive, and ANY operating system can have a look. Unless you encrypt/password you hard drive, this scheme is useless.
Are you saying your laptop’s hard drive isn’t encrypted? Interesting…
[…] the “BusKill,” this USB cable has been designed by Michael Altfield who’s a software program engineer […]
Do I get this right ? You key chain a USB extension to the table to make this work?
At this point juts buy a freaking laptop tether. Seriously. No need for tech-savvy people if all you do is add another lock.
No, you didn’t get this right. Try reading, it helps sometimes 😛
[…] is not available for sale but Altfield provides all the details needed to build your […]
[…] Майкл хвастается: из-за своей простоты устройство очень надежно и не поддается атакам взломщиков. Правда, для установки защиты вам потребуется ноутбук на Linux и выполнение инструкций, которые опубликовал изобретатель в своем блоге. […]
[…] Altfield v příspěvku Introducing BusKill: A Kill Cord for your Laptop na svém blogu představil “výtrhovou pojistku” pro Linux aneb uživatel je ke svému […]
[…] détails techniques et les règles peuvent être trouvés dans le blog de Michael Altfield , voici la vidéo de […]
Windows 10 allows you to bluetooth your phone to it. When your phone is out of range, it will lock the os. No purchase necessary.
[…] by /u/maltfield [link] […]
[…] submitted by /u/maltfield [link] […]
https://youtu.be/mvlcCQ1RWXc
https://nearlock.me/
[…] non è disponibile alla vendita, ma Altfield fornisce tutti i dettagli necessari per crearlo. Il progetto ha scatenato un’enorme discussione su Reddit poiché gli scenari ipotizzati da […]
[…] non è disponibile alla vendita, ma Altfield fornisce tutti i dettagli necessari per crearlo. Il progetto ha scatenato un’enorme discussione su Reddit poiché gli scenari ipotizzati da […]
[…] is not available for sale, but Altfield provides all the details needed to create it. The project sparked a huge discussion on Reddit since the scenarios hypothesized by Altfield are […]
[…] has detailed everything in his blog post about the setting up of the cable and the […]
[…] might want to try. Invented by Michael Altfield, a sysadmin at the Open Source Ecology project, the BusKill cord acts as a sort of kill switch against thieves that works via […]
[…] might want to try. Invented by Michael Altfield, a sysadmin at the Open Source Ecology project, the BusKill cord acts as a sort of kill switch against thieves that works via […]
[…] might want to try. Invented by Michael Altfield, a sysadmin at the Open Source Ecology project, the BusKill cord acts as a sort of kill switch against thieves that works via […]
[…] implements a laptop kill cord, so I decided to build one myself for ~$20 and a simple udev rule.” wrote the expert in a blog […]
[…] saat ini BusKill tidak dijual, namun Altfield melalui blognya sudah menjelaskan secara detail bagaimana cara membuat BusKill kalian […]
[…] inžinier Michael Altfield navrhol zaujímavý kábel pre zariadenia so systémom Linux, ktorý […]
Rly good project. I will try this with my YubiKey. When disconnected, then lock the computer and enable GPS signal
[…] want to try. Invented by Michael Altfield, a sysadmin at the Open Source Ecology project, the BusKill cord acts as a sort of kill switch against thieves that works via […]
[…] has detailed everything in his blog post about the setting up of the cable and the […]
[…] programmer has come up with a potential solution. On Thursday, Michael Altfield published a blog post on how Linux laptop owners can build a $20 killswitch to automatically shut down their machine if […]
[…] Linux kill cord […]
I don’t get it… if you want to kill the power if “someone snatches your laptop”, then just use the notebook without a battery (since in the video it was connected to AC)… of course there’s no way to destroy the data then, but at least any active sessions will need to be restarted…
Lots of commenters seem to be asking about this.
depending on the risk model–you may want the kill signal to actually shut down your machine
I think he assumes you have an encrypted laptop. The crook won’t be able to decrypt it once it’s been turned off.
[…] developer does not sell BusKill, but on his website he published detailed DIY instructionsWith which anyone can create their own cable. For assembly, you will need a USB drive, a carabiner […]
[…] Altfield a postat două script-uri udev pe site-ul său. Unul blochează dispozitivul activând screensaver-ul, iar celălalt script […]
[…] продажей BusKill, но на своем сайте он опубликовал подробную DIY-инструкцию, с помощью которой любой может создать свой […]
[…] Après il y a une mauvaise et une bonne nouvelle. La mauvaise c’est que ce câble n’est pas en vente. La bonne c’est que tout le monde peut s’en fabriquer un pour à peine 20 à 40€. Le créateur expose toute la manip à suivre sur son site. […]
Really nice idea, I think I’ll go for it soon
Only one question: once we have finished working in a public place, how to disconnect this device without having it shutting down the computer ?
Thanks a lot
What I did was modify the kill script to check if a specific file exists on the machine. If so, then the laptop shuts down. If not, then it stays running. I also added a script that when the specific USB drive is inserted, this file is automatically created. That way I don’t have to remember to create it. I only have to remember to remove it if I specifically don’t want the laptop to shut down when I’m done.
[…] details and the rules can be found in Michael Altfield’s blog post, here is the video […]
This looks like it depends on Linux/Unix/BDS (includes Mac and Apple), Which brings about the problem that most users on laptops are running Windows.
[…] Note: This post is adapted from its original article on Michael Altfield's tech blog, which first introduced […]
This post is really nice, great work really.