Exploit databaseDownload repository ZIP
GH-f103b497572b6405c32a7cd6514c0d99
zhqagp/php-7.2
Sources for CVE-2026-109618
412 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files72
zhqagp/php-7.2Revision 2139335c0281
- ↑..Parent directory
- tests/
- travis/
- .gdbinit
- .gitignore
- .phpdbginit
- .travis.yml
- CREDITS
- Changelog.md
- Makefile.frag
- README.md
- config.m4
- config.w32
- create-test.php
- phpdbg.1.in
- phpdbg.c
- phpdbg.h
- phpdbg.init.d
- phpdbg_bp.c
- phpdbg_bp.h
- phpdbg_break.c
- phpdbg_break.h
- phpdbg_btree.c
- phpdbg_btree.h
- phpdbg_cmd.c
- phpdbg_cmd.h
- phpdbg_eol.c
- phpdbg_eol.h
- phpdbg_frame.c
- phpdbg_frame.h
- phpdbg_help.c
- phpdbg_help.h
- phpdbg_info.c
- phpdbg_info.h
- phpdbg_io.c
- phpdbg_io.h
- phpdbg_lexer.c
- phpdbg_lexer.h
- phpdbg_lexer.l
- phpdbg_list.c
- phpdbg_list.h
- phpdbg_opcode.c
- phpdbg_opcode.h
- phpdbg_out.c
- phpdbg_out.h
- phpdbg_parser.c
- phpdbg_parser.h
- phpdbg_parser.y
- phpdbg_print.c
- phpdbg_print.h
- phpdbg_prompt.c
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
sapi/phpdbg/create-test.php
PHP · 4,059 bytes#!/usr/bin/env php
<?php
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2018 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Bob Weinand <[email protected]> |
+----------------------------------------------------------------------+
*/
#####
## This is just a helper for intercepting stdin/stdout and the file and create a half-finished test.
## The output still may need adapting to match file names etc.
#####
error_reporting(-1);
$phpdbg = getenv('TEST_PHPDBG_EXECUTABLE') ?: null;
$pass_options = ' -qbI -n -d "error_reporting=32767" -d "display_errors=1" -d "display_startup_errors=1" -d "log_errors=0"';
$file = "";
$cmdargv = "";
if (isset($argc) && $argc > 1) {
$post_ddash = false;
for ($i = 1; $i < $argc; $i++) {
if ($argv[$i][0] == "-" && !$post_ddash) {
switch (substr($argv[$i], 1)) {
case "p":
$phpdbg = $argv[++$i];
break;
case "n":
$pass_options .= " -n";
break;
case "d":
$pass_options .= " -d ".escapeshellarg($argv[++$i]);
$ini[] = $argv[$i];
break;
case "-":
$post_ddash = true;
break;
}
} else {
$real_argv[] = $argv[$i];
}
}
if (isset($real_argv[0])) {
$file = realpath($real_argv[0]);
$cmdargv = implode(" ", array_map("escapeshellarg", array_slice($real_argv, 1)));
}
}
$proc = proc_open("$phpdbg $pass_options $file -- $cmdargv", [["pipe", "r"], ["pipe", "w"], ["pipe", "w"]], $pipes);
if (!$proc) {
die("Couldn't start phpdbg\n");
}
$input = $output = "";
stream_set_blocking(STDIN, false);
do {
$r = [$pipes[1], STDIN];
$w = $e = null;
$n = @stream_select($r, $w, $e, null);
if ($n > 0) {
if ("" != $in = fread(STDIN, 1024)) {
$input .= $in;
fwrite($pipes[0], $in);
continue;
}
if (feof(STDIN)) {
die("stdin closed?!\n");
}
if (feof($pipes[1])) {
$n = false;
} else {
$output .= $c = fgetc($pipes[1]);
echo $c;
}
}
} while ($n !== false);
stream_set_blocking(STDIN, true);
print "\n";
if (!isset($name)) {
print "Specify the test description: ";
$desc = trim(fgets(STDIN));
}
while (!isset($testfile)) {
print "Specify the test file name (leave empty to write to stderr): ";
$testfile = trim(fgets(STDIN));
if ($testfile != "" && file_exists($testfile)) {
print "That file already exists. Type y or yes to overwrite: ";
$y = trim(fgets(STDIN));
if ($y !== "y" && $y !== "yes") {
unset($testfile);
}
}
}
$output = str_replace("string(".strlen($file).") \"$file\"", 'string(%d) "%s"', $output);
$output = str_replace($file, "%s", $output);
$input = trim($input);
$testdata = <<<TEST
--TEST--
$desc
--PHPDBG--
$input
--EXPECTF--
$output
TEST;
if (!empty($ini)) {
$testdata .= "\n--INI--\n".implode("\n", $ini);
}
if ($cmdargv != "") {
$testdata .= "\n--ARGS--\n$cmdargv";
}
if ($file != "") {
$testdata .= "\n--FILE--\n".file_get_contents($file);
}
if ($testfile == "") {
print "\n";
} elseif (file_put_contents($testfile, $testdata)) {
print "Test saved to $testfile\n";
} else {
print "The test could not be saved to $testfile; outputting on stderr now\n";
$testfile = "";
}
if ($testfile == "") {
fwrite(STDERR, $testdata);
}