Remote Access Tool Over Telegram
- Free software: GNU General Public License v3
- Documentation: https://ratot.readthedocs.io.
Have you ever wanted to remotedly access your personal computer or server? Have you ever wanted to do it without setting up port forwarding or otherwise making your computer accessible to the world? How about without using a solution such as Teamviewer (of which I've been a faithful user for years), which only provides a graphical interface, making it very suseptible to bad connections and will also eat your mobile data for lunch?
Enter RAToT, a tool to allow access to Bash (and eventually other command line oriented apps) using a Telegram messenger app. Written in Python, it leverages the Telegram bot platform to bridge the gap between a remote machine, and whatever device you have at hand that can run a Telegram client, phone, PC, browser-only machine, etc. Just use as if you're chatting with someone.
And now for a totally random and unnecessary statement: This is only possible because Telegram is the best messaging service out there!
- Allows remote control of Bash on a system from Telegram.
- Built on Linux in Python3, tested on Mac. Windows is not an option (unless someone contributes).
- Fork this project if you would like to contribute.
- Clone from this repo or your own fork.
- Setup and activate a virtualenv for the project. I recommend pyenv.
- Install the requirements (and optionally requirements_dev).
- Patch the following files in your Python's site-packages folder:
- In pexpect/__init__.py add
from . import replwrap
- In rpyc/__init__.py add
from rpyc.utils import server
- NB: You can use
$ python3 -c 'import rpyc; print(rpyc.__path__)'
, etc to get the path
- Copy the .env.template file to .env
- Visit the BotFather in your Telegram, create a bot and copy the token.
- Add the bot token and other information to your .env:
$ dotenv set TOKEN your-bot-token
$ dotenv set ADMINS your-telegram-username
(set one if needed in your profile)- You may also change the HOST and PORT if you wish and know what you're doing.
- NB: If you get the message It seems python-dotenv is not installed with cli option., do
$ pip install python-dotenv[cli]
- Start both the server and router bot on your machine:
$ cd ratot
$ ./server.py
$ ./router.py
- Find your bot in Telegram by the username you gave to the BotFather, and /start it. If all goes well you should get a welcome message and can now start sending commands to your machine.
- Setup the "telewrap" client (alpha, optional):
- Go to telegram.org, sign in and create an app.
- Grap the API ID and API hash.
- Add to the .env as API_ID and API_HASH.
- Add your registered phone numer as PHONE; format +1234567890.
- Optionally change the default SESSION_NAME.
- Run client with
$ ./telewrap.py
(ACTUALLY DON'T DO THIS; CURRENTLY INCOMPLETE & BROKEN)- Wait for fix or contribute one [see above].
- Allow sudo access by following the instructions in su_it.
- Interactive programs don't work
- There is a limit on the amount of text that can transferred
- Bring client to working state
- Fix Travis and other broken repo things
- Make a patcher
- Implement file transfer and syncing
- Implement multiple session handling
- Work on docs
- Support more shells and interpreters (Python, xonsh, etc)
- Support interactive programs (less, man, screen, sudo, etc)
- Implement command aliasing
See AUTHORS.rst for listing.
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.