A dummy server to illustrate the usage of NettyServer. To run the examples you first need to generate certificates
by running ssl/certs.sh.
The commands available are:
- l - list connections
- r <cmd> [arg [arg [...]]] - run a remote command
- i <requestId> <stdin text> - send input to stdin of process
- c <requestId> - close stdin of process
21:56:09.607 [main] INFO c.formicary.remoterun.server.NettyServer - Listening for connections on 0.0.0.0/0.0.0.0:1081
21:56:17.525 [New I/O worker #1] INFO c.formicary.remoterun.server.NettyServer - Client connected from /127.0.0.1:50495 (1 open connections)
21:56:17.742 [New I/O worker #1] INFO c.formicary.remoterun.server.NettyServer - Client connection complete from /127.0.0.1:50495 (CN=client1, O=Formicary Ltd, L=London, ST=Greater London, C=GB)
l
21:56:23.800 [main] INFO com.formicary.remoterun.server.Server - 1: CONNECTED /127.0.0.1:50495
21:56:23.800 [main] INFO com.formicary.remoterun.server.Server - Finished listing 1 agent connections
r cat
21:56:27.768 [main] DEBUG n.f.r.common.NettyLoggingHandler - [id: 0x01977fc5, /127.0.0.1:50495 => /127.0.0.1:1081] WRITE: messageType: RUN_COMMAND requestId: 1 runCommand { cmd: "cat" }
21:56:27.899 [New I/O worker #1] DEBUG n.f.r.common.NettyLoggingHandler - [id: 0x01977fc5, /127.0.0.1:50495 => /127.0.0.1:1081] RECEIVED: messageType: STARTED requestId: 1
i 1 hello\n
21:56:40.697 [main] DEBUG n.f.r.common.NettyLoggingHandler - [id: 0x01977fc5, /127.0.0.1:50495 => /127.0.0.1:1081] WRITE: messageType: STDIN_FRAGMENT requestId: 1 stdinFragment: "hello\n"
21:56:40.701 [New I/O worker #1] DEBUG n.f.r.common.NettyLoggingHandler - [id: 0x01977fc5, /127.0.0.1:50495 => /127.0.0.1:1081] RECEIVED: messageType: STDOUT_FRAGMENT requestId: 1 fragment: "hello\n"
c 1
21:56:46.610 [main] DEBUG n.f.r.common.NettyLoggingHandler - [id: 0x01977fc5, /127.0.0.1:50495 => /127.0.0.1:1081] WRITE: messageType: CLOSE_STDIN requestId: 1
21:56:46.614 [New I/O worker #1] DEBUG n.f.r.common.NettyLoggingHandler - [id: 0x01977fc5, /127.0.0.1:50495 => /127.0.0.1:1081] RECEIVED: messageType: EXITED requestId: 1 exitCode: 0