Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
NGINX-Rift — CVE-2026-42945 NGINX 堆溢出漏洞扫描与验证工具 | Kitploit
Tools/GitHubGitHub/nu0l/nginx-rift
Vulnerability ScannersContainer SecurityConfiguration AuditingWeb SecurityCloud SecurityDevSecOps
GitHubnu0l/nginx-rift

NGINX-Rift

CVE-2026-42945 NGINX 堆溢出漏洞扫描与验证工具

View Repository
5163 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

NGINX Rift — CVE-2026-42945 / CVE-2026-9256 Vulnerability Scanning and Verification Tool

Go CVE-2026-42945 | CVE-2026-9256 License Platform

NGINX Rift is an open-source scanning and verification tool targeting CVE-2026-42945 and CVE-2026-9256 (heap overflow vulnerabilities in NGINX ngx_http_rewrite_module). It supports remote network fingerprint scanning and local in-depth configuration auditing, helping security teams quickly identify potential risks in NGINX environments.

Vulnerability Overview

CVE-2026-9256 (CVSS 4.0: 9.2 Critical)

AttributeDetails
CVE IDCVE-2026-9256
Vulnerability TypeHeap-based Buffer Overflow (CWE-122)
Affected ComponentNGINX ngx_http_rewrite_module
Affected VersionsNGINX open-source 0.1.17 ~ 1.31.0 (mainline) / 0.1.17 ~ 1.30.1 (stable)
Fixed VersionsNGINX 1.31.1 (mainline) / 1.30.2 (stable), released 2026-05-22
SeverityHigh — can lead to denial of service (DoS); remote code execution (RCE) possible when ASLR is disabled

Trigger Condition: The rewrite directive uses a PCRE regex with overlapping captures, and the replacement string references multiple unnamed capture groups.

CVE-2026-42945

AttributeDetails
CVE IDCVE-2026-42945
Vulnerability TypeHeap Overflow
Affected ComponentNGINX ngx_http_rewrite_module
Affected VersionsNGINX open-source 0.6.27 ~ 1.30.0 / NGINX Plus R32 ~ R36
Fixed VersionsNGINX 1.30.1 (stable) / 1.31.0 (mainline) / NGINX Plus R32 P6+
SeverityHigh — can lead to denial of service (DoS) and remote code execution (RCE)

Trigger Condition: The replacement URL in the rewrite directive contains both ? and a reference to an unnamed capture group (e.g., $1).

Vulnerable Configuration Examples

root@kitploit:~
# CVE-2026-42945 trigger config: ? + $1
rewrite ^/api/(.*)$ /internal?id=$1 last;

# CVE-2026-9256 trigger config: multiple $N capture references
rewrite ^/(\w+)/(\d+)$ /$2/$1 last;

# Safe configuration (using named capture groups)
rewrite ^/api/(?<myid>.*)$ /internal?id=$myid last;

Features

  • Remote Scan Mode — Identify NGINX versions via HTTP response header fingerprinting, supports single target and batch scanning
  • Local Verification Mode (Verify) — Three-step comprehensive audit: Binary version detection → Configuration file semantic analysis → K8s Ingress resource discovery
  • OS Patch Backport Detection — Integrates with dpkg/rpm package managers to check if the distribution has backported patches
  • K8s Cloud-Native Support — Automatically discover dangerous rewrite-target annotations in Kubernetes Ingress resources
  • Zero Dependencies — Pure Go standard library implementation, single-file compilation, no third-party dependencies
  • Cross-Platform — Supports Windows / Linux / macOS (amd64 + arm64)

Installation

Method 1: Download Precompiled Binary

Download the binary for your platform from the Releases page.

Method 2: Build from Source

root@kitploit:~
git clone https://github.com/nu0l/NGINX-Rift.git
cd NGINX-Rift

# Build for single platform
go build -o nginx_rift_scanner nginx_rift_scanner.go

# Cross-compile for all platforms
chmod +x build.sh && ./build.sh

Usage

View Help

root@kitploit:~
./nginx_rift_scanner -h

Scan Mode — Remote Network Scanning

root@kitploit:~
# Scan a single target
./nginx_rift_scanner scan -u http://example.com

# Batch scan (read URL list from file)
./nginx_rift_scanner scan -f url.txt

url.txt should contain one URL per line, for example:

root@kitploit:~
http://target1.com
https://target2.com
target3.com

Verify Mode — Local Deep Audit

root@kitploit:~
# Automatically find default NGINX configuration paths
./nginx_rift_scanner verify

# Specify a configuration file path
./nginx_rift_scanner verify -p /etc/nginx/nginx.conf

Verify Mode performs a three-step audit:

  1. Binary Version Detection — Runs nginx -v to obtain the version and checks OS package manager for backported patches
  2. Configuration File Analysis — Recursively parses NGINX configuration (including include directives) to identify dangerous rewrite rules
  3. K8s Ingress Discovery — If kubectl is detected, automatically scans all Ingress resources in the cluster

Remediation Recommendations

PrioritySolutionDescription
P0Upgrade NGINXUpgrade to NGINX 1.30.2+ (stable) / 1.31.1+ (mainline) / NGINX Plus latest security release
P0OS Package Manager UpdateRun apt-get upgrade nginx or yum update nginx
P1Emergency Configuration MitigationReplace $1, $2, etc. in rewrite rules with named capture groups $name; no downtime required
P2K8s Ingress FixUpgrade the Ingress Controller and modify the rewrite-target annotation
P3Defense in DepthEnable server_tokens off; to hide version fingerprinting

Project Structure

root@kitploit:~
NGINX-Rift/
├── nginx_rift_scanner.go         # Main program source code
├── build.sh                      # Cross-platform compilation script
├── go.mod                        # Go module definition
└── README.md

Technical Implementation

  • Uses Go standard library net/http to send HTTP requests and parse the Server response header
  • Extracts version numbers for open-source (nginx/X.Y.Z) and commercial (NGINX Plus RXX) editions via regex
  • Version range covers the union of CVE-2026-42945 (0.6.27 - 1.30.0) and CVE-2026-9256 (0.1.17 - 1.31.0)
  • Recursively parses NGINX configuration files, tracking include directives and using a visited map to prevent circular references
  • Configuration detection identifies both vulnerability patterns: ? + $N (CVE-2026-42945) and multiple $N references (CVE-2026-9256)
  • Dynamically retrieves K8s Ingress configuration via kubectl get ingress --all-namespaces -o yaml
  • Calls dpkg-query/rpm --changelog to detect OS-level backported patches (searches for both CVE IDs)
  • Static compilation (CGO_ENABLED=0) produces a standalone binary without C dependencies

License

MIT License

Acknowledgments

Contributed by the security community.

Download Tool