Skip to content

skeledrew/ratot

Repository files navigation

Ratot

image

image

Documentation Status

Updates

Remote Access Tool Over Telegram

Description

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!

Features

  • 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).

Installation

  1. Fork this project if you would like to contribute.
  2. Clone from this repo or your own fork.
  3. Setup and activate a virtualenv for the project. I recommend pyenv.
  4. Install the requirements (and optionally requirements_dev).
  5. 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
  1. Copy the .env.template file to .env
  2. Visit the BotFather in your Telegram, create a bot and copy the token.
  3. 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]
  1. Start both the server and router bot on your machine:
  1. $ cd ratot
  2. $ ./server.py
  3. $ ./router.py
  1. 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.
  2. Setup the "telewrap" client (alpha, optional):
  1. Go to telegram.org, sign in and create an app.
  2. Grap the API ID and API hash.
  3. Add to the .env as API_ID and API_HASH.
  4. Add your registered phone numer as PHONE; format +1234567890.
  5. Optionally change the default SESSION_NAME.
  6. Run client with $ ./telewrap.py (ACTUALLY DON'T DO THIS; CURRENTLY INCOMPLETE & BROKEN)
  7. Wait for fix or contribute one [see above].
  1. Allow sudo access by following the instructions in su_it.

Known Bugs/Issues/Quirks

  • Interactive programs don't work
  • There is a limit on the amount of text that can transferred

TODO

  • 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

Credits

See AUTHORS.rst for listing.

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

About

[migrated] Remote Access Tool Over Telegram

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published