{"id":13611533,"url":"https://github.com/mkst/zte-config-utility","last_synced_at":"2025-05-16T07:03:28.012Z","repository":{"id":43941555,"uuid":"270958193","full_name":"mkst/zte-config-utility","owner":"mkst","description":"Scripts for decoding/encoding config.bin for ZTE routers","archived":false,"fork":false,"pushed_at":"2025-05-05T19:54:09.000Z","size":532,"stargazers_count":289,"open_issues_count":47,"forks_count":94,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-05T20:48:57.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkst.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-06-09T09:24:08.000Z","updated_at":"2025-05-05T19:54:14.000Z","dependencies_parsed_at":"2024-01-14T06:48:04.719Z","dependency_job_id":"3263a4e3-d9c9-4a87-b911-81735218a8a4","html_url":"https://github.com/mkst/zte-config-utility","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkst%2Fzte-config-utility","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkst%2Fzte-config-utility/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkst%2Fzte-config-utility/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkst%2Fzte-config-utility/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkst","download_url":"https://codeload.github.com/mkst/zte-config-utility/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485045,"owners_count":22078767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:01:57.130Z","updated_at":"2025-05-16T07:03:27.654Z","avatar_url":"https://github.com/mkst.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# zte config utility\n\nThe core of the decoding work is taken from a [pastebin](https://pastebin.com/GGxbngtK) dump by 'Felis-Sapien'.\n\nCreates byte-perfect binaries for the limited number of `config.bin` that have been tested.\n\n## Quickstart\n\nClone the repo and run `python3 -m pip install . --user` to install the `zcu` module.\nYou can then use the scripts in the [examples](./examples) directory.\n\n**NOTE:** This project has only been tested against **Python 3.7** and higher.\n\n### 100% auto decode\n\nTry running the `examples/auto.py` against your `config.bin`\n\n```sh\n$ python3 examples/auto.py config.bin config.xml\n```\n\n## Examples\n\n### Decode/Encode a type-2, version 2 `config.bin` (if the key is known for the signature given/detected, you can omit it)\n\n```sh\n$ python3 examples/decode.py resources/ZXHN_H298N.bin resources/ZXHN_H298N.xml --key 'Wj'\n$ python3 examples/encode.py resources/ZXHN_H298N.xml resources/ZXHN_H298N.NEW.bin --key 'Wj' --signature 'ZXHN H298N' --include-header\n$ md5sum resources/ZXHN_H298N.bin resources/ZXHN_H298N.NEW.bin\n8529c1e3d4e3018db508a3b5b5b574cc  resources/ZXHN_H298N.bin\n8529c1e3d4e3018db508a3b5b5b574cc  resources/ZXHN_H298N.NEW.bin\n```\n\n### Decode/Encode a type-2, version 1 `config.bin`\n\n```sh\n$ python3 examples/decode.py resources/ZXHN_H108N_V2.5.bin resources/ZXHN_H108N_V2.5.xml --key 'GrWM2Hz\u0026LTvz\u0026f^5'\n$ python3 examples/encode.py resources/ZXHN_H108N_V2.5.xml resources/ZXHN_H108N_V2.5.NEW.bin --key 'GrWM2Hz\u0026LTvz\u0026f^5' --signature 'ZXHN H108N V2.5' --version 1 --include-header\n$ md5sum resources/ZXHN_H108N_V2.5.bin resources/ZXHN_H108N_V2.5.NEW.bin\n5dbb537bb8a5bfa51f9bc9e2d48f576d  resources/ZXHN_H108N_V2.5.bin\n5dbb537bb8a5bfa51f9bc9e2d48f576d  resources/ZXHN_H108N_V2.5.NEW.bin\n```\n\n### Decode/Encode a type-0 `config.bin`\n\n```sh\n$ python3 examples/decode.py resources/F600W.bin resources/F600W.xml\n$ python3 examples/encode.py resources/F600W.xml resources/F600W.NEW.bin --signature F600W --payload-type 0\n$ md5sum resources/F600W.bin resources/F600W.NEW.bin\na6ac0e5e04f705b54747c30f80dfd4ba  resources/F600W.bin\na6ac0e5e04f705b54747c30f80dfd4ba  resources/F600W.NEW.bin\n```\n\n### Decode/Encode a type-3 `db_default_auto_cfg.xml` from a H298Q\n\n```sh\n$ python3 examples/decode.py --model \"H298Q\" resources/ZXHN_H298Q_C7_db_type3.bin resources/ZXHN_H298Q_C7_db.xml\n$ python3 examples/encode.py --model \"H298Q\" resources/ZXHN_H298Q_C7_db.xml resources/ZXHN_H298Q_C7_db_type3.NEW.bin\n$ md5sum resources/ZXHN_H298Q_C7_db_type3.bin resources/ZXHN_H298Q_C7_db_type3.NEW.bin\n2b76e781a8a91136539e0f2534ac030b  resources/ZXHN_H298Q_C7_db_type3.bin\n2b76e781a8a91136539e0f2534ac030b  resources/ZXHN_H298Q_C7_db_type3.NEW.bin\n```\n\n### Decode/Encode `config.bin` from a DigiMobil ZXHN H298A router\n\nYou can find the serial number in the web interface of the router, in the \"Management \u0026 Diagnosis\" tab.\n\n```sh\n$ python3 examples/decode.py --serial ZTEXXXXXXXXXXXX config.bin config.xml\n$ python3 examples/encode.py --serial ZTEXXXXXXXXXXXX --signature 'ZXHN H298A V1.0' config.xml config.bin\n```\n\n### Decode/Encode `config.bin` from a ZXHN H168N V3.5 router\n\nSome routers (Type 4), might use the signature to create the encryption key.\nWhen decoding, ZCU will use the signature it finds automatically (without spaces), but you can specify one by passing the `--signature` argument to the `decode.py` script.\nWhen re-encoding, you need to specify `--use-signature-encryption` if you want signature encryption to be used.\n\n```sh\n$ python3 examples/decode.py ./config.bin ./config.xml\n$ python3 examples/encode.py --signature 'ZXHN H168N V3.5' --use-signature-encryption config.xml config.bin\n```\n\n### Grab 'signature' from a `config.bin`\n\n```sh\n$ python3 examples/signature.py resources/ZXHN_H108N_V2.5.bin\nZXHN H108N V2.5\n```\n\n### Auto-decode\n\nIf your router's signature is associated with a key known to this utility, you can omit the `--key` parameter when decoding.\n\n```sh\n$ python3 examples/decode.py resources/ZXHN_H298N.bin resources/ZXHN_H298N.xml\n```\n\nYou can also try all the keys known to this utility against your `config.bin` with the `--try-all-known-keys` parameter.\nThis might be useful if your key is known but your router's signature has not been associated with it.\n\n```sh\n$ python3 examples/decode.py resources/ZXHN_H298N.bin resources/ZXHN_H298N.xml --try-all-known-keys\n```\n\n## Limitations\n\nThe decoder has only been tested against `config.bin` files generated by the following routers:\n - `ZXHN H298A`\n - `ZXHN H298N`\n - `ZXHN H267A`\n - `ZXHN H268Q`\n - `ZXHN H298Q`\n - `ZXHN H168N V2.2`\n - `ZXHN H168N V3.5`\n - `ZXHN H108N V2.5`\n - `F600W`\n\nAnd `db_default_auto_cfg.xml` files extracted from `ZXHN H268N` and `ZXHN H298Q` firmwares\n\nIt makes a number of assumptions due to this. The encoder has not been heavily tested in the wild. Use at your own risk.\n\n## Requirements\n\nThe AES encryption relies on [pycryptodomex](https://pypi.org/project/pycryptodomex/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkst%2Fzte-config-utility","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkst%2Fzte-config-utility","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkst%2Fzte-config-utility/lists"}