VOGONS

Common searches


First post, by Kerr Avon

User metadata
Rank Oldbie
Rank
Oldbie

Like no doubt most people on here, I use USB devices (USB hard drives, USB sticks, etc) very often with PCs, and since these devices are writable, then they are vulnerable to viruses/ransomware/malware/etc, plus of course user stupidity (i.e. me deleting the wrong file, or overwriting something important), especially when I am fixing a PC that might have an infection.

So I was wondering, is there a sort of 'USB Switch' for sale anywhere, basically just a USB to USB cable that sits between the PC and the USB device, and contains a hardware switch that disables the hardware writing ability of the USB connection? Something like that would be great for security, but I've never seen one for sale.

Is this even possible, or am I overlooking something. And if it is possible, but none are available, then how difficult is it to make one?

Thanks for any answers.

Reply 1 of 11, by konc

User metadata
Rank l33t
Rank
l33t

Some USB flash drives did have a physical switch on them, but it's not common anymore.
As a non-permanent solution (since it's not done on the controller chip) and for modern OS', you can use diskpart to set the read-only attribute of a disk. Admittedly it's not even close to the convenience of flipping a switch and other OS' won't necessarily respect it, just mentioning it for when it might be useful.

Reply 2 of 11, by Con 2 botones

User metadata
Rank Member
Rank
Member

Not exactly what you are looking for, but there is some antimalware software, specifically oriented towards USB drives, lile "MX One" or "No Autorun".
Of course, those cannot be as secure as a physical "no write" switch, mentioned above.

Reply 4 of 11, by zerodiagonal

User metadata
Rank Newbie
Rank
Newbie

Not as simple as a usb cable with a switch but there's something called a "forensic adapter" or "write blocker". There's a bit of a variety from function to price but in it's basic form, they just do that, write protect your media. Not all are OS agnostics, meaning, some will only be guaranteed to work under, say, Windows. So read the details before purchasing. (also, don't confuse it with data blocker, those are just usb adapters that don't have the datapins wired, meant to charge your devices on public spaces that have usb-charging stations/outlets).

Reply 5 of 11, by rasteri

User metadata
Rank Member
Rank
Member

Such a device would need to probe quite deeply into the USB protocol stack. So pretty nontrivial to make one, especially at USB2/USB3 speeds.

Write-protecting an SDcard then putting it in a USB adapter might work, but at least on some devices the write protect functionality is software-bypassable

Reply 6 of 11, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie
Kerr Avon wrote on 2022-06-15, 12:33:

Is this even possible, or am I overlooking something. And if it is possible, but none are available, then how difficult is it to make one?

well, you would have to intercept every usb pack going to device, hope that it was class compliant device so you could understand what is in the packet, detect a write, remove that packet from the stream, send back an ack packet or fail packet back to the host.. deal with protocol timing and protocol changes usb 1/2/3, full speed, half speed etc.

youd need a whole embedded cpu that can run a usb stack. its not as simple as "a switch", it would actually be crazy complex.

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 9 of 11, by Kerr Avon

User metadata
Rank Oldbie
Rank
Oldbie

Thanks for the answers, everyone. You've explained why this hypothetical connector is so rare or non-existent; in my lack of hardware expertise (and lack of anything between my ears), I thought that maybe if a write signal cable was disconnected then the USB device would function as read-only. Why is nothing ever straightforward in this world?

Oh well, it's not something I really need. It's just as a safety net for when I'm sorting out an infected PC, if I remain careful then it's not needed. But I might track down a Kanguru or similar USB stick, thanks Plasma, and also read up on forensic adapters, thanks Zerodiagonal.

Con 2 botones, I did know about software protection (I've seen dying USB sticks that are read-only because Windows thinks the read-only setting is permanently enabled), but of course that wouldn't stop well written, or comprehensive, malware, I would have thought. But I will look at the software you mention it, as it might help, and can't hurt, thanks.

Reply 10 of 11, by weedeewee

User metadata
Rank l33t
Rank
l33t
Hoping wrote on 2022-06-15, 13:41:

Never tried it, but the sd cards have a lock, so maybe it worth a try.

SD card locks depend on the controller, though mostly the software driving that controller.
All it does is set a signal. the software can in most cases use that signal, or just ignore it.
There might be some hardware implemented write lock SD controllers around, but I haven't got one yet.

Right to repair is fundamental. You own it, you're allowed to fix it.
How To Ask Questions The Smart Way
Do not ask Why !
https://www.vogonswiki.com/index.php/Serial_port

Reply 11 of 11, by RandomStranger

User metadata
Rank Oldbie
Rank
Oldbie

You can look for an old flash drive, those more often had this feature, but not many people sell them.

This is one I picked up not too long ago:

IMG_20220616_193459.jpg
Filename
IMG_20220616_193459.jpg
File size
1.18 MiB
Views
543 views
File license
CC-BY-4.0

sreq.png retrogamer-s.png