I need to protect index.php in my Cpanel to hacker can't change the structure of that file anymore. Anyone have step by step what i must done. I heard that can be added in .htaccess file.
You should focus on revoking the hacker's access in the first place. Why were they able to modify your files? Did they have access to your cPanel account? If so the obvious solution would be to update your hosting account's credentials.
I don't think so. I think that he have change index.php from some other method every 4-5 days. In other words i think this is due to robot,not human. This was previous happen in my other domain,but after buying firewall never happen again. P.S. Hacker not need to have your login credentials,he can hack Cpanel without that.
Again, focus on revoking hacker's access. Whether that be through securing your hosting account or making sure your files are not vulnerable to exploits, etc. There is no definite answer to your question because we don't know why your file is vulnerable in the first place. Are you using WordPress by any chance? If so it could be due to a theme or plugin that's not secure.
Yes,PHP script is,and last update is before 1 year and 3 months. And i know because not receive update for security or whatever else,can be at attack. Here is a thing that hacker can have access to Cpanel somehow,and change example index.php. But this happen in every 5 days,so i think this is an automated method,is not changed by human. Then he is not a human,he is robot,who can only change some files,but can't delete example whole public_html. And i was ask here how to protect that files without adding firewall for now,because then i must pay extra to buy firewall who will definitelly stop that hacker robot or whatever. So i need other solution,to add some script to htaccess or anything that can stop hacking.