PPPP (CS2) P2P Cameras - Port 32100 UDP

Basic Info

Peer-to-peer (P2P) enabled cameras represent one of the most significant security risks in the IoT ecosystem today. With over 50 million devices utilizing vulnerable P2P protocols like CS2 Network P2P and Shenzhen Yunni iLnkP2P, these cameras have become prime targets for attackers worldwide. This comprehensive guide provides security professionals with the complete methodology for identifying, analyzing, and testing P2P camera security.

The P2P Camera Problem

What Makes P2P Cameras So Dangerous?

  1. Automatic Internet Exposure: P2P cameras bypass NAT/firewalls automatically, making them accessible from anywhere

  2. No User Configuration Required: The "plug and play" nature means users have no visibility into security settings

  3. Massive Scale: Over 8.7 million vulnerable devices identified on the Internet as of 2022

  4. Weak Authentication: Default credentials, predictable UIDs, and poor password policies

  5. Built-in Backdoors: Some implementations include intentional backdoors for "cloud access"

  6. Supply Chain Issues: Hundreds of brands use the same vulnerable firmware

Affected Device Types

  • IP Security Cameras (indoor/outdoor)

  • Baby Monitors

  • Doorbell Cameras

  • Digital Video Recorders (DVRs)

  • Network Video Recorders (NVRs)

  • Smart Home Alarm Systems

  • Nanny Cams

  • Pet Cameras

Common Brands & Vendors

Over 300 brands use vulnerable P2P implementations, including:

  • VStarcam

  • HiChip/Hichip Vision

  • ICSee

  • CamHi

  • LookCam

  • O-KAM Pro

  • Wireless IP Camera (P2P) WIFICAM

  • Yi Technology cameras

  • And hundreds more white-label products


Understanding P2P Camera Architecture <a name="architecture"></a>

How P2P Cameras Work

Traditional IP cameras require manual port forwarding and DDNS configuration. P2P cameras eliminate this through a relay system:

The P2P Connection Flow:

  1. Device Registration

    • Camera boots up and connects to hardcoded P2P servers

    • Sends registration with unique UID (e.g., "ABC-123456-VWXYZ")

    • Reports its public IP address and port mapping

    • Maintains persistent connection via keep-alive packets

  2. Client Discovery

    • Mobile app or PC client connects to P2P servers

    • Queries for device using UID

    • Receives device's public IP and port information

  3. NAT Traversal (UDP Hole Punching)

    • Client and device send simultaneous UDP packets to each other

    • Both NAT routers create temporary mappings

    • Direct peer-to-peer connection established

  4. Fallback Relay Mode

    • If direct connection fails, traffic relays through P2P servers

    • Camera becomes a "supernode" that can relay other users' traffic

    • Critical: Users unknowingly proxy strangers' video streams

Device UID Structure

UIDs follow a predictable format that enables enumeration:

Vulnerability: The verification code uses only 22 letters (excluding A, I, O, Q), resulting in approximately 5 million possible combinations - easily brute-forceable.

Network Ports Used

Port
Protocol
Purpose

32100

UDP

Primary P2P communication, device registration

32108

UDP

Alternative P2P port, "hello" messages

32101-32110

UDP

Additional P2P relay ports

443

TCP

Obfuscated traffic (not real HTTPS)

80

TCP

HTTP web interface on camera

554

TCP

RTSP video streaming

8000-8001

TCP

Alternative HTTP ports

Hardcoded P2P Servers

Analysis reveals cameras connect to specific server IPs/domains:

Common CS2 Network Servers:

Common iLnkP2P Servers:


The PPPP/CS2 Protocol Explained

Protocol Overview

PPPP (Peer-to-Peer Proprietary Protocol) is a UDP-based protocol developed by CS2 Network. Despite the name, it attempts to replicate TCP functionality over UDP with custom reliability mechanisms.

Message Structure

Basic PPPP Message Format:

Example "Hello" Message (First packet sent to port 32100):

Message Types

Common message types identified through reverse engineering:

"Encryption" & Obfuscation

The protocol uses weak obfuscation, not real encryption:

P2P_Proprietary_Encrypt Function

Common Hardcoded Keys:

Critical Weakness: Keys are stored plaintext in mobile apps and can be extracted via APK decompilation.

PPPP_CRCEnc Function (Additional Layer)

Protocol Vulnerabilities

  1. Weak Obfuscation: XOR-based "encryption" easily reversible

  2. Known Plaintext: First packet always starts with F1 00 00 00

  3. Hardcoded Keys: Keys embedded in application binaries

  4. No Perfect Forward Secrecy: Same key used for entire session

  5. Replay Attacks: No nonce or timestamp validation

  6. Man-in-the-Middle: No certificate validation on "HTTPS" fallback


Reconnaissance & Discovery

1. Network Scanning

Discovering P2P Cameras on Local Network

UDP Port 32100 Detection

Expected Response Pattern:

2. LAN Search Protocol

P2P cameras support local network discovery via broadcast:

LAN Search Message Structure:

3. Internet-Wide Discovery

Using Shodan

Using Censys

Using Masscan

4. Identifying P2P Servers

Passive Monitoring:

Expected P2P Server Indicators:

5. Device Fingerprinting


Protocol Analysis & Reverse Engineering

1. Wireshark Analysis

Installing PPPP Dissector

Capturing P2P Traffic

Analyzing Captures

2. Decrypting Traffic

3. Reverse Engineering Mobile Apps

Extracting APK

Decompiling with JADX

Finding Encryption Keys

Extracting Init Strings

Init strings contain server addresses and encryption keys:

4. Firmware Analysis

Extracting Firmware

Analyzing Filesystem

Finding PPPP Configuration


Enumeration Techniques

1. UID Enumeration

UIDs are predictable, allowing mass enumeration:

2. Using Paul Marrapese's Tools

3. Rogue Supernode Attack

Attackers can register as a "supernode" to collect device UIDs:

Note: This technique was publicly disclosed by Paul Marrapese in 2019 and used to discover millions of devices.

4. Passive Traffic Analysis


Authentication & Credential Attacks

1. Default Credentials

Common default credentials for P2P cameras:

2. Credential Interception

P2P protocols often transmit credentials in plaintext or weak obfuscation:

3. Man-in-the-Middle Attack

4. Password Extraction from Firmware


Exploitation Techniques

1. Direct RTSP Stream Access

Many P2P cameras expose RTSP streams without proper authentication:

2. Command Injection

Some camera web interfaces are vulnerable to command injection:

3. CVE-2020-9529: Hichip Buffer Overflow

Critical pre-authentication RCE affecting millions of cameras:

Vendor Response: Patched in June 2020 firmware updates, but many devices remain vulnerable.

4. Firmware Backdoors

Some vendors include intentional backdoors:

5. Exploiting Dual Authentication Bypass

VStarcam and similar cameras have dual authentication backdoors:


Critical Vulnerabilities

1. CVE-2019-11219: iLnkP2P UID Enumeration

Impact: Allows attackers to discover and connect to 3.6+ million devices

Details:

  • UIDs are predictable and sequential

  • No rate limiting on UID verification

  • Verification codes use only 22 characters (~5M combinations)

Exploitation:

Vendor Status: No fix from Shenzhen Yunni (abandoned product)

2. CVE-2019-11220: iLnkP2P Man-in-the-Middle

Impact: Complete traffic interception, credential theft, video stream access

Details:

  • No encryption for credentials

  • No certificate validation

  • Session tokens transmitted in plaintext

Exploitation:

3. CVE-2020-9525/9526: CS2 Network P2P MitM

Impact: Same as iLnkP2P - affects 50+ million devices

Details:

  • Weak XOR-based obfuscation

  • Hardcoded encryption keys in apps

  • No authentication of P2P servers

Exploitation: Similar to iLnkP2P, but requires decryption with extracted key

4. CVE-2020-9529: Hichip Pre-Auth RCE

Impact: Remote code execution as root without authentication

Details:

  • Buffer overflow in LAN search handler

  • No stack protection (ASLR/NX often disabled)

  • Affects 81% of iLnkP2P devices (60+ million cameras)

Exploitation: See exploitation section above

Vendor Status: Patched June 2020, but millions remain vulnerable

5. Supernode Relay Exploitation

Impact: Traffic from millions of users relayed through compromised devices

Details:

  • Devices can be promoted to "supernode" status

  • Supernodes relay traffic for other P2P connections

  • Users unaware their camera is proxying strangers' video

Exploitation:


Post-Exploitation & Persistence

1. Maintaining Access

2. Lateral Movement


Defense & Mitigation

1. Immediate Actions

For Users:

For Network Administrators:

2. Long-Term Solutions

  1. Replace Vulnerable Cameras

    • Avoid any P2P-enabled devices

    • Use cameras with local-only access

    • Prefer enterprise brands with security track records

  2. Network Segmentation

    • Isolate IoT devices on separate VLAN

    • No Internet access for cameras

    • VPN for remote access

  3. Monitoring & Detection


Practical Lab Scenarios

Lab 1: Setting Up Vulnerable Environment

Lab 2: Traffic Analysis Exercise

Lab 3: Exploitation Practice


Conclusion

P2P cameras represent a critical security failure in the IoT ecosystem. With over 50 million vulnerable devices and no patches from many vendors, these cameras will remain exploitable for years to come.

Key Takeaways:

  1. Never use P2P-enabled cameras for security-sensitive applications

  2. Block UDP port 32100 at firewall to disable P2P

  3. Replace vulnerable cameras - patching is often impossible

  4. Implement defense in depth - VLANs, VPNs, monitoring

  5. Stay informed - new vulnerabilities discovered regularly

For Pentesters:

  • P2P cameras are low-hanging fruit in most environments

  • Tools and exploits widely available

  • Mass exploitation possible via UID enumeration

  • Always obtain proper authorization before testing


Additional Resources

Tools & Scripts

Vulnerability Databases

  • CVE-2019-11219 (iLnkP2P UID Enumeration)

  • CVE-2019-11220 (iLnkP2P MitM)

  • CVE-2020-9525 (CS2 Network MitM)

  • CVE-2020-9526 (CS2 Network MitM)

  • CVE-2020-9529 (Hichip Pre-Auth RCE)

circle-check

Last updated