Должны ли мы отключить dmesg для пользователей без прав администратора?

1202
Marek Sebera

Как я могу найти в Mac OS X

smarek:~ marekseberaold$ dmesg Unable to obtain kernel buffer: Operation not permitted usage: sudo dmesg 

Это действительно важно, чтобы отключить доступ к выводу dmesg для пользователей без полномочий root / без прав администратора? Почему Apple делает это вообще?

2
По-видимому, необходимость запуска от имени пользователя root связана с [оригинальной командой BSD] (http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man8/dmesg.8.html). Я думаю, что современная FreeBSD отказалась от необходимости иметь root `dmesg`. new123456 12 лет назад 0

1 ответ на вопрос

3
user427616

A clear "yes" from my side:

An attacker can use it to snoop kernel messages, e.g. about segfaults, kernel errors and thus use it as feedback loop for exploit optimization. Another usecase: the iptables LOG target will write to same buffer, information about connections of other users can then be misused to spoof packets with better chance for success.

I guess someone skilled will find even more ways to use dmesg to aid in privilege escalation.

A recent example on Linux: https://googleprojectzero.blogspot.com/2018/09/a-cache-invalidation-bug-in-linux.html `kernel.dmesg_restrict` is the kernel flag. Similarly, `hidepids` on `/proc` can help. One needs to be careful to not inconvenience users too much, though -- especially if they already have access to `/var/log/kern.log` and the like (e.g., `adm` group) Jacopo 5 лет назад 0

Похожие вопросы