All Projects → firnsan → shell-agent

firnsan / shell-agent

Licence: other
Agent program installed on remote host, help you to execute shell command on the remote host via HTTP. Also help to transport file to/from remote host.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to shell-agent

Snowflake
Graphical SFTP client and terminal emulator with helpful utilities
Stars: ✭ 1,676 (+3987.8%)
Mutual labels:  remote-execution, remote-shell
remote
Work with remote hosts seamlessly. Code local, build / execute commands remotely
Stars: ✭ 24 (-41.46%)
Mutual labels:  remote-execution
ShellBot
An advanced reverse shell written in Python3.
Stars: ✭ 20 (-51.22%)
Mutual labels:  remote-shell
rce-agent
gRPC-based Remote Command Execution Agent
Stars: ✭ 111 (+170.73%)
Mutual labels:  remote-execution
Eternalterminal
Re-Connectable secure remote shell
Stars: ✭ 2,191 (+5243.9%)
Mutual labels:  remote-shell
FactoryOrchestrator
A cross-platform system service which provides a simple way to run and manage factory line validation, developer inner-loop, diagnostics, and fault analysis workflows.
Stars: ✭ 36 (-12.2%)
Mutual labels:  remote-execution
reverse-ssh
Statically-linked ssh server with reverse shell functionality for CTFs and such
Stars: ✭ 548 (+1236.59%)
Mutual labels:  remote-shell
ops channel
命令通道是联接人与机器,人与业务的一座桥.它跟常用的开源运维工具(`ansible`,`saltstack`,`puppet`)有相似之处,但也有着本质的差异。
Stars: ✭ 34 (-17.07%)
Mutual labels:  remote-shell
method5
Remote execution for Oracle SQL, PL/SQL, and shell scripts, built entirely inside Oracle. Method5 lets you easily run commands quickly and securely on hundreds of databases.
Stars: ✭ 19 (-53.66%)
Mutual labels:  remote-execution
perfy
A simple, light-weight NodeJS utility for measuring code execution in high-resolution real times.
Stars: ✭ 54 (+31.71%)
Mutual labels:  execution
ModooCode
Repo for the Modoocode.
Stars: ✭ 42 (+2.44%)
Mutual labels:  remote-execution
efs2
A dead-simple configuration management tool powered by stupid shell scripts.
Stars: ✭ 82 (+100%)
Mutual labels:  remote-execution
ch.vorburger.exec
Java library to launch external processes
Stars: ✭ 26 (-36.59%)
Mutual labels:  execution
Rtty
Access your terminal from anywhere via the web.
Stars: ✭ 2,434 (+5836.59%)
Mutual labels:  remote-shell
giraffe
Gracefully Integrated Remote Access For Files and Execution
Stars: ✭ 50 (+21.95%)
Mutual labels:  command-execution
robotito
Terminal shell accessible through a jabber connection
Stars: ✭ 68 (+65.85%)
Mutual labels:  remote-shell
Ghost
Ghost Framework is an Android post-exploitation framework that exploits the Android Debug Bridge to remotely access an Android device.
Stars: ✭ 1,934 (+4617.07%)
Mutual labels:  remote-shell
buildkube
Bazel Remote Cache + Remote Execution in Kubernetes
Stars: ✭ 60 (+46.34%)
Mutual labels:  remote-execution
ondevice
ondevice.io client
Stars: ✭ 32 (-21.95%)
Mutual labels:  remote-shell
EasyJob
🔨 EasyJob - keep and execute your PowerShell and BAT scripts from one interface
Stars: ✭ 228 (+456.1%)
Mutual labels:  execution

Shell Agent

Shell Agent, is a program installed on remote host, help you to execute shell command on the remote host.

This agent can also help to transport file to/from remote host.

Install

go build
./shell_agent 

Now you can visit the agent via 8080 port.

The usage is simple:

Shell Agent.

        Usage:
        shell_agent [--cnf=<path>] [--addr=<addr>]
        shell_agent -h | --help
        shell_agent --version

        Options:
        --cnf=<path>  config file path [default: ].
        --addr=<addr>  config file path [default: :8080].

Execute command

There are two ways to execute command on remote host: sync(is default) and async.

sync

Type the following curl request will hang and wait for sleep 5 to finish.

curl -d '{"cmd":"sleep 5 && echo test sleep"}' http://127.0.0.1:8080/api/v1/cmd/run
{"errno":0,"error":"succeed","data":{"id":"bda8616a-0179-4c54-468b-918e15112006","status":"finished","error":"","cmd":"sleep 600 \u0026\u0026 echo test sleep","env":null,"stdout":"test sleep\n","stderr":"","exit_code":0,"pid":10266,"create_time":"2018-02-25T19:01:32.870915989+08:00","finish_time":"2018-02-25T19:11:32.875958476+08:00"}}

Take a careful look at the response:

{
    "errno": 0, 
    "error": "succeed", 
    "data": {
        "id": "bda8616a-0179-4c54-468b-918e15112006", 
        "status": "finished", 
        "error": "", 
        "cmd": "sleep 600 && echo test sleep", 
        "env": null, 
        "stdout": "test sleep\n", 
        "stderr": "", 
        "exit_code": 0, 
        "pid": 10266, 
        "create_time": "2018-02-25T19:01:32.870915989+08:00", 
        "finish_time": "2018-02-25T19:11:32.875958476+08:00"
    }
}

The returned http response contain:

  • id: UUID of the job .
  • status: Status of the job, maybe running, finished(the command exited with zero exit code), failed(the command failed to start, or be killed, or exited with non-zero exit code), canceled(canceled by user)
  • error: The reason why the job failed.
  • stdout: Stdout of the command.
  • stderr: Stderr of the command.
  • exit_code: Exit code of the command.

async

Type the following curl request will not hang and return immediately. The returned http response only contain the job id, which can be use to query job progress.

curl -d '{"cmd":"sleep 600 && echo test sleep", "async":true}' http://127.0.0.1:8080/api/v1/cmd/run  
{"errno":0,"error":"succeed","data":{"id":"3dcb8bb9-5aab-4a5c-7575-fa11294d2dff","create_time":"2018-02-25T19:38:38.539287299+08:00"}}

The returned http response contain:

  • id: UUID of the job .

Query a job

You can use the job id to query the job info:

curl http://127.0.0.1:8080/api/v1/cmd/query?id=3dcb8bb9-5aab-4a5c-7575-fa11294d2dff

Cancel a job

You can cancel a runnning job:

curl http://127.0.0.1:8080/api/v1/cmd/cancel?id=3dcb8bb9-5aab-4a5c-7575-fa11294d2dff

List all command jobs

You can get all jobs ordered by create time desc:

curl http://127.0.0.1:8080/api/v1/cmd/list

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].