Exploit databaseDownload repository ZIP
GH-3baece89601ed5be4b6e9a7af9edf773
advancedsecurity-examples/php_3rdparty_example
Sources for CVE-2023-39848
53 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
advancedsecurity-examples/php_3rdparty_exampleRevision 04072ae33804
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
vulnerabilities/exec/source/medium.php
PHP · 630 bytes<?php
if( isset( $_POST[ 'Submit' ] ) ) {
// Get input
$target = $_REQUEST[ 'ip' ];
// Set blacklist
$substitutions = array(
'&&' => '',
';' => '',
);
// Remove any of the characters in the array (blacklist).
$target = str_replace( array_keys( $substitutions ), $substitutions, $target );
// Determine OS and execute the ping command.
if( stristr( php_uname( 's' ), 'Windows NT' ) ) {
// Windows
$cmd = shell_exec( 'ping ' . $target );
}
else {
// *nix
$cmd = shell_exec( 'ping -c 4 ' . $target );
}
// Feedback for the end user
$html .= "<pre>{$cmd}</pre>";
}
?>