Firmware rescue and flashing tool for routers via TFTP
Project description
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 / Ubuntu
sudo apt update
sudo apt install build-essential python3-dev
✅ CentOS / RHEL / Fedora
sudo dnf groupinstall "Development Tools"
sudo dnf install python3-devel
✅ Arch Linux
sudo pacman -S base-devel python
✅ Void Linux
sudo xbps-install -S base-devel python3-devel
Once these are installed, you can run:
pip install .
Or, if you're using a virtual environment:
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
ipandroutecommands)
📄 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tftp_router_flasher-0.0.1.tar.gz.
File metadata
- Download URL: tftp_router_flasher-0.0.1.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1de2e50772751ae751295fde32c89ed32f15a693085c673a818fe362b7ed4e97
|
|
| MD5 |
311482214c1952493ba6c92961c89f81
|
|
| BLAKE2b-256 |
d81f9510c428243f7257b9a4d9a2821beb049fc066497b1f482a11aa5891ecdb
|
File details
Details for the file tftp_router_flasher-0.0.1-py3-none-any.whl.
File metadata
- Download URL: tftp_router_flasher-0.0.1-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e62016b30cb0b4adfa068984fa1aa42edafe542402a8b1077fe4a971db34c3cd
|
|
| MD5 |
99e70c5904fd390b67403d014ae8b562
|
|
| BLAKE2b-256 |
1e2c30f3d25bd4c5320821f125899b76baebfd6f1b471c495067ea46408a7008
|