Skip to content

DKraiser/remote_shell_emulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPAaSM Assignment 2. Remote shell

Author: Oles Andrela

AIS ID: 136166

Seminar: Wed, 18:00

Tutor: J. Mikulec

Task

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

Minimal provided functionality

  • help command - write the following information;

    • Author info;
    • What the programm is that;
    • How to use;
    • Available commands.
  • quit command - close the connection sent this command;

  • halt command - close all connections and stop the entire program;

  • -p flag - select a port;

  • -h flag - write help information and quit;

  • -s flag - use server behavior;

  • -c flag - use client behavior;

  • Start with no -s or -c arguments - 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>

Bonus tasks

  1. stat command - 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
  1. <username> and <hostname> using inline ASM; (3 points)

  2. Makefile;

  3. English documentation;

Command execution

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.

About

Task 2 of SPaASM subject on STU FIIT. Remote shell emulator - client server shell application designed for GNU/Linux x86-64 systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors