How to restore the website after the system intrusion monitoring scan detects a Trojan horse on the website?

Published: 2024-02-29

```html

Our company's virtual hosting has an intrusion monitoring function, which can detect website intrusion and tampering by hackers, and then provide real-time protection.


How to handle:


1. If it is an uploaded webshell virus Trojan file, the system has automatically renamed it to a file with the .bak suffix. After verifying, you can delete it directly.

2. If malicious code has been written into an original normal file, please check the original file, clean out the written malicious code, or overwrite it with the original file.

This situation indicates that the program definitely has a vulnerability, and it has been exploited and successfully executed by hackers. If you are using a common program (such as dedecms, etc.), be sure to upgrade to the latest version; if it is your own program, please analyze the web logs of the day, and you can basically find the specific problem. If you need help, please submit a ticket in the Management Center. Our company can provide paid assistance to analyze the program vulnerability. Please also fix the program vulnerability in time; otherwise, it will still be exploited by hackers and cause unnecessary losses!

3. If the program vulnerability cannot be fixed temporarily, you can use the security provided by our company for temporary security protection: first, through the "Permission Settings" function in File Management, set the entire site's wwwroot files to read-only; then set the required folders as writable (for example, common directories that require write permissions such as /cache, /upload, etc.); next, use the "Directory Protection" function to protect these directories so that they cannot execute scripting languages. For details, please refer to: https://www.west.cn/faq/list.asp?unid=733  . If you have any questions, you can submit a ticket.


How to remove the restriction:

Virtual Hosting Management - find the host and click Manage - enter the host control panel and click "Intrusion Monitoring" to view the details.

image.png

image.png



Check and handle the program code according to the displayed situation. After handling, click "Confirm Trojan Removal", and the system will perform identification verification and remove the read-only restriction.


========================================

If website access still prompts that there is an abnormality in space writing, as shown in the figure below:

image.png

image.png

This may be because the restriction was not removed successfully, or the directory is read-only. You can click "Directory Protection".

image.png

Click "Remove Restriction" at the bottom of the page to remove it, as shown in the figure below.

image.png

Then go to File Management, check the wwwroot directory, and click Permissions to reset the directory permissions. How to reset directory permissions: https://www.west.cn/faq/list.asp?unid=286 


If you have any questions, you can submit a ticket for feedback.

```