A fast, safe CLI tool to deobfuscate and manipulate ASUS router configuration files
awrtconf is a command-line utility for working with ASUS router (Asuswrt) configuration backup files. It can decode obfuscated .CFG files into human-readable JSON, allow you to edit settings, and re-encode them back to the original format.
- Decode obfuscated ASUS router config files to JSON
- Encode JSON configurations back to binary format
- Inspect config file metadata without full decoding
- Cross-platform support (Linux, macOS, Windows)
- Zero dependencies at runtime
- Memory safe implementation in Rust
cargo install awrtconfgit clone https://github.com/BigNerd95/Asuswrt-Configs-Deobfuscator.git
cd Asuswrt-Configs-Deobfuscator
cargo install --path .Download pre-built binaries from the Releases page.
# View config file information
awrtconf info -i Settings_Router.CFG
# Dump config to editable JSON
awrtconf dump -i Settings_Router.CFG -o settings.json
# Edit settings.json with your favorite editor...
# Pack JSON back to config file
awrtconf pack -i settings.json -o Settings_Router_Modified.CFGInspect a configuration file without decoding its contents:
awrtconf info -i Settings_DSL-N55U.CFGOutput:
** Conf Info **
Profile: HDR2
Body length: 31744 bytes (0x7c00)
Obfuscated conf file
Randkey: 5 (0x5)
Lost ASCII chars: 5 (0x5), 6 (0x6), 7 (0x7)
If you used one of these chars in your configs,
please make the backup again until the randkey is higher or at least 3 value smaller.
Recommended randkey values: randkey <= 4 (0x04) or randkey >= 14 (0x0E).
Best is 0, only 2 chars lost (0x01 and 0x02).
Convert a binary config file to editable JSON format:
awrtconf dump -i Settings_DSL-N55U.CFG -o settings.jsonThe output JSON structure:
{
"PROFILE": "HDR2",
"SETTINGS": {
"lan_ipaddr": "192.168.1.1",
"lan_netmask": "255.255.255.0",
"wl0_ssid": "MyNetwork",
"wl0_wpa_psk": "MyPassword123"
}
}Warning: Do not modify the
PROFILEvalue unless you know what you're doing.
Convert a JSON file back to binary config format:
awrtconf pack -i settings.json -o Settings_Modified.CFGAll ASUS firmware versions support plaintext (HDR1) config files. Use the -p flag to avoid obfuscation algorithm bugs:
awrtconf pack -i settings.json -o Settings_Plain.CFG -pThis is the recommended approach for maximum compatibility.
| Profile | Format | Description |
|---|---|---|
HDR1 |
Plaintext | Unobfuscated configuration |
HDR2 |
Obfuscated | Standard obfuscated format |
N55U |
Obfuscated | DSL-N55U specific format |
AC55U |
Obfuscated | RT-AC55U specific format |
ASUS config files consist of an 8-byte header followed by the configuration body:
Plaintext (HDR1):
| Offset | Size | Type | Description |
|---|---|---|---|
| 0x00 | 4 | char[4] | Profile identifier (HDR1) |
| 0x04 | 4 | uint32_le | Body size (KB-aligned) |
Obfuscated (HDR2, N55U, AC55U):
| Offset | Size | Type | Description |
|---|---|---|---|
| 0x00 | 4 | char[4] | Profile identifier |
| 0x04 | 3 | uint24_le | Body size (KB-aligned) |
| 0x07 | 1 | uint8 | Random key (0-29) |
The obfuscation is a simple XOR-based transformation with a random key. Due to implementation bugs in the original ASUS code, certain byte values may be lost during encoding:
- Bytes equal to
randkey,randkey+1, orrandkey+2collide with NULL byte encoding - Best practice: Use plaintext format (
-pflag) or ensurerandkey <= 4orrandkey >= 14
For detailed algorithm analysis, see the original research.
awrtconf <COMMAND>
Commands:
info Display config file information
dump Dump config to JSON format
pack Pack JSON config back to binary format
help Print help information
Options:
-h, --help Print help
awrtconf info -i <INPUT_FILE>
Options:
-i, --input <INPUT_FILE> Input config file (.CFG)
awrtconf dump -i <INPUT_FILE> -o <OUTPUT_FILE>
Options:
-i, --input <INPUT_FILE> Input config file (.CFG)
-o, --output <OUTPUT_FILE> Output JSON file
awrtconf pack -i <INPUT_FILE> -o <OUTPUT_FILE> [-p]
Options:
-i, --input <INPUT_FILE> Input JSON file
-o, --output <OUTPUT_FILE> Output config file (.CFG)
-p, --plain Force plaintext (HDR1) format
- Rust 1.70 or later
- Cargo
# Debug build
cargo build
# Release build (optimized)
cargo build --release
# Run tests
cargo test# Windows
cargo build --release --target x86_64-pc-windows-gnu
# macOS (from Linux)
cargo build --release --target x86_64-apple-darwin
# Linux static binary
cargo build --release --target x86_64-unknown-linux-muslContributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Original Python implementation by BigNerd95
- ASUS source code reference from asuswrt-merlin
- asuswrt-merlin - Enhanced firmware for ASUS routers
- nvram-faker - NVRAM emulation library
Made with Rust