| .onedev-buildspec.yml | Loading last commit info... | |
| rustrunner_client | ||
| rustrunner_server | ||
| .gitignore | ||
| README.md |
RustRunner
RustRunner is a simple, proof-of-concept client-server application written in Rust that allows for remote command execution with token-based authentication.
Features
- Remote Command Execution: The server can execute shell commands sent by an authenticated client.
- Token-Based Authentication: The server requires a pre-shared token to authorize clients.
- Client-Server Architecture: The project is split into two separate crates:
rustrunner_serverandrustrunner_client.
Project Structure
rustrunner_server/: Contains the server application. It listens for TCP connections and executes commands from authenticated clients.rustrunner_client/: Contains the client application. It connects to the server, sends a command, and prints the response.
Getting Started
Prerequisites
Building
To build both the client and the server, navigate to their respective directories and run the build command.
Build the server:
cd rustrunner_server
cargo build --release
Build the client:
cd rustrunner_client
cargo build --release
The executables will be located in the target/release/ directory within each project folder.
Usage
1. Run the Server
The server requires an authentication token to be specified on startup.
./rustrunner_server/target/release/rustrunner_server -t YOUR_SECRET_TOKEN
The server will start and listen on 0.0.0.0:7878.
2. Run the Client
The client needs the server's address, the command to execute, and the same authentication token.
Required arguments:
-c <command>: The shell command to execute on the server.-t <token>: The authentication token to connect to the server.
Optional arguments:
-a <address>: The IP address of the server. Defaults to127.0.0.1.
Example:
./rustrunner_client/target/release/rustrunner_client -t YOUR_SECRET_TOKEN -c "ls -l"
To connect to a server on a different machine:
./rustrunner_client/target/release/rustrunner_client -a 192.168.1.10 -t YOUR_SECRET_TOKEN -c "echo Hello from client"
The client will send the command to the server, and the server's response (the command's stdout) will be printed to your console.