TFTP Router Flasher
TFTP Router Flasher is a cross-platform command-line tool for flashing firmware to routers using the TFTP protocol. It is designed to assist in firmware recovery for routers that support TFTP-based rescue modes, such as many ASUS RT-series models.
This tool is a modern rewrite of the original arescue script by Joonas Nissinen. It has been updated for Python 3, refactored for clarity, and packaged as a CLI utility with improved logging, interface detection, and dependency management.
๐ Contents
- โจ Features
- ๐ฆ Installation
- ๐ ๏ธ Build Requirements
- ๐ Usage
- ๐ฅ๏ธ Compatibility
- ๐ License
- ๐ค Contributing
- โ ๏ธ Disclaimer
โจ Features
- ๐ ๏ธ Automatically configures your network interface for rescue mode
- ๐ก Scans IP ranges to detect routers in recovery mode
- ๐ค Uploads firmware via TFTP using a Python client
- ๐งพ Logs all activity to both console and file
- ๐งช Includes retry logic and fallback IP configurations
- ๐งฐ Packaged for easy installation and CLI use
๐ฆ Installation
Clone the repository and install locally:
git clone https://github.com/vr-ski/tftp-router-flasher.git
cd tftp-router-flasher
pip install .
This will install the CLI command tftp-router-flasher, which you can run from your terminal.
๐ก Make sure you're using
pip >= 21.3to ensure proper support forpyproject.tomlbuilds.
๐ ๏ธ Build Requirements
Click to expand Linux setup instructions
TFTP Router Flasher depends on Python packages like `psutil` that include native C extensions. To install successfully, your system must have: - A C compiler (e.g. `gcc`) - Python development headers (e.g. `Python.h`) - Build tools (e.g. `make`, `binutils`) ### ๐ง Linux Setup Instructions #### โ Debian / Ubuntusudo apt update
sudo apt install build-essential python3-dev
sudo dnf groupinstall "Development Tools"
sudo dnf install python3-devel
sudo pacman -S base-devel python
sudo xbps-install -S base-devel python3-devel
pip install .
python -m venv .venv
source .venv/bin/activate
pip install .
๐ Usage
tftp-router-flasher --firmware /path/to/firmware.trx --interface eth0
CLI Options
| Flag | Description | Default |
|---|---|---|
--firmware |
Path to the firmware file | (required) |
--interface |
Network interface to use | en0 |
--hostname |
Router IP address | 192.168.1.1 |
--timeout |
TFTP upload timeout (seconds) | 120 |
--no-ping |
Disable ping check. Useful for some models | False |
--debug |
Enable debug logging | False |
๐ฅ๏ธ Compatibility
Click to view supported platforms
Tested on: - โ Linux (Debian, Ubuntu, Arch) - โ macOS - โ ๏ธ Windows (not officially supported due to reliance on `ip` and `route` commands)๐ License
This project is licensed under the GPL-2.0 License.
This project is inspired by arescue by Joonas Nissinen, originally licensed under GPL-2.0. All original credit goes to the author.
๐ค Contributing
Pull requests are welcome! If youโve tested this with other router models or added new features, feel free to open an issue or submit a PR.
โ ๏ธ Disclaimer
This tool is provided as-is. Flashing firmware can permanently damage your device if done incorrectly. Use at your own risk.