nerdofcode / restricted-shell Goto Github PK
View Code? Open in Web Editor NEWA simple shell in C that is designed to be fast and efficient and only allows specified commands...
License: GNU General Public License v2.0
A simple shell in C that is designed to be fast and efficient and only allows specified commands...
License: GNU General Public License v2.0
If installing user decides to change the install-dir, modules that take advantage of the Src/global_bash_var
file, will be unable to access it...
As the absolute file location of the global_bash_var
file is assumed to be in the default location fo the shell @ /etc/Restricted-Shell/
.
A user inside the "R-Shell" can no longer access the shells files via the cd
command...
Although it is still possible to modify the shells files while in use through the nano
command...
For example: nano /etc/Restricted-Shell/Src/shell.c
...
A fix is underway!
The cd
command doesn't work with any directory. For example,
cd /tmp
returns:
File Access Error[FAE]...
Error 1001...
even though any user can access /tmp
.
In Bin/nano, the script checks the location of rnano
, and then runs it. However, there is no point in doing this as rnano
is just a symbolic link to nano
:
file $(which rnano)
returns:
/bin/rnano: symbolic link to nano
which is just /bin/nano
:
file /bin/nano
returns:
/bin/nano: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=e87c5ab33de1e9e225244efd8e2a03f55892c98f, stripped
Please DO NOT directly edit /etc/passwd
, as this can break your OS. Instead, please recommend using the built-in chsh
command:
sudo chsh [desired user] -s /etc/Restricted-Shell/run.sh
Also, this allows for you to change your own shell without being root.
Storing executables in /etc/
is not standard, and probably not a good idea. Instead, please use /usr/local/
:
The
/usr/local
hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable among a group of hosts, but not found in /usr.
User can remove shell within shell via rmdir
When the shell has been compiled and the user is in the "Restricted-Shell", they can execute unauthorized executable files...
For example; if the user wanted to re-run the shell script that enables and disables all their commands... They could simply run something such as the following:
Command[Src]: ../run.sh
A non-admin user within the R-Shell can potentially gain admin access if they modify the source files... They can do so by running something similar to:
nano /etc/Restricted-Shell/cmd_src/...
Attempting to run bash run.sh
yields an error reading "run.sh: line 71: Kali GNU/Linux: No such file or directory." By copying into the Src directory and compiling with gcc shell.c globals.h -o rshell
and running with ./rshell
results in no commands being executable aside from the "cmds" command.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.