Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/ersinkoc/sshole-check
防御工具漏洞扫描器容器安全配置审计渗透测试身份验证错误配置事件响应日志分析
GitHubersinkoc/sshole-check

sshole-check

针对 CVE-2026-123158(*SSHole)——musl/Alpine 上的 OpenSSH 密码绕过——在 Docker 容器、镜像和主机上的审计与临时缓解措施

查看仓库
3114天前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 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

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    371
  • 4

    redforge

    cybersecurity91/redforge

    浏览器端红队工具包,包含 102 个离线工具,用于侦察、载荷生成、凭据攻击、加密、编码和交战报告。

    336
  • 5

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    326
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI原生网络安全的行动系统——在这里,意图转化为受治理的执行,证据沉淀为运营记忆,每一次操作都让下一次更出色。

    322

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

sshole-check

用于 CVE-2026-123158("*SSHole") 的审计与临时缓解工具,该漏洞是 OpenSSH 在基于 musl 的 Linux(Alpine)上的密码认证绕过漏洞。它覆盖你的运行中的 Docker 容器、本地镜像以及主机。

示例输出(节选,来自一台测试机器):

$ sudo ./sshole-check.sh --images
CVE-2026-123158 (*SSHole) audit · sshole-check 1.0.0 · 2026-11-05 22:45:52 UTC

[VULN  ] container sshole-real ghcr.io/requarks/wiki:2.5
                   OpenSSH 10.3p1 · openssh-server-10.3_p1-r1 openssh-server-common-10.3_p1-r1 · alpine 3.24.3
                   PasswordAuthentication=yes · PAM=off · PermitRootLogin=prohibit-password · port: 22
                   '*' accounts: root carol · $5$/$6$ hashed: bob
                   sshd running: yes · published: 22→0.0.0.0:33776 [::]:33776
                   → unpatched (package older than 10.3_p1-r2, the Alpine 3.24 fix) and all conditions are met
                   · root is '*' but PermitRootLogin=prohibit-password, root cannot log in with a password
                   · sshd is running and published to the outside
[WARN  ] image     docker.gitea.com/gitea:1.24.4 dd29b53ab011
                   OpenSSH 10.0p2 · openssh-server-10.0_p1-r7 openssh-server-common-10.0_p1-r7 · alpine 3.22.1
                   PasswordAuthentication=yes · PAM=off · PermitRootLogin=without-password · port: 22
                   '*' accounts: root git · $5$/$6$ hashed: -
                   EXPOSE 22/tcp 3000/tcp
                   → unpatched (package older than 10.0_p1-r11, the Alpine 3.22 fix); conditions not met right now, becomes exploitable once an account gets a password
[OK    ] container postgres postgres:16-alpine
                   no sshd

Summary: OK=339 WARN=8 VULN=1 BREACH=0 SKIPPED=11

它从不尝试登录。 探测程序只读取 sshd 二进制文件、sshd -T / sshd_config、/etc/shadow、apk 数据库以及每个目标内的日志文件。运行前请先阅读脚本;它是一个由纯 bash 和 POSIX sh 编写的单文件。


快速开始

curl -fsSLO https://raw.githubusercontent.com/ersinkoc/sshole-check/main/sshole-check.sh
less sshole-check.sh            # read it first
chmod +x sshole-check.sh
sudo ./sshole-check.sh          # running containers + host
sudo ./sshole-check.sh --images # also every local image

要求:运行该工具的机器上需有 bash,并能访问 Docker(或 Podman)CLI。目标容器只需 /bin/sh。没有 shell 的镜像(如 distroless 或 scratch 镜像)会被报告为 SKIP;它们本来也无法运行 sshd。


关于 CVE-2026-123158

名称*SSHole / "sshhole"
组件OpenSSH sshd,不使用 PAM 的密码认证
平台Linux + musl libc(Alpine,也包括 OpenWrt / Buildroot / Yocto 构建)
修复于OpenSSH 10.6p2(2026-11-05),以及 Alpine 对 3.16 起所有分支的向后移植
CVSS 3.18.1 High,AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CWECWE-394(意外的状态码或返回值)
GHSAGHSA-4fcc-vm97-gx3x
报告者Özgün Kültekin(Wakefield)

问题出在哪里

三种各自看似合理的行为叠加在一起,就构成了登录绕过:

  1. musl 的 crypt() 在失败时返回 "*"。 自 2012 年起,musl 在失败时返回失败字符串而非 NULL。其 SHA-crypt 实现拒绝长度超过 256 字节的密钥(KEY_MAX,一项 DoS 防护),因此长度超过 256 字节的密码会被哈希为字面字符串 *。
  2. 即使账户没有可用的哈希,OpenSSH 仍会对密码进行哈希。 自 CVE-2016-6210 用户枚举修复以来,当存储的密码字段过短、无法容纳盐值时,sshd 会借用另一个账户真实 $5$/$6$ 哈希的盐值和设置,使时序看起来一致。这就是为什么需要第二个受密码保护的账户。
  3. Alpine 基础镜像自带 root:*。 自 Alpine 3.16(2022)起,* 是 root 的“无密码,仅密钥”标记。同一标记也用于仅密钥用户、目录服务用户(nslcd、sssd、winbind)以及 tiny-cloud 镜像中的 alpine 用户。

在不使用 PAM 的情况下,sshd 会将 crypt(password, borrowed_salt) 与存储字段进行比较。对于 257 到 1024 字节的密码,比较结果为 "*" == "*",登录即被接受。

OpenSSH 10.6p2 通过拒绝过短、无法有效的存储哈希来规避此问题。musl 中的底层行为并未改变;修复位于 sshd 中。

仅当所有以下条件均成立时,你才存在漏洞

  • sshd 为 OpenSSH < 10.6p2,且未包含 Alpine 向后移植,并链接到 musl
  • 密码检查不经过 PAM:即 openssh-server 包,或 openssh-server-pam 且 UsePAM no
  • PasswordAuthentication yes(默认值)
  • 至少有一个账户的 shadow 密码字段恰好为 *(! 锁定不受影响)
  • 至少有一个其他本地账户具有 $5$ 或 $6$ 哈希
  • 攻击者能够访问 SSH 端口

root 本身只有在 PermitRootLogin yes 时才可访问;默认的 prohibit-password 会阻止 root 的密码登录。不过,在 Alpine 的 AWS/Azure tiny-cloud 镜像上,* 用户 alpine 拥有免密码的 doas,因此以 alpine 身份进入即意味着获得 root。

不受影响: glibc 发行版(Debian、Ubuntu、RHEL、Fedora 等)、UsePAM yes、PasswordAuthentication no、不运行 sshd 的容器、Dropbear,以及 OpenBSD 的 sshd。

修复版本

Alpine 分支首个修复的 openssh修复点版本
edge10.6_p2-r0–
3.2410.3_p1-r23.24.4
3.2310.2_p1-r13.23.8
3.2210.0_p1-r113.22.8
3.219.9_p2-r13.21.10
3.209.7_p1-r6(EOL,仅包)
3.199.6_p1-r3(EOL,仅包)
3.189.3_p2-r4(EOL,仅包)
3.179.1_p1-r7(EOL,仅包)
3.169.0_p1-r6(EOL,仅包)

Alpine 向后移植了该修复,因此大多数分支保留其旧的上游版本:已修复的 3.24 机器仍会报告 OpenSSH_10.3p1。仅凭 sshd -V 无法判断你是否已打补丁。 这就是本工具要将 apk 包发布版本与上表进行比对的原因。


为什么 Docker 是特殊情况

  • 在运行中的容器上执行 apk upgrade,容器重建后这些更改就会丢失。你需要修复的是镜像。
  • 固定到旧标签的基础镜像(alpine:3.22.1、FROM node:20-alpine@sha256:…)会永远保留有漏洞的软件包,而且带缓存的重新构建可能会复用旧的 apk add 层。
  • 镜像可能“当前不可利用”(还没有 $6$ 账户),但只要入口脚本运行 chpasswd,就会立刻变得可利用。sshole-check 会将其报告为 WARN。
  • 使用 --network host 的容器,或使用 -p 22:22 / -p 2222:22 的容器,会把该漏洞暴露到网络上。sshole-check 会显示每个容器发布的端口映射。

检查内容

对于每个目标,它都会在其中运行一个小型 POSIX sh 探测脚本。容器通过 docker exec -u 0 进行探测。镜像通过 docker run --rm --network none --entrypoint sh -u 0 启动。主机则直接探测。

检查项方式
libc存在 /lib/ld-musl-*
sshd + 版本sshd -V
是否已修补?上游版本 ≥ 10.6p2 或 apk 软件包 ≥ 目标 Alpine 分支的修复版本(apk version -t)或作为回退,软件包构建日期晚于 2026-11-05
生效配置sshd -T(如果镜像还没有主机密钥,则在临时目录中使用一次性主机密钥),回退到解析 sshd_config + sshd_config.d/*.conf
PAMsshd / sshd-session 链接到 libpam 且 UsePAM yes
账户/etc/shadow:密码字段恰好为 * 的账户,以及使用 $5$/$6$ 哈希的账户
RootPermitRootLogin 必须为 yes,root:* 才会计入
暴露面正在运行的 sshd、docker port 映射、主机网络、镜像 EXPOSE
证据/var/log/{messages,auth.log,secure} 中的 Accepted password for <user>,以及可选的 docker logs 中的记录,并与 * 账户进行匹配

判定结果

判定含义
OK无 sshd、非 musl、已修补,或正在使用 PAM
WARN未修补,但当前不可利用(密码认证关闭、没有 $5$/$6$ 账户、仅有使用 prohibit-password 的 root:*,或 shadow 不可读)
VULN未修补且所有条件均满足
BREACH记录了某个密码字段为 * 的账户成功登录。请将该目标视为已失陷
SKIP非 musl(主机)、无 shell,或执行失败

退出码

代码含义
0干净
1至少有一个 WARN
2至少有一个 VULN 或 BREACH
64命令行选项错误

用法

sshole-check.sh [options]

Scan targets:
  (default)          running containers + host
  --images, --all    also scan local images (each started briefly with --network none)
  --no-host          skip the host
  --no-containers    skip running containers

Extra checks:
  --logs             scan `docker logs` for "Accepted password for"
  --online           inside containers, compare installed openssh with the apk repo (needs network)

Interim mitigation (running containers only, asks before each change):
  --mitigate         prepend "PasswordAuthentication no" to sshd_config and reload sshd
  --upgrade          upgrade openssh packages via apk and reload sshd

Output:
  -y, --yes          don't ask for confirmation
  -q, --quiet        only print targets with problems
  -V, --version      print version
  -h, --help         this help

Environment:
  DOCKER=podman      use another docker-compatible CLI

示例

# Everything, only show problems
sudo ./sshole-check.sh --images --logs -q

# Podman
sudo DOCKER=podman ./sshole-check.sh

# Just the images (e.g. on a build server / in CI)
./sshole-check.sh --no-host --no-containers --images -q || echo "fix your images"

# Hot-fix running containers: upgrade openssh, then disable password login
sudo ./sshole-check.sh --upgrade --mitigate

# Alpine host without bash
apk add bash && sudo bash sshole-check.sh --no-containers

临时缓解措施(--upgrade、--mitigate)

两者都只作用于正在运行的容器,且这些容器尚未修复、也未使用 PAM;除非传入 -y,否则每次更改前都会询问。

下载工具