Checks if you're allowed to connect to the X server.
If the X server is listening on TCP port 6000+n (where n is the display number), it is possible to check if you're able to get connected to the remote display by sending a X11 initial connection request.
In reply, the success byte (0x00 or 0x01) will determine if you are in
xhost + list. In this case, script will display the message:
X server access is granted.
nmap -sV -sC <target>
Host script results: |_ x11-access: X server access is granted
License: Same as Nmap--See http://nmap.org/book/man-legal.html