Because the ftp of their own website does not have the property of directly setting the file on the space, then wrote a section of PHP code to modify the Index.php file property
After you set the read-only property for the index.php file, the Trojan does not have permission to append ads to the end of the file.
Below we look at the specific code, set index.php Read only:
The code is as follows:
<?phpfunction set_writeable ($file _name) {if (@chmod ($file _name,0555) { echo "modified index.php file read-only attribute succeeded";} else{ echo "Modify index.php file read-only property failed, the space quotient does not support this operation!" ";}} Set_writeable ("index.php");? >
Save the above content to setread.php, then upload to the space, direct browser to browse the address can be set to read-only.
However, after you set this read-only property, you do not have permission to delete index.php yourself via FTP, or if you need to remove or overwrite index.php, use the following code to set index.php read and Write permissions.
Here is the code to set index.php read and write:
The code is as follows:
<?phpfunction set_writeable ($file _name) {if (@chmod ($file _name,0777) { echo "modified index.php file read-write property succeeded";} else{ echo "Modify index.php file read-write properties failed, the space quotient does not support this operation!" ";}} Set_writeable ("index.php");? >
Save the above: setwrite.php, access to the browser can be set to read and write permissions.