repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
32100-udp-pentesting-pppp-cs2-p2p-cameras.mdMarkdown179 lines11.4 KiBsource raw download

title: "32100/UDP - Pentesting PPPP (CS2) P2P Cameras" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/32100-udp-pentesting-pppp-cs2-p2p-cameras.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/32100-udp-pentesting-pppp-cs2-p2p-cameras.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

32100/UDP - Pentesting PPPP (CS2) P2P Cameras#

Overview#

PPPP (a.k.a. “P2P”) is a proprietary device connectivity stack by CS2 Network that’s widely embedded in low-cost IP cameras and other IoT devices. It provides rendezvous, NAT traversal (UDP hole punching), an application-layer “reliable” stream on top of UDP, and an ID-based addressing scheme, allowing a mobile/desktop app to reach devices anywhere on the Internet by knowing only a device ID.[1]

Key traits relevant to attackers:[1][4]

Typical device ID format (LookCam family): PREFIX-######-CCCCC, shortened in apps (e.g., GHBB-000001-NRLXW → G000001NRLXW). Observed prefixes: BHCC ("hekai"), FHBB and GHBB ("mykj").

Discovery and Enumeration#

Notes:

NAT Traversal and Transport#

Weak “Encryption” and Key Recovery#

Two ineffective mechanisms exist in the CS2 stack:[1]

  1. Blanket cipher (optional) – P2P_Proprietary_Encrypt
  1. Registration “encryption” – PPPP_CRCEnc

Simple keystream recovery for PPPP_CRCEnc (Python):

# ciphertext: captured bytes of an encrypted registration message
# known: guessed/known plaintext region (e.g., JSON or constant header)
keystream = bytes([c ^ p for c, p in zip(ciphertext[:len(known)], known)])
# Decrypt more bytes by XORing with the repeating keystream
pt = bytes([c ^ keystream[i % len(keystream)] for i, c in enumerate(ciphertext)])

Threat model mismatch: CS2 materials focus on preventing DoS via fake device registrations, not on confidentiality. This explains selective “encryption” of registration while video/control remain optional or cleartext. Historical PPPP servers show no rate limiting, enabling brute-force/abuse at scale.[1][5]

Control Plane: JSON Commands and Auth Bypass#

Many PPPP camera firmwares exchange JSON messages once the session is up. Example “login” the client sends:

{
  "cmd": "LoginDev",
  "pwd": "123456"
}

Common vulnerability in LookCam-class devices:

Useful commands observed:

Workflow to deanonymize location via transient artifacts:

  1. Send {"cmd":"searchWiFiList"}.
  2. Read /tmp/wifi_scan.txt through DownloadFile.
  3. Submit observed BSSIDs to an authorized geolocation service. Accuracy depends on the service's database and local access-point density.

Memory-Safety to RCE on Embedded Firmware#

Typical unsafe pattern (pseudocode from handlers):

char buf[256];
char *cmd = cJSON_GetObjectItem(request, "cmd")->valuestring;
memset(buf, 0, sizeof(buf));
memcpy(buf, cmd, strlen(cmd)); // no bound check

See also:#

Readme#

Readme

Cloud Storage Abuse (HTTP, Device-ID only)#

Many LookCam-branded firmwares upload recordings to api.l040z.com (apicn.l040z.com for BHCC) over HTTP only. Observations:

This is classic cleartext sensitive transmission (CWE-319) with missing server-side authZ.[1]

Device-ID Enumeration and Guessing#

Practical sources of IDs:

Forcing Remote Reachability#

Some firmwares reboot in a loop until rendezvous servers are reachable. If egress is blocked, the device will remain in a reboot cycle, effectively coercing owners to leave it Internet-reachable and exposed to PPPP rendezvous.[1]

Practical Exploitation Playbook (for repro/defense testing)#

  1. Obtain device ID
  1. Establish PPPP session
  1. Test the documented authentication bypass
  1. Validate file-read and geolocation exposure
  1. Validate memory safety in a lab
  1. Test cloud authorization

The concrete hostnames, commands, missing checks, and exploitability observations above describe the analyzed LookCam/Anyka ecosystem; they are not universal properties of every product that embeds a PPPP-derived library.[1][3]

Defensive validation#

554 8554 Pentesting Rtsp#

Readme

References#