Skip to content
RCE Write-up Intermediate

Hacking Zyxel IP cameras to gain a root shell

The Zyxel IP cameras expose an unauthenticated RTSP video stream and a UPnP service that serves configuration files, and the profile export/import feature allows adding cron jobs or startup scripts that run as root. An attacker with network access could view the video feed without credentials, crash the RTSP server on one model, and, with admin credentials, gain a root shell.

Eric Urban Follow

Published on hydrogen18.com

I bought these cameras primarily to use as a test device for work. I needed something that had an ethernet interface and worked as an IP based device.

Eric Urban, on hydrogen18.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the RTSP server lacks authentication, the UPnP service exposes configuration files, and the profile import feature allows arbitrary files (cron jobs, startup scripts) to be placed in a directory that is executed with root privileges.

Impact

An attacker on the same network could view the video stream without authentication, crash the RTSP server on one model, and, if they have admin credentials, gain a root shell on the device.

What the attacker needed

Network access to the camera; admin credentials for root shell

The fix

The devices are no longer supported and should be removed from service; otherwise, authentication should be added to the RTSP stream, UPnP should be disabled, and profile imports should be restricted.

How it was found

  1. Scan the device to find open ports including RTSP on 554 and UPnP on 49152.
  2. Send an RTSP DESCRIBE request to the /medias1 path to access the video stream without authentication.
  3. Send an RTSP DESCRIBE request to /medias2 to crash the RTSP server on the IPC-3605N model.
  4. Export the profile from the web interface, which is a gzip-compressed tarball containing a crontab file.
  5. Modify the crontab to add a line that starts a telnet daemon, then re-import the profile.
  6. Connect to the telnet daemon to obtain a root shell.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

These cameras have several security holes. Anyone on the network can watch the video without logging in, and one model can be crashed remotely. If you know the admin password, you can also upload a modified settings backup that makes the camera run your commands as the root user, giving full control.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Eric Urban

View all

1 more disclosed report, best first.

More from Zyxel

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.