For the terminally lazy, here’s another cool trick you can do with a serial reader under Windows: automatically wake up Windows, kill the screensaver and login with your implant without having to touch the keyboard.
Normally, if the screensaver has kicked in, or if Windows has turned the screen off to save power, you have to hit a key to bring up the login prompt. Now with this trick, no more: just scan your hand and it’ll bring you straight to your desktop, even if the screen has turned off. Yes, this was a world-class problem that definitely needed solving!
So how does it work?
When Windows starts the screensaver, it’s up to the screensaver to watch for mouse or keyboard events and terminate when something has happened. When it terminates, Windows brings up the login prompt and Rohos Logon Key can then log you in. Problem: you need to hit a key to terminate the screensaver.
So what we need is something that kills the screensaver when some data is received from the serial port. Problem: under Windows, COM ports are exclusive use - and since Rohos Logon Key has already opened it for its own use, you can’t make a program that watches the same serial port and kills the screensaver when something comes through.
What you can do however is connect Rohos Logon Key to a “fake” COM port, and make a “wedge” program that reads the real serial port, kills the screensaver upon receiving serial data, then transfers the data to Rohos Logon Key through the fake COM port.
To achieve this, first you need to download and install com0com. This gem of a utility is a null modem cable emulator: you can create a pair of virtual COM ports that can be used to make two serial port applications talk to each other without physical serial ports or a cable.
So let’s do that: create a pair of COM ports (port class on both sides). Here I create COM8 and COM9:
Then connect Rohos Logon Key to one end of the fake serial cable. Here COM8:
Rohos Logon Key thinks it’s connected to a reader, but in fact it’s connected to a dangling virtual null modem cable. Now what we need is a program to connect the real RFID reader’s COM port and the other end of the fake null modem cable, that also kills the screensaver:
To do this, first install the Python3 language interpreter. Then in the command line, download the PySerial module with pip
:
Then open a file called, for example, screensaver_killer.py
somewhere in your home directory and paste the following script in it:
#!/usr/bin/python3
import os
import time
import serial
incomport="COM4"
outcomport="COM9"
screensaver="ribbons.scr"
while True:
uid=None
# Read a UID from the serial RFID reader
try:
with serial.Serial(incomport) as s:
uid=s.readline().strip().decode("ascii")
print("UID read in:", uid)
except:
print("Read error")
uid=None
time.sleep(0.2)
# Pass on the UID to Rohos Logon Key
if uid:
try:
with serial.Serial(outcomport) as s:
s.write((uid+"\n").encode("ascii"))
print(" UID sent out")
except:
print(" Write error")
# Kill the screensaver
if uid:
try:
os.system("taskkill /f /t /im {}".format(screensaver))
except:
pass
In the file, replace the incomport
variable with the COM port corresponding to your RFID reader, outcomport
to the virtual COM port corresponding to the dangling end of the virtual serial cable created by com0com, and screensaver
by the name of the screensaver you normally run. Then save the file.
At this point you can run it to try it if you want: as long as it runs, it’ll pass stuff it receives from the serial RFID reader on to Rohos Logon Keys, and kill the screensaver specified in the script. But if you want to run it at boot time in the background, you can start it with the Task Scheduler:
And here’s a video to show it works: I log in directly from the screensaver with my EM4xxx implant, then with the computer in power saving mode: