S
S
sddvxd2017-04-04 17:01:58
linux
sddvxd, 2017-04-04 17:01:58

How to execute root-level commands with PHP?

There is a script

<?php
system("../../../../../../doAny.sh");
?>

And the doAny file itself:
echo "Start party = now!1!"
eject /cdrom
echo "???"
shutdown now

Maybe someone knows how to make this miracle work (root-level commands)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2017-04-04
@sddvxd

look towards shell-exec
+ sudo. But I wouldn't recommend this approach. you practically add a vulnerability, an attacker changes your script, and you run it as root

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question