I do not know the vector used to gain the level of access that was gained: root. This is the first time I have ever seen that. I suspect it has something to do with recent kernel bugs that allow privilege escalation. But I have not found the evidence of how it was done.
I have many many lines of custom code (plugins, etc) that all could be suspect. But, I am very security conscious when it comes to AXAX, API calls, public data input, and coding in general. Been coding too many years to not defend against the easy hacker tricks. My code is not perfect and exploitable bugs could exist. I am generally protected from that since my code is not open source (no public access). So the hacker will be basically be trying to hack a black box.
Hackers are the laziest coders, as all criminals are lazy. Even though the vBulletin code is also not open source, but it is readily available. So hackers can let AI work over the code base and look for exploits.
Normally hacks are from spammer hackers, and they just want to get some kind of redirection in place. Or a spam page or fake login. As sending a spam email that has a legitimate site link helps trick you. Checkout pitmaster tools here! With the link to Pitmaster that gets redirected to some other site, and these normally have several redirection jumps via several hacked sites. Landing on some casino site or some fake login page.
However, this time they gained root access and setup a CRON to overwrite the /root/.ssh/authorized_keys file with their key (which was pulled from a pastebin site via CURL). Since I do not allow password logins, only pubkey logins, this was the only way they could retain access. And this happened in real time. As I was logged in SSH (after noticing that the site was messed up) and was deleting the hacker files. I then saw the files returned and tried to SSH a second console, so I could have a spare, and that failed. As I tried to use the first console to figure out what was happening, they rebooted (not before corrupting the boot config).
I honestly think the break and run (and reboot) was a panic move as I was locking them out when it happened. I have my own tricks.
The rest of the hack was installing the crypto miner (in /tmp) and setting up the code to allow them to use it remotely.
The only reason I could regain access is because Linode has a web console feature (most virtual server hosting has this). It is not optimal as the server could not be booted and I had to boot into rescue mode, mount the main server, and do my work from there.
I do have daily backups. In the last one was only a few hours old. Not up to the minute. I was able to do a complete database dump minutes before the hackers rebooted. This is always my first action on a suspected hack, dump the database. So that was available. Now how to get the data? The attachments directory is currently 65GB. I could not set up pubkey login on the rescue disk. So I temporarily allowed password login on another server and use sftp to transfer all files and the database dump. That took about 4 hours, the vast majority of that was the attachments. Also took that long to transfer all the files to the new server.
So that's it. Summary: use exploit to get a file on the server, use file to escalate privileges, install crypto miner, use crontab to lock out other logins and ensure you can login.
The two things that bother me about all this. The first is the vector, how they got in to start with. But the other thing is, they did not stay stealthy. Hackers do not want you to know your site or server was hacked, as you will then take steps to clean it up. The first thing they did was break the site, deleted the file that handles rendering all assets (CSS, JS, and Media). Then breaking my ability to login at all. Very concerning. Lazy, stupid, or bold?
I have many many lines of custom code (plugins, etc) that all could be suspect. But, I am very security conscious when it comes to AXAX, API calls, public data input, and coding in general. Been coding too many years to not defend against the easy hacker tricks. My code is not perfect and exploitable bugs could exist. I am generally protected from that since my code is not open source (no public access). So the hacker will be basically be trying to hack a black box.
Hackers are the laziest coders, as all criminals are lazy. Even though the vBulletin code is also not open source, but it is readily available. So hackers can let AI work over the code base and look for exploits.
Normally hacks are from spammer hackers, and they just want to get some kind of redirection in place. Or a spam page or fake login. As sending a spam email that has a legitimate site link helps trick you. Checkout pitmaster tools here! With the link to Pitmaster that gets redirected to some other site, and these normally have several redirection jumps via several hacked sites. Landing on some casino site or some fake login page.
However, this time they gained root access and setup a CRON to overwrite the /root/.ssh/authorized_keys file with their key (which was pulled from a pastebin site via CURL). Since I do not allow password logins, only pubkey logins, this was the only way they could retain access. And this happened in real time. As I was logged in SSH (after noticing that the site was messed up) and was deleting the hacker files. I then saw the files returned and tried to SSH a second console, so I could have a spare, and that failed. As I tried to use the first console to figure out what was happening, they rebooted (not before corrupting the boot config).
I honestly think the break and run (and reboot) was a panic move as I was locking them out when it happened. I have my own tricks.

The rest of the hack was installing the crypto miner (in /tmp) and setting up the code to allow them to use it remotely.
The only reason I could regain access is because Linode has a web console feature (most virtual server hosting has this). It is not optimal as the server could not be booted and I had to boot into rescue mode, mount the main server, and do my work from there.
I do have daily backups. In the last one was only a few hours old. Not up to the minute. I was able to do a complete database dump minutes before the hackers rebooted. This is always my first action on a suspected hack, dump the database. So that was available. Now how to get the data? The attachments directory is currently 65GB. I could not set up pubkey login on the rescue disk. So I temporarily allowed password login on another server and use sftp to transfer all files and the database dump. That took about 4 hours, the vast majority of that was the attachments. Also took that long to transfer all the files to the new server.
So that's it. Summary: use exploit to get a file on the server, use file to escalate privileges, install crypto miner, use crontab to lock out other logins and ensure you can login.
The two things that bother me about all this. The first is the vector, how they got in to start with. But the other thing is, they did not stay stealthy. Hackers do not want you to know your site or server was hacked, as you will then take steps to clean it up. The first thing they did was break the site, deleted the file that handles rendering all assets (CSS, JS, and Media). Then breaking my ability to login at all. Very concerning. Lazy, stupid, or bold?









Comment