first commit
This commit is contained in:
parent
985a5c928c
commit
f40a84879c
551 changed files with 72374 additions and 24 deletions
30
dvwa/vulnerabilities/exec/source/medium.php
Normal file
30
dvwa/vulnerabilities/exec/source/medium.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
if( isset( $_POST[ 'Submit' ] ) ) {
|
||||
// Get input
|
||||
$target = $_REQUEST[ 'ip' ];
|
||||
|
||||
// Set blacklist
|
||||
$substitutions = array(
|
||||
'&&' => '',
|
||||
';' => '',
|
||||
);
|
||||
|
||||
// Remove any of the charactars 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>";
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue