Last active
March 29, 2019 22:56
-
-
Save carlospolop/e3d664c2fef53ba6bf8b7750eff7f6c1 to your computer and use it in GitHub Desktop.
Check if any function to execute commands (REC) in PHP is available
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
echo "Hello! Trying to execute commands..."; | |
echo "<br>"; | |
if (function_exists('exec')){ exec("echo exec"); echo "<br>";} | |
if (function_exists('passthru')){ passthru("echo passthru"); echo "<br>";} | |
if (function_exists('shell_exec')){ shell_exec("echo shell_exec"); echo "<br>";} | |
if (function_exists('popen')){ $p = popen('/bin/echo popen 2>&1', 'r'); echo fread($p, 2096); pclose($p); echo "<br>";} | |
if (function_exists('proc_open')) echo "proc_open<br>"; | |
if (function_exists('pcntl_exec')) echo "pcntl_exec<br>"; | |
`echo backtips`; echo "<br>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment