Skip to main content

A minimalist REST API wrapper for python's subprocess API.

Project description

Flask-Shell2HTTP

CodeFactor Language grade: Python flask-shell2http on pypi

A minimalist Flask extension that serves as a REST API wrapper for python's subprocess API.

  • Convert any command-line tool into a REST API service.
  • Execute pre-defined shell commands asynchronously and securely via flask's endpoints.
  • Designed for development, prototyping or remote control.

Inspired by the work of awesome folks over at msoap/shell2http.

Use Cases

  • Set a script that runs on a succesful POST request to an endpoint of your choice. See Example code.
  • Map a base command to an endpoint and pass dynamic arguments to it. See Example code.
  • Can also process multiple uploaded files in one command. See Example code.
  • This is useful for internal docker-to-docker communications if you have lots of different binaries. See real-life example.
  • Currently, all commands are run asynchronously, so result is not available directly. An option would be provided for this in future release.

Note: This extension is primarily meant for executing long-running shell commands/scripts (like nmap, code-analysis' tools) in background from an HTTP request and getting the result at a later time.

Documentation / Quick Start

Documentation Status

Read the Quickstart from the documentation to get started!

Why?

This was initially made to integrate various command-line tools easily with IntelOwl.

Project details


Download files

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

Files for Flask-Shell2HTTP, version 1.1.3
Filename, size File type Python version Upload date Hashes
Filename, size Flask_Shell2HTTP-1.1.3-py3-none-any.whl (9.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size Flask-Shell2HTTP-1.1.3.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page