Author: Oles Andrela
AIS ID: 136166
Seminar: Wed, 18:00
Tutor: J. Mikulec
To implement a simple program that provides a remote shell functionality as a client and a server.
Allowed languages:
- C 23
- C++ 23
- NASM x64
-
helpcommand - write the following information;- Author info;
- What the programm is that;
- How to use;
- Available commands.
-
quitcommand - close the connection sent this command; -
haltcommand - close all connections and stop the entire program; -
-pflag - select a port; -
-hflag - write help information and quit; -
-sflag - use server behavior; -
-cflag - use client behavior; -
Start with no
-sor-carguments - similar to one with-s; -
Predefined prompt for client and server:
<username>@<hostname><prompt_end_symbol>, where<username>and<hostname>are got by library functions or system calls; -
Validity checks, starting incoming scripts, redirecting using system calls;
-
Usage of
popen()and similar functions for executing shell scripts is prohibited; -
Connections established via
sockets; -
Multiple active connections via the same port;
-
No compiler warnings;
# Server start
remshell -s -p <port>
remshell -p <port>
# Client start
remshell -c -p <port>statcommand - list all active connections; (3 points)
user@host#stat
0. 147.145.0.2:2345
1. 147.145.0.2:2346
2. 147.145.3.5:3333-
<username> and <hostname>using inline ASM; (3 points) -
Makefile;
-
English documentation;
Commands should be executed directly (without initiating a shell process). To do this, we can fork the current process, and exec the requested program (each command is a program contained in directories included in $PATH). For parsing the operator syntax, idea of automates can be used.