Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

Hut-hzf/ung220z-tool

Security & Privacy

Extract current admin, PPPoE, Wi-Fi and root credentials from your own UNG220Z optical modem via Telnet.

1,005
254
Python
MIT
3 days old

What it does

UNG220Z optical modems (Unionman / China Mobile) run a .gch CGI web admin where the login password is rotated periodically through TR-069, so the sticker password often stops working after a few days. This tool opens the Telnet channel through the modem's own telnet.gch endpoint, logs in as root, decrypts the device configuration database with sidbg 1 DB decry, and prints currently valid credentials: web account, Telnet password, PPPoE, Wi-Fi keys and root password. It is intended for owners recovering a forgotten admin password, migrating broadband settings, or auditing their own device; unauthorized use on other people's equipment is illegal.

Quick start

Requirements: Python 3.8+ (standard library only, no pip install), and the modem reachable on the LAN. Run from the repository directory:

python3 ung220z.py

The script prompts for the modem address (default 192.168.1.1), the web username (default user) and password; these are normally printed on the sticker on the back of the modem. Non-interactive use:

python3 ung220z.py -i 192.168.1.1 -u user -p 'your-password'
python3 ung220z.py -i 192.168.1.1 -u user -p 'your-password' --no-browser

If the web session is locked, --unlock restarts httpd; --no-release skips releasing a leftover web session; --telnet-user and --telnet-password override the default CMCCAdmin Telnet account when it differs from the web password. On success the tool prints a credential table and writes an ung220z_<timestamp>.log file in the working directory.

How it works

The tool first requests /usr=<user>&psw=<pass>&cmd=1&telnet.gch, expecting TelnetSet Success! to enable Telnet; it probes port 23 and logs in as root. The web password is only base64-encoded on the front end, with a Frm_Logintoken that increments per response and must be echoed back. sidbg 1 DB decry /userconfig/cfg/db_user_cfg.xml decrypts the config without a passphrase, and the root password is checked against common factory defaults using the SHA-256 crypt hash in /etc/shadow. See the usage and parameter reference for details.

Constraints

  • Specific to UNG220Z (Unionman / China Mobile) modems; the workarounds assume that model's CGI framework and sidbg command.
  • Must be run on the same LAN as the modem; Telnet must be enabled or enableable through telnet.gch.
  • The output log contains plaintext credentials — store and delete it accordingly; do not share it.
  • Only use it on devices you own or administer; the MIT license does not grant permission to access other people's equipment.

HotRepo's take

The repository appeared on HotRepo's new-project list on 2026-11-17, gaining 41 stars and 9 forks over a roughly 1.5-hour window ending at 14:46 UTC, reaching 146 stars and 43 forks; there is no recorded GitHub daily rank. That is a short, single-window reading, so it shows a quick initial reaction rather than sustained adoption. The code's value is in the device-specific reverse-engineering details — the telnet.gch activation, the Frm_Logintoken handling and the passphrase-free sidbg 1 DB decry — which are the parts worth checking before running it on a real modem.

Written by AI from the project's README, updated . The project's own docs are the source of truth.

You might also like

  1. kgretzky/evilginx2A reverse-proxy phishing framework for red-team testing that captures credentials and session cookies to bypass 2FA.Go15,859
  2. derv82/wifit3Cross-platform USB Wi-Fi auditor for wireless security testing on Linux, Windows and macOS.Python2,998
  3. N1nEmAn/sapper-v2Multi-agent pentest orchestration harness that coordinates swappable AI agent CLIs over a shared fact graph.Python2,118