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

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
check-sshole — 查找那些包含暴露于 *sshole(CVE-2026-123158)的 sshd 的 Dockerfile。提供 CLI、pre-commit 钩子和 GitHub Action。 | Kitploit
工具/GitHubGitHub/shenxianpeng/check-sshole
防御工具静态分析漏洞扫描器容器安全脚本与自动化配置审计安全虚拟化DevSecOps错误配置
GitHubshenxianpeng/check-sshole

check-sshole

查找那些包含暴露于 *sshole(CVE-2026-123158)的 sshd 的 Dockerfile。提供 CLI、pre-commit 钩子和 GitHub Action。

15天前尚未审核
分享
查看仓库

check-sshole

CI PyPI version License: MIT

只需一条命令,即可在构建或部署任何内容之前,找出会暴露受 *sshole (CVE-2026-123158) 影响的 sshd 的 Dockerfile。

uvx check-sshole

这会扫描当前文件夹下的每个 Dockerfile。无需安装、无需 Docker、无需网络访问:它只读取文件。(pipx run check-sshole 或 pip install check-sshole 也可以。)

.devcontainer/Dockerfile:2: sshd from 'openssh' on 'python:3.12-alpine3.15' accepts password logins: exposed to *sshole (CVE-2026-123158)
  why: Alpine 3.15 never got a fixed openssh build
  fix: turn password logins off: RUN echo 'PasswordAuthentication no' >> /etc/ssh/sshd_config
       (or start sshd with -o PasswordAuthentication=no)
   or: move to Alpine 3.16 or newer and require its fixed openssh build
  more: https://sshhole.com/ (to silence, put '# check-sshole: ignore' above line 2)

services/sftp/Dockerfile:2: sshd from 'openssh-server' on 'alpine:3.22' accepts password logins: exposed to *sshole (CVE-2026-123158)
  why: a fresh build may pull the fixed package, but nothing here requires it; older or cached builds have the bug
  fix: turn password logins off: RUN echo 'PasswordAuthentication no' >> /etc/ssh/sshd_config
       (or start sshd with -o PasswordAuthentication=no)
   or: if you need password logins, require a fixed build: apk add 'openssh-server>=10.0_p1-r11'
  more: https://sshhole.com/ (to silence, put '# check-sshole: ignore' above line 2)

check-sshole: 2 findings in 3 Dockerfiles

我是否受影响?

*sshole 是 OpenSSH 的 sshd 在 10.6p2 之前版本中的一个密码认证绕过漏洞,前提是 sshd 在未启用 PAM 的情况下针对 musl libc 构建。Alpine 正是这样构建其默认的 openssh-server,因此,通过 apk 安装 sshd 并保留密码登录(OpenSSH 的默认设置)的容器会受到影响。密码字段为 * 的账户(仅使用密钥的用户,以及 Alpine 上的 root)是存在风险的账户。Debian、Ubuntu、RHEL 及其他 glibc 镜像不受影响。

当以下所有条件均成立时,check-sshole 会标记 Dockerfile 阶段:

条件check-sshole 检查的内容
已安装 sshdapk add openssh、openssh-server、openssh-server-pam 或 openssh-server-krb5,包括 shell 形式、exec 形式、sh -c 和 heredoc;会跟踪 apk del
基础镜像是 musl该阶段使用 apk,且不是 Wolfi/Chainguard(这些是 glibc)
密码登录已开启在 RUN、CMD/ENTRYPOINT(sshd -o …)、从仓库 COPY 的 sshd 配置文件或 COPY heredoc 中,没有任何内容设置 PasswordAuthentication no 或不含密码的 AuthenticationMethods;使用 openssh-server-pam 时设置 UsePAM yes 也算作关闭
不要求修复后的构建该软件包未固定(=、>=、~)到修复后的构建版本

会跟踪多阶段构建:一个阶段会继承其 FROM <stage> 父阶段所安装和配置的内容,并且只检查没有其他阶段在其之上构建的阶段。

用法

命令行

check-sshole                         # every Dockerfile under the current folder
check-sshole services/ Dockerfile    # some folders and files
check-sshole --format json .         # machine-readable

它会匹配 Dockerfile、Containerfile、Dockerfile.<anything> 和 <anything>.Dockerfile,并跳过 .git、node_modules 以及 virtualenv。 你指定的文件无论叫什么名字都会被检查。

退出状态含义
0未发现任何问题
1至少发现一个问题
2路径不存在或无法读取

pre-commit

repos:
  - repo: https://github.com/shenxianpeng/check-sshole
    rev: v0.1.0
    hooks:
      - id: check-sshole

要一次性检查所有 Dockerfile,而不仅仅是某次提交涉及的 Dockerfile: pre-commit run check-sshole --all-files。

GitHub Actions

jobs:
  check-sshole:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: shenxianpeng/[email protected]
        # with:
        #   path: services/ Dockerfile   # default: the whole repository

检查结果会以注解形式显示在拉取请求上,并出现在作业摘要中,同时使作业失败。该 action 使用运行器自带的 Python 运行,不安装任何内容。

输入默认值含义
path.要扫描的文件或文件夹,以空格分隔
formatgithubgithub(注解和作业摘要)、text 或 json

各 Alpine 分支的 openssh 修复版本

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.179.1_p1-r7
3.169.0_p1-r6
3.15 及更早版本无:请关闭密码登录或迁移到更新的分支

来源:各 *-stable 分支上的 aports 提交 "main/openssh: fix password authentication"(2026-11-05)。

检查已构建的镜像

check-sshole 读取的是 Dockerfile,因此无法看到现有镜像实际包含的内容。要检查某个镜像,请读取其已安装的构建版本,并与下表进行比对:

docker run --rm --entrypoint apk IMAGE list --installed openssh-server
# openssh-server-10.0_p1-r11 aarch64 {openssh} (SSH-OpenSSH) [installed]

sshd -V 和 ssh -V 不会显示 Alpine 修订版本(-r11),而 apk info -v 不会打印版本号,因此请使用 apk list --installed。 在没有 --no-cache 的情况下重新构建镜像,可能会保留旧的、存在漏洞的层。

屏蔽某条发现

将 # check-sshole: ignore 放在安装 sshd 的 RUN 的上一行, 或放在 FROM 上方以跳过整个阶段(以及基于该阶段构建的后续阶段):

FROM alpine:3.22
# check-sshole: ignore  (sshd only listens on the internal network)
RUN apk add --no-cache openssh-server

限制

  • 它只读取 Dockerfile 以及这些 Dockerfile 从仓库中 COPY 的 sshd 配置文件。它从不构建或拉取镜像,也从不连接主机。
  • 它无法看到基础镜像自带的 sshd(例如 FROM linuxserver/openssh-server),也无法看到入口点脚本在运行时修改的 sshd 配置。请使用上述命令检查这些镜像。

开发

pip install -e '.[test]'
pytest --cov    # fails below 100% coverage

发布流程通过发布一个标记为 vX.Y.Z 的 GitHub release 来完成;发布工作流会构建软件包并将其上传至 PyPI。

许可证

MIT

下载工具

最受欢迎

查看全部 →

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

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    645
  • 3

    looking-glass

    anonghosty/looking-glass

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

    420
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer是一个开源的特权访问管理(PAM)平台,为DevOps和IT团队提供通过Web浏览器按需安全访问SSH、RDP、Kubernetes、数据库和RemoteApp端点的能力。

    388
  • 5

    ARTEX

    baarai/artex

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

    330
  • 6

    SafeLine

    chaitin/safeline

    自托管WAF和反向代理,可过滤恶意HTTP流量、阻止SQL注入、XSS和机器人攻击,具备速率限制和动态HTML/JS加密功能。

    328

探索所有工具

浏览我们的工具集合

查看所有工具 →