Malware + File Permission Issue on client website

johir1590r

Member
May 4, 2022
53
4
8
Hello guys. I don't know if this post is suitable here or not. But I need a little help.
And I know here all brilliant WordPress experts/hackers are available.

The problem is: I can't change the file permission from 444 to 644. this problem only with index.php & .htacess And A big malicious code in the index.php

I have Cpanel + WHM Access... When I change the file permission from Cpanel and then edit the file. after that, it automatically returns to 444 file permission with the same code.
I also check the cronjob and deleted everything + scanned with wordfence plugin: the only problem is with index.php & htacess

I would be grateful if you could help me to solve this problem
Thanks
 

xLab

Well-known member
Null Master
Trusted Uploader
Jun 6, 2020
246
671
93
Set the file owner as root.
Then delete the relevant files.
 
  • Like
Reactions: ukgamer

johir1590r

Member
May 4, 2022
53
4
8
Set the file owner as root.
Then delete the relevant files.
Can you please, explain a little bit? How I can do this?
I have Cpanel + WHM Access... I was looking for SSH / terminal to run a command. but its not there
 

mml

Well-known member
Trusted Uploader
Dec 4, 2020
575
461
63
FREEDOM
Through the cPanel, upload a clean file and set the rights to 444? Since this is repeated, is there still a reason? Looking for a reason...

Look who is the owner of the file?
 

joAbear

Well-known member
Trusted Seller
Banned User
Dec 23, 2020
1,372
774
113
Code inside index.php regenerates itself. When you delete index.php, code previously in that file still gets executed (it's still loaded in memory). Solution: restart PHP process to unload from memory.
 
  • Like
Reactions: ukgamer

johir1590r

Member
May 4, 2022
53
4
8
then you have a backdoor in the script as well
Let me tell you what I have done:
From Public_html, I delete everything except the wp-content folder & config.php file
then upload WordPress fresh core files.
Then delete all old themes & plugins & replace them with fresh themes & plugins.
Before uploading them, I checked each item on virustotal.com/

what I can do now? where I'll find the backdoor? function.php is also fresh
 

johir1590r

Member
May 4, 2022
53
4
8
Code inside index.php regenerates itself. When you delete index.php, code previously in that file still gets executed (it's still loaded in memory). Solution: restart PHP process to unload from memory.
Thanks, but can you please tell me how I can do it?
 

nevenx

Well-known member
Trusted Uploader
Aug 4, 2018
523
416
63
Mars
hyiptemplates.net
Let me tell you what I have done:
From Public_html, I delete everything except the wp-content folder & config.php file
then upload WordPress fresh core files.
Then delete all old themes & plugins & replace them with fresh themes & plugins.
Before uploading them, I checked each item on virustotal.com/

what I can do now? where I'll find the backdoor? function.php is also fresh
Try to enable hidden files, and after you delete everything see if there are any hidden files with malicious code.


It is for sure somewhere in the wp-content folder.
 
  • Like
Reactions: ukgamer

ukgamer

Well-known member
Trusted Uploader
Mar 7, 2019
2,061
1,143
113
EmbedWorld Movie API
embedworld.xyz
Thanks, but can you please tell me how I can do it?
restart the server before re-uploading the new files

Let me tell you what I have done:
From Public_html, I delete everything except the wp-content folder & config.php file
then upload WordPress fresh core files.
Then delete all old themes & plugins & replace them with fresh themes & plugins.
Before uploading them, I checked each item on virustotal.com/

what I can do now? where I'll find the backdoor? function.php is also fresh
if that fails then wipe the server and do a complete fresh install , then just uploading everything after if it happens again then its defo in wp-content folder
 

GrizzlyBear

Active member
Trusted Uploader
Dec 4, 2020
44
108
33
Pretty sure the malware also overwrote some or multiple theme or plugins files to make sure install stays hacked, Very common trick used by hackers to make sure hack is not easily removed.. Have seen it before on many hacked wp installs. Check your themes and plugins. Take a database backup and reinstall plugins if you don't want to spend time locating all modified files. Deleting one file and checking won't help here, as the other copy of hack code, if it was not removed will make new copies again. Wipe wp-content and index together.
 
  • Like
Reactions: nevenx

ukgamer

Well-known member
Trusted Uploader
Mar 7, 2019
2,061
1,143
113
EmbedWorld Movie API
embedworld.xyz
Pretty sure the malware also overwrote some or multiple theme or plugins files to make sure install stays hacked, Very common trick used by hackers to make sure hack is not easily removed.. Have seen it before on many hacked wp installs. Check your themes and plugins. Take a database backup and reinstall plugins if you don't want to spend time locating all modified files. Deleting one file and checking won't help here, as the other copy of hack code, if it was not removed will make new copies again. Wipe wp-content and index together.
like old version of Elementor pro are known for it
 

Forum statistics

Threads
69,206
Messages
908,351
Members
236,895
Latest member
jeremcastdlp

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu