Ninja is a privilege escalation detection and prevention
system for GNU/Linux hosts. While running, it will monitor
process activity on the local host, and keep track of all
processes running as root. If a process is spawned with
UID or GID zero (root), ninja will log necessary informa-
tion about this process, and optionally kill the process
if it was spawned by an unauthorized user.
A "magic" group can be specified, allowing members of this
group to run any setuid/setgid root executable.
Individual executables can be whitelisted. Ninja uses a
fine grained whitelist that lets you whitelist executables
on a group and/or user basis. This can be used to allow
specific groups or individual users access to setuid/set-
gid root programs, such as su(1) and passwd(1).
Ninja es un sistema de detección y prevención de escaladas de privilegios para GNU/Linux. Mientras está corriendo, monitorea las actividades de los procesos locales por un lado, y de los procesos corriendo como root por el otro. Si un proceso lanza a otro nuevo con UID o GID cero (root), Ninja va a loguear la información necesaria acerca del mismo, y opcionalmente lo puede finalizar si fue creado por un usuario (es decir, un proceso de un usuario) sin autorización.
NAME
ninja - Privilege escalation detection system for
GNU/Linux
CONFIGURATION
Ninja requires a configuration file to run. For more
information about the configuration, please refer to the
"default.conf" file, located at "examples/config/" in the
source tree. There, all the available options are
explained in detail.
WHITELIST
The whitelist is a plain text file, containing new-line
separated entries. Entries consists of three fields, sep-
arated by colons. The first field is the full path to the
executable you wish to whitelist. The second field is a
comma separated list of groups that should be granted
access to the executable. The third field is a comma sep-
arated list of users.
: :
The second or third field can be left empty. Please refer
to the example whitlist located in "examples/whitelist/".
Remember that it is a good idea to whitelist programs such
as passwd(1) and other regular setuid applications that
users require access to.
SECURITY
The goal of this application is to be able to detect and
stop local, and possibly also remote exploits. It is
important to note that ninja cannot prevent attackers from
running exploits, as a successful exploitation only will
be detected AFTER the attacker has gained root. However,
when ninja is running with a short scanning cycle, this
detection happens nearly immediately. The security lies in
the fact that we stop the attacker before he/she has time
to do anything nasty to the system, and it gives us the
opportunity to disable the attacker's shell access, and
lock him/her out of the system.
In an ideal environment, ninja should be run together with
kernel hardening systems such as grsecurity (www.grsecu-
rity.net) as this will allow for some protection of the
ninja process.
This is not a complete security system. Do not rely on it
to keep your system safe.
BUGS
Please let me know if you should stumble across any bugs
or other weirdness. I greatly appreciate all bug reports,
patches, ideas, suggestions and comments.
Actualmente en la versión 0.1.3, es una aplicación que lo destaca su sencillez, Pueden Descargarlo desde aquí.
Cito nuevamente, pero esta vez desde syswoody.com, su instalación y configuración:
La configuración de NINJA consta de el archivo de configuración y un archivo llamado whitelist donde se almacenaran los ejecutables el grupo y los usuarios que podrán correrlos, estos dos se encuentran en la carpeta /etc/ninja. Adicionalmente debemos crear un archivo que guardara el log de nuestra herramienta, para esto hacemos lo siguiente:1.apt-get install ninja
Ahora creamos un grupo llamado ninja(por favor tomen nota del GID):1.touch /var/log/ninja.log2.chmodo-rwx /var/log/ninja.log
El siguiente paso consiste en agregar nuestro usuario y el usuario root al grupo que acabamos de crear:1.addgroup ninja
Editamos el archivo de configuración:1.usermod -a -G tusuario2.usermod -a -G root3.usermod -a -G messagebus
Buscamos las siguientes lineas y hacemos los cambios respectivos1.gedit /etc/ninja/ninja.conf
El turno es para la lista blanca abrimos el archivo y borramos la linea de SUDO ya que en Debian no se utiliza, quedaría de esta forma:1.group= GID -> aquí debe ir el GID que guardaste cuando creaste el grupo ninja2.daemon=yes3.interval=04.logfile=/var/log/ninja.log// asegúrese de quitar el # del comentario5.whitelist=/etc/ninja/whitelist6.no_kill = no7.no_kill_ppid = no
Por ultimo agregamos ninja al inicio, adicionamos la siguiente linea en el archivo /etc/rc.local:1./bin/su:users:2./bin/fusermount:users:3./usr/bin/passwd:users:4./usr/bin/pulseaudio:users:5./usr/sbin/hald:haldaemon:6./usr/lib/hal/hald-runner:haldaemon:
Solo nos queda reiniciar y probar que nuestro ninja este funcionando como debería.1./usr/sbin/ninja /etc/ninja/ninja.conf
Haciendo una pequeña prueba...
Artículos recomendados: revistalinux.net (dos-herramientas-para-sysadmins-ninja-y-ksplice) ; How to Ninja and How to Ninja - Ubuntu 10.04 by bodhi.zazen.

0 comentarios:
Publicar un comentario en la entrada