Files
cdata_onu_tools/README.md
Victor Golovanenko 117622257b Initial commit
2025-07-27 21:07:02 +03:00

98 lines
3.8 KiB
Markdown

# C-Data ONU tools
Tools for managing settings of the C-Data FD511G-X xPON ONU (and possibly other models), which are not available from the web interface:
enabling/disabling shell access, getting SSH/Telnet password.
![C-Data FD511G-X ONU](img/C-Data%20FD511G-X%20front%20side.webp)
## Abstract
The ONU web interface (usually available at http://192.168.101.1) allows you to download a configuration backup as a file. This is a regular XML file that is encrypted using XOR encryption with a key of `0x26`.
The tools presented here are designed to load, read, and modify this configuration file.
## Tools
- `enable_shell_access.py` helps to enable/disable SSH/Telnet root shell access from LAN/WAN and change username & password.
Usage:
```
$ python enable_shell_access.py --help
usage: enable_shell_access.py [-h] [-a AUTHORIZATION] [-d] [-i {LAN,WAN}] [-p {SSH,Telnet}] [--change-username CHANGE_USERNAME] [--change-password CHANGE_PASSWORD] [host]
Program to enable or disable Telnet or SSH access to the C-Data FD511G-X ONU
positional arguments:
host ONU host (IP address or domain). Default: 192.168.101.1.
options:
-h, --help show this help message and exit
-a, --authorization AUTHORIZATION
Web interface authorization credentials, separated by colon. Default: adminisp:adminisp.
-d, --disable Disable access. If this argument is not passed, it enables access.
-i, --interface {LAN,WAN}
Interface for enabling access: LAN or WAN. Default: LAN.
-p, --protocol {SSH,Telnet}
Protocol for enabling access: SSH or Telnet. Default: SSH.
--change-username CHANGE_USERNAME
Set new username
--change-password CHANGE_PASSWORD
Set new password
```
Usage examples:
- enable LAN SSH access:
```
$ python enable_shell_access.py 192.168.101.1
Logging in to http://192.168.101.1 with adminisp:adminisp...
Current SSH credentials:
username: manu
password: c8a9b413
SSH access from LAN enabled
Uploading new configuration to the ONU...
Config successfully uploaded. Do you want to reboot ONU now? (Y/n) : Y
ONU reboot error. The device is probably already rebooting.
```
- disable LAN Telnet access:
```
$ python enable_shell_access.py 192.168.101.1 -p Telnet -d
Logging in to http://192.168.101.1 with adminisp:adminisp...
Current Telnet credentials:
username: manu
password: c8a9b413
Telnet access from LAN disabled
Uploading new configuration to the ONU...
Config successfully uploaded. Do you want to reboot ONU now? (Y/n) : Y
Device is rebooting. Please wait.
```
- login with custom web interface credentials:
```
$ python enable_shell_access.py 192.168.101.1 -a adminisp:admin1234
Logging in to http://192.168.101.1 with adminisp:admin1234...
Current SSH credentials:
username: manu
password: c8a9b413
SSH access from LAN enabled
Uploading new configuration to the ONU...
Config successfully uploaded. Do you want to reboot ONU now? (Y/n) : Y
ONU reboot error. The device is probably already rebooting.
```
- `extract_credentials.py` extracts credentials from the binary config file, including SSH and Telnet username & password, and also saves decrypted version of the config file.
Usage:
```
$ python extract_credentials.py ~/config.bin
File decrypted and saved to "/home/user/config.xml"
Web interface credentials:
root-level account:
username: adminisp
password: adminisp
user-level account:
username: admin
password: admin
Shell credentials (Telnet and SSH):
username: manu
password: c8a9b413
```