sysctl [sistema] configuraciones

Iniciado por Adalher, Mayo 22, 2021, 08:30:17 PM

Tema anterior - Siguiente tema

0 Miembros y 2 Visitantes están viendo este tema.

Hola a todos,

voy a compartir mis configuraciones para Linux v 1.0. Muy equilibrado, fuertemente orientado a VM y no crea un brick del sistema. Pronto llegarán la versión 2 y una configuración de sysctl [Network] que es muy extensa. No es una cosa de copy-y-paste-de-cualquier-lado, más bien lo revise todo individualmente con numerosas pruebas dentro de una máquina virtual.

- Los usuarios de Arch no deberían usar esto porque para eso existe lo siguiente:
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

- Los usuarios de Whonix tampoco lo necesitan porque:
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

- Esta configuración bombardea radicalmente todo en la RAM. No apto para portátiles, PCs que solo tengan 4 GB. 8 está bien, recomiendo 16 GB. Mejora notablemente la velocidad. Tu NVMe SSD se ,,alivia", dura más y se reducen los rastros de datos.

Con sysctl -a se puede comparar la configuración actual y ajustarla según sea necesario.

Estas configuraciones se copian y se pegan en /etc/sysctl.conf

Luego hay que reiniciar el sistema.

Código: php
#Avoid swap  / disk write and bomb all data in RAM. This is what Whonix and Tails do.
vm.swappiness=1
vm.vfs_cache_pressure=0
vm.dirty_background_ratio=100
vm.dirty_ratio=100

#Increase mmap ASLR randomization to the maximum supported value.
vm.mmap_rnd_bits=32
vm.mmap_rnd_compat_bits=16

#The following two sysctls help mitigating TOCTOU vulnerabilities by preventing users from creating symbolic or hard links to files they do not own or have read/write access to.
fs.protected_fifos=2
fs.protected_regular=2

#Hide exposed kernel pointers, specifically via /proc interfaces. Exposing these pointers provides an easy target for kernel write vulnerabilities.
kernel.kptr_restrict=2

#Prevents unprivileged users from reading the syslog.
kernel.dmesg_restrict=1

#Enable the ptrace scope restriction provided by the Yama LSM. When you update your system, you need down the value at 1.
kernel.yama.ptrace_scope=1

#This restricts loading TTY line disciplines to the CAP_SYS_MODULE capability to prevent unprivileged attackers from loading vulnerable line disciplines with the TIOCSETD ioctl which has been abused in a number of exploits before.
dev.tty.ldisc_autoload=0

#Userfaultfd can be misued to make it easier to exploit existing use-after-free (and similar) bugs that might otherwise only make a short window or race condition available.
vm.unprivileged_userfaultfd=0

#kexec is a system call that is used to boot another kernel during runtime. This functionality can be abused to load a malicious kernel and gain arbitrary code execution in kernel mode so this sysctl disables it.
kernel.kexec_load_disabled=1

#The SysRq key exposes a lot of potentially dangerous debugging functionality to unprivileged users. Contrary to common assumptions, SysRq is not only an issue for physical attacks as it can also be triggered remotely.
kernel.sysrq=0

#So the idea is, if there are core dumps and a regular user can read them, they might find out privileged information. If the program is dumped well it had privileged information in memory, and the user can read the dump, they might find out that privileged information.
fs.suid_dumpable=0



Saludos
Este es el mayor reproche al pueblo hispanohablante:

Que a pesar de su inteligencia y a pesar de su valentía siempre adoran el poder.

¿Pero que tan seguro es ese wipe que te brickea el pc?

Pd: ¿Entonces con 4Gb no es viable no?
¿Que pasa si un objeto imparable choca contra otro inamovible?