Detect VNC in Splunk
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/
SPL Detection Query
index=wineventlog (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" OR sourcetype="WinEventLog:Security")
(
(EventCode=1
(Image="*\\vncserver.exe" OR Image="*\\vncviewer.exe" OR Image="*\\tvnserver.exe" OR Image="*\\tvnviewer.exe" OR Image="*\\winvnc.exe" OR Image="*\\winvnc4.exe" OR Image="*\\uvnc_service.exe" OR Image="*\\ultravnc.exe")
| eval AlertType="VNC_ProcessExecution"
| table _time, host, User, Image, CommandLine, ParentImage, AlertType)
OR
(EventCode=3
(DestinationPort>=5900 AND DestinationPort<=5910)
| eval AlertType="VNC_NetworkConnection"
| table _time, host, Image, DestinationIp, DestinationPort, AlertType)
OR
(EventCode=7045 OR EventCode=4697)
ServiceName IN ("uvnc_service", "tvnservice", "vncserver", "winvnc", "rfbdrv")
| eval AlertType="VNC_ServiceInstall"
| table _time, host, ServiceName, ServiceFileName, AlertType)
)
| sort - _time Detects VNC activity in Windows environments using Sysmon events: Event ID 1 (process creation for VNC binaries including tvnserver, vncviewer, winvnc, uvnc_service), Event ID 3 (network connections to port range 5900-5910), and Event ID 7045/4697 (VNC service installation). The AlertType field classifies the detection category.
Data Sources
Required Sourcetypes
False Positives & Tuning
- IT help desk staff using VNC for legitimate end-user support
- System administrators using VNC to manage servers
- Vendor remote support solutions with VNC
- Development environments using VNC for headless Linux server GUI
- ICS environments using VNC for SCADA HMI access
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.