Skip to content

About

Huawei HG8245H5 GPON ONT reverse engineering and security research

Resources

Stars

12 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Huawei HG8245H5 GPON ONT

Reverse engineering documentation for the Huawei HG8245H5 fiber optic terminal.

 _   _  ____  ___ ____  _  _  ____  _   _ ____  
| | | |/ ___|( _ )___ \| || || ___|| | | | ___| 
| |_| | |  _ / _ \ __) | || ||___ \| |_| |___ \ 
|  _  | |_| | (_) / __/|__   _|__) |  _  |___) |
|_| |_|\____|\___/_____|  |_||____/|_| |_|____/ 

Overview

The HG8245H5 is a GPON (Gigabit Passive Optical Network) ONT widely deployed by ISPs across South Asia, Southeast Asia, and other regions. This device serves as the demarcation point between the ISP's fiber network and the customer premises.

This repository documents findings from analyzing the device's firmware, CLI interface, web management system, and configuration structures. The research was conducted on personally-owned hardware deployed by SLT (Sri Lanka Telecom).


Table of Contents

  1. Hardware Specifications
  2. System Architecture
  3. Access Methods
  4. CLI Reference
  5. Web Interface
  6. Password Storage
  7. Network Configuration
  8. TR-069 Remote Management
  9. Known Issues
  10. Security Assessment
  11. Related Work

Hardware Specifications

+------------------------------------------------------------------+
|                        HUAWEI HG8245H5                           |
+------------------------------------------------------------------+
| SoC          | HiSilicon SD5116 (ARM Cortex-A9)                  |
| RAM          | 128 MB DDR3                                       |
| Flash        | 128 MB NAND                                       |
| GPON         | SD511X series optical transceiver                 |
| WiFi         | Hi1151v210 dual-band (2.4GHz b/g/n, 5GHz a/n/ac)  |
| Ethernet     | 4x Gigabit LAN (RTL8367RB switch)                 |
| Voice        | 2x POTS (FXS) via LE9641 SLIC                     |
| USB          | 1x USB 2.0 Host                                   |
| Power        | 12V DC, 1.5A                                      |
+------------------------------------------------------------------+

Firmware Information

Product Version    : V5R019C00S125
Inner Version      : V500R019C00SPC125B920
U-Boot Version     : 2017.07 (HiSilicon)
Kernel Version     : Linux 3.10.53-HULK2 (armv7l)
Filesystem         : SquashFS (rootfs) + JFFS2 (config)
Build Toolchain    : arm-hisi-linux-gnueabi-gcc 4.9.2

System Architecture

+-------------------+     +-------------------+
|   GPON Module     |<--->|    SD5116 SoC     |
|   (WAN - Fiber)   |     |                   |
+-------------------+     |  +-------------+  |
                          |  | ARM Core    |  |
+-------------------+     |  | (Linux)     |  |
|   RTL8367RB       |<--->|  +-------------+  |
|   (LAN Switch)    |     |                   |
+-------------------+     |  +-------------+  |
                          |  | NPU/HW Accel|  |
+-------------------+     |  | (Forwarding)|  |
|   Hi1151v210      |<--->|  +-------------+  |
|   (WiFi Module)   |     |                   |
+-------------------+     +-------------------+
                                   |
                          +--------+--------+
                          |                 |
                    +-----+-----+     +-----+-----+
                    | LE9641    |     | USB 2.0   |
                    | (VoIP)    |     | Host      |
                    +-----------+     +-----------+

Software Stack

Layer 4: Web UI (ASP) / CLI (WAP Shell) / TR-069 Client
Layer 3: BBSP (Broadband Service Platform) - Huawei proprietary
Layer 2: Linux 3.10.53 Kernel with HiSilicon BSP
Layer 1: U-Boot 2017.07 Bootloader
Layer 0: Hardware (SD5116 + peripherals)

The BBSP layer handles:

  • PPPoE/IPoE WAN connections
  • NAT/firewall rules
  • QoS and traffic shaping
  • VoIP SIP registration
  • CWMP (TR-069) communication
  • Configuration persistence

Access Methods

Telnet (Port 23)

Primary method for CLI access. The device runs a custom Huawei shell (WAP) with hierarchical privilege levels.

$ telnet 192.168.1.1

Welcome Visiting Huawei Home Gateway
Copyright by Huawei Technologies Co., Ltd.

Login: root
Password: ******

Default Credentials (varies by ISP/firmware):

Username Password Privilege Notes
root adminHW User Most common across deployments
telecomadmin admintelecom Admin Some ISP variants
admin admin User Rare

After login, the prompt shows WAP>. To escalate privileges:

WAP> su
success!
SU_WAP>

The SU_WAP> prompt provides access to configuration commands. Further escalation to a BusyBox shell:

SU_WAP> shell
WAP(Dopra Linux) #

Note: The BusyBox shell is heavily restricted. Many standard commands are unavailable or limited.

Web Interface (Port 80)

HTTP-based management accessible at http://192.168.1.1. Two user levels:

Account UserLevel Access
user 1 Basic settings (WiFi password, DHCP)
administrator 0 Full configuration access

The administrator password is stored encrypted in the configuration. Without it, web access is limited.

SSH (Port 22)

Disabled by default. Port scan shows filtered/closed. May be enabled via CLI but not documented.

Serial Console (UART)

Physical UART pins available on PCB (115200 8N1). Provides U-Boot and kernel console access. Useful for firmware recovery.


CLI Reference

Shell Hierarchy

Login (root/adminHW)
    |
    v
  WAP>  ----[su]---->  SU_WAP>  ----[shell]---->  BusyBox #
(User mode)          (Superuser)                (Linux shell)

Essential Commands

System Information

display version                    # Firmware versions
display sysinfo                    # CPU, memory, uptime
display startup info               # Boot configuration
display flashlock status           # Flash write protection (0=unlocked)
display board info                 # Hardware details

Configuration

display current-configuration      # Dump entire config as XML (~300KB)
save data                          # Write config to flash
reset                              # Factory reset (DANGEROUS)

Network

display waninfo all                # WAN connection status
display ip route                   # IPv4 routing table
display ip -6 route                # IPv6 routing table
display dhcp server lease          # DHCP leases
display dns server info            # DNS settings
ifconfig                           # Interface details (in shell mode)

Services

display tr069 info                 # Remote management status
display sip info                   # VoIP registration
display debug info dhcp6s          # DHCPv6 server state
display wlan config                # WiFi settings

User Management

set userpasswd                     # Change passwords (prompts interactively)

Configuration Dump Format

The display current-configuration command outputs XML:

<InternetGatewayDevice DBEncrypt="1">
  <WANDevice>
    <WANConnectionDevice>
      <WANPPPConnection>
        <Username>[email protected]</Username>
        <Password>$2{encrypted}$</Password>
        <X_HW_IPv4Enable>1</X_HW_IPv4Enable>
        <X_HW_IPv6Enable>1</X_HW_IPv6Enable>
      </WANPPPConnection>
    </WANConnectionDevice>
  </WANDevice>
  ...
</InternetGatewayDevice>

Web Interface

Architecture

+-------------+     +------------------+     +----------------+
|   Browser   |<--->|  HTTP Server     |<--->|  BBSP Backend  |
|             |     |  (lighttpd-like) |     |                |
+-------------+     +------------------+     +----------------+
                           |
                    +------+------+
                    |             |
              +-----+-----+ +-----+-----+
              | ASP Pages | | Static    |
              | (CGI)     | | Resources |
              +-----------+ +-----------+

Endpoints

Authentication

GET  /asp/GetRandCount.asp      # Fetch CSRF token (32 hex chars)
POST /login.cgi                 # Submit credentials
GET  /asp/Logout.asp            # Terminate session

Configuration

GET  /asp/GetConfig.asp?para=X  # Read config parameter
POST /asp/SetConfig.asp         # Write config parameter

Authentication Flow

  1. Client requests /asp/GetRandCount.asp, receives CSRF token
  2. Client computes authentication cookie:
    SHA256(token) + SHA256(username + token) + SHA256(SHA256(MD5(password)) + token)
    
  3. Password sent as base64 in POST body alongside cookie
  4. Server validates, sets session cookie
  5. Session bound to client IP

Security Headers

Cache-Control: no-cache, no-store, max-age=0
X-Frame-Options: SAMEORIGIN

No HTTPS support. All traffic including credentials transmitted in cleartext.


Password Storage

Format

Stored passwords use a proprietary encryption scheme:

$2{encrypted_content}$

Components:

  • Prefix: $2 (constant)
  • Content: Variable-length encrypted data (printable ASCII)
  • Suffix: $ (constant)
  • Salt: 24 hex characters stored in separate attribute

Storage Modes

Mode Usage Salt Attribute
EncryptMode="2" CLI users Salt="..."
PassMode="3" Web users Salt="..."

Analysis

Despite the $2 prefix resembling bcrypt, this is NOT bcrypt:

  • bcrypt format: $2a$10$salthere...hashhere
  • Huawei format: $2{random_chars}$

Observations:

  • Output length varies (suggests encryption, not hashing)
  • Character set extends beyond base64
  • Salt stored separately (typical for symmetric encryption)
  • Same device can verify passwords (implies decryption or re-encryption)

Probable algorithm: AES or 3DES with device-specific key derivation.

See docs/password-encryption.md for detailed analysis.


Network Configuration

WAN Modes

+-------------------+     +-------------------+
|     PPPoE Mode    |     |    IPoE Mode      |
+-------------------+     +-------------------+
| - ISP username    |     | - DHCP client     |
| - ISP password    |     | - Static IP       |
| - MTU 1492        |     | - MTU 1500        |
| - VLAN tagging    |     | - VLAN tagging    |
+-------------------+     +-------------------+

Dual-Stack (IPv4 + IPv6)

The device supports simultaneous IPv4 and IPv6:

X_HW_IPv4Enable="1"    # IPv4 enabled on WAN
X_HW_IPv6Enable="1"    # IPv6 enabled on WAN

IPv6 implementation:

  • DHCPv6-PD for prefix delegation from ISP
  • Router Advertisement (RA) for LAN clients
  • Stateless address autoconfiguration (SLAAC)
  • Optional DHCPv6 server for LAN

VLAN Configuration

ISP typically assigns VLANs:

  • VLAN 20: Internet service
  • VLAN 30: VoIP service
  • VLAN 40: IPTV service (if applicable)

TR-069 Remote Management

Overview

TR-069 (CWMP - CPE WAN Management Protocol) enables ISP remote management:

+-------------+     HTTPS      +-------------+
|   Device    |<-------------->|   ACS       |
|   (CPE)     |   (Port 443)   |   Server    |
+-------------+                +-------------+

Status Check

SU_WAP> display tr069 info

EnableCWMP: 1
URL: http://acs.example.isp/
Username: acs@isp
ConnectionRequestURL: http://device-ip:30005/
PeriodicInformEnable: 1
PeriodicInformInterval: 86400

Implications

When TR-069 is enabled:

  • ISP can read/write any configuration parameter
  • Firmware can be remotely updated
  • Local changes may be overwritten
  • Some settings may be locked

Disabling TR-069 may require ISP cooperation or config modification.


Known Issues

IPv6/IPv4 Dependency

Symptom: Disabling IPv6 on client devices breaks IPv4 connectivity.

Observed Behavior:

1. Client requests IPv6 disable (Link-Local Only or Off)
2. IPv6 connectivity stops (expected)
3. IPv4 connectivity also fails (unexpected)
4. Re-enabling IPv6 restores both

Probable Causes:

  • Router's PPP session management couples IPv4/IPv6
  • ISP provisioning requires dual-stack
  • Bug in BBSP network stack

Workarounds:

  • Use secondary router behind ONT
  • Configure client-side firewall instead
  • Request ISP assistance

Restricted Shell

The BusyBox shell lacks many standard utilities:

  • No wget, curl
  • No vi, nano
  • Limited cat, ls
  • No package management

Security Assessment

Vulnerabilities

Issue Severity Description
Default credentials HIGH Well-known root/adminHW in wide use
Telnet enabled MEDIUM Unencrypted protocol, credentials visible
HTTP-only web UI MEDIUM No TLS, credentials transmitted cleartext
Weak password storage MEDIUM Encryption (reversible) vs hashing
TR-069 backdoor LOW ISP has full remote access

Recommendations

  1. Change default passwords immediately after deployment
  2. Disable telnet if not needed:
    # Method TBD - may require TR-069 or ISP
    
  3. Segment network - place ONT in DMZ, use separate router
  4. Monitor configuration - TR-069 can silently modify settings

Related Work

Similar Devices

  • Huawei HG8245H (predecessor)
  • Huawei HG8546M (different chipset)
  • Huawei EchoLife series

References

  • TR-069 Amendment 6 Specification (Broadband Forum)
  • GPON Standard ITU-T G.984
  • HiSilicon SD5116 Documentation (limited availability)

Community Resources


Repository Structure

.
├── README.md                      # This file
├── LICENSE                        # MIT License
└── docs/
    ├── password-encryption.md     # Encryption scheme analysis
    └── web-interface.md           # Web server documentation

Contributing

Research contributions welcome:

  • Password encryption algorithm identification
  • CLI command documentation
  • Firmware analysis
  • Alternative access methods
  • ISP-specific findings

Open an issue or submit a pull request.


Disclaimer

This documentation is provided for educational and research purposes. The techniques described should only be applied to equipment you own or have explicit authorization to analyze. Unauthorized access to computer systems is illegal.


License

MIT License. See LICENSE for details.

The programs included with this repository are free software.
The exact distribution terms for each program are described in LICENSE.

About

Huawei HG8245H5 GPON ONT reverse engineering and security research

Resources

Stars

12 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors