Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/github30/shell2http
Executing shell commands via HTTP server
https://github.com/github30/shell2http
executor os-command-injection popen python shell shell2http subprocess webhook
Last synced: 22 days ago
JSON representation
Executing shell commands via HTTP server
- Host: GitHub
- URL: https://github.com/github30/shell2http
- Owner: GitHub30
- License: mit
- Created: 2022-08-11T21:20:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-03T09:03:34.000Z (almost 2 years ago)
- Last Synced: 2024-09-24T01:14:48.126Z (about 2 months ago)
- Topics: executor, os-command-injection, popen, python, shell, shell2http, subprocess, webhook
- Language: Python
- Homepage: https://pypi.org/project/shell2http/
- Size: 50.8 KB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Python](https://img.shields.io/pypi/pyversions/shell2http.svg)](https://badge.fury.io/py/shell2http)
[![PyPI](https://badge.fury.io/py/shell2http.svg)](https://badge.fury.io/py/shell2http)# 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](https://github.com/GitHub30/shell2udp) it runs with minimal latency.# Usage
```bash
shell2http [-h] [-form] [-no-index] [-add-exit] [-output] [-sse] [-p PORT] ["shell command" for /] /path "shell command" /path2 "shell command2" ...positional arguments:
commandoptional 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
```bash
pip install shell2http
```# Examples
## Windows
stop http server with `Ctrl` + `Pause/Break`
```powershell
shell2http "shutdown -s -t 0"
``````powershell
shell2http "shutdown -s -t 0" /beep "powershell -c echo `a"
``````powershell
shell2http --port 3306 /beep "powershell -command [Console]::Beep(440,2000)"
```http://localhost:8080/form?from=10&to=100
```bash
shell2http -output -form /form 'echo %v_from%, %v_to%'
```## Linux
```bash
shell2http 'notify-send Hello root'
``````bash
shell2http -p3000 'notify-send Hello root' /path 'canberra-gtk-play -i desktop-login'
``````bash
shell2http -p3000 /path 'canberra-gtk-play -i desktop-login'
``````bash
shell2http -output /info 'uname -a'
``````bash
shell2http -output -sse /ping 'ping -c4 8.8.8.8'
``````bash
shell2http -add-exit pwd
```http://localhost:8080/form?from=10&to=100
```bash
shell2http -output -form /form 'echo $v_from, $v_to'
```html sufix to endpoint will change header to "text/html":
```bash
# Ability to have server events and server simple html pages as clients
shell2http -output -sse /serve_files_as.html "cat LICENSE|sed 's/.*/&<\/pre>/'"
```# Acknowledgements
https://github.com/msoap/shell2http
https://github.com/eshaan7/Flask-Shell2HTTP