0

I have a shared hosting that I use to upload front end projects only. My file manager has only HTML, CSS & JS files. I don't have any forms or receive anything from the user. But every few months, I get code injected to my JS files and it causes the creation of random email accounts/subdomains/redirection to other websites.

The code I found in the files:

code injected in js file

I have a SSL certificate, the permission of the affected files is 0644.

Judging by the code in the pic, what's the cause to this problem and what can I do to stop it?

Thanks.

Mohammed
  • 103
  • 11
  • Your server or your account got hacked. Talk to your hosting provider to get the problem fixed. If it's shared hosting, and you only have file upload access, they're responsible for the security. – Bergi Jun 01 '21 at 19:20
  • @Bergi I did, they run a malware scan and found those files, I removed this code and the scan passed. They wouldn't elaborate on the issue, they just propose a high-level security company which cost many times the price of the actual hosting that I have. – Mohammed Jun 01 '21 at 19:26
  • Did you ensure it wasn't your account that is compromised? Did you reset your passwords? If this happens repeatedly, and you're not accountable, find a better hosting company. – Bergi Jun 01 '21 at 19:35
  • It doesn't seem like that's the case, only my ip address was accessing the cpanel and I have changed the password a few times. I guess it's time to change the hosting. – Mohammed Jun 01 '21 at 19:54

0 Answers0