Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2024-3094 PoC — Xz: malicious code in distributed source

Source
Associated Vulnerability
Title:Xz: malicious code in distributed source (CVE-2024-3094)
Description:Malicious code was discovered in the upstream tarballs of xz, starting with version 5.6.0. Through a series of complex obfuscations, the liblzma build process extracts a prebuilt object file from a disguised test file existing in the source code, which is then used to modify specific functions in the liblzma code. This results in a modified liblzma library that can be used by any software linked against this library, intercepting and modifying the data interaction with this library.
Description
An ssh honeypot with the XZ backdoor. CVE-2024-3094
Readme
# xz-vulnerable-honeypot

An ssh honeypot with the XZ backdoor. CVE-2024-3094

**TODO**: hook the backdoor and/or sshd. log rsa keys for decryption.

notes:
- https://gist.github.com/smx-smx/a6112d54777845d389bd7126d6e9f504
- https://gist.github.com/q3k/af3d93b6a1f399de28fe194add452d01
- https://github.com/hamarituc/xz-backdoor

## Warning

**PLEASE run this on a separate isolated system. Docker is configured in a way that allows a threat actor to easily escape it.
Docker is only used to get all the shared libraries working and configured.**

## Installation

Install [notify](https://github.com/projectdiscovery/notify) by projectdiscovery using the following command:

```bash
go install -v github.com/projectdiscovery/notify/cmd/notify@latest
```

Run the following command to start the honeypot:

```bash
./monitor.sh DISCORD_WEBHOOK_URL
```

e.g.

```bash
./monitor.sh https://discord.com/api/webhooks/12345678909876/aaaaaaaa
```

This will use [notify](https://github.com/projectdiscovery/notify) to send all logs to a discord webhook.

## How it works

The vulnerable version of xz (5.6.1) and the liblzma linked version of sshd from the fedora repositories are ran in the configuration that activates the backdoor. Monitoring is provided by `bpftrace`, `strace`, `tcpdump`, and the `sshd` process itself.

- `bpftrace`
  - Syscall monitoring and shared library hooking.
- `strace`
  - Syscall montioring for the parent `sshd` process.
- `tcpdump`
  - Capturing packets.
- `sshd`
  - Login events (**NOTE** This will most likely not capture the login event for a bad actor as the backdoor uses `set_log_mask` to change the logging behaviour when the attacker attempts to login)
File Snapshot

[4.0K] /data/pocs/058e3c8614307eb4bd067ada1f1b80cdd2c1880a ├── [4.0K] container │   └── [ 808] run.sh ├── [ 246] docker-compose.yml ├── [ 280] Dockerfile ├── [ 18K] LICENSE ├── [ 687] monitor.sh └── [1.7K] README.md 1 directory, 6 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →