Detect VNC in Elastic Security
Adversaries may use Valid Accounts to remotely control machines using Virtual Network Computing (VNC). VNC uses the Remote Framebuffer (RFB) protocol to relay screen, mouse, and keyboard inputs over the network. Unlike RDP, VNC provides screen-sharing rather than resource-sharing, making it useful for interactive control. Threat actors including Gamaredon Group, FIN7, and APT groups have used VNC tools including UltraVNC, TightVNC, TigerVNC, and RealVNC for lateral movement and remote access. VNC communicates on TCP port 5900+ by default and can be used with or without password authentication, with some implementations historically vulnerable to authentication bypasses.
MITRE ATT&CK
- Tactic
- Lateral Movement
- Technique
- T1021 Remote Services
- Sub-technique
- T1021.005 VNC
- Canonical reference
- https://attack.mitre.org/techniques/T1021/005/
Elastic Detection Query
any where
(
event.category == "process" and event.type == "start" and
process.name in~ ("vncserver.exe", "vncviewer.exe", "vncconfig.exe",
"vnc4server", "x0vncserver", "tightvncserver", "tightvncviewer.exe",
"ultravnc.exe", "uvnc_service.exe", "tvnserver.exe", "tvnviewer.exe",
"winvnc.exe", "winvnc4.exe", "rfbdrv.exe")
) or
(
event.category == "process" and event.type == "start" and
process.parent.name in~ ("vncserver.exe", "tvnserver.exe", "winvnc.exe",
"uvnc_service.exe", "ultravnc.exe")
) or
(
event.category == "network" and event.type == "start" and
network.transport == "tcp" and
destination.port >= 5900 and destination.port <= 5910
) or
(
event.category == "registry" and
event.type in ("creation", "change") and
registry.path like~ ("*RealVNC*", "*TightVNC*", "*UltraVNC*", "*TigerVNC*", "*WinVNC*", "*RFBDRV*")
) or
(
event.category == "registry" and
event.type in ("creation", "change") and
registry.value like~ ("*vncserver*", "*tvnserver*", "*winvnc*", "*uvnc*")
) Detects VNC-related activity across process execution, network connections on TCP ports 5900-5910, and registry key creation/modification using Elastic Common Schema fields. Covers parent process spawning, VNC service binary execution, and registry persistence for known VNC implementations including RealVNC, TightVNC, UltraVNC, TigerVNC, and WinVNC.
Data Sources
Required Tables
False Positives & Tuning
- IT helpdesk and sysadmin teams using authorised VNC-based remote support tools (e.g., RealVNC Viewer for managed endpoint administration with documented approval and known source IPs)
- Automated UI testing pipelines in CI/CD environments running headless VNC servers (e.g., Xvnc, x11vnc) for browser or desktop application testing on Linux build agents
- Vulnerability scanners and asset inventory tools (e.g., Nessus, Rapid7 InsightVM, Shodan internal crawlers) generating TCP connection attempts to port 5900 during scheduled service discovery scans
Other platforms for T1021.005
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Install TightVNC Server as Windows Service
Expected signal: Sysmon Event ID 1: tvnserver.exe with -install flag. Windows Security Event ID 7045: new service tvnservice created. Registry key created at HKLM\SOFTWARE\TightVNC. Sysmon Event ID 12 (registry key create) for TightVNC registry entries.
- Test 2VNC Connection to Remote Host via vncviewer
Expected signal: Sysmon Event ID 1: tvnviewer.exe process creation with target IP. Sysmon Event ID 3: outbound TCP connection to 127.0.0.1:5900. Windows firewall log entry for port 5900 connection.
- Test 3Configure UltraVNC with No Authentication (Backdoor Setup)
Expected signal: Sysmon Event ID 13 (Registry Value Set) for HKLM\SOFTWARE\UltraVNC\Password and SecurityIdentifier. Security Event ID 4657 (registry value modified). Parent process visible as cmd.exe.
- Test 4Start VNC Server on Non-Standard Port
Expected signal: Linux auditd EXECVE for vncserver with -rfbport 5901 and -SecurityTypes None. Network socket opened on port 5901. Process creation for Xvnc child process.
References (7)
- https://attack.mitre.org/techniques/T1021/005/
- https://www.tightvnc.com/
- https://www.realvnc.com/en/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1021.005/T1021.005.md
- https://symantec-enterprise-blogs.security.com/blogs/threat-intelligence/shuckworm-ukraine-gamaredon
- https://www.crowdstrike.com/blog/carbon-spider-embraces-big-game-hunting/
- https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
Unlock Pro Content
Get the full detection package for T1021.005 including response playbook, investigation guide, and atomic red team tests.