Jump to content

chown -- useage


ameliabob

Recommended Posts

I have downloaded a file from a service and saved it. I want to use it and then delete it. I have found that the download is done through the adminstrator privilege and I am using at as a normal person who has all priveleges. unlink won't let me delete (and I guess correctly as I didn't create it)chown won't let me change ownership to me. I guess there is something in the C/C++ language that I am missing. Where do I look from here?

Link to comment
Share on other sites

AFAIK, the ability to take ownership is a separate privilege that may be disabled.You need to make PHP run as the user that has enough permissions. This is a server setting, so there's nothing you can do from PHP to circumvent it - if you find a way with just PHP code tweaks, you've found an OS vulnerability.

Link to comment
Share on other sites

Ok, as someone said, one question leads to another. I am using the wamp server and Apache, so what is the setting called? So I can go and look for it. And/or how do I know what setting it is being run at. Am I allowed to see that?

Link to comment
Share on other sites

You can find out the username PHP runs as using get_current_user().If PHP runs as an Apache module, it will run with the same privileges Apache has. You can adjust that username by going to "Control Panel > Administrative Tools > Services", double click the Apache service, and then in the "Log on" tab, type the username and password for the account you wish Apache (=> PHP) to run as - one that you know has enough permissions (e.g. Administrator). Restart the Apache service for these settings to take effect, and the script should now have enough permissions.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...