Exploit databaseDownload repository ZIP
GH-300d2208a2cf06e3d82074368488128b
xiaohj233/ghostlock-x200-root
Sources for CVE-2026-43499
166 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files2
xiaohj233/ghostlock-x200-rootRevision 119472587f78
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
exploit/build/build_w2host.sh
Shell · 1,601 bytes#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright 2026 GhostLock-X200 contributors
#
# Build w2host (cred leak + CAPSROOT + rootcmd) from this repository's
# exploit/ sources (self-contained). Requires an Android NDK:
# aarch64-linux-android28-clang in PATH, -n <ndk-llvm-bin>, or
# $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/<host>/bin.
#
# Usage: bash build_w2host.sh [-o <outdir>] [-n <ndk-llvm-bin>] [-t <tag>]
# 注: w2host 采样窗口/候选范围运行时注入 (W2_CRED_IPS/W2_CAND_MIN/W2_DIRECT_END),
# 不按机型编译; 重编仅用于修改 w2host.c 本身.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
OUT_DIR="."
NDK_BIN=""
TAG="x200-b57-v1.0"
while [ $# -gt 0 ]; do
case "$1" in
-o) OUT_DIR="$2"; shift 2 ;;
-n) NDK_BIN="$2"; shift 2 ;;
-t) TAG="$2"; shift 2 ;;
*) echo "usage: $0 [-o <outdir>] [-n <ndk-llvm-bin>] [-t <tag>]" >&2; exit 2 ;;
esac
done
if [ -z "$NDK_BIN" ] && [ -n "$ANDROID_NDK_HOME" ]; then
for h in linux-x86_64 darwin-x86_64 windows-x86_64; do
if [ -d "$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$h/bin" ]; then
NDK_BIN="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$h/bin"; break
fi
done
fi
if [ -n "$NDK_BIN" ]; then export PATH="$NDK_BIN:$PATH"; fi
command -v aarch64-linux-android28-clang >/dev/null 2>&1 || { echo "ERR: aarch64-linux-android28-clang not found (install Android NDK or pass -n)" >&2; exit 1; }
mkdir -p "$OUT_DIR"
aarch64-linux-android28-clang -O2 -static -o "$OUT_DIR/w2host-$TAG" "$SCRIPT_DIR/../src/w2host.c"
ls -la "$OUT_DIR/w2host-$TAG" && echo "W2HOST_BUILD_OK"