Skip to main content
Critical December 18, 2014

Command Execution and Backdoor in Zhone GPON-2520

This post will describe a backdoor account found in the Zhone GPON-2520 and will provide a PoC which can be used to disable the firewall filtration rules in order to allow access to services such as ssh, telnet and ftp.

CVSS Score

9.8 / 10.0

Severity

Critical

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Advisory

DeviceZhone GPON-2520
FirmwareR4.0.2.566b (distributed in Mexico by Axtel)
ImpactRemote root shell via backdoor account + authenticated command execution

Description

The Zhone GPON-2520 ships with two severe vulnerabilities that combine to give a remote attacker a root shell.

The first is arbitrary command execution through the administrative web interface (the same pattern previously documented on Alcatel ONTs). The second is a backdoor account whose password cannot be changed from any documented interface.

By default, the SSH service is filtered by the device firewall and the regular web-admin account cannot log in over SSH. Chaining the two issues — using the web RCE to drop the firewall, then logging in as the backdoor account over SSH — yields full interactive root access.

Default Port Exposure

Before exploitation, a port scan via w3dt.net shows which services are reachable from the Internet:

Internet-side port scan of the Zhone GPON-2520

From the local network, the following additional ports are visible:

LAN-side port scan of the Zhone GPON-2520

Proof of Concept

The only prerequisites are the internal IP of the GPON and the web-admin credentials (root:admin by default).

Web admin login with default credentials

Run the Websec PoC to disable the firewall rules that block incoming SSH, Telnet, and FTP:

Running the firewall-disable PoC

After the PoC runs, the firewall rules blocking inbound critical services are disabled, and the backdoor account accepts SSH with super-user privileges:

SSH into the GPON via the backdoor account

The backdoor is configured in /etc/rg_zhone.xml:

Backdoor configuration in /etc/rg_zhone.xml

The same backdoor account is referenced in public Alcatel advisories:

Cross-reference with Alcatel advisories

Once inside, credentials for other services are trivially recoverable. FTP is ont:ont:

FTP credentials in the device configuration

Cracking /etc/passwd reveals that root is 111111:

Cracked /etc/passwd showing root password

Typing enable in the device shell unlocks additional configuration modes from which any part of the device can be controlled:

Device shell enable mode, configuration tree

Additional privileged subcommands

For example, the front-panel LEDs can be turned off from the CLI:

Disabling the front-panel LEDs from the CLI

Containment

Because the backdoor cannot be removed on the device, the only defence is to block inbound traffic to the management services at the network edge. The following iptables rules filter the relevant ports on both the Internet-facing and LAN-side interfaces:

iptables -A INPUT -i wan0 -p tcp --dport 22    -j DROP
iptables -A INPUT -i wan0 -p tcp --dport 23    -j DROP
iptables -A INPUT -i wan0 -p tcp --dport 53    -j DROP
iptables -A INPUT -i wan0 -p tcp --dport 80    -j DROP
iptables -A INPUT -i wan0 -p tcp --dport 7001  -j DROP
iptables -A INPUT -i wan0 -p tcp --dport 7002  -j DROP
iptables -A INPUT -i wan0 -p tcp --dport 49152 -j DROP

iptables -A INPUT -i wan8 -p tcp --dport 22    -j DROP
iptables -A INPUT -i wan8 -p tcp --dport 23    -j DROP
iptables -A INPUT -i wan8 -p tcp --dport 53    -j DROP
iptables -A INPUT -i wan8 -p tcp --dport 80    -j DROP
iptables -A INPUT -i wan8 -p tcp --dport 7001  -j DROP
iptables -A INPUT -i wan8 -p tcp --dport 7002  -j DROP
iptables -A INPUT -i wan8 -p tcp --dport 49152 -j DROP

After the rules are applied, a repeat port scan from the Internet shows the management services are no longer reachable:

Internet-side port scan after applying iptables rules

Making these changes persistent requires modifying the device image, which risks bricking the unit — at your own risk.

Original advisory by Luis Ramirez; translated by Roberto Salgado.

Remediation

Disable WAN-side HTTP, Telnet, SSH, and FTP. No vendor fix for the backdoor account.

Share this advisory:

Related Security Advisories

Stay informed about other recent vulnerabilities and security advisories

High May 22, 2014

Huawei HG8245 / HG8247 WPA Generator

Huawei HG8245 & HG8247 ONT (firmware version V1R006C00S100) rely on a weak algorithm to calculate the WPA keys, keys can be predicted easily using the WiFi's MAC Address (BSSID).

Severity:
CVSS: 7.4
View advisory
High December 19, 2013

Arbitrary Command Execution in Alcatel-Lucent I-240W-Q

The Alcatel-Lucent I-240W-Q ONT's Diagnostics page does not filter shell metacharacters in the IP address field, allowing any authenticated administrator to execute arbitrary commands as root and fully compromise the device.

Severity:
CVSS: 8.0
View advisory