Giter VIP home page Giter VIP logo

trsh-go's Introduction

trsh-go

Telegram Remote-Shell is a Golang script that let you comunicate with your Linux server using a Telegram Bot
This repo is a re-make of my original Python script created a few years ago here




Requirements

  • Linux OS (tested on Ubuntu 20.04 and Centos 7)
  • Telegram Bot created using @BotFather
  • Packages required: jq
  • (Optional packages used): nmap, dig, mtr, net-tools (netstat)

Quick setup

Before setup:

  • Chat with BotFather in order to create a Bot ( https://telegram.me/botfather ), just launch the command /newbot and get your Telegram Token.
    Open the bot chat and send some messages to activate the bot.

  • Launch this oneliner+script on your Linux system (where the bot will be running as a service):

git clone https://github.com/fnzv/trsh-go /home/trsh/ && cd /home/trsh/ && bash install.sh
WARNING: this command will install the required/missing packages ( dnsutils, nmap, mtr, net-tools )
NOTES:
  • You will be asked to insert your Telegram Bot Token acquired on the first step and then follow the quick installation wizard.

  • The script will gather your chat-id based on the last unread message you send to the bot on the first step.

After you finished the installation the Golang script binary will run as a system service with systemd (trsh.service).

Usage

  • /dig - Resolve the given domain, supports RR.. example /dig A google.com or /dig MX google.com
  • /mtr - Execute a mtr with a following report
  • /nmap - Execute a nmap -Pn -A
  • /curl - Execute a curl request
  • /whois - Whois lookup
  • /sysinfo - Display generic system information (disk usage, network & memory)
  • /sh - Execute a command with Bash.. example /sh cat namefile , /sh ps auxf | grep ssh

Tests

The following scripts are tested on Ubuntu 20.04 LTS, Centos 7 and marked as working.

Run using docker

Inside this repo you will find a prepared Docker image to build and use in order to run trsh-go:

  1. Build the image:
docker build -t trsh .
  1. Run the docker image and specify your ENV vars (below an example):
docker run -d -e TGBOT_TOKEN="123456789:qwertyuiopasdfghjklzxcb" -e TGBOT_CHATID="12345678" trsh-go
  1. Chat with your Bot

Contributors

Feel free to open issues or contact me directly

License

Code distributed under MIT licence.

trsh-go's People

Contributors

fnzv avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.