How to bulk Delete a hacker-implanted read-only hidden file

Source: Internet
Author: User

A common means of hacking attacks on websites is to embed a large number of read-only and hidden files. These documents are very harmful, and some are used to external contracts, and some are used to hang horses, there are hackers left behind the backdoor procedures. Because hackers set these files as read-only and hidden attributes, and with special characters in their filenames, we are generally not easy to find and difficult to delete. We can use the following batch command to remove these pesky files.

First, we need to adjust the system options to expose these hidden files. To do this: open My Computer, click on the Tools on the menu bar, select Folder Options, and then open the View tab.

Then, remove both options for hiding protected operating system files and extensions that hide known file types. In this way, we will be able to see the hacker implanted hidden files.

Delete method One: Single delete

We create a new bat batch file on the desktop, and the filename can be arbitrarily taken. The contents are as follows:

Del/f/a/q "?%1"

RD/S/q "?%1"

Then drag the file you want to delete onto the bat file. As shown in the following illustration:

Delete Method Two: bulk Delete

If the hacker implanted a large number of hidden files, we cannot delete one by one, you can use the following batch delete script.

We create a new bat batch file on the desktop, and the filename can be arbitrarily taken. The contents are as follows:

@echo off

CD/D D:wwwroot

for/f%%i in (' dir/arh/s/b ') do echo%%i

Pause

The function of this program is to list all the read-only and hidden files, and if your data directory is not d:wwwroot, modify it to the appropriate directory. If there is no problem, the following batch will be executed to remove them in bulk, which is the benefit of preventing accidental deletion.

@echo off

CD/D D:wwwroot

for/f "delims="%%i in (' dir/arh/s/b ') do (

Del/f/a/q "?%%i"

RD/S/q "?%%i"

)

Pause

If you have more files, it takes a while to find a read-only hidden file, please be patient

Note : More wonderful tutorials Please pay attention to the triple computer tutorial section, triple Computer office group: 189034526 welcome you to join

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.