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

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

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

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
Gixy-Next — Gixy-Next:NGINX 配置安全扫描器与性能检查器 | Kitploit
工具/GitHubGitHub/megamansec/gixy-next
静态分析漏洞扫描器配置审计Web安全云安全DevSecOps硬件安全错误配置
GitHubmegamansec/gixy-next

Gixy-Next

Gixy-Next:NGINX 配置安全扫描器与性能检查器

查看仓库
18445911天前Kitploit 审核通过

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
网站
# Gixy-Next:用于安全审计的 NGINX 配置安全扫描器

## 概述

<a href="https://gixy.io/"><img width="192" height="192" alt="Gixy-Next 吉祥物标志" style="float: right;" align="right" src="https://assets.kitploit.com/production/public/readmes/10695/943d5c952685014f6540ef9cb02fe9d8cd895479a41a8f78786b5f2997207ec0.jpg" /></a>

Gixy-Next(Gixy)是一款开源的 NGINX 配置安全扫描器与加固工具,可对 nginx.conf 进行静态分析,在配置进入生产环境之前检测出安全配置错误、加固缺口以及常见的性能陷阱。它是 Yandex 的 [Gixy](https://github.com/yandex/gixy) 的一个积极维护的分支。Gixy-Next 的源代码[可在 GitHub 上获取](https://github.com/megamansec/gixy-next)。

Gixy-Next 也可以在浏览器中[此页面](https://gixy.io/scanner/)运行。无需下载;你可以在网站上扫描你的配置(在本地运行,使用 WebAssembly)。

### 快速开始

Gixy-Next(`gixy` 或 `gixy-next` 命令行工具)发布在 [PyPI](https://pypi.python.org/pypi/Gixy-Next) 上。你可以使用 pip 或 uv 安装它:

```shell-session
# pip
pip3 install gixy-next
# uv
uv pip install gixy-next
```

然后你可以运行它:

```shell-session
# gixy defaults to reading /etc/nginx/nginx.conf
gixy
# But you can also specify a path to the configuration
gixy /opt/nginx.conf
```

你也可以将 NGINX 配置导出为单个转储文件(参见 [nginx -T Live Configuration Dump](https://gixy.io/nginx-config-dump)):

```shell-session
# Dumps the full NGINX configuration into a single file (including all includes)
nginx -T > ./nginx-dump.conf
# Scan the dump elsewhere (or via stdin):
gixy ./nginx-dump.conf
# or
cat ./nginx-dump.conf | gixy -
```

### 基于 Web 的扫描器

无需在本地下载并运行 Gixy-Next,你可以使用[此网页](https://gixy.io/scanner/)在 Web 浏览器中扫描配置(在本地通过 WebAssembly 运行)。

### 使用 Docker 扫描

Gixy-Next 以 Docker 镜像形式提供,可从 [Docker Hub](https://hub.docker.com/r/megamansec/gixy-next/) 或 [GitHub Registry](https://github.com/MegaManSec/Gixy-Next/pkgs/container/gixy-next) 获取。

通过将本地配置文件挂载到容器中来扫描该文件:

```shell-session
# Use Github Registry
docker run --pull=always --rm -v "$PWD/nginx.conf:/nginx.conf:ro" ghcr.io/megamansec/gixy-next /nginx.conf
# Or Docker Hub
docker run --pull=always --rm -v "$PWD/nginx.conf:/nginx.conf:ro" megamansec/gixy-next /nginx.conf
```

扫描 NGINX 实时配置转储:

```shell-session
# Dumps the full NGINX configuration into a single file (including all includes)
nginx -T > ./nginx-dump.conf
# Use Github Registry
docker run --pull=always --rm -v "$PWD/nginx-dump.conf:/nginx-dump.conf:ro" ghcr.io/megamansec/gixy-next /nginx-dump.conf
# Or Docker Hub
docker run --pull=always --rm -v "$PWD/nginx-dump.conf:/nginx-dump.conf:ro" megamansec/gixy-next /nginx-dump.conf
```

从标准输入扫描:

```shell-session
# Use Github Registry
nginx -T | docker run --pull=always --rm -i ghcr.io/megamansec/gixy-next gixy-next -
# Or Docker Hub
nginx -T | docker run --pull=always --rm -i megamansec/gixy-next gixy-next -
```

## 功能概述

Gixy-Next 能够检测 `nginx.conf` 及所包含配置文件中的各类 NGINX 安全与性能配置错误。支持以下插件:

- [[add_header_content_type] 通过 add_header 设置 Content-Type](https://gixy.io/plugins/add_header_content_type/)
- [[add_header_multiline] 多行响应头](https://gixy.io/plugins/add_header_multiline/)
- [[add_header_redefinition] 通过 "add_header" 指令重定义响应头](https://gixy.io/plugins/add_header_redefinition/)
- [[alias_traversal] 因 alias 配置错误导致的路径遍历](https://gixy.io/plugins/alias_traversal/)
- [[allow_without_deny] 指定了 allow 但未指定 deny](https://gixy.io/plugins/allow_without_deny/)
- [[default_server_flag] 缺少 default_server 标志](https://gixy.io/plugins/default_server_flag/)
- [[error_log_off] `error_log` 设置为 `off`](https://gixy.io/plugins/error_log_off/)
- [[filesystem_root_exposure] 将文件系统根目录用作文档根目录](https://gixy.io/plugins/filesystem_root_exposure/)
- [[hash_without_default] hash 块中缺少 default](https://gixy.io/plugins/hash_without_default/)
- [[host_spoofing] 请求的 Host 头伪造](https://gixy.io/plugins/host_spoofing/)
- [[http2_misdirected_request] 缺少 HTTP/2 错误定向请求防护](https://gixy.io/plugins/http2_misdirected_request/)
- [[http_splitting] HTTP 响应拆分](https://gixy.io/plugins/http_splitting/)
- [[if_is_evil] 在 location 上下文中使用 if 是危险的](https://gixy.io/plugins/if_is_evil/)
- [[invalid_regex] 无效的正则捕获组](https://gixy.io/plugins/invalid_regex/)
- [[low_keepalive_requests] `keepalive_requests` 值过低](https://gixy.io/plugins/low_keepalive_requests/)
- [[missing_worker_processes] 缺少 `worker_processes`](https://gixy.io/plugins/missing_worker_processes/)
- [[mixed_case_variable] 大小写混合的变量引用](https://gixy.io/plugins/mixed_case_variable/)
- [[origins] referer/origin 头验证问题](https://gixy.io/plugins/origins/)
- [[overlapping_captures] rewrite 重定向/参数上下文中捕获组重叠](https://gixy.io/plugins/overlapping_captures/)
- [[proxy_buffering_off] 禁用 `proxy_buffering`](https://gixy.io/plugins/proxy_buffering_off/)
- [[proxy_pass_normalized] `proxy_pass` 可能向上游发送非预期路径](https://gixy.io/plugins/proxy_pass_normalized/)
- [[proxy_set_header_redefinition] 通过 "proxy_set_header" 指令重定义代理请求头](https://gixy.io/plugins/proxy_set_header_redefinition/)
- [[quic_bpf_reuseport] 重载后 QUIC 连接被静默丢弃](https://gixy.io/plugins/quic_bpf_reuseport/)
- [[regex_redos] 正则表达式拒绝服务(ReDoS)](https://gixy.io/plugins/regex_redos/)
- [[resolver_external] 使用外部 DNS 名称服务器](https://gixy.io/plugins/resolver_external/)
- [[return_bypasses_allow_deny] return 指令绕过 allow/deny 限制](https://gixy.io/plugins/return_bypasses_allow_deny/)
- [[ssl_ecdh_curve] 后量子组导致 NGINX 在旧版 OpenSSL 上无法启动](https://gixy.io/plugins/ssl_ecdh_curve/)
- [[ssl_stapling_letsencrypt] OCSP stapling 对 Let's Encrypt 证书不起作用](https://gixy.io/plugins/ssl_stapling_letsencrypt/)
- [[ssl_stapling_without_resolver] 没有 resolver 时 OCSP stapling 会静默失败](https://gixy.io/plugins/ssl_stapling_without_resolver/)
- [[ssrf] 服务端请求伪造](https://gixy.io/plugins/ssrf/)
- [[stale_dns_cache] proxy_pass 中使用了过时/陈旧的缓存 DNS 记录](https://gixy.io/plugins/stale_dns_cache/)
- [[status_page_exposed] 确保 status_page 未对外暴露](https://gixy.io/plugins/status_page_exposed/)
- [[try_files_is_evil_too] 未启用 open_file_cache 时 `try_files` 指令是危险的](https://gixy.io/plugins/try_files_is_evil_too/)
- [[unanchored_regex] 未锚定的正则表达式](https://gixy.io/plugins/unanchored_regex/)
- [[unnamed_groups] rewrite 查询字符串中的未命名捕获组](https://gixy.io/plugins/unnamed_groups/)
- [[valid_referers] valid_referers 中的 none/blocked](https://gixy.io/plugins/valid_referers/)
- [[version_disclosure] 为 server_tokens 使用不安全的取值](https://gixy.io/plugins/version_disclosure/)
- [[worker_rlimit_nofile_vs_connections] `worker_rlimit_nofile` 必须至少是 `worker_connections` 的两倍](https://gixy.io/plugins/worker_rlimit_nofile_vs_connections/)

有未检测到的情况?请在 GitHub 上提交一个 [issue](https://github.com/MegaManSec/Gixy-Next/issues),说明缺少了什么!

## 用法(标志)

`gixy` 默认从 `/etc/nginx/nginx.conf` 读取系统的 NGINX 配置。你也可以通过将其传递给 `gixy` 来指定位置:

```shell-session
# Analyze the configuration in /opt/nginx.conf
gixy /opt/nginx.conf
```

你可以使用 `--tests` 运行一个针对性的检查子集:

```shell-session
# Only run these checks
gixy --tests http_splitting,ssrf,version_disclosure
```

或者使用 `--skips` 跳过一些嘈杂的检查:

```shell-session
# Run everything except these checks
gixy --skips low_keepalive_requests,worker_rlimit_nofile_vs_connections
```

要仅报告某一严重级别或更高级别的问题,请使用可叠加的 `-l` 标志:

```shell-session
# -l for LOW severity issues and higher, -ll for MEDIUM and higher, and -lll for only HIGH severity issues
gixy -ll
```

默认情况下,`gixy` 的输出为 ANSI 彩色格式;建议在兼容的终端中查看。你可以使用 `--format`(`-f`)标志并指定 `text` 值来获得无彩色输出:

```shell-session
$ gixy -f text

==================== Results ===================

Problem: [http_splitting] Possible HTTP-Splitting vulnerability.
Description: Using variables that can contain "\n" may lead to http injection.
Additional info: https://gixy.io/plugins/http_splitting/
Reason: At least variable "$action" can contain "\n"
Pseudo config:
include /etc/nginx/sites/default.conf;

	server {

		location ~ /v1/((?<action>[^.]*)\.json)?$ {
			add_header X-Action $action;
		}
	}


==================== Summary ===================
Total issues:
    Informational: 0
    Low: 0
    Medium: 0
    High: 1
```

你也可以使用 `-f json` 来获取可复现、机器可读的 JSON 输出:

```shell-session
$ gixy -f json
[{"config":"\nserver {\n\n\tlocation ~ /v1/((?<action>[^.]*)\\.json)?$ {\n\t\tadd_header X-Action $action;\n\t}\n}","description":"Using variables that can contain \"\\n\" or \"\\r\" may lead to http injection.","file":"/etc/nginx/nginx.conf","line":4,"path":"/etc/nginx/nginx.conf","plugin":"http_splitting","reason":"At least variable \"$action\" can contain \"\\n\"","reference":"https://gixy.io/plugins/http_splitting/","severity":"HIGH","summary":"Possible HTTP-Splitting vulnerability."}]
```

你也可以使用 `-f sarif` 获取 [SARIF 2.1.0](https://sarifweb.azurewebsites.net/) 日志,例如用于上传到 GitHub 代码扫描:

```shell-session
# Write a SARIF report to a file, e.g. for `github/codeql-action/upload-sarif`
gixy -f sarif -o gixy-results.sarif
```

更多用法标志可通过向 `gixy` 传递 `--help` 查看。你也可以在[使用指南](https://gixy.io/usage/)中找到更多信息。

## 配置与插件选项

部分插件提供了一些选项,你可以通过 CLI 标志或配置文件进行设置。你可以在[配置指南](https://gixy.io/configuration/)中了解更多相关内容。

## 用于 NGINX 安全与合规的 Gixy-Next

与仅检查语法的 `nginx -t` 不同,Gixy-Next 会实际分析你的配置,并检测未加固的实例和漏洞。

借助 Gixy-Next,你可以执行自动化的 NGINX 配置安全审查,该审查可在每次变更时于本地运行,无论是用于审计、合规还是常规测试,都能帮助产出可操作的发现,从而帮助防止 NGINX 服务器不稳定/变慢,并降低不安全指令和不安全默认配置带来的风险。

## 贡献

Gixy-Next 由 [Joshua Rogers](https://joshua.hu) 维护,但始终欢迎贡献!你可以通过不同方式帮助我们,例如:

- 报告缺陷。
- 建议新的检测插件。
- 改进文档。
- 修复、重构、改进和编写新代码。

在通过拉取请求提交任何更改之前,请阅读贡献指南文档[为 Gixy-Next 贡献](https://gixy.io/contributing/)。

Gixy-Next 的官方主页是 [https://gixy.io/](https://gixy.io/)。Gixy-Next 中文档的任何更改都会自动反映在该网站上。

源代码可在 [https://github.com/MegaManSec/Gixy-Next](https://github.com/MegaManSec/Gixy-Next) 找到。

## 什么是 Gixy?(背景)

_Gixy_ 是一个 NGINX 配置分析器,[最初](https://github.com/yandex/gixy)由 Yandex 的 Andrew Krasichkov 开发。它于 2017 年首次发布,此后便不再维护。它不支持现代版本的 Python,包含大量缺陷,并且在功能和检测易受攻击的 NGINX 配置的能力上存在局限。如今在现代系统上运行原始 Gixy 会导致以下错误:

```text
  File "gixy/core/sre_parse/sre_parse.py", line 61, in <module>
    "t": SRE_FLAG_TEMPLATE,
         ^^^^^^^^^^^^^^^^^
NameError: name 'SRE_FLAG_TEMPLATE' is not defined. Did you mean: 'SRE_FLAG_VERBOSE'?
```

因此,Gixy-Next 是一个分支版本,它增加了对现代系统的支持,新增了检查项、性能改进、加固建议,并支持现代 Python 和 NGINX 版本。

### 为什么不选择 `gixy-ng`?

Gixy-Next 实际上是 `gixy-ng` 的一个分支,而 `gixy-ng` 本身又是原始 `gixy` 的一个分支。Gixy-Next 的诞生,是因为 `gixy-ng` 的维护者开始产出大量 AI 辅助的改动和自动生成的代码,这些代码既庞大到无法审查,又存在缺陷。

一段时间后,`gixy-ng` 的维护者开始向代码库提交 AI 生成的改动,这些改动引入了明显的回归问题,破坏了工具的关键行为(任何使用该工具的人都能发现),添加了随机的 AI 工具残留物,并引入了根本未实现其预期功能的代码。最重要的是,该维护者还**在所有文档、所有输出和所有源代码中为其业务添加了营销内容**。

换言之,`gixy-ng` 的维护者拿走了原始的 `gixy`,让 AI 进行修改,引入了一堆 bug(以及其他 AI 垃圾),然后在代码中添加了广告。他们还以合并请求的形式接受了贡献,但抹去了作者的信息(参见[这篇](https://joshua.hu/gixy-ng-new-version-gixy-updated-checks#quality-degradation)文章和[这篇](https://joshua.hu/gixy-ng-ai-slop-gixy-next-maintained)文章)。

Gixy-Next 专注于恢复质量,并已在近 100,000 行长的 NGINX 配置上经过了实战检验。它修复了 `gixy-ng` 中引入的改动所导致的 bug 和误检,移除了 AI 工具残留物/垃圾,并努力保持代码库的可审查性和可维护性。这个分支面向那些关注整洁代码和长期可维护性的人。
下载工具