Exploit database

Vulnerability

CVE-2023-36845

Junos OS: EX and SRX Series: A PHP vulnerability in J-Web allows an unauthenticated to control an important environment variable

Vulnerability details

Score
9.8
Severity
critical

CVSS 3.1 · juniper

Vector string

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Description

A PHP External Variable Modification vulnerability in J-Web of Juniper Networks Junos OS on EX Series and SRX Series allows an unauthenticated, network-based attacker to remotely execute code. Using a crafted request which sets the variable PHPRC an attacker is able to modify the PHP execution environment allowing the injection und execution of code. This issue affects Juniper Networks Junos OS on EX Series and SRX Series: * All versions prior to 20.4R3-S9; * 21.1 versions 21.1R1 and later; * 21.2 versions prior to 21.2R3-S7; * 21.3 versions prior to 21.3R3-S5; * 21.4 versions prior to 21.4R3-S5; * 22.1 versions prior to 22.1R3-S4; * 22.2 versions prior to 22.2R3-S2; * 22.3 versions prior to 22.3R2-S2, 22.3R3-S1; * 22.4 versions prior to 22.4R2-S1, 22.4R3; * 23.2 versions prior to 23.2R1-S1, 23.2R2.

CVE Program

Exploit source choices

18 sources
Junos OS PHPRC Environment Variable Manipulation RCE
MSF-freebsd--http--junos_phprc_auto_prepend_fileMetasploitPHP,Unix / remote

This module exploits a PHP environment variable manipulation vulnerability affecting Juniper SRX firewalls and EX switches. The affected Juniper devices run FreeBSD and every FreeBSD process can access their stdin by opening /dev/fd/0. The exploit also makes use of two useful PHP features. The first being 'auto_prepend_file' which causes the provided file to be added using the 'require' function. The second PHP function is 'allow_url_include' which allows the use of URL-aware fopen wrappers. By enabling allow_url_include, the exploit can use any protocol wrapper with auto_prepend_file. The module then uses data:// to provide a file inline which includes the base64 encoded PHP payload. By default this exploit returns a session confined to a FreeBSD jail with limited functionality. There is a datastore option 'JAIL_BREAK', that when set to true, will steal the necessary tokens from a user authenticated to the J-Web application, in order to overwrite the root password hash. If there is no user authenticated to the J-Web application this exploit will try to create one. If unsuccesfull this method will not work. The module then authenticates with the new root password over SSH and then rewrites the original root password hash to /etc/master.passwd. There is an option to set allow ssh root login, if disabled.

2023-08-17junos_phprc_auto_prepend_file.rb
vulncheck-oss/cve-2023-36845-scanner
GH-ea7cac01c1fe8f924a3c6f3037cac2d0GitHubUnofficial GitHub source

A go-exploit to scan for Juniper firewalls vulnerable to CVE-2023-36845

2023-09-1610 files · 63 stars
kljunowsky/cve-2023-36845
GH-7b7657543c89b7e78ded841cc9938e02GitHubUnofficial GitHub source

Juniper Firewalls CVE-2023-36845 - RCE

2023-09-263 files · 54 stars
ak1t4/cve-2023-36845
GH-f72135e4fb10e0771d7bb7259611dbc9GitHubUnofficial GitHub source

CVES

2024-02-133 files · 5 stars
r3dcl1ff/cve-2023-36844_juniper_rce
GH-fb8d32c30e98a9e8a8ed87a7fcab7ffcGitHubUnofficial GitHub source

A Proof of Concept for chaining the CVEs [CVE-2023-36844, CVE-2023-36845, CVE-2023-36846, CVE-2023-36847] to achieve Remote Code Execution (phpinfo) in Juniper JunOS within SRX and EX Series products.Modified from original exploit developed by @watchTowr .

2023-09-242 files · 5 stars
cyberh3als/cve-2023-36845-poc
GH-d402ba2994afbbbb0d3e9c598240bf4bGitHubUnofficial GitHub source

CVE-2023-36845 PoC script automates the PoC for CVE-2023-36845 targeting Juniper Networks Junos OS's J-Web component on EX and SRX Series devices. It exploits a PHP flaw, allowing remote modification of the PHPRC variable. Successful exploitation can lead to code injection and execution.

2023-10-024 files · 4 stars
zaenhaxor/cve-2023-36845
GH-b6d4436b47a8f01c370271966d40b51aGitHubUnofficial GitHub source

CVE-2023-36845 - Juniper Firewall Remote code execution (RCE)

2023-09-293 files · 4 stars
0xnehru/cve-2023-36845-juniper-vulnerability
GH-fd1733a2e40d0f64c292c3af73f53723GitHubUnofficial GitHub source

This Python script automates the Proof of Concept (PoC) for CVE-2023-36845, a vulnerability impacting Juniper Networks Junos OS on EX and SRX Series devices. The vulnerability resides in the J-Web component, allowing remote manipulation of the PHPRC variable, potentially leading to code injection.

2024-02-143 files · 1 stars
e11i0t4lders0n/cve-2023-36845
GH-72f469776b24be45d218030f09d899c1GitHubUnofficial GitHub source

CVE-2023-36845 – Unauthenticated Juniper Remote Code Execution Vulnerability Scanner

2024-02-182 files · 1 stars
halencarjunior/cve-2023-36845
GH-98e9e5f8aee3039368ff585f9232a9f1GitHubUnofficial GitHub source

halencarjunior/cve-2023-36845 source repository

2023-09-274 files · 1 stars
jahithoque/juniper-cve-2023-36845-mass-hunting
GH-bdcef4a596b24bbda387bd3962a01bd8GitHubUnofficial GitHub source

Juniper RCE (Remote Code Execution) CVE-2023-36845 is a vulnerability that has been identified within Juniper's software. This particular flaw allows for remote code execution, meaning an attacker could run arbitrary code on a system without needing physical access to the device.

2024-01-304 files · 1 stars