Hacked!

Despite taking precautions the sheer onslaught from AI-assisted hacking is difficult to resist and yesterday I got hit.

I was alerted this morning by my security mail showing the the machine had undergone an orderly reboot yesterday. I knew I hadn't done it so it was time to investigate. An unclean shutdown would have been accepted as a power glitch, but this was clearly a properly-triggered reboot:

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.

So I started looking in logs and my first shock was they've been rotating ever 2-3 hours, so the archive goes back less than 24 hours. That's the AI onslaught again. However the earliest log shows:
Code:
176.65.149.224 - - [30/Nov/2026:12:01:05 +0000] "POST /xmlrpc.php HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; WOW64; rv:41.0) Gecko/20100101 Firefox/140.0 (x64 de)"
176.65.149.224 - - [30/Nov/2026:12:01:03 +0000] "GET /%3F%0DSet-Cookie%3Acrlfinjection=crlfinjection HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_7_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15"
176.65.149.224 - - [30/Nov/2026:12:01:06 +0000] "GET /%0ASet-Cookie%3Acrlfinjection/.. HTTP/1.1" 200 14126 "-" "Mozilla/5.0 (Fedora; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
176.65.149.224 - - [30/Nov/2026:12:01:06 +0000] "GET /?Page=%0D%0ASet-Cookie:crlfinjection=crlfinjection&_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&callback=%0D%0ASet-Cookie:crlfinjection=crlfinjection&checkout_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&content=%0D%0ASet-Cookie:crlfinjection=crlfinjection&continue=%0D%0ASet-Cookie:crlfinjection=crlfinjection&continueTo=%0D%0ASet-Cookie:crlfinjection=crlfinjection&counturl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&data=%0D%0ASet-Cookie:crlfinjection=crlfinjection&dest=%0D%0ASet-Cookie:crlfinjection=crlfinjection&dest_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&dir=%0D%0ASet-Cookie:crlfinjection=crlfinjection&document=%0D%0ASet-Cookie:crlfinjection=crlfinjection&domain=%0D%0ASet-Cookie:crlfinjection=crlfinjection&done=%0D%0ASet-Cookie:crlfinjection=crlfinjection&download=%0D%0ASet-Cookie:crlfinjection=crlfinjection&feed=%0D%0ASet-Cookie:crlfinjection=crlfinjection&file=%0D%0ASet-Cookie:crlfinjection=crlfinjection&host=%0D%0ASet-Cookie:crlfinjection=crlfinjection&html=%0D%0ASet-Cookie:crlfinjection=crlfinjection&http=%0D%0ASet-Cookie:crlfinjection=crlfinjection&https=%0D%0ASet-Cookie:crlfinjection=crlfinjection&image=%0D%0ASet-Cookie:crlfinjection=crlfinjection&image_src=%0D%0ASet-Cookie:crlfinjection=crlfinjection&image_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&imageurl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&include=%0D%0ASet-Cookie:crlfinjection=crlfinjection&media=%0D%0ASet-Cookie:crlfinjection=crlfinjection&navigation=%0D%0ASet-Cookie:crlfinjection=crlfinjection&next=%0D%0ASet-Cookie:crlfinjection=crlfinjection&open=%0D%0ASet-Cookie:crlfinjection=crlfinjection&out=%0D%0ASet-Cookie:crlfinjection=crlfinjection&page=%0D%0ASet-Cookie:crlfinjection=crlfinjection&page_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&pageurl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&path=%0D%0ASet-Cookie:crlfinjection=crlfinjection&picture=%0D%0ASet-Cookie:crlfinjection=crlfinjection&port=%0D%0ASet-Cookie:crlfinjection=crlfinjection&proxy=%0D%0ASet-Cookie:crlfinjection=crlfinjection&redir=%0D%0ASet-Cookie:crlfinjection=crlfinjection&redirect=%0D%0ASet-Cookie:crlfinjection=crlfinjection&redirectUri&redirectUrl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&reference=%0D%0ASet-Cookie:crlfinjection=crlfinjection&referrer=%0D%0ASet-Cookie:crlfinjection=crlfinjection&req=%0D%0ASet-Cookie:crlfinjection=crlfinjection&request=%0D%0ASet-Cookie:crlfinjection=crlfinjection&retUrl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&return=%0D%0ASet-Cookie:crlfinjection=crlfinjection&returnTo=%0D%0ASet-Cookie:crlfinjection=crlfinjection&return_path=%0D%0ASet-Cookie:crlfinjection=crlfinjection&return_to=%0D%0ASet-Cookie:crlfinjection=crlfinjection&rurl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&show=%0D%0ASet-Cookie:crlfinjection=crlfinjection&site=%0D%0ASet-Cookie:crlfinjection=crlfinjection&source=%0D%0ASet-Cookie:crlfinjection=crlfinjection&src=%0D%0ASet-Cookie:crlfinjection=crlfinjection&target=%0D%0ASet-Cookie:crlfinjection=crlfinjection&to=%0D%0ASet-Cookie:crlfinjection=crlfinjection&uri=%0D%0ASet-Cookie:crlfinjection=crlfinjection&url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&val=%0D%0ASet-Cookie:crlfinjection=crlfinjection&validate=%0D%0ASet-Cookie:crlfinjection=crlfinjection&view=%0D%0ASet-Cookie:crlfinjection=crlfinjection&window=%0D%0ASet-Cookie:crlfinjection=crlfinjection&redirect_to=%0D%0ASet-Cookie:crlfinjection=crlfinjection HTTP/1.1" 200 14126 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.6 Safari/605.1.15"
176.65.149.224 - - [30/Nov/2026:12:01:06 +0000] "GET /?Test=%0D%0ASet-Cookie:crlfinjection=crlfinjection HTTP/1.1" 200 14126 "-" "Mozilla/5.0 (CentOS; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
176.65.149.224 - - [30/Nov/2026:12:00:46 +0000] "GET /../../../..//etc/passwd HTTP/1.1" 400 266 "-" "-"

Is that the break-in? I'm not sure, because there's already something wrong. That IP address had bombarded my server with over 1,000 requests before it got to that, and I have processes both within Apache and on the host machine which should have blocked the IP long before it got that far, and it wasn't listed in the PF abusers table, so something had already interfered with that. I cannot investigate further because the sheer escalation of web traffic driven by AI makes it almost impossible to maintain logs which go back far enough.

AI is a menace. Because it's written to solve problems, however much we try to keep it out it is designed to find a way round.
 
no
and even if it got /etc/passwd that is not extremly usefull but that request got a 400 response
the long ones probably got the homepage (same length to all)
so its not from these requests
 
It's a poor legal excuse for automated brute-forcing and trying out exploit collections. If digital intrusion is illegal, just remove the responsible person or organisation to blame.
 
This is nothing to do with AI. These attempts are almost as old as internet (or at least web) itself. It's just bot trying known issues against your IP. Sometimes bots can find your IP interesting enough to push harder.

You didn't show the whole log, usually you can see which PID initiated reboot.
 
"POST /xmlrpc.php HTTP/1.1"
Probably looking for CVE-2023-43187

/%3F%0DSet-Cookie%3Acrlfinjection=crlfinjection
/%0ASet-Cookie%3Acrlfinjection/..
"GET /?Page=%0D%0ASet-Cookie:crlfinjection=crlfinjection&_url=%0D{.....snip....}
CRLF injection test.

GET /../../../..//etc/passwd
Typical path traversal bug test.

Agree. This is just random bot noise.

but this was clearly a properly-triggered reboot:
Look in /var/log/messages, you will have actual time stamps. The excerpt you posted has none, so you have no idea when that reboot actually happened. Also, /var/log/messages will log WHO issued that reboot command. Regular users (including various "limited" accounts like www) are not allowed to reboot (or shutdown) a machine. They can only do this if they're a member of the operator group, and a really, really, hope you didn't put the www user in that group.

Code:
Oct 31 10:06:05 maelcum shutdown[51027]: reboot by dice:
 
Despite taking precautions the sheer onslaught from AI-assisted hacking is difficult to resist and yesterday I got hit.

I was alerted this morning by my security mail showing the the machine had undergone an orderly reboot yesterday. I knew I hadn't done it so it was time to investigate. An unclean shutdown would have been accepted as a power glitch, but this was clearly a properly-triggered reboot:

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.

So I started looking in logs and my first shock was they've been rotating ever 2-3 hours, so the archive goes back less than 24 hours. That's the AI onslaught again. However the earliest log shows:
Code:
176.65.149.224 - - [30/Nov/2026:12:01:05 +0000] "POST /xmlrpc.php HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; WOW64; rv:41.0) Gecko/20100101 Firefox/140.0 (x64 de)"
176.65.149.224 - - [30/Nov/2026:12:01:03 +0000] "GET /%3F%0DSet-Cookie%3Acrlfinjection=crlfinjection HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_7_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15"
176.65.149.224 - - [30/Nov/2026:12:01:06 +0000] "GET /%0ASet-Cookie%3Acrlfinjection/.. HTTP/1.1" 200 14126 "-" "Mozilla/5.0 (Fedora; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
176.65.149.224 - - [30/Nov/2026:12:01:06 +0000] "GET /?Page=%0D%0ASet-Cookie:crlfinjection=crlfinjection&_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&callback=%0D%0ASet-Cookie:crlfinjection=crlfinjection&checkout_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&content=%0D%0ASet-Cookie:crlfinjection=crlfinjection&continue=%0D%0ASet-Cookie:crlfinjection=crlfinjection&continueTo=%0D%0ASet-Cookie:crlfinjection=crlfinjection&counturl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&data=%0D%0ASet-Cookie:crlfinjection=crlfinjection&dest=%0D%0ASet-Cookie:crlfinjection=crlfinjection&dest_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&dir=%0D%0ASet-Cookie:crlfinjection=crlfinjection&document=%0D%0ASet-Cookie:crlfinjection=crlfinjection&domain=%0D%0ASet-Cookie:crlfinjection=crlfinjection&done=%0D%0ASet-Cookie:crlfinjection=crlfinjection&download=%0D%0ASet-Cookie:crlfinjection=crlfinjection&feed=%0D%0ASet-Cookie:crlfinjection=crlfinjection&file=%0D%0ASet-Cookie:crlfinjection=crlfinjection&host=%0D%0ASet-Cookie:crlfinjection=crlfinjection&html=%0D%0ASet-Cookie:crlfinjection=crlfinjection&http=%0D%0ASet-Cookie:crlfinjection=crlfinjection&https=%0D%0ASet-Cookie:crlfinjection=crlfinjection&image=%0D%0ASet-Cookie:crlfinjection=crlfinjection&image_src=%0D%0ASet-Cookie:crlfinjection=crlfinjection&image_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&imageurl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&include=%0D%0ASet-Cookie:crlfinjection=crlfinjection&media=%0D%0ASet-Cookie:crlfinjection=crlfinjection&navigation=%0D%0ASet-Cookie:crlfinjection=crlfinjection&next=%0D%0ASet-Cookie:crlfinjection=crlfinjection&open=%0D%0ASet-Cookie:crlfinjection=crlfinjection&out=%0D%0ASet-Cookie:crlfinjection=crlfinjection&page=%0D%0ASet-Cookie:crlfinjection=crlfinjection&page_url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&pageurl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&path=%0D%0ASet-Cookie:crlfinjection=crlfinjection&picture=%0D%0ASet-Cookie:crlfinjection=crlfinjection&port=%0D%0ASet-Cookie:crlfinjection=crlfinjection&proxy=%0D%0ASet-Cookie:crlfinjection=crlfinjection&redir=%0D%0ASet-Cookie:crlfinjection=crlfinjection&redirect=%0D%0ASet-Cookie:crlfinjection=crlfinjection&redirectUri&redirectUrl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&reference=%0D%0ASet-Cookie:crlfinjection=crlfinjection&referrer=%0D%0ASet-Cookie:crlfinjection=crlfinjection&req=%0D%0ASet-Cookie:crlfinjection=crlfinjection&request=%0D%0ASet-Cookie:crlfinjection=crlfinjection&retUrl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&return=%0D%0ASet-Cookie:crlfinjection=crlfinjection&returnTo=%0D%0ASet-Cookie:crlfinjection=crlfinjection&return_path=%0D%0ASet-Cookie:crlfinjection=crlfinjection&return_to=%0D%0ASet-Cookie:crlfinjection=crlfinjection&rurl=%0D%0ASet-Cookie:crlfinjection=crlfinjection&show=%0D%0ASet-Cookie:crlfinjection=crlfinjection&site=%0D%0ASet-Cookie:crlfinjection=crlfinjection&source=%0D%0ASet-Cookie:crlfinjection=crlfinjection&src=%0D%0ASet-Cookie:crlfinjection=crlfinjection&target=%0D%0ASet-Cookie:crlfinjection=crlfinjection&to=%0D%0ASet-Cookie:crlfinjection=crlfinjection&uri=%0D%0ASet-Cookie:crlfinjection=crlfinjection&url=%0D%0ASet-Cookie:crlfinjection=crlfinjection&val=%0D%0ASet-Cookie:crlfinjection=crlfinjection&validate=%0D%0ASet-Cookie:crlfinjection=crlfinjection&view=%0D%0ASet-Cookie:crlfinjection=crlfinjection&window=%0D%0ASet-Cookie:crlfinjection=crlfinjection&redirect_to=%0D%0ASet-Cookie:crlfinjection=crlfinjection HTTP/1.1" 200 14126 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.6 Safari/605.1.15"
176.65.149.224 - - [30/Nov/2026:12:01:06 +0000] "GET /?Test=%0D%0ASet-Cookie:crlfinjection=crlfinjection HTTP/1.1" 200 14126 "-" "Mozilla/5.0 (CentOS; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
176.65.149.224 - - [30/Nov/2026:12:00:46 +0000] "GET /../../../..//etc/passwd HTTP/1.1" 400 266 "-" "-"

Is that the break-in? I'm not sure, because there's already something wrong. That IP address had bombarded my server with over 1,000 requests before it got to that, and I have processes both within Apache and on the host machine which should have blocked the IP long before it got that far, and it wasn't listed in the PF abusers table, so something had already interfered with that. I cannot investigate further because the sheer escalation of web traffic driven by AI makes it almost impossible to maintain logs which go back far enough.

AI is a menace. Because it's written to solve problems, however much we try to keep it out it is designed to find a way round.
The information you posted isn't enough to determine anything. Look at lastlog. Verify your file modification times are what you think they should be. If they appear fine but you think the file might have been altered, look at the ctime.

Forensic analysis takes more than mere minutes.

I agree AI is the bane of our existence. Sure it helps with some day-to-day tasks at $JOB and with FreeBSD work, but in the over 50 years I've been doing this stuff I've never seen such CVE chaos as I've experienced now.
 
please also show us the output of "freebsd-version -kru", the version of your webserver, and tell us what web application/stack you were running?
 
The log rotated at 12:00:13. The machine would have taken longer than a minute to reboot. There are 1200 continuous entries from that IP since the rotation over a period of 32 seconds from 12:00:34-12:01:06. There is nothing earlier to show.

As for the time of reboot, dmesg doesn't record times and there's no message about the reboot in /var/log/messages although it does contain the line:
Code:
Nov 30 16:50:43 master6 ntpd[660]: leapsecond file ('/var/db/ntpd.leap-seconds.list'):
expired 156 days ago
which could be a clue. However, there is no corresponding record in Apache logs.

What I do know:
1. A reboot happened sometime in a 24-hour period, recorded in dmesg.
2. The reboot is not recorded in /var/log/messages or any Apache logs, though clearly it should have been.
3. I am hampered by Apache logs not going back beyond noon yesterday because so many accesses are thrown at the server they rotate every few hours and the newsyslog quota only allows 7 archives at current settings. This will only get worse.
4. Postfix logs running in a different jail on the same machine show no record of a shutdown or restart.
5. My precautions against IP addresses bombarding the server with hundreds of requests per
minute failed on at least one occasion and the reason isn't clear.

Things I am trying to work out:
1. Has someone got in and managed to delete all record of their activity apart from the reboot in dmesg?
2. Is there some automated process which could have called for a reboot?
3. Is there a spurious record of a reboot when none took place? How could the host reboot but not show a record on servers running in jails?

Requested information:
Code:
# freebsd-version -kru
15.1-RELEASE-p7
15.1-RELEASE-p7
15.1-RELEASE-p7

apache24-2.4.71_1

All pages/scripts/stylesheets were written in a text editor and uploaded with sftp.
 
there's no message about the reboot in /var/log/messages
You do know there are 5 rotated logs kept? They are compressed but can be easily read with bzless[*] (also bzcat or bzgrep) for example. You don't need to unpack them first.

Code:
% ll /var/log/messages*
-rw-r--r--  1 root wheel 970953 Dec  1 17:41 /var/log/messages
-rw-r--r--  1 root wheel  54259 Oct 26 11:00 /var/log/messages.0.bz2
-rw-r--r--  1 root wheel  49786 Oct  4 22:00 /var/log/messages.1.bz2
-rw-r--r--  1 root wheel  51831 Sep  5 15:00 /var/log/messages.2.bz2
-rw-r--r--  1 root wheel  56165 Aug 11 18:00 /var/log/messages.3.bz2
-rw-r--r--  1 root wheel  52345 Jul 20 21:00 /var/log/messages.4.bz2

[*] if you set LESSOPEN you can have less(1) automatically uncompress and open them (lessopen.sh).
 
Bare metal. It's a small old machine (a former PC now running FreeBSD for Internet services) with two SSDs - one for the jails running services and a second one for logs and similar data - the idea being if the logs wear out the drive it can easily be replaced. (Actually, after a few years there is no sign of significant drive wear and I suspect fears around writing to flash memory are exaggerated. It will eventually wear out but not for a long time. More likely it will just fail for some unrelated random reason.)

There are four jails, recently converted from ezjail to bastille. Two run Apache web servers, one runs Postfix for incoming mail, and the fourth was for storing user data securely when one of my sites was envisaged as a membership organisation, but is not actually used.

Code:
ls -l /var/log/messages*
-rw-r--r--  1 root wheel 873870 Dec  1 16:51 /var/log/messages
-rw-r--r--  1 root wheel  14418 Jan  1  2026 /var/log/messages.0.bz2
-rw-r--r--  1 root wheel  20973 Jan  1  2025 /var/log/messages.1.bz2
-rw-r--r--  1 root wheel  19345 Jan  1  2024 /var/log/messages.2.bz2
-rw-r--r--  1 root wheel  17553 Jan  1  2023 /var/log/messages.3.bz2
-rw-r--r--  1 root wheel  14217 Jan  1  2022 /var/log/messages.4.bz2

# head /var/log/messages
Jan  1 00:00:00 master6 newsyslog[94118]: logfile turned over
Jan  1 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list')
: expired 188 days ago
Jan  2 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list')
: expired 189 days ago
Jan  3 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list')
: expired 190 days ago
Jan  4 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list')
: expired 191 days ago
Jan  5 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list')
: expired 192 days ago
Jan  6 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list')
: expired 193 days ago
Jan  7 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list')
: expired 194 days ago
Jan  8 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list')
: expired 195 days ago
Jan  9 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list')
: expired 196 days ago

# tail -n 20 /var/log/messages
Nov 30 19:00:21 master6 syslogd: last message repeated 1 times
Nov 30 22:05:12 master6 syslogd: last message repeated 1 times
Nov 30 22:05:12 master6 syslogd: last message repeated 3 times
Nov 30 22:37:08 master6 syslogd: last message repeated 1 times
Nov 30 22:37:10 master6 syslogd: last message repeated 6 times
Nov 30 23:58:39 master6 syslogd: last message repeated 1 times
Nov 30 23:58:39 master6 syslogd: last message repeated 7 times
Dec  1 07:19:29 master6 kernel: pfr_update_stats: assertion failed.
Dec  1 07:19:29 master6 syslogd: last message repeated 1 times
Dec  1 08:29:16 master6 syslogd: last message repeated 1 times
Dec  1 08:29:16 master6 syslogd: last message repeated 11 times
Dec  1 09:58:40 master6 syslogd: last message repeated 1 times
Dec  1 10:07:34 master6 syslogd: last message repeated 3 times
Dec  1 10:27:38 master6 syslogd: last message repeated 1 times
Dec  1 10:27:38 master6 syslogd: last message repeated 3 times
Dec  1 10:38:35 master6 syslogd: last message repeated 8 times
Dec  1 11:14:50 master6 syslogd: last message repeated 1 times
Dec  1 11:15:55 master6 syslogd: last message repeated 42 times
Dec  1 11:31:54 master6 su[4381]: user to root on /dev/pts/0
Dec  1 16:50:43 master6 ntpd[660]: leapsecond file ('/var/db/ntpd.leap-seconds.list'): 
expired 157 days ago

As you can see, there's no useful information there.

Now this is interesting:
Code:
# grep boot /var/log/messages
Jan 22 17:39:02 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jan 29 12:32:40 master6 reboot[81643]: rebooted by user
Jan 29 12:33:49 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jan 29 12:33:49 master6 kernel: Rebooting...
Feb 25 18:14:10 master6 reboot[74465]: rebooted by user
Feb 25 18:15:19 master6 syslogd: kernel boot file is /boot/kernel/kernel
Feb 25 18:15:19 master6 kernel: Rebooting...
Feb 28 22:22:04 master6 reboot[18089]: rebooted by user
Feb 28 22:23:18 master6 syslogd: kernel boot file is /boot/kernel/kernel
Feb 28 22:23:18 master6 kernel: Rebooting...
Feb 28 23:22:19 master6 reboot[58432]: rebooted by root
Feb 28 23:23:25 master6 syslogd: kernel boot file is /boot/kernel/kernel
Feb 28 23:23:25 master6 kernel: Rebooting...
Mar 26 16:45:36 master6 reboot[81623]: rebooted by user
Mar 26 16:46:38 master6 syslogd: kernel boot file is /boot/kernel/kernel
Mar 26 16:46:38 master6 kernel: Rebooting...
Apr 22 16:54:04 master6 reboot[82476]: rebooted by user
Apr 22 16:55:05 master6 syslogd: kernel boot file is /boot/kernel/kernel
Apr 22 16:55:05 master6 kernel: Rebooting...
Apr 29 09:51:39 master6 syslogd: kernel boot file is /boot/kernel/kernel
Apr 30 11:18:55 master6 reboot[69013]: rebooted by user
Apr 30 11:20:00 master6 syslogd: kernel boot file is /boot/kernel/kernel
Apr 30 11:20:00 master6 kernel: Rebooting...
May  2 20:48:14 master6 reboot[38402]: rebooted by user
May  2 20:49:20 master6 syslogd: kernel boot file is /boot/kernel/kernel
May  2 20:49:20 master6 kernel: Rebooting...
May 21 18:38:51 master6 reboot[2232]: rebooted by user
May 21 18:39:56 master6 syslogd: kernel boot file is /boot/kernel/kernel
May 21 18:39:56 master6 kernel: Rebooting...
Jun 10 19:39:59 master6 reboot[78075]: rebooted by user
Jun 10 19:41:01 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jun 10 19:41:01 master6 kernel: Rebooting...
Jun 25 22:37:40 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jun 25 22:48:42 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jun 27 09:52:33 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jul  1 15:51:45 master6 reboot[7022]: rebooted by user
Jul  1 15:52:47 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jul  1 15:52:47 master6 kernel: Rebooting...
Jul  8 04:35:08 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jul  8 05:25:25 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jul 30 12:46:39 master6 reboot[49746]: rebooted by user
Jul 30 12:47:40 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jul 30 12:47:40 master6 kernel: Rebooting...
Jul 30 13:11:31 master6 reboot[82229]: rebooted by user
Jul 30 13:12:37 master6 syslogd: kernel boot file is /boot/kernel/kernel
Jul 30 13:12:37 master6 kernel: Rebooting...
Sep 30 21:42:48 master6 reboot[51503]: rebooted by user
Sep 30 21:43:53 master6 syslogd: kernel boot file is /boot/kernel/kernel
Sep 30 21:43:53 master6 kernel: Rebooting...
Oct 15 17:15:37 master6 reboot[35124]: rebooted by user
Oct 15 17:16:46 master6 syslogd: kernel boot file is /boot/kernel/kernel
Oct 15 17:16:46 master6 kernel: Rebooting...
Oct 24 13:08:58 master6 reboot[48676]: rebooted by root
Oct 24 13:10:07 master6 syslogd: kernel boot file is /boot/kernel/kernel
Oct 24 13:10:07 master6 kernel: Rebooting...
Oct 24 16:37:58 master6 reboot[79100]: rebooted by user
Oct 24 16:39:03 master6 syslogd: kernel boot file is /boot/kernel/kernel
Oct 24 16:39:03 master6 kernel: Rebooting...
Oct 27 19:00:47 master6 reboot[77987]: rebooted by user
Oct 27 19:01:54 master6 syslogd: kernel boot file is /boot/kernel/kernel
Oct 27 19:01:54 master6 kernel: Rebooting...
Oct 27 19:21:18 master6 reboot[5560]: rebooted by root
Oct 27 19:22:23 master6 syslogd: kernel boot file is /boot/kernel/kernel
Oct 27 19:22:23 master6 kernel: Rebooting...
Oct 27 19:38:08 master6 reboot[43860]: rebooted by root
Oct 27 19:39:14 master6 syslogd: kernel boot file is /boot/kernel/kernel
Oct 27 19:39:14 master6 kernel: Rebooting...
Oct 31 21:25:33 master6 syslogd: kernel boot file is /boot/kernel/kernel
Oct 31 21:25:33 master6 kernel: Automatic reboot in 15 seconds - press a key on the console to abort
Oct 31 21:25:33 master6 kernel: Rebooting...
Oct 31 21:25:33 master6 kernel: Rebooting...
Oct 31 21:25:33 master6 kernel: Rebooting...
Oct 31 22:35:01 master6 syslogd: kernel boot file is /boot/kernel/kernel
Oct 31 22:35:01 master6 kernel: Automatic reboot in 15 seconds - press a key on the console to abort
Oct 31 22:35:01 master6 kernel: Rebooting...
Oct 31 22:56:42 master6 reboot[83928]: rebooted by root
Oct 31 22:57:47 master6 syslogd: kernel boot file is /boot/kernel/kernel
Oct 31 22:57:47 master6 kernel: Rebooting...
Nov  3 16:33:36 master6 syslogd: kernel boot file is /boot/kernel/kernel
Nov 15 16:39:30 master6 syslogd: kernel boot file is /boot/kernel/kernel
Nov 15 17:29:48 master6 reboot[4285]: rebooted by user
Nov 15 17:30:47 master6 syslogd: kernel boot file is /boot/kernel/kernel
Nov 15 17:30:47 master6 kernel: Rebooting...
Nov 15 19:04:51 master6 reboot[65175]: rebooted by user
Nov 15 19:57:53 master6 syslogd: kernel boot file is /boot/kernel/kernel
Nov 15 19:57:53 master6 kernel: Rebooting...
Nov 15 19:57:53 master6 kernel: Rebooting...
Nov 15 22:23:29 master6 reboot[65633]: rebooted by root
Nov 15 22:24:35 master6 syslogd: kernel boot file is /boot/kernel/kernel
Nov 15 22:24:35 master6 kernel: Rebooting...
Nov 18 16:49:42 master6 reboot[30716]: rebooted by user
Nov 18 16:50:42 master6 syslogd: kernel boot file is /boot/kernel/kernel
Nov 18 16:50:42 master6 kernel: Rebooting...

Though there's no entry for yesterday, those "Automatic reboot" messages suggest there might be a process called from time to time which reboots the machine, in which case it could be I'm noticing something which happens quite innocently from time to time but I've never spotted it before. that needs following up.
 
Jan 9 11:03:53 master6 ntpd[78677]: leapsecond file ('/var/db/ntpd.leap-seconds.list') : expired 196 days ago
See if running service ntpd fetch fixes this issue.

Oct 31 21:25:33 master6 kernel: Automatic reboot in 15 seconds - press a key on the console to abort
These happen right after loading the kernel. Either a bad kernel or a bad module being loaded (/boot/loader.conf) that causes it to crash. Maybe bad memory? It doesn't always happen, and I'm pretty sure a would-be-hacker would not be able to fix this remotely without booting to single user mode and having console access.

Oct 27 19:00:47 master6 reboot[77987]: rebooted by user
This your user account? Did you replace it when you posted the logs here? I'm assuming this a normal user account on your system? Check their history files, you might find some clues there.
 
Not really relevant to the current issue but:
Code:
# service ntpd fetch
fetch: ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list: Not logged in

More to the point, this is a line I have in /etc/syslog.conf:
Code:
*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err   /var/log/messages

Is that right?
 
OK, let's take a step back here and investigate what this break-in actually tried to achieve.

A reboot as such is not a useful action for an attacker. If an attacker reboots a machine they have taken over that is to get a modified kernel actually running (or some other startup item, although that is less likely).

So your next step is to compare your kernel with a kernel from a freshly downloaded build of the same version. If you want to do this right you also do this when you are not booted into this potentially compromised kernel, boot from USB instead.
 
Oct 31 21:25:33 master6 kernel: Rebooting...
Oct 31 21:25:33 master6 kernel: Rebooting...
Oct 31 21:25:33 master6 kernel: Rebooting...
Looks like your computer is sick or the rebooting script is sick (3 reboot messages at the same time)? There are later instances as well.

May be run "sudo system accounting enable; sudo system accounting start" so that you can run lastcomm(1) in future to see what programs were running prior to a reboot.
 
Back
Top