Skip to main content

Executing shell commands via HTTP server

Project description

Python PyPI

shell2http

HTTP-server to execute shell commands. Designed for development, prototyping or remote control. Settings through two command line arguments, path and shell command. By default bind to :8080. with shell2udp it runs with minimal latency.

Usage

shell2http [-h] [-form] [-no-index] [-add-exit] [-output] [-sse] [-p PORT] ["shell command" for /] /path "shell command" /path2 "shell command2" ...

positional arguments:
  command

optional arguments:
  -h, --help            show this help message and exit
  -form                 parse query into environment vars
  -no-index             do not generate index page
  -add-exit             add /exit command
  -output               send back output
  -sse                  use Server Sent Events
  -p PORT, --port PORT

Install

pip install shell2http

Examples

Windows

stop http server with Ctrl + Pause/Break

shell2http "shutdown -s -t 0"
shell2http "shutdown -s -t 0" /beep "powershell -c echo `a"
shell2http --port 3306 /beep "powershell -command [Console]::Beep(440,2000)"

http://localhost:8080/form?from=10&to=100

shell2http -output -form /form 'echo %v_from%, %v_to%'

Linux

shell2http 'notify-send Hello root'
shell2http -p3000 'notify-send Hello root' /path 'canberra-gtk-play -i desktop-login'
shell2http -p3000 /path 'canberra-gtk-play -i desktop-login'
shell2http -output /info 'uname -a'
shell2http -output -sse /ping 'ping -c4 8.8.8.8'
shell2http -add-exit pwd

http://localhost:8080/form?from=10&to=100

shell2http -output -form /form 'echo $v_from, $v_to'

html sufix to endpoint will change header to "text/html":

# Ability to have server events and server simple html pages as clients
shell2http -output -sse /serve_files_as.html "cat LICENSE|sed 's/.*/<pre>&<\/pre>/'"

Acknowledgements

https://github.com/msoap/shell2http

https://github.com/eshaan7/Flask-Shell2HTTP

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shell2http-2.10.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

shell2http-2.10-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page