recmd

Crates.iorecmd
lib.rsrecmd
version0.3.0
sourcesrc
created_at2023-02-25 19:41:33.919774
updated_at2023-03-11 16:12:00.528764
descriptionRemote Commands Executor
homepagehttps://github.com/0xor0ne/recmd/blob/master/README.md
repositoryhttps://github.com/0xor0ne/recmd
max_upload_size
id794519
size80,107
0xor0ne (0xor0ne)

documentation

https://docs.rs/recmd

README

REmote CoMmanD Executor

recmd is a simple utility that can be used to execute command on a remote host.

Build

cargo build --release

For building using Docker or for static builds, see here

Usage

On the remote host where the command must be executed run recmd in server mode:

remcd srv -p 22000

If you prefer to run the server in background, you can enable the daemon mode by using the option -d:

remcd srv -p 22000 -d

with the commands above recmd will listen on port 22000 (TCP) for incoming command requests.

For sending a command request, run recmd in send mode (change 1.2.3.4 with the IP address of the host where the server is running):

recmd snd -a 1.2.3.4 -p 22000 -c "bash -c 'ls /etc > /tmp/out'"
recmd snd -a 1.2.3.4 -p 22000 -c "bash -c 'cat /tmp/out'"

Encryption Key

Communications between the client and the server are encrypted and authenticated with ChaCha20-Poly1305. recmd uses a static password (used to derive the 256 bits ChaCha20 key) defined in src/config.rs with the variable PASSWORD_DEF.

const PASSWORD_DEF: &str = "1e$tob5UtRi6oFr8jlYO";

Be sure to change the value of this variable with your own password before building your own recmd executable.

Alternatively, it is possible to set on-demand the password used for deriving the cryptographic key by setting the RECMDK environment variable. For using this methodology, run the server with (in this example the password is set to "mypasswd"):

RECMDK='mypasswd' remcd srv -p 22000 -d

and then use recmd in client mode like this (change 1.2.3.4 with the IP address of the host where the server is running):

RECMDK='mypasswd' recmd snd -a 1.2.3.4 -p 22000 -c "bash -c 'ls /etc > /tmp/out'"

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 23

cargo fmt