Send realtime keystrokes to machine from external source without installing software on that machine? Perhaps a USB dongle that registers as keyboard?

4

2

I have a few bare-bones systems running legacy software on creaking hardware. I want to be able to automate a lot of tasks by using auto hotkey scripts for tasks that currently, must be performed manually. I really don't want to install any software on these machines, and in some cases can't (as they are already maxed out on resources, or running Linux builds, or running weird stripped down Windows versions from the stone age)

I need a solution whereby I can receive keystrokes on a machine in real time without installing any software on it. However, requiring drivers or software on the machine sending keystrokes is no problem.

That's the problem I need to solve. Given the restriction on the receiving machine, I can only imagine that a solution might be along the lines of the input being via something like a Bluetooth dongle or USB receiver that registers as a keyboard, but is actually receiving keystrokes originating on another computer. If anyone knows if such a piece of hardware exists, could you post below? Or alternatively, any other solution that meets the goals.

Some_Guy

Posted 2015-07-07T10:45:06.513

Reputation: 684

What about a bluetooth keyboard and receiver? Are you avoiding that? You'd just have to install a driver for one of those. – Datarecovery.com MK – 2015-07-07T16:54:25.167

Can you get a bluetooth keyboard which accepts external keystrokes from a second device? – Some_Guy – 2015-07-08T07:59:48.313

I posted an answer since it got too long – Datarecovery.com MK – 2015-07-08T16:08:12.367

BTW, I was in college during the computer stone age (before bluetooth), and a researcher needed essentially what you describe. He built a platform that sat on top of a keyboard, with a solenoid-activated plunger for each key. He then sent the typing instructions to his device from another computer. I'm guessing that wouldn't be a practical solution for you. – fixer1234 – 2015-07-14T17:00:02.553

hoping not to have to build anything, yeah haha. How's the question now do you think? – Some_Guy – 2015-07-14T17:05:11.983

I read the question multiple times but I just don't get it, if you can plugin a bluetooth dongle, why not just plugin a usb keyboard? – Chris.C – 2015-07-14T17:35:21.737

https://www.pjrc.com/teensy/td_keyboard.html – ssnobody – 2015-07-15T06:03:02.070

@Chris.C: the objective is to send the keystrokes from a script on another computer to automate some tasks. Without the ability to load software on the receiving computer, one suggested approach is to make the computer think it's getting keyboard input by routing input through a keyboard receiver. – fixer1234 – 2015-07-15T06:15:17.013

@ssnobody, do you know if that chip can accept keystrokes in real-time, or just preprogrammed? Also, seconding fixer, please respond as an answer :) – Some_Guy – 2015-07-15T08:57:17.250

@Some_Guy I dont really feel the problem here to be honest. If you have rights to access those computers you should be able to connect to them remotely. So why linux ssh and windows psexec are not a solution? – mnmnc – 2015-07-15T09:41:32.733

@Some_Guy: 1) A dongle might not already have a native driver, which would imply loading a driver for it. Is that acceptable? 2) You don't describe the nature of the tasks you want to perform. Could these be performed by actions after mounting the hard disk during a live Linux session (boot liveDVD or RAM-resident distro on the receiving machine, mount the hard disk, do the actions on it)? This approach wouldn't even require the keyboard fake. You could use remote control software or shell commands and a LAN connection without having to install anything. – fixer1234 – 2015-07-15T18:38:15.557

2I appreciate the comments asking me to create an answer, but I wanted to seed a solution without spending the time to create a good answer. I'm sure you'll agree that a comment pointing you (and others who might be willing to write a more complete answer) in a workable direction is better than nothing. Personally, I might connect an Ethernet module and have it become a echo client over the network rather than serial or bluetooth as some others are suggesting but either way it should resolve your problem. – ssnobody – 2015-07-15T21:37:50.823

I really appreciate your contribution, thanks :) – Some_Guy – 2015-07-15T21:50:53.533

I might be being dumb here, but why don't you just SSH or RDP into the machines?

If you have scripts you can set them to run etc.

I must say personally I would suggest looking at resolving the real problem of ageing machines etc, you could clone your machines onto new machines in a virutal environment, therefore removing all this complex workaround and have a better environment.

Otherwise you are just going to constantly have to come up with more work arounds as everything get more and more redundant and old. – David Golding – 2015-07-17T09:48:07.853

Because I want a magic bullet that allows me to remote into any computer running any platform anywhere, where all it requires is a keyboard input, so I can conquer the world! – Some_Guy – 2015-07-17T12:14:54.913

But in all seriousness you may well be right. I could solve almost all my problems that way, but it would take some time to get it all working, and could well be very very buggy. If there was an out-of the box, or simple solution that someone could point me to I would have liked to just buy a thing and get going with it, for ease, and for lack of maintenance. – Some_Guy – 2015-07-17T12:17:14.847

There's also the fact that updating these systems is not really in my control, unfortunately. – Some_Guy – 2015-07-17T12:18:31.027

Added an answer with an out of the box solution, though it may be overkill for your application. – ssnobody – 2015-07-20T04:01:44.923

Were you able to attempt usage of a remote KVM? Are there any issues still left unresolved? If one of the answers worked for you, you have the option to accept it.

– ssnobody – 2015-07-29T21:42:05.573

Answers

5

You can use a remote IP-based KVM to generate keystrokes on another machine in real time.

Simply connect up the KVM's keyboard (and optionally the video and mouse) to the computer you want to send remote keystrokes to.

You then connect to the IP on the KVM via your web browser or the provided native system app, and send whatever keystrokes you wish.

One such product is Tripp Lite's Server Remote Control, External KVM over IP and another is the Lantronix Spider KVM

Alternatively, you can rebuild a DIY version of one of these with only keyboard support (rather than keyboard, video, and mouse support) using a Teensy USB Dev Board connected to a WIZ712MJ ethernet module with the WIZ812 Ethernet Adaptor Kit

At that point you could use the Teensy's ethernet and keyboard libraries to write a small program that spawns a server using Server.begin(), waits for a connection, and then has an infinite while loop with something like the following content to create a one-way network echo server:

if (myclient.available()) {
    Keyboard.print(myclient.read());
}

You'll likely want to flesh that out with some error checking and the like, but it should work as a skeleton.

ssnobody

Posted 2015-07-07T10:45:06.513

Reputation: 2 510

While this does look like a good solution, my worry here would be how difficult connecting to an IP-based KVM would be. A lot of the time I'm dealing with a bolted on to hardware machinethat doesn't have any internet capability, or even any network connection. I mean, there's an Ethernet port on the machine, but whether it's good for anything?... – Some_Guy – 2015-07-20T09:13:30.707

Also, I think this doesn't quite meet the requirement of not installing software on the follower machine – Some_Guy – 2015-07-20T09:18:48.717

1@Some_Guy: Hardware KVM devices do not require software on the follower machine. They appear as hardware K, V, and M devices. If you deem attaching a keyboard to a machine as "installing software" then your requirements are impossible to meet. Also, how exactly do you plan on sending keystrokes to the machine in realtime if there is no network connection? We don't quite have subspace transceivers yet... – qasdfdsaq – 2015-07-20T11:50:07.587

You wouldn't be using the network port on a machine, the machine need not have a network port. You'd be using the network port on the KVM. – ssnobody – 2015-07-20T15:02:48.873

@qasdfdsaq I didn't quite realise how the device worked, I'm not familiar with it – Some_Guy – 2015-07-20T21:36:42.997

@ssnobody yeah I think I understand that now, so the leader can connect to the KVM via a network connection and then the KVM can just USB into the follower machine and appear as a keyboard? Sorry for the noob question I really have no experience with linux, or virtualisation. I know I'm in a bit over my head but I am willing to put some time into making it work, I just want to make sure my efforts won't be misdirected. Thanks – Some_Guy – 2015-07-20T21:42:20.650

1Exactly right. The leader connects to the KVM device via the network and the KVM device appears as a keyboard (both USB and PS2 versions are available) to the follower. So its leader --ethernet-> kvm --USB-> follower – ssnobody – 2015-07-20T21:54:53.863

1I would add that depending on the KVM device, some have java clients and some have IPMI interfaces. IPMI is somewhat insecure, but is very widely supported and easily scriptable even from a mobile phone. – qasdfdsaq – 2015-07-21T10:00:09.993

4

Here is a possible solution, some assembly required.

You can use a micro controller to receive keystrokes via network and transfer them to the computer it is connected to. One possible option would be Arduino platform and it's keyboard library as it may be simpler than making the hardware and libraries yourself. You will also need DIY software to send the keystrokes and, in case of Arduino it can be written in its IDE(simplified JAVA environment) . There are other platforms out there and most can be scaled down in production environment if you find this to be too big or expensive to deploy (as you may need more than one).

Enis P. Aginić

Posted 2015-07-07T10:45:06.513

Reputation: 1 288

This is a good suggestion, but it looks to me like teensy USB is probably just a little bit easier (looking at this https://www.pjrc.com/teensy/td_keyboard.html), and a little bit cheaper. However, I would love your opinion since I don't have that much experience.

– Some_Guy – 2015-07-20T09:25:48.473

Also, do you think it would be possible to send realtime keystrokes from a connected computer using this, rather than pre-programmed? – Some_Guy – 2015-07-20T09:26:18.910

@Some_Guy It looks like a scalled down version of Arduino I was talking about, so it should do just fine. But you would need to connect from two computers at the same time to have realtime keystrokes and that is not possible via one USB port. Full size Arduino can suppport ready made network shields to separate connections, for example send keystrokes via network from your laptop and forward to USB to the receiving computer. – Enis P. Aginić – 2015-07-20T09:45:13.177

yeah the plan was to receive through serial port and go out via USB for the teensy – Some_Guy – 2015-07-20T21:39:02.510

3

This is far from an out-of-the-box solution, but you might be able to adapt something like the Teensy USB to accomplish this mission. I would envision configuring the Teensy USB to appear as a keyboard, then loading a program onto the Teensy USB that

  • receives keystrokes over a serial connection wired to its I/O pins and
  • sends those keystrokes to the target machine over its USB connection.

I personally wired one to a footpedal and programmed it to send the 's' keystroke when I stepped on the pedal, but that project was much much simpler than what you would need.

Mutant Bob

Posted 2015-07-07T10:45:06.513

Reputation: 342

Failing something easier, this seems like a good solution (But I'm hoping for an easier one). I was previously looking at an arduino build that looked more difficult, more expensive and bigger than this, so thanks! – Some_Guy – 2015-07-15T15:20:59.323

I have hardly any experience of using microcontrollers (I years ago did a very easy project where my hand was held by a book the whole time). Let's say I went with the teensy (looks very good). Would you connect a keyboard directly to the teensy USB with the program loaded, or go through through a laptop with an interface loaded? What type of connectors would I need? – Some_Guy – 2015-07-15T15:23:36.517

The TeensyUSB is the keyboard. I would then connect the laptop to the TeensyUSB using a serial connection (solder a DB9 to the I/O pins of the TeensyUSB and then plug the laptop into that DB9). Then use some terminal software (kermit?) on the laptop to type your characters across the serial connection. Writing the program that runs on the Teensy USB that receives the serial and sends keystrokes would not be trivial, but it would not be a major engineering project either. – Mutant Bob – 2015-07-15T15:33:26.067

I believe that there are bluetooth solutions that send/receive serial port data. BlueSoleil is a commercial software that probably does it - http://www.manualslib.com/manual/534847/Ivt-Bluesoleil.html?page=49 "The Bluetooth Serial Port (SPP) provides a virtual serial port via Bluetooth as an alternative to a hardwired serial cable between a computer and device. Any program that uses a standard serial port can use the Bluetooth serial port without any change." http://www.bluesoleil.com/bssoftware/BSoftware.aspx

In fact, you might want to talk with them and see what they say about your project.

– Datarecovery.com MK – 2015-07-15T17:05:07.717

This all looks really promising, I'm definitely going to investigate the feasibility of this as a project. Thanks everyone so far, but any further suggestions are still welcome of course! – Some_Guy – 2015-07-15T22:08:56.583

1Hi, I wanted to create another bounty and also award it to this question, but it seems I have to double my bounty to do that. I really appreciate this answer though, so thanks! – Some_Guy – 2015-07-20T21:49:23.910

0

It would be a bit odd that a keyboard would receive input. I think I understand a little better your angle of sending a keystroke sequence from a laptop. The bluetooth receiver (USB dongle) does the receiving from a bluetooth keyboard. So forget the keyboard since you have a laptop sending instead. There might be a bluetooth receiver out there that is general purpose and will let you pair and receive keyboard data from some other bluetooth device. Keyboard data is part of the bluetooth profile for HID ("Human Interface Device Profile") so at least that's covered. But a receiver that comes with a Logitech keyboard for instance might not allow receiving from anything but a Logitech keyboard. Searching Amazon for "bluetooth data receiver usb" brings up a few that might work like Mediastic's.

Do you already have a way you plan to send the data out from the laptop via bluetooth? You asked about receiving, but not sending. There are a couple interesting questions already about this -

Datarecovery.com MK

Posted 2015-07-07T10:45:06.513

Reputation: 454

Well you might actually be able to receive bluetooth data from non-Logitech devices using a Logitech bluetooth receiver after all - http://forums.logitech.com/t5/Keyboards-and-Keyboard-Mice/diNovo-Edge-Using-bluetooth-for-other-devices/td-p/307820

– Datarecovery.com MK – 2015-07-08T16:11:57.720

The second bullet links to https://github.com/lkundrak/btkbdd/blob/master/btkbdd.pod, which seems to describe the solution requested, at least for Linux. The last bullet also seems like almost a duplicate of this question. +1

– fixer1234 – 2015-07-15T16:42:44.330

-1

Perfectly possible. In fact its the exact vector attack behind the thing called BAD USB.

You can read in detail about it in here.

Basically, its about changing(reprogramming) USB stick from storage device to another HUD device. It's not that easy to do but if you have the time and skills - yes, it's possible. Certainly not easy though.

A BadUSB device may even have replaced the computer’s BIOS – again by emulating a keyboard and unlocking a hidden file on the USB thumb drive.

mnmnc

Posted 2015-07-07T10:45:06.513

Reputation: 3 637

This isn't really an answer. I know that it's possible to spoof keystrokes, but I'm looking for a device that accepts keystrokes in realtime. – Some_Guy – 2015-07-15T09:23:09.830

This is not stated clearly in the question. However I think you are more likely to use my solution and make the USB device execute commands on the computer. Those commands can be: 1. powershell command to download netcat onto computer, 2. executiing netcat to connect to designated IP address of the server waiting for connection. 3. netcat is also binding local shell to connection 4. Server receiving connection is executing specified script /commands on the connected computer. This is the way to complete your task. Other solutions will most likely involve some kind of installation, – mnmnc – 2015-07-15T09:29:40.117

Also, much easier is to make BADUSB device to download script to the computer and execute it locally although for security reasons powershell script execution tends to be locked on a windows 7+ systems so reverse shell binding might be somewhat less bothersome. – mnmnc – 2015-07-15T09:31:51.573

I've re-written this question (again). What do you think? – Some_Guy – 2015-07-15T09:59:51.180

Your comment does not address the scope of this question. I need to execute keystrokes on an external machine from an external source, without running any scripts on that machine. I am plugging into DOS based systems in some case. The whole point of the question is to avoid having to work out a solution for each individual platform. I really want something that, once set up, is good to go for anything that has the most basic input drivers on it, and I can type on it remotely. – Some_Guy – 2015-07-15T10:06:53.540

Essentially I want to be able to work on a real environment as if it was a remote desktop connection from a different PC. Except it isn't, it's a real-world link – Some_Guy – 2015-07-15T10:07:47.053

I am trying to make this as clear as I can from the question, please comment if you think it could be improved, thanks – Some_Guy – 2015-07-15T10:08:14.700

Yeahh... the fact that some of those machines are still using DOS is quite important and should be stated clearly. This changes much in my opinion. Unfortunately I don't think you will find a solution. Do those DOS machines have network connectivity? Do they use modems or is TCP/IP stack implemented? What are the systems other computers running? If you want single solution for DOS/WINDOWS/LINUX that will work by plugging in a USB dongle i think you would have to basically create one yourself specially designed and with some seriously sophisticated coding. – mnmnc – 2015-07-15T10:18:37.573

Look, I have a bunch of machines that can accept usb keyboard input. That's the starting point of this question. Nothing else really matters to this question. The challenge has to be looked at from the end of how to send keystrokes, not to receive them. – Some_Guy – 2015-07-15T10:27:22.773

" have a few bare-bones systems running legacy software on creaking hardware. I want to be able to automate a lot of tasks by using auto hotkey scripts for tasks that currently, must be performed manually. I really don't want to install any software on these machines, and in some cases can't" Is this not clear? – Some_Guy – 2015-07-15T10:29:30.963

@Some_Guy Send keystrokes in real time from other machine via USB? Such device does not exist. It would involve creating a usb dongle with WIFI/IRDA/BLUETOOTH router that would have shell and could send keystrokes to USB port. Or if you want to send predified keystrokes from USB directly to system - thouse would need to be specific to the operating system that is receiving. – mnmnc – 2015-07-15T10:35:09.413

@mnmnc If the computer has USB, and allows you to install a driver, you can use a generic bluetooth adapter to receive keyboard input. The question is about sending then. That question matches this one - http://superuser.com/questions/615027/using-laptop-keyboard-as-wireless-bluetooth-keyboard Right?

– Datarecovery.com MK – 2015-07-15T14:52:19.767

@Datarecovery.comMK Yes, but I am open to other methods of solving this problem too so I wouldn't say they are duplicates. – Some_Guy – 2015-07-15T22:21:30.097

and @mnmnc at the risk of starting a flame war, what you don't know != what is possible – Some_Guy – 2015-07-15T22:22:12.010