Kuboid
Open Luck·Kuboid.in

Watchers Being Watched: Exploiting Surveillance Systems and Their Supply Chain

DEFCONConference15,461 views43:48over 1 year ago

This talk demonstrates multiple critical vulnerabilities in NVR and surveillance systems, including stack-based buffer overflows, command injection, and authentication bypasses. The researchers analyze the firmware of major vendors like Hikvision and Dahua, revealing how these vulnerabilities propagate through the supply chain to re-labeled OEM products. The presentation provides a methodology for firmware extraction, vulnerability analysis, and exploitation, culminating in a demonstration of full device takeover and real-time video tampering. The findings highlight the significant security risks posed by insecure IoT devices exposed to the internet.

Breaking Surveillance: How Insecure NVRs and OEM Supply Chains Enable Remote Takeovers

TLDR: Researchers at DEF CON 2024 demonstrated how critical vulnerabilities in NVR and DVR firmware, including stack-based buffer overflows and authentication bypasses, allow for full remote device takeover. These flaws propagate through the supply chain to countless re-labeled OEM products, creating a massive, unpatched attack surface. Pentesters should prioritize auditing these devices for OWASP Injection and Broken Access Control flaws, while defenders must isolate these systems from external networks immediately.

Surveillance systems are the silent sentinels of our infrastructure, yet they are often the most neglected components in a network. When we talk about IoT security, we usually focus on the cameras themselves, but the real brain of the operation is the Network Video Recorder (NVR). These devices aggregate video feeds, manage user access, and frequently sit exposed to the internet to facilitate remote monitoring. The research presented at DEF CON 2024 proves that these devices are not just vulnerable; they are often wide open, with flaws that allow an attacker to bypass authentication, execute arbitrary code, and manipulate live video feeds in real-time.

The Anatomy of an NVR Takeover

The research focused on major vendors like Hikvision and Dahua, but the implications extend far beyond these names. Because these companies act as massive OEM suppliers, their vulnerable firmware is baked into hundreds of re-labeled products sold by smaller, regional vendors. If you find a vulnerability in a base Hikvision or Dahua device, you have effectively found it in a significant portion of the global surveillance market.

The researchers utilized a systematic approach to firmware analysis, starting with extraction via UART and moving into dynamic analysis using GDB and GEF. One of the most striking findings was the prevalence of stack-based buffer overflows in background services like the 'Aol' service running on port 8088. By manipulating the data size field in the service header, an attacker can overwrite the return address on the stack. Since these devices often lack modern exploit mitigations like stack canaries, achieving code execution is straightforward.

For example, the command injection vulnerability identified in Hikvision NVRs, tracked as CVE-2024-29949, allows an authenticated user to execute arbitrary commands. When combined with an authentication bypass, the barrier to entry for an attacker disappears.

Exploitation Techniques in the Wild

During the presentation, the researchers demonstrated a multi-stage attack flow. First, they used credential stuffing to gain initial access. Once inside, they triggered a buffer overflow to gain a shell. From there, they moved laterally, using the device as a pivot point to scan the internal network for Windows machines. The final blow involved exploiting a vulnerability in a third-party plugin, CVE-2023-28812, which allowed them to achieve remote code execution on the client-side Windows workstation.

The demo of real-time video tampering was particularly chilling. By manipulating the RTSP path through the NVR’s management interface, the attackers could swap a live feed for a static image or a pre-recorded loop without triggering any alarms. This is not just a theoretical risk; it is a direct threat to the integrity of any physical security system relying on these devices.

For those conducting penetration tests, the methodology is clear. Do not just scan for open ports. Focus on the management web interface and the underlying API endpoints. Use Shodan to identify exposed NVRs, but remember that the device name is often hidden or generic. Look for patterns in the config.json or sea.js files, which often contain versioning information that can be mapped back to known vulnerable firmware builds.

The Supply Chain Trap

The most dangerous aspect of this research is the supply chain reality. When you buy a "white-label" NVR from a local distributor, you are likely buying a re-branded Dahua or Hikvision device. The firmware is identical, meaning the same CVEs apply. The researchers performed binary diffing between the original manufacturer's firmware and that of several OEM vendors, finding that the core logic—and the vulnerabilities—remained unchanged.

Defending against this requires a shift in mindset. If you are managing these devices, the first rule is absolute isolation. These systems should never be reachable from the public internet. If remote access is required, force all traffic through a VPN or a secure gateway. Disable UPnP and any cloud-based P2P features that punch holes in your firewall.

What to Do Next

If you are currently auditing a network, treat every NVR as a high-value target. Assume that if you can reach the management interface, you can likely find a way to bypass authentication or trigger a memory corruption bug. The lack of basic security hygiene in these devices is staggering, and the fact that these vulnerabilities persist across re-branded products makes them a persistent threat.

Start by mapping your internal assets. Identify every NVR, DVR, and IP camera on your network. Check their firmware versions against the latest vendor advisories. If a device is end-of-life or the vendor has stopped providing patches, it is time to replace it or move it to a completely isolated VLAN with no egress traffic. The era of "set it and forget it" for surveillance hardware is over. Every device you leave unpatched is an open door for an attacker to walk through.

Talk Type
research presentation
Difficulty
advanced
Category
iot security
Has Demo Has Code Tool Released


DEF CON 32

260 talks · 2024
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in