Exploit database

GH-14fb583d3d1bd2da10251bb1a37b93d6

gitchw/ghostlock-cve-2026-43499

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-43499

168 sources

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

Repository files678
gitchw/ghostlock-cve-2026-43499Revision 96acd93156f6
Next files →

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

analysis/keyctl_jt.py

Python · 2,898 bytes
#!/usr/bin/env python3
"""Extract keyctl jump table and find DH_COMPUTE handler."""
import struct
from capstone import Cs, CS_ARCH_ARM, CS_MODE_ARM

KERNEL = r"F:\phone\ow251\全量包\kernel_raw.bin"
BASE = 0xC0008000

with open(KERNEL, "rb") as f:
    data = f.read()

md = Cs(CS_ARCH_ARM, CS_MODE_ARM)

# Jump table at 0xc04e55b4, 32 entries (0-31)
jt_addr = 0xc04e55b4
off = jt_addr - BASE

# keyctl operations
ops = [
    "GET_KEYRING_ID", "JOIN_SESSION_KEYRING", "UPDATE", "REVOKE",
    "CHOWN", "SETPERM", "DESCRIBE", "CLEAR",
    "LINK", "UNLINK", "SEARCH", "READ",
    "INSTANTIATE", "NEGATE", "SET_REQKEY_KEYRING", "SET_TIMEOUT",
    "SET_SECURITY", "SESSION_TO_PARENT", "INSTANTIATE_IOV", "INVALIDATE",
    "GET_PERSISTENT", "DH_COMPUTE", "DH_COMPUTE_KDF", "RESTRICT_KEYRING",
    "MOVE", "CAPABILITIES", "WATCH_KEY", "GET_SECURITY",
    "SET_KEEP", "BROKEN_29", "BROKEN_30", "BROKEN_31"
]

print("keyctl jump table:")
for i in range(32):
    target = struct.unpack_from("<I", data, off + i*4)[0]
    # Check if it's a tail call (b target) or data
    name = ops[i] if i < len(ops) else f"OP_{i}"
    print(f"  case {i:2d} ({name:25s}) -> 0x{target:08x}")

# DH_COMPUTE is op 21 (KEYCTL_DH_COMPUTE = 21? Let me check)
# Actually KEYCTL_DH_COMPUTE = 7 in the POC? Let me check the POC
# POC says: keyctl(KEYCTL_DH_COMPUTE, params, buf, 64, 0)
# KEYCTL_DH_COMPUTE = 7? No, let me check:
# KEYCTL_GET_KEYRING_ID = 0
# KEYCTL_JOIN_SESSION_KEYRING = 1
# KEYCTL_UPDATE = 2
# KEYCTL_REVOKE = 3
# KEYCTL_CHOWN = 4
# KEYCTL_SETPERM = 5
# KEYCTL_DESCRIBE = 6
# KEYCTL_CLEAR = 7
# KEYCTL_LINK = 8
# KEYCTL_UNLINK = 9
# KEYCTL_SEARCH = 10
# KEYCTL_READ = 11
# KEYCTL_INSTANTIATE = 12
# KEYCTL_NEGATE = 13
# KEYCTL_SET_REQKEY_KEYRING = 14
# KEYCTL_SET_TIMEOUT = 15
# KEYCTL_SET_SECURITY = 16
# KEYCTL_SESSION_TO_PARENT = 17
# KEYCTL_INSTANTIATE_IOV = 18
# KEYCTL_INVALIDATE = 19
# KEYCTL_GET_PERSISTENT = 20
# KEYCTL_DH_COMPUTE = 21
# KEYCTL_DH_COMPUTE_KDF = 22
# KEYCTL_RESTRICT_KEYRING = 23
# KEYCTL_MOVE = 24
# KEYCTL_CAPABILITIES = 25
# KEYCTL_WATCH_KEY = 26
# KEYCTL_GET_SECURITY = 27
# KEYCTL_SET_KEEP = 28

# Wait, the POC says KEYCTL_DH_COMPUTE. Let me check the actual value.
# In Linux: KEYCTL_DH_COMPUTE = 21? No...
# Actually looking at the POC code, it uses:
# keyctl(KEYCTL_DH_COMPUTE, params, buf, 64, 0)
# KEYCTL_DH_COMPUTE is defined as 7? Let me check.
# Actually in keyutils.h:
# KEYCTL_DH_COMPUTE = 7? No...
# Let me just look at the jump table entries

# Case 7 (CLEAR) and case 21 (DH_COMPUTE)
for i in [7, 18, 21, 22]:
    target = struct.unpack_from("<I", data, off + i*4)[0]
    print(f"\nCase {i} handler at 0x{target:08x}:")
    # Disassemble first few instructions
    foff = target - BASE
    for insn in md.disasm(data[foff:foff+64], target):
        print(f"  0x{insn.address:08x}: {insn.mnemonic:10s} {insn.op_str}")
        if insn.mnemonic == 'b':
            break