Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-cycode authored Sep 8, 2024
1 parent 08118a1 commit 5b8cb55
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions jwr-high.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

if( isset( $_POST[ 'Submit' ] ) ) {
// Get input
$target = trim($_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 ' . escapeshellarg($target) );
}
else {
// *nix
$cmd = shell_exec( 'ping -c 4 ' . escapeshellarg($target) );
}

// Feedback for the end user
$html .= "<pre>{$cmd}</pre>";
}

?>

0 comments on commit 5b8cb55

Please sign in to comment.