Telegram Bot Exec Terminal Command

teleterm

Telegram Bot Exec Terminal Command codecov

you can exec command from your telegram

Demo


Video Demo & Tutorial : https://www.youtube.com/watch?v=AJOPngS-BsE


# Use Case - Controll Docker CLI - Control IoT Devices - Etc

Tested On

  • ubuntu 20.04
  • Mac OS 15

How To use

- install `go get github.com/alfiankan/teleterm/teleterm`
- see following example code
package main

import "github.com/alfiankan/teleterm/teleterm"

func main()  {
	teleterm.StartBot("your telegram bot token")
}

Available Bot Command

Command Desc
/lock <true/false> Lock/unlock acces to account
/cmd <terminal command> exec terminal command and directly get log
/cmdf <terminal command> exec terminal command then save log to file
/get <file path> Download File From server/host
send File When you send File directly saved to server or host

Version History

v1.0

  • read telegram token from .env file
  • exec command and directly get response log
  • exec command then save log to file
  • telegram user can receive log text
  • sending/uploading file [Document(not included > image, video, and audio)] to server/host device
  • Downloading File from server/host device
Owner
alfiankan
Long life learns
alfiankan
Comments
  • Access White List by user id

    Access White List by user id

    according to https://github.com/alfiankan/teleterm/issues/14 Literally everybody can access the server through the bot and all bots are public with an @. In terms of functinality the bot is great but you need to add a Whitlist for users

    white listing using telegram username on config file. teleterm running using file config.yaml at /home-path/.teleterm/config.yaml. on this feature request the config file will be :

    
    teleterm:
      telegram_token: "xxxxxxxxx"
      shell_executor: "/bin/bash"
      whitelists:
        - sabrina
        - hilda
        - ambross
        - zelda
    
    

    so only listed users on config file can execute command.

  • security issue

    security issue

    Literally everybody can access the server through the bot and all bots are public with an @. In terms of functinality the bot is great but you need to add a Whitlist for users

  • Missmatch of file and erorr while try to build it

    Missmatch of file and erorr while try to build it

    Describe the bug it doesnt have a lot of file and video does nat match and represtents the file are missing btw when i try to buid teleterm.go its sayng root@raspberrypi:~/terminal/teleterm/teleterm# go build -o teleterm4 teleterm.go

    command-line-arguments

    ./teleterm.go:6:15: syntax error: unexpected literal 5554722719, expecting ) ./teleterm.go:7:26: syntax error: unexpected :, expecting comma or )

    To Reproduce Steps to reproduce the behavior:

    1. Go to 'dev/teleterm/teleterm#'
    2. Click on 'teleterm.go'
    3. Scroll down to '....'
    4. See error that -bash: ./1: Permission denied

    Desktop (please complete the following information):

    • OS: [Rasbian ]
    • raspberry 3
    • Version [last ]

    i realy like the idea what did u make but in rep it needs to fix it out

  • Can't get it to run on debian

    Can't get it to run on debian

    The bot worked fine on my ubuntu vps but now I'm using debian 11 and cant get it to work.

    debian@vps:~$ teleterm-bin -bash: /usr/local/bin/teleterm-bin: Permission denied debian@vps:~$ sudo teleterm-bin sudo: teleterm-bin: command not found

    Any suggestions how to fix that?

  • feat: add, delete button, exec command

    feat: add, delete button, exec command

    • [x ] - add shortcut button
    • [ x] - delete shortcut button
    • [ x] - run command using shortcut
    • [ x] - run command full output
    • [ x] - run command head output
    • [ x] - run command tail output
  • Access white list by username

    Access white list by username

        > > It would be better to use the user id for whitelist and not username since the user id of your account will never changed. Also some people don't have an unsername
    

    is it possible to get userid without using @userinfobot bot ? you're right about username, but what do you think if we use both username and user id as whitelist ? since username is easily accessible i think, but we still provide possibility to use user id as whitelist

    @alfajrimutawadhi @catty-dev

    teleterm:
      telegram_token: "xxxxxxxxx"
      shell_executor: "/bin/bash"
      whitelists:
        - @sabrina
        - @hilda
        - @ambross
        - @zelda
        - 783277716
        - 133475712
    

    Sounds like a good solution. Only the official client don't show id's. Forks like telegramX or plus messenger shows them and it makes working with bots much easier. Using username and id for whitelist seems to be the best solution.

    Originally posted by @catty-dev in https://github.com/alfiankan/teleterm/issues/15#issuecomment-1366249316

A bot based on Telegram Bot API written in Golang allows users to download public Instagram photos, videos, and albums without receiving the user's credentials.

InstagramRobot InstagramRobot is a bot based on Telegram Bot API written in Golang that allows users to download public Instagram photos, videos, and

Dec 16, 2021
Bot - Telegram Music Bot in Go

Telegram Music Bot in Go An example bot using gotgcalls. Setup Install the serve

Jun 28, 2022
Bot-template - A simple bot template for creating a bot which includes a config, postgresql database

bot-template This is a simple bot template for creating a bot which includes a c

Sep 9, 2022
The serverless OTP telegram service use telegram as OTP service, and send OTP through webhook

Setup OTP First thing, you need prepare API(webhook) with POST method, the payload format as below { "first_name": "Nolan", "last_name": "Nguyen",

Jul 24, 2022
IRC, Slack, Telegram and RocketChat bot written in go
IRC, Slack, Telegram and RocketChat bot written in go

go-bot IRC, Slack & Telegram bot written in Go using go-ircevent for IRC connectivity, nlopes/slack for Slack and Syfaro/telegram-bot-api for Telegram

Dec 20, 2022
Golang telegram bot API wrapper, session-based router and middleware

go-tgbot Pure Golang telegram bot API wrapper generated from swagger definition, session-based routing and middlewares. Usage benefits No need to lear

Nov 16, 2022
Telegram Bot Framework for Go

Margelet Telegram Bot Framework for Go is based on telegram-bot-api It uses Redis to store it's states, configs and so on. Any low-level interactions

Dec 22, 2022
Client lib for Telegram bot api

Micha Client lib for Telegram bot api. Supports Bot API v2.3.1 (of 4th Dec 2016). Simple echo bot example: package main import ( "log" "git

Nov 10, 2022
Go library for Telegram Bot API
Go library for Telegram Bot API

tbot - Telegram Bot Server Features Full Telegram Bot API 4.7 support Zero dependency Type-safe API client with functional options Capture messages by

Nov 30, 2022
Telebot is a Telegram bot framework in Go.

Telebot "I never knew creating Telegram bots could be so sexy!" go get -u gopkg.in/tucnak/telebot.v2 Overview Getting Started Poller Commands Files Se

Dec 30, 2022
Golang bindings for the Telegram Bot API

Golang bindings for the Telegram Bot API All methods are fairly self explanatory, and reading the godoc page should explain everything. If something i

Jan 6, 2023
Golang Based Account Generator Telegram Bot

Account Generator Bot Account Generator Bot, written in GoLang via gotgbot library. Variables Env Vars - BOT_TOKEN - Get it from @BotFather CHANNEL_ID

Nov 21, 2022
Bot that polls activity API for Github organisation and pushes updates to Telegram.

git-telegram-bot Telegram bot for notifying org events Requirements (for building) Go version 1.16.x Setup If you don't have a telegram bot token yet,

Apr 8, 2022
📱 Hentai bot for Telegram 📱
📱 Hentai bot for Telegram 📱

Random-Good-Hanime Hentai Telegram bot for educational purpose ?? Features ?? Random hentai Lot of different categories ?? Real time logs ?? Config fi

Nov 25, 2022
A telegram bot that fetches multiple RSS cryptocurrency news feeds for sentiment analysis

Crypto News Telegram Bot A simple telegram bot that will help you stay updated on your latest crypto news This bot will help you keep track of the lat

Aug 22, 2021
A Telegram bot that will run code for you.

piston_bot A Telegram bot that will run code for you. Made using piston. Available as @iruncode_bot on telegram. Examples Basic example Input: /run py

Sep 11, 2022
Telegram bot to get information on vaccine availabilities.

?? berlin-vaccine-alert Telegram bot to get information on vaccine availabilities. Get the latest appointments directly on telegram. The bot listen to

Jun 23, 2022
Flexible message router add-on for go-telegram-bot-api library.
Flexible message router add-on for go-telegram-bot-api library.

telemux Flexible message router add-on for go-telegram-bot-api library. Table of contents Motivation Features Minimal example Documentation Changelog

Oct 24, 2022
Instagram to Telegram Channel Bot.

InstaTG Instagram to Telegram Channel Bot. Can access posts from any public Instagram account or an account that you follow. Features Keeps track of e

Nov 16, 2022