I’ve been messing around with routers this weekend, and I’ve decided to write a PowerShell script to decode Asus router configuration backup files.
The script is inspired by this Bash script that I’ve used in my previous blog post.
You can find the PowerShell script in my Asus-Router-Config-Decoder GitHub repository.
Why?
Because I wanted to understand how Asus routers encode and decode their configuration backups.
I already had the previously mentioned Bash script as a starting point.
And I considered that it would be a nice PowerShell exercise, since I haven’t done any work on PSBlitz for a while.
The added bonus to this is that the resulting PowerShell script is faster than the Bash script I used as the inspiration for it.
What it does?
- decodes the provided .cfg file
- writes the decoded content to a text file
- writes DHCP client list to a pipe-delimited text file
- outputs the following to the console:
- Web GUI admin username and password
- Wi-Fi network names (SSIDs)
- Wi-Fi passwords (WPA PSKs)
- PPPOE credentials
At the moment, I’ve successfully tested the script with the following Asus router models:
- Asus RT-BE88U
- Asus RT-AX86U Pro
- Asus RT-AC86U
Feel free to leave a comment with the Asus router models you’ve used this script to decode their configuration files.
How to use it?
Execute it in PowerShell (version 5.1 and up) and pass the name of the .cfg file you want to decode.
Usage examples
If the configuration file you want to decode is in the same directory as the script:
1 | PS>.\Decode-AsusRouterConfig.ps1 '.\Settings_RT-XXXXX.CFG' |
If the script is in a different directory from the one where the Asus router configuration file is:
1 | PS>.\Decode-AsusRouterConfig.ps1 'C:\Path\To\File\Settings_RT-XXXXX.CFG' |
Conclusion
I just figured I’d share the result of my weekend PowerShell exercise in case anyone might need it to decode their Asus router configuration backup.
If you’re interested in more networking related uses for PowerShell, check out this post about doing a ping sweep using PowerShell.