spontaneous reboots on bruteforce?
Posted: Mon Oct 31, 2011 5:18 pm
Hi,
I'm having spontaneous reboots when bruteforce is detected.
I was using this simple program:
as regular user. However, it has a slight bug, that is it doesn't check if p=NULL which happens when invalid user is supplied. Which is ok, or it should be - so the program segfaults. After it does so few times, CONFIG_GRKERNSEC_BRUTE=y kicks in, and kills my ssh session, which is also great. However, when I try to ssh back in, the server is extremely slow, and after dozen seconds spontaneously reboots:
It is repeatable, I've managed to reboot it 2 times before I found out my unprivileged process was causing reboots.
Unfortunately it is production server, so I can't experiment too much if it will probably result in another reboot.
kernel is as log says, vanilla 2.6.32.46 patched with grsec 201110080819
I'm having spontaneous reboots when bruteforce is detected.
I was using this simple program:
- Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <pwd.h>
#include <sys/types.h>
main(int argc, char **argv)
{
struct passwd *p;
if (argc != 2) {
printf ("usage: getpwnam <user>\n");
exit(1);
}
p=getpwnam(argv[1]);
printf ("pw_name=%s\npw_passwd=%s\npw_uid=%d\npw_gid=%d\npw_gecos=%s\npw_dir=%s\npw_shell=%s\n",
p->pw_name, p->pw_passwd, p->pw_uid, p->pw_gid, p->pw_gecos, p->pw_dir, p->pw_shell
);
}
as regular user. However, it has a slight bug, that is it doesn't check if p=NULL which happens when invalid user is supplied. Which is ok, or it should be - so the program segfaults. After it does so few times, CONFIG_GRKERNSEC_BRUTE=y kicks in, and kills my ssh session, which is also great. However, when I try to ssh back in, the server is extremely slow, and after dozen seconds spontaneously reboots:
- Code: Select all
Oct 31 21:02:08 data kernel: grsec: From x.x.x.x: (default:D:/) Segmentation fault occurred at 0000000000000028 in /home/mnalis/work/test_getpwnam/getpwnam[getpwnam:14350] uid/euid:500/500 gid/egid:500/500, parent /usr/bin/ltrace[ltrace:14349] uid/euid:500/500 gid/egid:500/500
Oct 31 21:02:08 data kernel: grsec: From x.x.x.x: (default:D:/) possible exploit bruteforcing on /home/mnalis/work/test_getpwnam/getpwnam[getpwnam:14350] uid/euid:500/500 gid/egid:500/500, parent /usr/bin/ltrace[ltrace:14349] uid/euid:500/500 gid/egid:500/500 banning execution for 600 seconds/home/mnalis/work/test_getpwnam/getpwnam[getpwnam:14350] uid/euid:500/500 gid/egid:500/500, parent /usr/bin/ltrace[ltrace:14349] uid/euid:500/500 gid/egid:500/500
Oct 31 21:02:08 data kernel: md: md1 in immediate safe mode
Oct 31 21:02:08 data kernel: grsec: From x.x.x.x: (default:D:/) special role admin (id 1) exited by /bin/zsh4[zsh:1758] uid/euid:0/0 gid/egid:0/0, parent /bin/su[su:1753] uid/euid:0/0 gid/egid:0/0
Oct 31 22:03:41 data syslogd 1.5.0#5: restart.
Oct 31 22:03:41 data kernel: klogd 1.5.0#5, log source = /proc/kmsg started.
Oct 31 22:03:41 data kernel: Linux version 2.6.32.46-grsec201110080819 (mnalis@sabik) (gcc version 4.6.1 (Debian 4.6.1-4) ) #3 SMP Mon Oct 10 13:04:35 UTC 2011
It is repeatable, I've managed to reboot it 2 times before I found out my unprivileged process was causing reboots.
Unfortunately it is production server, so I can't experiment too much if it will probably result in another reboot.
kernel is as log says, vanilla 2.6.32.46 patched with grsec 201110080819