Skip to content
rianpreiPublic

About

CLI for Technicolor TC3102 / CGA4233 cable modem gateways (Claro/NET Brazil)

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

rtr

Command-line interface for Technicolor TC3102 / CGA4233 cable modem gateways.

Python 3.8+ License: MIT Zero Dependencies

rtr gives you full programmatic control over Technicolor TC3102 (CGA4233CLB2/CGA4233TCH5) DOCSIS 3.1 cable modem gateways commonly deployed by Claro and NET in Brazil. It reproduces the admin panel's authentication flow and exposes all API endpoints through a clean CLI.

Features

  • Zero dependencies — Python stdlib only, runs anywhere (Linux, macOS, Windows, Termux)
  • Reverse-engineered auth — two-step PBKDF2-HMAC-SHA256 challenge-response, fully automated
  • Persistent sessions — cookie jar with auto-relogin on expiry
  • Proxy-safe — direct connections only, prevents session IP-binding failures
  • 30+ API endpoints — Wi-Fi, LAN, DHCP, firewall, port forward, DMZ, UPnP, DDNS, and more

Quick Start

# Install
pip install -e .
# — or just run directly —
python -m rtr

# First-time setup (interactive)
rtr setup

# Use
rtr info          # system info
rtr wifi          # SSID + password
rtr hosts         # connected devices
rtr get <path>    # raw API call

Installation

From source (recommended)

git clone https://github.com/rianprei/rtr.git
cd rtr
pip install -e .

Manual (no install)

git clone https://github.com/rianprei/rtr.git
cd rtr
python -m rtr setup
python -m rtr info

Termux (Android)

pkg install python git
git clone https://github.com/rianprei/rtr.git
cd rtr && pip install -e .
rtr setup

Configuration

Credentials are stored in ~/.config/rtr/config.json (chmod 600):

{
  "host": "192.168.0.1",
  "user": "CLARO_XXXXXX",
  "password": "your_password_from_device_label"
}

Override via environment variables: RTR_HOST, RTR_USER, RTR_PASS.

Where to find credentials: look at the sticker on the bottom of your router. The fields "Acesso ao Modem" show the IP, username, and password.

Commands

Command Description
rtr setup Interactive first-time configuration
rtr login Authenticate and save session
rtr logout End session
rtr info Show model, firmware, MAC, uptime
rtr wifi Show SSID and password for 2.4 GHz / 5 GHz
rtr hosts List connected devices (IP, hostname, RSSI, MAC)
rtr menu Dump the full API menu with all endpoints
rtr reboot --yes Reboot the router
rtr get <path> Raw GET to api/v1/<path>
rtr post <path> --data k=v Raw POST with form data
rtr post <path> --json '{...}' Raw POST with JSON body

Usage Examples

# System information
$ rtr info
ModelName        TC3102
Manufacturer     Technicolor
SoftwareVersion  TC3102-19.1B38-46-P15-RQ
RTMACAddress     00:cb:7a:df:ed:5f
LanMode          router
IPMode           dualstack
LocalTime        2026-11-02 15:38:23

# Wi-Fi details
$ rtr wifi
[2.4 GHz — radio 1]
  SSID           MyNetwork
  password       secret123
  security       WPA-WPA2-Personal
  enabled        true
[5 GHz — radio 2]
  SSID           MyNetwork_5G
  password       secret123
  security       WPA-WPA2-Personal
  enabled        true

# Connected devices
$ rtr hosts
IP               Hostname               Active  RSSI   MAC
192.168.0.120    MyPhone                true    -62    ca:2b:17:2b:b4:b7
192.168.0.54     LGwebOSTV              true    -54    44:cb:8b:b9:25:4a

# Raw API: get LAN settings
$ rtr get "dhcp/v4/1/LanIPAddress,LanSubnetMask"
{
  "error": "ok",
  "data": {
    "LanIPAddress": "192.168.0.1",
    "LanSubnetMask": "255.255.255.0"
  }
}

# Change Wi-Fi SSID
$ rtr post "wifi/1" --data SSID=NewName

API Endpoints

All endpoints are at api/v1/<path>. Use rtr menu for the full list. Common ones:

Path Description
system/<fields> System info (SoftwareVersion, ModelName, LocalTime, ...)
wifi/1,2/<fields> Wi-Fi config (SSID, KeyPassphrase, Channel, ...) — 1=2.4GHz, 2=5GHz
host/hostTbl Connected devices table
dhcp/v4/1/<fields> DHCP / LAN settings
devicecontrol WAN mode, DNS, hostname
firewall Firewall settings
portforward Port forwarding rules
dmz DMZ configuration
remoteaccess Remote management settings
reset Reboot / factory reset (POST)
backuprestore/backup Download config backup (POST)
backuprestore/restore Restore config backup (POST multipart)

How Authentication Works

The TC3102 uses a non-standard two-step PBKDF2 challenge-response:

1. POST {username, password: "seeksalthash"}
   → {salt, saltwebui}

2. h1 = PBKDF2-HMAC-SHA256(password, salt, 1000 iterations, 16 bytes) → hex
   final = PBKDF2-HMAC-SHA256(h1, saltwebui, 1000 iterations, 16 bytes) → hex
   POST {username, password: final}
   → Sets cookie 'auth' = CSRF token

3. All subsequent requests require:
   - Cookie: auth=<token>
   - Header: X-CSRF-TOKEN: <token>
   - Header: X-Requested-With: XMLHttpRequest

Important: connections MUST be direct (no HTTP proxy). The router binds sessions to the client's source IP. A proxy changes the apparent source, causing all data endpoints to return 401.

Compatible Models

Model ISP Status
Technicolor TC3102 Claro Brazil ✅ Tested
Technicolor CGA4233CLB2 Claro Brazil ✅ Same hardware
Technicolor CGA4233TCH5 Claro Brazil ✅ Same hardware
Technicolor CGA4233 (other variants) Various 🔶 Likely compatible

License

MIT

About

CLI for Technicolor TC3102 / CGA4233 cable modem gateways (Claro/NET Brazil)

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages