Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 783 Bytes

File metadata and controls

33 lines (27 loc) · 783 Bytes

This is a simple implementation for a command server. Don't use it for illegal actions.

Requirements

gradle 7.1, jdk 11, screen, bash, curl

Server

  1. Build gradle build
  2. Run ./build/libs/command-server-1.0-SNAPSHOT.jar
  3. Open swagger ui: http://localhost:8889

Get commands

curl -X 'GET' \
  'http://localhost:8889/api/get-commands/123token123' \
  -H 'accept: */*'

Send command

curl -X 'POST' \
  'http://localhost:8889/api/send-command/123token123' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d 'uname -a'

Important: run the get-commands method before the send-command method

Client

Run command agent in background

screen -dmS command-agent ./command-agent.sh