This bash script takes a screenshot of the RDP desktop and converts the image to text.
The script will connect to an RDP server, makes a screenshot and converts the image to text with OCR to obtain the username(s) of logged in users. The screenshot can be made because NLA(Network Level Authentication) is not configured properly on the host.
More info about NLA: https://technet.microsoft.com/en-us/magazine/hh750380.aspx
- Connects to RDP using rdesktop
- Verifies if screenshot can be made
- Takes screenshot
- Kills RDP connection
- Linux host running an X server
- The following packages: xdotool imagemagick rdesktop bc
- Debian/Ubuntu/Kali install:
apt-get install xdotool imagemagick rdesktop bc tesseract-ocr
Scan a single host: ./RDP-screenshotter.sh 192.168.1.10
Scan Multiple hosts: for i in $(cat list.txt); do ./RDP-screenshotter.sh "${i}"; done
Used large chunks of code from the stickyKeysHunter.sh script from ztgrace