Monday, June 5, 2017

Interactive Multi User Javascript Shell: JSShell

1:03 PM Leave a Reply
Interactive Multi User Javascript Shell: JSShell


Interactive Multi User Javascript Shell

     An interactive multi-user web based shell written in Python with Flask (for server side) and of course Javascript and HTML (client side). It was initially created in order to debug remote esoteric browsers during tests and research.





Features

Multi client support
Cyclic DOM objects support
Pre flight scripts
Command queue
Command Context


The shell interface contains various commands (can be revealed using the help command).

  ╦╔═╗╔═╗┬ ┬┌─┐┬  ┬
  ║╚═╗╚═╗├─┤├┤ │  │
 ╚╝╚═╝╚═╝┴ ┴└─┘┴─┘┴─┘
  By @Daniel_Abeles

>> help
+-------------+---------------------------------------------------------------+
| command     | description                                                   |
+-------------+---------------------------------------------------------------+
| list        | Lists all the clients registered                              |
| help        | self.help()                                                   |
| select <id> | Selected a specific client from the list                      |
| <command>   | Executes a command to the current selected client             |
| back        | Detaches from the current client                              |
| exit        | Exists this interactive shell                                 |
| coms        | Displays the commands and output for the current client       |
| com <id>    | Displays a specific command and output for the current client |
| comk        | Kills a command ("*" for all)                                 |
| clik        | Kills a client ("*" for all)                                  |
+-------------+---------------------------------------------------------------+                              
Utilizing the command queue, you can fire multiple commands and the client will execute them one by one. All the commands are executed using a single context, so you issue multiple related commands.

To view the commands issued to a client, first select a client:

>> select 1
Then, issue the coms command to view all the commands for the client:

(Client 1) >> coms
To view the full command and it’s full output (on the coms command the output is truncated to fit the screen):

(Client 1) >> com 1


Installation

It is recommended to use a virtual environment:

Pyenv

pyenv virtualenv -p python3.6 venv
pyenv activate venv
virtualenv

virtualenv -p python3.6 venv
source venv/bin/activate
For both

pip install -r requirements.txt


Running

Create the database

python db_handler.py create
Start the server:

python run.py
Navigate with a browser to the server address

http://localhost:5000 (port can be changed)

Open the interactive shell

python shell.py

Download