Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2024-3094 — Ansible role and Python script that detect backdoored liblzma (xz 5.6.0/5.6.1, CVE-2024-3094), back up affected libraries, upgrade packages, and re-scan hosts. | Kitploit
工具/GitHubGitHub/axisops/cve-2024-3094
Defensive ToolsVulnerability ScannersScripting & AutomationConfiguration AuditingDevSecOpsSupply Chain SecurityIncident Response
GitHubaxisops/cve-2024-3094

CVE-2024-3094

Ansible role and Python script that detect backdoored liblzma (xz 5.6.0/5.6.1, CVE-2024-3094), back up affected libraries, upgrade packages, and re-scan hosts.

查看仓库
2026年10月30日尚未审核
分享
网站
内容在请求的语言中不可用。显示英文版本。

xz Backdoor CVE-2024-3094 Detection and Mitigation Ansible Role

This Ansible role deploys a Python-based script that finds backdoored liblzma (xz 5.6.0 and 5.6.1, CVE-2024-3094) on a host and replaces it with the distribution's fixed package.

It is designed to be run via Ansible, but you can also execute the script manually if you wish.

Read more about the xz backdoor here:

  • NVD CVE-2024-3094
  • Andres Freund's report on oss-security
  • Debian DSA-5649-1
  • Red Hat: urgent security alert for Fedora Linux 40 and Fedora Rawhide users
  • Ubuntu CVE-2024-3094
  • CISA alert

What it does

The upstream release tarballs for xz 5.6.0 and 5.6.1 contain build-time code that modifies liblzma. sshd does not use liblzma directly, but Debian and several other distributions patch openssh for systemd notification, and libsystemd depends on liblzma. That is the path to ssh server compromise described in the oss-security report of 2024-03-29.

Exposure by distribution, as stated in the advisories above:

DistributionAffectedFixed package
Debiantesting, unstable and experimental, 5.5.1alpha-0.1 up to and including 5.6.1-1. No stable release known to be affected5.6.1+really5.4.5-1
FedoraRawhide (5.6.0, 5.6.1) and Fedora 40 (xz-libs-5.6.0-1.fc40, 5.6.0-2.fc40)xz-5.4.6-3.fc40 (FEDORA-2024-d02c7bb266), epoch bumped
Red Hat Enterprise LinuxNo version affected—
UbuntuNo released version affected; the package reached only noble-proposed and was removed—

Features

  • Reads the installed xz package versions from dpkg-query (liblzma5, xz-utils) and rpm (xz, xz-libs), whichever is present
  • Scans library directories for liblzma.so.5*, resolves symlinks so each real file is counted once, and reads the version from the file name, or from the version string inside the library when the name carries none
  • Reports any 5.6.0 or 5.6.1 (and Debian's 5.5.1alpha)
  • Reads Debian's +really versions correctly: 5.6.1+really5.4.5-1 is the fix, not 5.6.1
  • Reports whether sshd links liblzma, using ldd
  • Dry run by default. Nothing changes without --apply
  • With --apply: backs up every affected library file, mirroring its full path under the backup directory, upgrades the xz packages with apt-get, dnf or yum, and scans again
  • Refuses when no supported package manager is present, and says so
  • Names any affected file the package manager does not own (built from source into /usr/local, or shipped inside an application) after the upgrade, rather than reporting the host clean
  • Writes all actions to a log file and prints a summary to stdout
  • Configurable via a YAML file, resolved relative to the script
  • Packaged as an Ansible role for automated deployment across multiple systems

Requirements

  • Python 3.9+
  • PyYAML, only for a run that reads a YAML config file (the installed apply). The role installs it from the distribution (python3-yaml, py3-yaml or python3-pyyaml), never from PyPI. The detection entry needs only the standard library: its config goes in as JSON on stdin
  • Root, for --apply and --backup-only. Detection runs as any user
  • ldd for the sshd check (part of glibc; the check is skipped without it)

Everything else is the standard library. The package managers are the distribution's own.

Configuration

The script is configured via a YAML file, templated automatically by the role.

Example config.yaml:

scan_paths:
  - /lib
  - /lib64
  - /usr/lib
  - /usr/lib64
  - /usr/local/lib
backup_directory: /opt/backups/xz
log_file: /var/log/xz_backdoor_mitigation.log
check_packages: true
check_sshd: true
sshd_path: /usr/sbin/sshd
  • scan_paths: directories to search for liblzma.so.5*
  • backup_directory: where to keep copies of affected libraries
  • log_file: path to a log file for operation tracking
  • check_packages: query dpkg-query/rpm for package versions
  • check_sshd: report whether sshd links liblzma
  • sshd_path: the sshd binary to check

Role variables (defaults/main.yml) carry the same names with an xz_backdoor_ prefix, plus:

  • xz_backdoor_apply (default true): back up and upgrade when something is found. Set false to report only
  • xz_backdoor_restart_sshd (default false): restart sshd after the upgrade when it links liblzma. Off by default: the restart is the operator's to schedule, and until it happens the running sshd keeps the old library
  • xz_backdoor_script_dest: defaults to /usr/local/lib/xz_backdoor_mitigation/, a directory of its own, so its config.yaml does not overwrite another role's in /usr/local/bin

Usage as an Ansible Role

Add this role to your playbook:

- name: Mitigate xz backdoor CVE-2024-3094
  hosts: all
  become: true
  roles:
    - xz_backdoor_mitigation

The role runs the script to detect, and only when something is found: backs up the affected files, upgrades liblzma5/xz-utils (apt) or xz/xz-libs (dnf, yum) to the latest version in the distribution's repositories, restarts sshd if it links liblzma and xz_backdoor_restart_sshd is true, and runs the script again. The host fails if anything is still affected. Debian's and Fedora's fixed packages both sort above the bad versions, so an ordinary upgrade installs them.

To report only:

ansible-playbook site.yml -e xz_backdoor_apply=false

Usage Directly

If you wish to run the script manually, you can do so:

  1. Copy the script and the shared library beside it to your target machine:

    files/xz_backdoor_mitigator.py
    files/samp_common.py
    
  2. Create your own config.yaml in the same directory.

  3. Run it:

    python3 xz_backdoor_mitigator.py                           # dry run, config.yaml beside the script
    python3 xz_backdoor_mitigator.py --config /path/to/config.yaml
    python3 xz_backdoor_mitigator.py --scan-path /srv/chroot/lib   # repeatable; replaces scan_paths
    sudo python3 xz_backdoor_mitigator.py --apply              # back up, upgrade, re-scan
    sudo python3 xz_backdoor_mitigator.py --backup-only        # back up, change nothing else
    

Validation

  • The script prints scanned=N vulnerable=N backed_up=N upgraded=N failed=N sshd_links_liblzma=N undetermined=N to stdout. Warnings naming each affected package or file go to stderr.
  • Exit codes: 0 nothing affected, 2 something affected remains or a library's version could not be read (undetermined=N), 1 a backup, upgrade or refusal failed, 130 interrupted.
  • Check the configured log file (default: /var/log/xz_backdoor_mitigation.log) for every package and library examined and its version
  • Confirm by hand: dpkg-query -W liblzma5 or rpm -q xz-libs
  • If sshd_links_liblzma=1 on a host that had 5.6.0 or 5.6.1, confirm sshd has restarted since the upgrade
  • Ideally, test in a staging environment before production rollout

Notes

下载工具

相关工具

  • wazuh

    开源XDR和SIEM平台,用于跨端点和云工作负载的威胁检测、日志分析、文件完整性监控、漏洞评估和合规管理。

  • suricata

    用于实时流量检测、入侵检测与防御、协议分析以及基于规则的威胁狩猎的开源网络 IDS/IPS/NSM 引擎。

  • zeek

    Zeek 是一个强大的网络分析框架,与你可能知道的典型 IDS 有很大不同。

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    针对 CVE-2026-43499 的一键式 Android 内核漏洞利用应用,通过内核模块加载实现权限提升,并提供偏移提取与设备端分析工具。

    745
  • 2

    IMSIcatcher

    28zaaky/imsicatcher

    IMSI Catcher 平台,可部署伪基站 GSM 小区以拦截短信、注入消息并追踪移动设备

    732
  • 3

    Callisto

    jetp1ane/callisto

    自动化二进制漏洞分析工具,通过Ghidra反编译可执行文件,使用Semgrep扫描伪C代码,并利用GPT-3.5-Turbo验证发现以减少误报。

    610
  • 4

    opencti

    opencti-platform/opencti

    开放式网络威胁情报平台

    546
  • 5

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    414
  • 6

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    413

探索所有工具

浏览我们的工具集合

查看所有工具 →