Hacked!

1. Has someone got in and managed to delete all record of their activity apart from the reboot in dmesg?
If I'm going after your particular server I'd clean up if I get root.
Bots usually don't care.

As it was mentioned here there's no evidence in provided information you have been hacked. The user 'user' is rebooting the server.
Could've script kiddie got in ? Yeah, but not by attack you showed in the logs so far.

Now .. if you want to play games :)
Code:
mv /sbin/reboot /sbin/reboot.orig
touch /sbin/reboot
chown root:wheel /sbin/reboot && chmod 755 /sbin/reboot
Now edit the /sbin/reboot and put:
Code:
#!/bin/sh

LOG=/root/susreboot.log

(
echo "$(date): I was called to reboot by ${PPID}!"
ps auxd
w
) >> ${LOG}

sync
/sbin/reboot.orig $*
And when somebody does call it you'll have your info prior to reboot in /root/susreboot.log log.
 
... That'll take a few hours, I expect, especially since in the liveusb I don't seem to have pipes available so I'm having to use scroll lock and up arrows rather than less.
do yourself a favor and use mtree by issuing mtree -c -F mtree -k type,link,sha256 -p /boot > /tmp/boot.mtree.output and then compare it with
mtree -f /tmp/boot.mtree.output -p /boot on the other machine
 
out.png
 
Ok, I've now established the kernel sums match, so the reboot wasn't someone trying to start a modified kernel.

Now I need to look through cronjobs and my own scripts to see whether software could have rebooted the server. It's possibly looking less like a break-in now the kernel seems unmodified.

(PS 22nd Jan 2026 is not in the future.)
 
Script I shared could help you with that. You'll have a ps output with its structure just before the reboot. Once you see it you can revert the change by renaming the original file to reboot again.

It's possibly looking less like a break-in now the kernel seems unmodified.

Logs you provided didn't show any successful entry. But what you wrote is dangerous thinking. Just because kernel provides valid checksum (and its modules) doesn't mean payload can't load after the boot. Modifying kernel would be impractical in most cases. Loading kernel modules is seldom disabled, that would be easier. Yes, rootkits can be KLM (kernel loadable module) but wild bots prefer hiding in userspace. Once you get root you try to spread elsewhere.

The 176.65.149.224 seems to be a mail server, I wouldn't be surprised if it's part of the bot farm.
 
I've modified reboot as you suggest. What a pity I hadn't done that a couple of days ago!

You're right, of course. The fact I have this in my security e-mail:
Code:
master6.evenas.org kernel log messages:
+pflog0: promiscuous mode disabled
+Waiting (max 60 seconds) for system process `vnlru' to stop... done
+Waiting (max 60 seconds) for system process `syncer' to stop...
+Syncing disks, vnodes remaining... 3 0 0 done
+All buffers synced.
+Uptime: 2d18h25m34s
+uhub1: detached
+uhub2: detached
+uhub0: detached
+uhub4: detached
+uhub3: detached
+re0: link state changed to DOWN
+re0: link state changed to UP
+Rebooting...
+cpu_reset: Stopping other CPUs
+---<<BOOT>>---
+Copyright (c) 1992-2025 The FreeBSD Project.
+Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
....

but nothing in /var/log/messages, nor any of the logs for the jails nor the servers running in the jails is itself highly suspicious. That only /var/log/dmesg.yesterday had anything about the reboot (and we've passed another midnight now so that's gone) does suggest the machine isn't safe. The problem is, how do I safeguard a rebuilt machine when I don't know how it was done?
 
Wait till the next reboot and check that /root/susreboot.log to see.

And you answered yourself that question - you can't harden it if you don't know the attack vector. But as discussed, very highly unlikely a hack.
 
Back
Top