Showing posts from May, 2019

Using scan codes to instrument VMs (VirtualBox)

I will try make this blogpost KISS. This is a feature that I came across during one of my projects and that saved my ass. The feature is present in VirtualBox although there is not much you can find out there regarding it's usage: Sending keyboard inputs. This feature doesn't require guest additions or anything aside from having a keyboard attached to our VM, and it is OS agnostic. The commands regarding this feature are: keyboardputscancode <hex> [<hex> …] | Sends input via scan codes. keyboardputstring <string1> [<string2> …] | Sends a string  keyboardputfile <filename> | Sends input strings included in a file. The last two are very straightforward, you write your string and that's it. But… What if you want to press enter? What if you want to press the SHIFT keys? What if you want to press the Windows Key or do key combinations…? So, for the scan codes, I took a quick look at this link and learned about the basic ones. What's most imp