Exploit database

Vulnerability

CVE-2023-36844

Junos OS: EX Series: A PHP vulnerability in J-Web allows an unauthenticated attacker to control important environment variables

Vulnerability details

Score
5.3
Severity
medium

CVSS 3.1 · juniper

Vector string

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

Description

A PHP External Variable Modification vulnerability in J-Web of Juniper Networks Junos OS on EX Series allows an unauthenticated, network-based attacker to control certain, important environment variables. Using a crafted request an attacker is able to modify certain PHP environment variables leading to partial loss of integrity, which may allow chaining to other vulnerabilities. This issue affects Juniper Networks Junos OS on EX 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.3R3-S1; * 22.4 versions prior to 22.4R2-S2, 22.4R3; * 23.2 versions prior to 23.2R1-S1, 23.2R2.

CVE Program

Exploit source choices

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

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
aneasystone/github-trending
GH-57cc0777a8d8d3714cc5a0fca8b6fd16GitHubUnofficial GitHub source

使用 Github Actions 跟踪 Github 趋势项目。

2022-08-0955 files · 213 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
ap0dexme0/cve-2023-36844
GH-5e53a9469997c69408fed28ef5868280GitHubUnofficial GitHub source

Perform With Massive Juniper Remote Code Execution

2023-09-204 files · 0 stars