camelcc / webshell

Web shell based on pty and xterm.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebShell

Demo for web shell. A web page with shell capability connecting to backend server.

Test

Run docker-compose up under current direcotry for local testing purpose. Visit localhost and using admin/admin for testing purpose.

server

Server is a go process serve the sh func based on pty, route all io to incoming websocket.

client

Client is a react SPA using antd design library.

Authentication

Web session been authenticated through cookie. Username and password is hardcoded in go process.

Proxy

Nginx serve as a reverse proxy to host these two services under the same domain to solve the CORS issue.

Deploy

Go

Authentication is been hardcoded and need to integrated into real backend system such as redis/memcached for web session, and real db for password verification.

Using go build to build the binary and serve it.

Web

Using npm buld and host the output file under the same domain as backend server.

Reverse Proxy

Refer nginx/nginx.conf for reference. Note if you want to deploy behind the ssl cerficiation, need to tweak web url from ws to wss, also need to enforce the cookie settings as secure cookie.

About

Web shell based on pty and xterm.js

License:MIT License


Languages

Language:TypeScript 46.4%Language:Go 40.8%Language:CSS 5.7%Language:HTML 2.7%Language:Dockerfile 2.6%Language:JavaScript 1.9%