David Ramsden
28Aug/14

Open curtains – VNC with no authentication

A few weeks ago I read an article about mass scanning the Internet for VNC servers that don't require authentication. Dubbed "open curtains" because it's like having your curtains open allowing anyone passing by to glance in. The person doesn't need to bypass any security in place or have a key to your door to get this access - it's open for everyone to take a peek inside.

To achieve this I used:

It's completely automated. No human interaction is required.

The nmap NSE script I wrote is as follows:

It's used with nmap to scan random targets:

The above continuously scans random addresses on TCP/5900 (the default VNC server port) and uses the open-curtains.nse script. The NSE script simply says "if the protocol is TCP and the port is 5900, execute the open-curtains.pl script passing the host IP and port number as arguments". The open-curtains.pl script is run in the background so things don't hang.

The open-curtains.pl Perl script I wrote is as follows:

This will first open a TCP connection to the target and negotiate the VNC protocol. The VNC server will first send an RFB header containing the server version (e.g. RFB 003.008). We then send back a response of "RFB 003.003" to tell the server what our client capabilities are. The server will then respond with the authentication mechanisms that are accepted. This is the important part. We only then continue if the server tells us that no security is configured (0x1). At no point do we try to bypass the security or try any passwords. Finally the vncsnapshot program is invoked to connect and take a screenshot from the VNC server.

And the results were quite interesting.

I found a lot of digital signage, all of which appear to be located in South Korea and mostly relating to "LG U+" (telecoms and mobile phone operator controlled by LG Group):

Quite a few desktops. Surprisingly a lot of them were Ubuntu desktops, proving that the Operating System is only as secure as the user makes it:

This desktop was pretty ironic. Look at the websites the user has open in Firefox:

vnc9

And an OS X desktop. Oddly enough it looks like someone has tried to pwn it but with win32 files?

vnc11

A few home automation type systems and embedded devices such as MFPs:

A few Danfoss terminals that appear to be running a UNIX like-OS popped up too:

vnc18A few Point of Sale/Back Office systems:

Worryingly one of these is likely pwned already and is connected to a C&C server via IRC. The mIRC registration web page that has opened gives the game away. Unfortunately the user is probably just closing the window each time:

vnc21

Other systems included a pharmacy system and a radar system on a ship:

Over the space of about 2 weeks I collected 399 screenshots. The process could be a lot quicker if something such as masscan were to be used. As of yet I've not found any SCADA systems but they are out there...

Comments (2) Trackbacks (0)
  1. Mac:openCurtain Souley$ ./open-curtains.pl 93.xxx.xx.xx
    Use of uninitialized value $port in concatenation (.) or string at ./open-curtains.pl line 14.
    [93.xx.xx.xx:] Trying to connect and snapshot.
    Use of uninitialized value $port in concatenation (.) or string at ./open-curtains.pl line 16.
    [93.xx.xx.xx:] Unable to connect: Invalid argument.

    What could be the problem in the code?

  2. Wouldn’t masscan or zmap be better at this then nmap?


Leave a comment

No trackbacks yet.