Exploit database

GH-2cd54743dc4f058e62eb99d21dbb8848

feiguang-ai/plz110-6.12.69-cve-2026-64560-ksu

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-64560

18 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files20

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

repro/lib/fgroot_elf.py

Python · 2,567 bytes
"""最小 ELF 检查器(纯标准库)。

用途:证明产物是"Android 上能直接跑的那类东西"—— aarch64、静态(没有 PT_INTERP)、
不是误编译成 host 架构。解析失败一律视为失败。
"""

from __future__ import annotations

import struct
from pathlib import Path

from .fgroot_common import FailClosed, require

EM_AARCH64 = 0xB7
ET_EXEC, ET_DYN = 2, 3
PT_LOAD, PT_DYNAMIC, PT_INTERP = 1, 2, 3


def inspect(path: Path) -> dict:
    data = Path(path).read_bytes()
    require(len(data) >= 64, f"{path}: 太短,不是 ELF")
    require(data[:4] == b"\x7fELF", f"{path}: 不是 ELF(magic 不对)")
    ei_class, ei_data = data[4], data[5]
    require(ei_class == 2, f"{path}: 不是 64 位 ELF")
    require(ei_data == 1, f"{path}: 不是小端 ELF")

    (e_type, e_machine, _e_version, _e_entry, e_phoff, _e_shoff, _e_flags,
     _e_ehsize, e_phentsize, e_phnum, _e_shentsize, _e_shnum,
     _e_shstrndx) = struct.unpack_from("<HHIQQQIHHHHHH", data, 16)

    segments = []
    for index in range(e_phnum):
        offset = e_phoff + index * e_phentsize
        p_type, p_flags, p_offset, p_vaddr, p_paddr, p_filesz, p_memsz, p_align = (
            struct.unpack_from("<IIQQQQQQ", data, offset)
        )
        segments.append({
            "type": p_type, "flags": p_flags, "offset": p_offset, "vaddr": p_vaddr,
            "filesz": p_filesz, "memsz": p_memsz, "align": p_align,
        })

    result = {
        "type": e_type,
        "machine": e_machine,
        "segments": len(segments),
        "hasInterp": any(s["type"] == PT_INTERP for s in segments),
        "hasDynamic": any(s["type"] == PT_DYNAMIC for s in segments),
        "loadSegments": sum(1 for s in segments if s["type"] == PT_LOAD),
        "bytes": len(data),
    }
    return result


def assert_android_static(path: Path, *, allow_dynamic: bool = False) -> dict:
    info = inspect(path)
    if info["machine"] != EM_AARCH64:
        raise FailClosed(
            f"{path}: e_machine=0x{info['machine']:x},不是 AArch64(0xb7) —— "
            "工具链没在交叉编译,产物在设备上跑不起来"
        )
    if info["type"] not in (ET_EXEC, ET_DYN):
        raise FailClosed(f"{path}: e_type={info['type']} 不是可执行文件")
    if not allow_dynamic and info["hasInterp"]:
        raise FailClosed(
            f"{path}: 存在 PT_INTERP(动态链接)—— 静态载荷不应有解释器;"
            "若这是有意为之(bionic 动态产物),显式传 --allow-dynamic"
        )
    return info