Exploit databaseDownload repository ZIP
GH-f838dcf62fc9fa430d033ea61489fdd5
wonjj6768/lenovo-tb365fc-ghostlock-cve-2026-43499
Sources for CVE-2026-43499
166 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
wonjj6768/lenovo-tb365fc-ghostlock-cve-2026-43499Revision bc326e03800f
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
ksu/verify_ksu.sh
Shell · 2,779 bytes#!/bin/sh
# verify_ksu.sh — verify the KernelSU LKM is loaded and answering as root.
#
# SERIAL=<serial> ./verify_ksu.sh
#
# After the LKM is late-loaded, KernelSU mounts its `su` at /system/bin/su and
# re-enables SELinux Enforcing; /data/adb/ksu is root-only and not listable from
# an adb shell, so the `su` check tries a fixed list of absolute paths and
# requires the u:r:ksu:s0 context.
set -u
ADB="${ADB:-adb}"
SERIAL="${SERIAL:-}"
adb_() { if [ -n "$SERIAL" ]; then "$ADB" -s "$SERIAL" "$@"; else "$ADB" "$@"; fi; }
# Git Bash on Windows rewrites /data/... arguments; keep them literal.
export MSYS_NO_PATHCONV=1
REMOTE_OUT=""
RC=0
sh_rc() {
RC=0
_o="$(adb_ shell "$1" 2>/dev/null)" || RC=$?
REMOTE_OUT="$(printf '%s' "$_o" | tr -d '\r')"
}
fail=0
check() {
name="$1"; ok="$2"
if [ "$ok" = "1" ]; then printf ' [PASS] %s\n' "$name"
else printf ' [FAIL] %s\n' "$name"; fail=$((fail+1)); fi
}
check_remote() { # name pattern command
name="$1"; pat="$2"; cmd="$3"
sh_rc "$cmd"
if [ "$RC" -eq 0 ] && printf '%s' "$REMOTE_OUT" | grep -Eq "$pat"; then
check "$name" 1
else
check "$name" 0
fi
}
state="$(adb_ get-state 2>/dev/null)"; src=$?
if [ "$src" -ne 0 ] || [ "$state" != "device" ]; then
echo "[!] adb device not ready (ADB=$ADB state='$state' rc=$src)"
exit 2
fi
echo "== device =="
sh_rc 'getprop ro.product.model; uname -r'
printf ' %s\n' "$(printf '%s' "$REMOTE_OUT" | tr '\n' ' ')"
echo "== checks =="
check_remote "kernelsu module loaded" '^[1-9]' 'grep -c ^kernelsu /proc/modules'
ksu_su=""
for c in /system/bin/su /product/bin/su /data/adb/ksu/bin/su; do
if adb_ shell "test -x $c" 2>/dev/null; then
sh_rc "$c -c id"
if [ "$RC" -eq 0 ] \
&& printf '%s' "$REMOTE_OUT" | grep -q 'uid=0(root)' \
&& printf '%s' "$REMOTE_OUT" | grep -q 'u:r:ksu:s0'; then
ksu_su="$c"
break
fi
fi
done
if [ -n "$ksu_su" ]; then
check "KernelSU su -c id (uid=0, context ksu)" 1
else
check "KernelSU su -c id (uid=0, context ksu)" 0
fi
# `grep` decides on the output alone: pm can return non-zero on this device even
# when it lists packages, so the command's exit status must not gate the check.
sh_rc 'pm list packages 2>/dev/null'
mgr="$(printf '%s' "$REMOTE_OUT" | grep -E 'me\.weishu\.kernelsu|com\.resukisu\.resukisu|com\.kowx712\.supermanager' | head -n1)"
if [ "${REQUIRE_MANAGER:-0}" = "1" ]; then
check "manager package installed" "$( [ -n "$mgr" ] && echo 1 || echo 0 )"
else
printf ' [info] manager package: %s (optional; REQUIRE_MANAGER=1 to require)\n' "${mgr:-none}"
fi
echo "== result =="
if [ "$fail" -eq 0 ]; then echo " ALL PASS"; else echo " $fail check(s) FAILED"; fi
exit "$fail"