To run bash commands from web in a queue like manner.
Example scenario: I connected a command-line scanner to a web interface and used this to start multiple scans at the same time. see if the scan is completed and updated the response with the data returned from that command once the scan was completed.
Apache
apt-get install apache2
PHPapt-get install php libapache2-mod-php
task-spoolerapt-get install task-spooler
Install Pre-requisites
git clone https://github.com/ZeeshanSultan/tsp tsp
mv tsp/tsp.php /var/www/html
sudo chmod 777 /var/www/html/tsp.php
http://<host>/tsp.php
id (ID of task), op (Task Operation), fetch_commands (Fetch all tasks), command (Add a command in task queue)
state
kill
of
urgent
data
To get all tasks
To create a new task
http://HOST/tsp.php?command=Base64EncodedCommand
http://HOST/tsp.php?command=bHMgLWxhaA==
To get task's state (whether its still queued, running or finished)
To get a task's output file
To get a task's output data
To kill a running task
To prioritize a task in queue
Note: creating a new task will return task id