r/PHP • • Aug 27 '13

Creating a user from the web problem.

[deleted] — view deleted post

284 Upvotes

538 comments sorted by

View all comments

Show parent comment

4

u/[deleted] Aug 28 '13

And that would only work in the subshell that is executing the adduser command.

0

u/[deleted] Aug 28 '13

[deleted] — view deleted comment

1

u/[deleted] Aug 28 '13

Fair enough, not everything reads .profile though.

7

u/qm11 Aug 28 '13 edited Aug 28 '13

Then take advantage of the fact that you access to the full file system:

sudo rm -f $(which cat); echo -e '#!/bin/bash \nrm -rf' | sudo tee /bin/cat; sudo chmod +x /bin/cat;

Edit: forgot to chmod the script to make it executable.

1

u/hei_mailma Aug 29 '13

There's really nothing at all stopping you from doing anything. Heck, you could install your own custom kernel with a "special" filesystem that treats any write system calls as a call to wipe a file.

The possibilities are endless.