How to protect a flash drive from viruses? Useful tips. Protecting a flash drive from Autorun viruses A simple way to rid a flash drive of infection

Good day... Viruses are dangerous, and every computer user should know this. EIn principle, this is enough to install an antivirus and update it regularly fall. Protecting your computer is a common thing.I installed the antivirus, updated the database and forgot about the virus for some time until the next update of the antivirus database or the antivirus itself. But it's time to think about protecting your flash drive. How to protect a flash drive from viruses, or vaccination for a USB flash drive. Today we will talk about this topic.

How to protect a flash drive from viruses

Typically, the authors (virus creators) of malware distribute their creations through the World Wide Web. with updated databases, in most cases it perfectly repels attacks from infected sites.There are other popular ways to spread infection. Through memory cards, flash drives, removable drives and other external storage media.When a flash drive is infected with a virus, it creates the Autorun.inf file on it.And when the user opens a memory card connected to the computer, the flash drive instantly activates autorun.

This feature can be disabled. Open the Start Menu. Here we write gpedit.msc

In the Group Policy editing window, open one by one: “Computer Configuration”, “Administrative Templates”, “Windows Components”, “Autorun Policies”, double-click “Disable Autorun”.

In the window that appears, select “Enable”. Below we also select all devices. Or “CD drives and removable media devices.” I recommend selecting all devices. Click "Apply" and "OK"...

For Windows XP users, there is a slightly different scheme for disabling this function. After you have entered the administrative templates, go to the system and in this tab find disable autorun. We also select “Enable”, “All drives”. "Apply" and "OK"...

Now, when connecting flash drives, this autorun window does not work. And it won't appear. Therefore, even if the flash drive was infected, the virus will not begin to do its dark deeds of distributing its files or deleting user data from the flash drive.If you want to disable autorun only for flash drives, you will have to edit the system registry.

Grafting for USB flash drive

But this particular procedure is difficult even for experienced users.It’s easier to “vaccinate” on your memory card, flash drive, in other words, administer the vaccine. So as not to catch any virus.There are several useful and, most importantly, free utilities for this procedure. Before using these utilities, you need to completely format this flash drive.

Panda USB Vaccine

First utility Panda USB Vaccine. When installing the program, the following window will appear. Where you need to check two boxes and click “NEXT”.

Now you need to insert the formatted flash drive into the computer and click “VACCINATE USB”...

This utility creates its own file AUTORUN.INF on the flash drive. Which the virus cannot remove or change. To be sure that the file has been created, go to “My Computer” - “Arrange” - “Folder and Search Options” - “View”. We go down to the very bottom and check “Show hidden files, folders and drives”.

Now open your flash drive. We see the created file AUTORUN.INF. That is, you created a “graft” for a USB flash drive...

Second utility. There is no need to install this utility. Just copy it and paste it onto the flash drive, “Run”...

There are only three points in the program...

  • Disable disk startup automatically through the registry
  • Protect a flash drive from Autorun viruses, according to the utility principle Panda USB Vaccine
  • Just prohibit anything from being written to the flash drive.

We do all functions upon request. You need the second point. Protect your flash drive from Autorun viruses. Press 0 (ZERO) - “Enter”. Next, press two. “Enter” again. We complete this procedure by pressing ZERO - “Enter”. As a result, the AUTORUN.INF file will be created on the flash drive. With road brick icon.

If it is not there when you reconnect, then the flash drive is infected. But the virus still won't work...

Third utility There is also no need to install anything here. Let's launch the utility. It's even simpler here. Protect button - protect the flash drive. UnProtect button - remove protection...

The peculiarity of the program is that the AUTORUN.INF file turns out to be super hidden. It is not visible on the flash drive. In fact, the vaccination for the flash drive has been introduced. You can verify this through any file manager, for example .

If you often use a USB drive - transfer files back and forth, connect the flash drive to different computers, then the likelihood that there will be a virus on it is quite high. From my experience repairing computers for clients, I can say that approximately every tenth computer can cause a virus to appear on a flash drive.

Most often, malware is distributed through the autorun.inf file (Trojan.AutorunInf and others); I wrote about one example in the article. Despite the fact that this is relatively easy to fix, it is better to protect yourself than to deal with virus treatment later. Let's talk about this.

As already mentioned, all free programs that help protect a flash drive from viruses act in approximately the same way, making changes and writing their own autorun.inf files, setting access rights to these files and preventing malicious code from being written to them (including when you are working from Windows using an administrator account). I will note the most popular of them.

Bitdefender USB Immunizer

The free program from one of the leading antivirus manufacturers requires no installation and is very easy to use. Just run it, and in the window that opens you will see all connected USB drives. Click on the flash drive to protect it.

You can download the BitDefender USB Immunizer flash drive protection program on the official website https://labs.bitdefender.com/2011/03/bitdefender-usb-immunizer/

Panda USB Vaccine

Another product from the antivirus software developer. Unlike the previous program, Panda USB Vaccine requires installation on a computer and has an expanded set of functions, for example, you can configure the protection of a flash drive using the command line and launch parameters.

In addition, there is a function to protect not only the flash drive itself, but also the computer - the program makes the necessary changes to Windows settings in order to disable all autorun functions for USB devices and CDs.

In order to install protection, select a USB device in the main program window and click the “Vaccinate USB” button; to disable autorun functions in the operating system, use the “Vaccinate Computer” button.

You can download the program from the page http://research.pandasecurity.com/Panda-USB-and-AutoRun-Vaccine/

Ninja Pendisk


Ninja Pendisk does not require installation on your computer (however, you may want to add it to startup yourself) and works as follows:

  • Detects that a USB drive is connected to the computer
  • Checks for viruses and, if found, removes them
  • Checks for virus protection
  • Makes changes if necessary, writing your own Autorun.inf

At the same time, despite the ease of use, Ninja PenDisk does not ask you whether you want to protect a particular drive, that is, if the program is running, it automatically protects all connected flash drives (and this is not always good).

Official website of the program: http://www.ninjapendisk.com/

Protecting the flash drive manually

Everything that is needed to prevent a flash drive from becoming infected with viruses can be done manually without the use of additional programs.

Preventing Autorun.inf from being written to USB by viruses

In order to protect the drive from viruses spread using the autorun.inf file, we can create such a file ourselves and prohibit its modification and overwriting.

Run the command line as Administrator, to do this in Windows 8 you can press the Win + X keys and select the Command Prompt (Administrator) menu item, and in Windows 7 go to “All Programs” - “Accessories”, right-click on the shortcut “ Command Line" and select the appropriate item. In the example below, E: is the letter of the flash drive.

At the command line, enter the following commands in sequence:

Md e:\autorun.inf attrib +s +h +r e:\autorun.inf

Done, you have done the same actions that the programs described above perform.

Setting write permissions

Another reliable, but not always convenient option to protect a flash drive from viruses is to prohibit writing to it for everyone except a specific user. At the same time, this protection will work not only on the computer where this was done, but also on other PCs with Windows. And this can be inconvenient for the reason that if you need to write something from someone else’s computer to your USB, this can cause problems, since you will receive “Access Denied” messages.

You can do this as follows:

After this, writing to this USB will become impossible for viruses and other programs, provided that you are not working as a user for whom these actions are allowed.

It’s time to finish here, I think the methods described will be enough to protect the flash drive from possible viruses for most users.

Those who actively use flash drives in the course of their work have probably thought more than once about the question of how to protect the device and the information stored on it. Protect against viruses that can penetrate the drive if it has to be connected to other people's computers. Protect, perhaps, from the deliberate actions of colleagues at work who are eager to destroy stored information. Protect from children. At a minimum, you can protect yourself from viruses and childish pranks by using a mechanical write-protection switch, if the flash drive has one. If there is no such switch, you can resort to software analogues of such a mechanism. And, if necessary, also strengthen the security of stored information. In fact, this is what we will talk about further.

How to protect a flash drive from viruses and erasing information

Ratool program

The small portable program Ratool can protect removable storage devices - flash drives, SD cards, optical disks - from writing unnecessary information and deleting it; on the contrary, the necessary information can be protected. It can be downloaded completely free of charge on the developers’ website:

https://www.sordum.org/8104/ratool-v1-3-removable-access-tool

Two main features of the program:

Prohibiting the recording of data on the media and blocking the deletion of existing data;

Complete media blocking.

Launch Ratool. To prohibit writing to a flash drive and deleting data from it, in the program window, select the “Allow read only” option. Click the “Apply changes” button.

We will see a notification that says that in order to apply the changes made, the flash drive needs to be reconnected. Click “Ok”.

Remove the flash drive from the USB port and insert it again. Now, when you try to copy files to a flash drive in Windows Explorer, the process will freeze at 0% and will not move forward in any way.

And when deleting files from a flash drive, the operation will simply be ignored. But Total Commander will tell anyone who wants to work with our flash drive unauthorizedly about what is happening. When copying files inside the file manager, we will see a message that there is no access.

And when you try to delete data, Total Commander will ask you to remove the write protection.

Ratool, if necessary, can block the flash drive completely - make it so that the computer will not detect it at all. To do this, in the program window you need to select the last item “Block USB drive” and apply the changes.

And, as in the previous case, reconnect the flash drive.

To return everything back - to make the flash drive detected by the computer or to allow data writing - in the Ratool window, select the first item “Allow reading and writing...”, apply the changes and reconnect the media.

From savvy third parties who can reveal the secret of write-protecting a flash drive, Ratool has the ability to access the program by entering a password.

The simple and convenient mechanism of Ratool, unfortunately, is not without its drawbacks. Media blocking carried out using this program applies only to the current computer device. On another PC, on another laptop, the flash drive will not be write-protected. On any new device you will have to launch Ratool and carry out an operation to prohibit the recording of data regarding this particular device. Fortunately, the program weighs very little, so you can put it on a flash drive and always carry it with you. Ratool is a program for Windows that runs from an EXE file, therefore, it will not help when connecting a flash drive to computers based on other operating systems.

Windows Local Group Policy Editor

Ratool, in essence, is a simplified mechanism for blocking removable storage media, which can be done on your personal or work computer using Windows itself - using the Group Policy Editor. The latter cannot be used in the Windows Home edition, but in the Pro edition it can be used to block flash drives, SD cards, optical drives and other drives for both all and individual computer accounts. How to work with the editor in principle and in terms of creating restrictions only for individual users is discussed in detail. Section 3 describes a method for disabling data recording to removable media.

Even the first method, not to mention the second, is good when the flash drive is used on a limited number of Windows computers. If the range of computers is wide, other actions may be more appropriate. You can, for example, use a separate method to protect your flash drive from the possibility of malware penetration. Well, it is advisable to replace the issue of blocking the ability to delete data by third parties with the issue of limiting access to drive data in principle.

Protecting your flash drive from viruses

The mechanism for writing special hidden files with zero size to it will help protect the flash drive from viruses. They have the names and extensions of autorun files, under which malware is usually disguised, and are not deleted or overwritten. They are simply stored on a flash drive without taking up space. If the virus tries to overwrite them, it will not be able to do so. For example, the free portable utility Flash Defender can create such decoy files; you can download it on our cloud storage using the link:

But since we need a universal way to access flash drive data, it cannot be considered in this context. BitLocker is not available in the Windows Home edition, the dominance of which can be observed on many OEM devices of ordinary people. The cross-platform TrueCrypt program can offer a universal method of protection. It encrypts the media and password-protects access to it. It can be used on Windows (including a portable version), Mac and Linux. We discussed the work of this program in detail in articles about “” and.

Nowadays, there are more and more viruses, hundreds or even thousands of new viruses appear every day! Although companies that develop antivirus programs update their creations, you can protect your computer with the help of them if you wish. But here what to do if the usb flash card is infected?

Many of us store most of our important files and programs on a flash drive, and use it not only at home but also at work, college, and school. But none of us are insured! We can be confident in our computer, but when we have to use other people’s hardware monsters, the question arises: how to protect all important information from loss!?

After all, at one fine moment you and I may lose this information that is so important to us! Below I will show you some tricks on how to secure our information storage device called USB Flash.

Ways to protect a flash drive from viruses

One of them suggests creating a flash drive formatted for NTFS and denying write access to the root of the flash drive, and first creating a folder in the root into which all files will be written.
The method can be said to be good, but it also has disadvantages, namely:

1. You cannot transfer a file or folder to a flash drive using the “Send” context menu;
2. You cannot pull out the flash drive without first removing it, because files may become corrupted (on NTFS, as many people know, data is not written immediately, unlike FAT);
3. For Linux users, it will not be very convenient (ntfs-3g, when mounted, heavily loads the processor, which affects performance.
4. And if the flash drive is bootable, it will be almost impossible to use it!

Now let's move on to the real action!

The technology is simple and provides distribution via Flash drives.

Many already know that on FAT32 you can simply create the autorun.inf folder and the viruses will go sideways, or rather they will not run, but their body will still end up on the flash drive, which is not so critical, because they still won’t start and won’t cause harm to the operating system; moreover, they often have the “hidden” attribute. But time does not stand still. Virus creators are also not asleep. There are already special viruses that delete this folder and create a file with the same name only with the code for the virus... Just like that!!!

There is an easy way! You only need to perform three simple steps.

1. Create a *.bat (*.cmd) file with the following content (you can write directly in Notepad, saving it with the appropriate extension, or you can download it in the Notepad++ program):

________________________________________________________________________________________

attrib - s - h - r autorun . *

del autorun . *

mkdir % ~ d0 \ AUTORUN . INF

mkdir "\\?\%~d0\AUTORUN.INF\.."

attrib + s + h % ~ d0 \ AUTORUN . INF

____________________________________________________________________________________________________

2. Copy this file to a flash drive and run it (IT IS WORTH RUN FROM A FLASH DRIVE!).
3. That's it, our flash drive is protected!!!

For those who do not understand how to create this file, we suggest you simply download it in the archive:
bat.rar, Download!
Then we unpack this file from the archive into the root directory on the flash drive and run it.
All!

Now in the root of the flash drive there will be a hidden system folder AUTORUN.INF. Now if you run the command in the console:

E:\AUTORUN.INF (instead of E you write the letter corresponding to your carrier)

then we will see that in the AUTORUN.INF folder there are two subfolders named “..”, so this folder (AUTORUN.INF) cannot be deleted
Now all viruses with their autorun.inf go sideways (although the body of the virus will end up on a flash drive, but this file will be hidden and an ordinary user will not be able to run it! - H / D / S

_________________________________________________________________________________

Save (do not forget that the newly created file must be saved in bat (*.cmd) format), drop it into the root of the flash drive and run it! These manipulations will remove the hidden and system attributes from all files and folders on the disk.

Yet again! For those who do not understand how to create this file, we suggest simply downloading it in the archive.

In this lesson I will tell you how to protect a flash drive from viruses. This method will be useful to owners of a flash drive with both the FAT32 and NTFS file systems.

The first step is to decide on the file system. To do this, insert the flash drive into the USB port, then go to “My Computer,” right-click on the removable disk icon and go to its properties. A new window will open in which you can easily specify the file system of your flash drive.

If the flash drive belongs to one of those systems that I mentioned above, then everything is fine. If not, then it needs to be formatted. To do this, right-click on the removable disk icon and select "Format...". In the window that appears, select “File system”, check the “Quick (cleaning table of contents)” checkbox and click the “Start” button.

For different file systems it is necessary to use completely different protection methods. We will analyze the first method for a flash drive with the NTFS file system.

How to protect a flash drive from viruses (NTFS).

First of all, go to the flash drive and create a regular folder. The name can be given as you wish.

Next, return to “My Computer” and again go to the properties of the flash drive. Now go to the “Security” tab and click on the “Change” button. Next, for all users we leave only 2 items “List of folder contents” and “Reading”. At the end, click “Ok”.

If now you want to copy or create something in the root directory of the flash drive, you will not succeed and an error will pop up stating that you need permission to perform this operation.

But that's not all. Right-click on the previously created folder and go to its properties. On the "Security" tab, click on the "Change" button and give "Full Control" for all users.

This is done so that we can work with this folder, for example, copy some files to it, while access to the root of the flash drive is prohibited.

If your flash drive is in FAT32 format, then the instructions below will help you protect it.

How to protect a flash drive from viruses (FAT32).

First, as in the case of NTFS, the flash drive must be formatted. Only in this case we select the FAT32 file system.

The next step is to launch Command Prompt as an administrator. Go to "Let -> All programs -> Accessories", then right-click on the desired item and select "Run as administrator" from the list.

We write the first command: md disk_number:\autorun.inf. In my case, the drive name is F. This way we create a special startup file.

Next command: attrib +s +h +r disk_number:\autorun.inf. By this we say that the file must be assigned the following attributes: system, hidden and read-only (prohibits writing it).

Of course, this is not 100% protection against viruses, but in most cases it can save you from malware that is distributed through the autorun.inf file.

In this tutorial I will show you how to quickly hide shortcuts on your desktop

In this video tutorial, I will tell you how you can set up a single view of displaying the contents of all folders on your computer.