Web terminal - A (unsafe) technical demo to export a shell to web browser

Web Terminal

A (unsafe) technical demo to export a shell to web browser.

This program is written in the go programming language, using the Gin web framework, gorilla/websocket, pty, and xterm.js! The workflow is simple, the client will initiate a terminal window (xterm.js) and create a websocket with the server. On the server side, it serves the basic HTML/JS/CSS files and websockets (by shovling the data between pty and xterm).

It is amazing what you can do with 260 lines of go code.

It is just a simple demo in case some people are interested in how to setup xterm.js with websocket.

To use the program, download/clone the code, and in the web_terminal directory, run go build ., this will create the binary called web_terminal. To run it, use ./web_terminal cmd options_to_cmd. If no cmd and options are given, web_terminal will run bash by default. You can run shells but also single programs, such as htop. The program has been tested on Linux, WSL2, Raspberry Pi 3B (Debian), and MacOSX.

known bug

On MacOS X, running zsh with web_terminal will produce an extra % each time. Consider it a feautre, will not fix unless there is a pull request.

NOTE

Do NOT run this in an untrusted network. You will expose your shell to anyone that can access your network and Do NOT leave the server running.

Here is a screenshot:

Similar Resources

GoTTY - Share your terminal as a web application

 GoTTY - Share your terminal as a web application

GoTTY - Share your terminal as a web application GoTTY is a simple command line tool that turns your CLI tools into web applications. Installation Fro

Dec 28, 2022

Extract structured data from web sites. Web sites scraping.

Extract structured data from web sites. Web sites scraping.

Dataflow kit Dataflow kit ("DFK") is a Web Scraping framework for Gophers. It extracts data from web pages, following the specified CSS Selectors. You

Jan 7, 2023

記帳-PWA-web-app (Bookkeeping-PWA-web-app)

記帳-PWA-web-app (Bookkeeping-PWA-web-app)

GoKeep (bookkeeping web app) 記帳-PWA-web-app (Bookkeeping-PWA-web-app) demo link : https://bookkepping.herokuapp.com/ 測試用帳密 : tester002 , tester002 (亦可

Jan 31, 2022

log4jScanner: provides you with the ability to scan internal (only) subnets for vulnerable log4j web servicelog4jScanner: provides you with the ability to scan internal (only) subnets for vulnerable log4j web service

log4jScanner: provides you with the ability to scan internal (only) subnets for vulnerable log4j web servicelog4jScanner: provides you with the ability to scan internal (only) subnets for vulnerable log4j web service

log4jScanner Goals This tool provides you with the ability to scan internal (only) subnets for vulnerable log4j web services. It will attempt to send

Jan 5, 2023

Go-web-scaffold - A simple scaffold for building web app quickly

Go-web-scaffold A simple scaffold for building web app quickly. features This sc

Jan 21, 2022

IP geolocation web server

freegeoip NOTE: as of April 2018 this repository is no longer active. Please visit https://github.com/apilayer/freegeoip/ for the current version. Thi

Dec 26, 2022

Polite, slim and concurrent web crawler.

gocrawl gocrawl is a polite, slim and concurrent web crawler written in Go. For a simpler yet more flexible web crawler written in a more idiomatic Go

Dec 31, 2022

A quick and easy password protected web server for your files. httpfolder makes downloading/uploading files from your current working directory easy, even for fairly large files.

httpfolder A quick and easy password protected web server for your files. httpfolder makes downloading/uploading files from your current working direc

Sep 12, 2022

sigurlx a web application attack surface mapping tool.

sigurlx a web application attack surface mapping tool, it does ...:

Jul 24, 2021
Comments
  • run without ssl

    run without ssl

    hello, I was trying witty and noticed that I can't run it without providing ssl cert/private key, but given that I would deploy this on kubernetes and ssl is handled separately I'd like to know if there's a way to run this is normal http mode.

OliveTin is a web interface for running Linux shell commands.
OliveTin is a web interface for running Linux shell commands.

OliveTin OliveTin is a web interface for running Linux shell commands. Some example use cases; Give controlled access to run shell commands to less te

Dec 30, 2022
Hajimari is a beautiful & customizable browser startpage/dashboard with Kubernetes application discovery.
Hajimari is a beautiful & customizable browser startpage/dashboard with Kubernetes application discovery.

Hajimari ?? ...The beginning of a pleasant experience Features Web search bar Dynamically list apps discovered from Kubernetes ingresses Support for n

Jan 4, 2023
Server and bookmarklet to download files via youtube-dl directly from your browser
Server and bookmarklet to download files via youtube-dl directly from your browser

gropple A web service and bookmarklet to download videos with a single click. Pre-requisites a passing familiarity with the command line youtube-dl (p

Nov 12, 2022
66 is two player game played with playing cards and from now on you can play it from browser with your friends.

altmis-alti 66 is two player game played with playing cards and this project provides multiplayer game space from browser. How to run? Clone the proje

Feb 1, 2022
Preview tar.gz in the browser

Preview tar.gz in the browser

Dec 14, 2021
Create a demo RESTful application using Golang

Instructions The goal of this exercise is to create a demo RESTful application using Golang. The Task In this task, we are building backend of an appl

Oct 30, 2021
A simple demo written in Golang to shorten URL and redirect

url-shortener A simple demo written in Golang to shorten URL and redirect . ├── go.mod ├── go.sum ├── handler │ └── handlers.go ├── main.go ├── shor

Jun 5, 2022
A ToDoList Demo based on Vue+Gin+Gorm+mysql
A ToDoList Demo based on Vue+Gin+Gorm+mysql

bubble清单 一个基于gin+gorm开发的练手小项目,通过该项目可初识go web开发该有的姿势。 前端页面基于vue和ElementUI开发,对前端不熟悉的童鞋可直接下载templates和static文件夹下的内容使用。 使用指南 下载 [email protected]:mao888/GoWe

Mar 16, 2022
Demo application to implement a REST api backend service for an android app using the Go aah framework.

aah-recycleview-backend This tutorial is based on the aah framework to implement a REST API form of CRUD application services, taking "IN-MEMORY" stor

Jan 28, 2022
Gin learning demo.

Gin demo For Gin learning, a Go web framework. learn_1, go hello world touch main.go, run by go run main.go config the package management tool, mod, u

Feb 10, 2022