
One of my favorite things to do each morning is to look at the significant recent vulnerabilities that I found interesting – right now, my list is Ivanti Connect Secure, Atlassian Confluence, Apache Ofviz, SnakeYAML, etc., to check our honeypots to see if any new exploits have dropped since last time. And oh boy, was I rewarded this morning when I checked Ivanti! The overwhelming majority of what we see daily is scanners scanning honeypots and honeypots luring scanners – a security Ouroborus, if you will – but thanks to our new sensors, we have much more insight into what “real” attackers are trying. Let’s see what turned up when I lifted the Ivanti rock this morning!
Note: I’m censoring IPs / users in the requests to defang them, but I included them at the bottom in case you want to block them.
Target
These payloads are all leveraging a pair of vulnerabilities in Ivanti Connect Secure – CVE-2023-46805 and CVE-2024-21887, written about here, and with a public exploit available. You can also see the exploitation picking up on our tag.
Payload 1
Here’s the first payload that caught my eye:
Which decodes to:
As of writing, that file is live and installs a persistent backdoor using cron:
Advice: Check for files that look like /etc/<long number>, /tmp/<long number>, or /var/tmp/<long number>, and check your crontab files for odd entries
The payload it fetches is a 64-bit executable:
What does the backdoor do? Let’s take the lazy approach – strings:
Aha, a bitcoin miner!
Payload 2
Next up, this payload:
Which decodes to:
Unsurprisingly, m.sh is a shell script:
Kinda weirdly, the scripts are 64-bit and 32-bit executables:
Both files are UPX-packed (what year is this?), which is fortunately quite easy to unpack:
Those files appear to be written in Go and somewhat obfuscated (or maybe Go always looks obfuscated?) – in any case, the strings command doesn’t tell me much other than an SSH private key:
Rather than spending a lot of time digging into this, I decided to move on to the next thing. Searching by checksum, it does appear that watchd0g is known malware
Advice: check for /tmp/watchd0g and /tmp/watchbog
Payload 3
And finally, the last payload:
Which decodes to:
And the shellscript it fetches:
That appears to install an ssh server, install a .json configuration file, and set up a systemd service, as well as a backdoor in the user’s .profile file. Here’s the configuration file:
Advice: Check for a systemd service called .ssh_miner, a .profile entry that rusn a miner, or a file called /tmp/script.sh
IoCs
Here are the SHA256 sums of all the files I saw:
- 0c9ada54a8a928a747d29d4132565c4ccecca0a02abe8675914a70e82c5918d2 backdoor
- bbfba00485901f859cf532925e83a2540adfe01556886837d8648cd92519c68d ivanti.js
- cf20940907be484440e8343aa05505ad2e4d6d1f24ef29504bfa54ade4a8455f m.sh
- 8eadb5beeb21d4a95dacd133cb2b934342fcb39fe4df2a8387a0d5499c72450d watchbog
- 1e1e94bd2bfd5054265123bf55c4cf6ce87de6692d9329bda4a37e89272356e4 watchd0g
- 45c9578bbceb2ce2b0f10133d2f3f708e78c8b7eb3c52ad69d686e822f9aa65f config.json
- 4cba272d83f6ff353eb05e117a1057699200a996d483ca56fa189e9eaa6bb56c script.sh
And some file paths:
- /etc/<long number>
- /etc/cron.d/<long number>
- /tmp/<long number>
- /var/tmp/<long number>
- m.sh
- /tmp/watchd0g
- /tmp/watchbog
- /tmp/script.sh
- $HOME/.ssh/config.json
- $HOME/.ssh/sshd
- $HOME/.ssh/config_background.json
And the IP addresses / users I observed:
- 45.130.22.219
- https[:]//raw.githubusercontent.com/momika233
- 192.252.183.116
We recommend organizations block IPs that have recently exploited Ivanti. We have published a Gist containing these IPs.
Source: https://www.greynoise.io/blog/ivanti-connect-secure-exploited-to-install-cryptominers
Views: 0