Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-123158_SSHole — Python PoC exploiting CVE-2026-123158, an OpenSSH password authentication bypass on Alpine musl systems, with auto-scan, precondition checks, and post-login command execution. | Kitploit
Tools/GitHubGitHub/gabrielunknown/cve-2026-123158_sshole
Vulnerability AnalysisExploitationReverse EngineeringNetwork SecurityPenetration TestingBinary AnalysisAuthenticationRemote Access Tool
GitHubgabrielunknown/cve-2026-123158_sshole

CVE-2026-123158_SSHole

Python PoC exploiting CVE-2026-123158, an OpenSSH password authentication bypass on Alpine musl systems, with auto-scan, precondition checks, and post-login command execution.

10514 days agoNot yet reviewed
View Repository

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    593
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    371
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    336
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    326
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    322

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-123158 — "SSHole"

OpenSSH Password Authentication Bypass on Alpine Linux (musl libc)
CVSS 3.1: 8.1 (High) · CWE-394 · Disclosure: 2026-11-05
Reporter: Özgün Kültekin (Wakefield)

Legal Disclaimer
This repository is intended solely for educational purposes, security research, and testing in authorized and controlled environments. Using this material against systems without explicit permission from the owner is illegal and unethical. The author assumes no responsibility for any misuse, damage, or legal consequences resulting from the use of this content outside an authorized context.


Summary

sshd on Alpine Linux accepts password authentication for accounts with no password configured (* in shadow) when the attacker sends a password longer than 256 bytes. No prior privileges are required — network access to the SSH port is sufficient.


Root Cause

The vulnerability arises from the interaction of three independent design decisions:

┌──────────────────────────────────────────────────────────┐
│ 1. musl libc — crypt() returns "*" on failure           │
│    (glibc returns NULL; no ambiguity)                    │
│                                                           │
│ 2. musl SHA-512 — KEY_MAX = 256 bytes                   │
│    password > 256B → crypt() fails → returns "*"         │
│                                                           │
│ 3. OpenSSH (CVE-2016-6210 patch) — anti-enumeration     │
│    sshd ALWAYS calls crypt() even for no-password accts  │
│    using a salt "borrowed" from another account           │
│                                                           │
│ RESULT:                                                   │
│   crypt("A"×300, real_salt) → "*"   ← musl failure      │
│   strcmp("*", "*")          → 0     ← no-password acct  │
│   LOGIN ACCEPTED                                          │
└──────────────────────────────────────────────────────────┘

Mechanism: Why Two Attempts Are Required

This is a critical detail not documented in public CVE sources.

Alpine's sshd uses pick_salt() in xcrypt.c with a static cache (salt_0). The bypass requires exactly two attempts within the same SSH connection:

Attemptpick_salt()pw_password statecrypt()Result
1stRuns getpwent/getspnam loop → overwrites musl static bufferCorrupted (points to another account's data)"*"strcmp("*", <corrupted>) → FAIL
2ndCache salt_0 != '\0' → returns immediately, no getspnam()Valid: still "*" from target account"*"strcmp("*", "*") == 0 → SUCCESS

musl buffer aliasing: getspnam() uses a single global static buffer for all calls. On the 1st attempt, pick_salt() calls getspnam("hashuser") to retrieve the salt, overwriting the buffer that pw_password points into (which came from getspnam("victim")). On the 2nd attempt, the loop is skipped — buffer untouched → exploit succeeds.

The exploit uses paramiko.Transport directly to perform both attempts within the same SSH connection.


Binary Analysis (Ghidra / REA)

Binary: sshd-session (ELF x86_64, OpenSSH 9.9p2, Alpine 3.21, with debug symbols)

Function Map

FunctionAddressRole
sys_auth_passwd0x10f2e0Main gate — vulnerable condition
xcrypt0x1a7720pick_salt inlined here (was static)
shadow_pw0x1a7700Calls getspnam() — buffer aliasing

pick_salt has no separate symbol; the compiler inlined it inside xcrypt.

sys_auth_passwd — vulnerable condition

// victim has shadow "*" → pw_password = "*"
char *pw_password = shadow_pw(pw);

// GATE: pw_password[1] == '\0'  ← for "*" (len=1) → condition FALSE
// salt stays NULL → xcrypt() calls pick_salt()
if (authctxt->valid && pw_password[0] && pw_password[1])
    salt = pw_password;   // NOT executed
else
    salt = NULL;          // vulnerable path

encrypted_password = xcrypt(password, salt);
return strcmp(encrypted_password, pw_password) == 0;  // strcmp("*","*") → LOGIN ACCEPTED

xcrypt — static cache salt_0

if (salt == NULL) {
    if (salt_0 == '\0') {           // 1st call: populate cache
        setpwent();
        do {
            pw    = getpwent();
            pcVar1 = shadow_pw(pw); // getspnam() → overwrites musl static buffer!
        } while (*pcVar1 != '$');
        strlcpy(&salt_0, pcVar1, len);
        explicit_bzero(pcVar1, strlen(pcVar1));
        endpwent();
    }
    // 2nd call: salt_0 != '\0' → skips loop, no getspnam()
    salt = &salt_0;
}
return crypt(password, salt);       // musl: len > 256 → returns "*"

Exploitation Requirements

ConditionAlpine default
PasswordAuthentication yesyes (default)
UsePAM no (no PAM)yes (default, no PAM installed)
Target account with * in shadowyes (root since Alpine 3.16; key-only accounts)
At least one other account with $5$/$6$ hashrequired for pick_salt()

Not vulnerable: glibc systems (Debian/Ubuntu/RHEL), UsePAM yes, PasswordAuthentication no, or shadow ! (locked account).

Accounts with * in shadow — real-world prevalence

AccountContext
rootAlpine default since 3.16 (key-only login)
alpineCloud-init default user (AWS, GCP, Hetzner)
ec2-userAmazon Linux AMIs based on Alpine
nobody, nginx, postgresCreated by package managers without passwords

Password Size Boundary

≤ 256 bytes  → rejected  (crypt() works, returns real hash)
257–1024     → ACCEPTED   (crypt() fails at KEY_MAX, returns "*")
≥ 1025       → rejected  (OpenSSH MAX_PASSWORD_LEN = 1024)

Vulnerable / Patched Versions

Alpine branchPatched version
edge10.6_p2-r0
3.2410.3_p1-r2
3.2310.2_p1-r1
3.2210.0_p1-r11
3.219.9_p2-r1
3.209.7_p1-r6
3.199.6_p1-r3
3.189.3_p2-r4
< 3.16no patch available

Upstream fix: OpenSSH 10.6p2 — auth-passwd.c rejects a match when the shadow field is fewer than 4 characters.


Immediate Mitigation

# Alpine — update openssh and restart daemon
apk upgrade -U -a
rc-service sshd restart   # mandatory — installing alone does not replace the running process

# Without updating — disable PasswordAuthentication
echo "PasswordAuthentication no" > /etc/ssh/sshd_config.d/disable-pw.conf
sshd -t && rc-service sshd restart

Confirm key-based login works before disabling password authentication.


exploit.py — Usage

usage: exploit.py (--single IP | --list FILE) [--port N] [--user NAME]
                  [--auto] [--scan] [--check] [--workers N] [--output FILE]
                  [--cmd CMD] [--size N] [-v] [-h]

required:
  --single IP    Single target (e.g. 192.168.1.10)
  --list FILE    IP list file (one per line; supports IP:port)
  --port N       SSH port (default: 22)
  --user NAME    Target user (not required with --auto)

operation mode  (default: direct exploit):
  --auto         Test common accounts with '*' in shadow: root, alpine,
                 ec2-user, nobody, nginx, postgres
  --scan         Map the password size boundary (requires --user)
  --check        Check preconditions without exploiting (requires --user)

optional:
  --workers N    Parallel workers for --list (default: 1; recommended: <= 20)
  --output FILE  Save vulnerable results to .txt (append; skips non-vulnerable)
  --cmd CMD      Command to run after login (default: id)
  --size N       Oversized password length (default: 300; range: 257-1024)
  -v, --verbose  Verbose output with technical mechanism details
  -h, --help     Show this message and exit

examples:
  # auto-scan a single target (tests common accounts)
  python3 exploit.py --single 192.168.1.10 --port 22 --auto
Download Tool