Menu
Is free
registration
home  /  Firmware/ Protection against viruses on flash drives. USB Disk Security - protect your computer from viruses from USB flash drives

Protection against viruses on flash drives. USB Disk Security - protect your computer from viruses from USB flash drives

Flash drives are primarily valued for their portability - the necessary information is always with you, you can view it on any computer. But there is no guarantee that one of these computers will not turn out to be a "hotbed" of malware. The presence of viruses on a removable storage device is always unpleasant and inconvenient. How to protect your storage medium, we will consider further.

There can be several approaches to protective measures: some are more complicated, others are simpler. This can use third-party programs or Windows tools. The following measures may be helpful:

  • setting up antivirus for automatic scanning of a USB flash drive;
  • disable autorun;
  • using special utilities;
  • using the command line;
  • autorun.inf protection.

Remember that sometimes it is better to spend a little time on preventive actions than to face infection not only of the flash drive, but of the entire system.

Method 1: Configuring antivirus

It is precisely because of the neglect of anti-virus protection that malware is actively spreading across various devices. However, it is important not only to have an antivirus installed, but also to make the correct settings for automatic scanning and cleaning of the connected USB flash drive. This will prevent the virus from replicating to your PC.

Method 2: Disable autorun

Many viruses are copied to the PC thanks to the file "Autorun.inf", where the launch of the malicious executable file is registered. To prevent this from happening, you can deactivate the automatic launch of the media.

This procedure is best done after the flash drive has been checked for viruses. This is done as follows:



This method is not always convenient, especially if you are using CDs with branched menus.

Method 3: Panda USB Vaccine Program

In order to protect the flash drive from viruses, special utilities were created. One of the best is the Panda USB Vaccine. This program also disables AutoRun to prevent malware from using it for its work.

To use this program, do the following:


Method 4: using the command line

Create "Autorun.inf" it is possible to protect against changes and overwriting by applying several commands. It is about this:



Please note that disabling AutoRun is not suitable for all media types. This applies, for example, bootable flash drives, Live USB, etc. Read about the creation of such media in our instructions.

Method 5: Protecting "autorun.inf"

You can also create a fully protected startup file manually. Previously, it was enough just to create an empty file on a USB flash drive "Autorun.inf" with rights "only for reading", but according to the assurances of many users, this method is no longer effective - viruses have learned to bypass it. Therefore, we use a more advanced version. Within this framework, the following actions are assumed:


These commands delete files and folders "Autorun", "Recycler" and "Recycled" who may have already "Capitalized" virus. Then a hidden folder is created "Autorun.inf" with all protective attributes. Now the virus will not be able to modify the file "Autorun.inf" since there will be a whole folder instead.

This file can be copied and run on other flash drives, thus holding a kind of "Vaccination"... But remember that it is highly discouraged to perform such manipulations on drives using AutoRun capabilities.

The main principle of protective measures is to prevent viruses from using autostart. This can be done both manually and using special programs. But you shouldn't forget about periodically checking the drive for viruses. After all, malware is not always launched through AutoRun - some of them are stored in files and wait in the wings.

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

The first step is to define the file system. To do this, insert the USB 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", put a tick on "Quick (clear the table of contents)" and click the "Start" button.

For different file systems, you need to use completely different methods of protection. Let's analyze the first method for a flash drive with the NTFS file system.

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

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

Then we 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. Further, 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, then you will fail and an error will pop up that you need permission to perform this operation.

But that's not all. We click on the previously created folder with the right mouse button and go to its properties. On the "Security" tab, click on the "Change" button and give "Full Control" to 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 denied.

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

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

To begin with, 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 the "Command Line" as administrator. We go "Let -> All programs -> Standard", then click on the desired item with the right mouse button and select "Run as administrator" from the list.

We register the first command: md disk_number: \ autorun.inf. In my case, the drive name is F. Thus, 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 attributes: system, hidden and read-only (prohibits its writing).

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

If you have a need for one reason or another to change the set windows 7 password, then in this lesson I will show you how you can do this easily and quickly.

In this lesson, we'll talk about what to do if the program is frozen.

In this tutorial, we will walk you through how to create a folder on the Windows desktop, and in this tutorial, you will learn how to rename and delete a folder from your computer.

Surely every computer user at least once picked up some kind of virus on his USB flash drive. And, despite the fact that there are both specialized utilities for protecting drives, and entire antivirus complexes, this does not give confidence in absolute protection. Today we will look at a somewhat time consuming but very effective way to protect a flash drive from viruses once and for all.

Let's make a reservation right away, it is only suitable for USB flash drives for computers, this method will not protect USB drives for cell phones or digital cameras.

So first of all. We have already considered this issue, so let's move on to further actions.

Create any folder on the flash drive, name it, for example, Files... From now on, only in this folder will we store all the files.

Right click on the flash drive icon in the My Computer window, open the context menu and select Properties - tab Security... Here we delete all groups and users, leaving only the group Everything.

If you get an error message when you try to delete a group, press the button [Additionally] and uncheck the box Inherit from parent permissions applicable to child objects, adding them to those explicitly specified in this window.

If the groups Everything not in the list, we create it by pressing the button [Add] and enter it manually.

An alternative way to add the All group: press the button [Additionally] in the window Choice: Users or Groups and then [Search], in the list we find the item Everything, select it and click [OK].

For a user group Everything set up access rights - in the column Allow put the following checkboxes:
- Reading and Execution;
- List of folder contents;
- Reading.
Let us remind you once again: we perform these settings for a flash drive.

Now we right-click on the folder Files and choose Properties - Security... In the window already familiar to us, we repeat the steps to remove unnecessary groups, if any, and for the group Everything turn on all the options in the column Allow.

On this, in fact, all the settings end. Let us now consider a few points related to the use of a flash drive protected by the described method. As already mentioned, all files and folders must be saved and copied only in the created folder. Neither we nor viruses can write anything to the root of the USB disk. There is one drawback: the Send menu, although active, will not allow us to copy files to a USB flash drive, instead of the expected result, we will receive an error message:

However, any other methods of copying files to a secure flash drive will work (for example Select - Copy - Paste). Only, as already noted, it will not be possible to write data to the root of the disk. And in the folder Files you can perform all the usual actions: create other folders and files, copy, delete, rename, etc.

Viruses, as a rule, creating an autorun.bat file in the root of a USB disk, after applying the described protection methods, will no longer be able to write any data to the USB flash drive. Consequently, our drive will remain completely protected once and for all: we will not catch the viruses themselves, and the computers of other users will not be infectable.

Since a flash drive is a universal storage medium, absolutely any files, including those that pose a danger, can fall on and store on it. First of all, the main danger is represented by viruses that can automatically start when the media is connected to the computer.

For these purposes, a special autorun.inf file is created. By itself, it does not carry any harm and its main purpose is to automatically launch applications when reading any device on which it is located. You connect the USB flash drive and if it contains this autorun file and the computer, following the instructions in it, launches the necessary program.

Viruses often do not pose any danger until they are launched. That is why such a dangerous space with the autorun file is used. Connect an infected USB flash drive and the virus starts, infecting the system in a fun way. And you don't even need to launch it on purpose.

To protect against such malicious programs, special utilities are used, and also, do not forget about the correct system settings, which can significantly increase security when working with removable media.

Disable autorun

Since most dangerous programs use autorun, then by disabling this function, we deactivate most of them.

Open the Start menu and right-click on the "Computer" section. In the context menu, you need to select "Management" (done on behalf of the Administrator).

In the left part of the new window, select the "Services" section. And on the right, among the list of services, we find the "Shell Hardware Definition". Now we right-click on this service and click on "Properties".

In the properties window, opposite the Startup type item, select the Disabled value. After that, click on Stop and apply the settings you made. In order for the changes to take effect, you must restart your computer.

This method is very effective, although it also has a drawback. For example, if you start a disc with a game (program, movie), then the installation will not start automatically. To start, you will have to open the disk itself, look for the startup file, and only then perform the installation. On the one hand, this is not such a big deal, because the system will be much more secure this way, on the other hand, you will have to do a lot of unnecessary actions if you often install software from disks.

Create your autorun.inf

I think that many people know about the impossibility of creating two files with the same name in the same folder. We will just use this! If you create your own autorun.inf file and set it to read-only, you can prevent someone else's autorun file from getting to the USB flash drive. This method is good, but not as effective as the previous one. Many viruses have learned to delete this file and create their own, which is no longer pleasing.

But do not give up, if the flash drive has the FAT file system, it is possible to create a folder named autorun.inf, which cannot be deleted.

To do this, create a special bat file. To do this, open Notepad (in the Start menu → All Programs → Accessories) and click save as. Save this file to a convenient place by specifying the .bat extension for it and then copy the following program code into the same file:

attrib -s -h -r autorun. *

"\\? \% ~ D0 \ autorun.inf \ name .. \"

attrib + s + h% ~ d0 \ autorun.inf

Save the file and make a copy of it to a flash drive. In the same place, on the flash drive, run it. After that, a folder named Autorun.inf will appear, which cannot be deleted.

Of course, such a method can only protect against infection from your flash drive, but there is still a danger of getting infected from any other. Also, it will not work if the USB flash drive has an NTFS file system. Typically, such flash drives have a volume of more than four gigabytes.

Software protection of a flash drive from viruses

Standard antivirus

This is a good way to protect your computer from this kind of viruses. It should be on every PC. Most antivirus programs automatically scan each media as soon as it is connected to the computer. If anything is detected, the antivirus will instantly intercept the malicious file and delete it, and in some cases even cure it. To find a good antivirus program, use the antivirus rating.

USB Disk Security

A good program that will protect your computer from any threat coming from devices connected via USB (flash drive, external drive, etc.). It's a good idea to use it in conjunction with the main antivirus.

Panda USB Vaccine

It is also a good auxiliary program that will help protect your computer from threats found on flash media. It allows you to automatically carry out all the above actions: disable autorun and create a non-removable autorun.inf. That, in fact, protects the computer from Trojans falling on it.

Along with cloud services, we very often use regular flash cards to store photos and movies. We connect it to other people's computers and laptops, which carries the risk of infection with viruses and other malicious programs. The statistics are relentless: every 10th computer is a direct threat. The question arises: how to protect a USB flash drive from viruses without reducing the comfort of its use?

Windows standard methods

Most often, infection of a USB drive occurs through a file autorun.inf... This file serves a very specific purpose: to automatically launch or install applications from a flash card to a computer. It is hidden, but it is present on any flash drive. As in other areas of life, early protection and prevention is better than laborious treatment, which does not guarantee a 100% positive result. Therefore, the main task is to make the autorun.inf file immune to attempts to infect it.

Extremely important: the methods described below will protect the media from malware that uses USB-flash as a means of distributing itself (they are the ones who tend to overwrite the mentioned file in their own way). Viruses, trojans and other troubles in program installers will not go anywhere: use antivirus software to detect them.

Disable startup

This is a method of protecting the computer itself from a possibly already infected flash drive, both from yours and from someone else's. The easiest way to do this is to follow the steps below. For Windows 7:

  • Press the key combination Win + R.
  • In the "Run" window that opens, enter gpedit.msc and click on OK.

  • Click on the "Allow" when a message appears about the need to perform an action on behalf of the administrator. You may also need to enter an administrator password.
  • In the Local Group Policy Editor window that appears, expand the "Computer Configuration" list and then "Administrative Templates".
  • Select the item "All parameters".

  • In the list that opens, right-click on the line "Disable autorun" with the right mouse button.

  • Click "Change", make the item "Enable" active, the value "All devices" should be set below.

  • Click "Apply".

Please note: in some versions of Windows (8,8.1) the sequence in steps 4-6 may differ slightly and look like this: "Computer Configuration" - "Administrative Templates" - "Windows Components" - "Autorun Policies" - "Disable Autorun".

A reboot may be required for the changes to take effect. That's all - now any flash drives connected to the computer will not start automatically on it and will not cause harm without the user's participation.

Autorun file protection

Now there is a way to protect the flash drive itself from malware that spreads using physical media. We are talking about the very autorun.inf.

In the good old days, it was enough to create an empty write-protected file on a USB-drive. That is, with read-only rights. Today, such measures are not enough. But the essence of the actions is similar. Create a special file on a USB flash drive checked by a good antivirus, making sure that there are no dangers. Open a regular notepad and copy these lines into it:

attrib -S -H -R -A autorun. *
del autorun. *
attrib -S -H -R -A recycler
rd "\\? \% ~ d0 \ recycler \" / s / q
attrib -S -H -R -A recycled
rd "\\? \% ~ d0 \ recycled \" / s / q
mkdir "\\? \% ~ d0 \ AUTORUN.INF \ LPT3"
attrib + S + H + R + A% ~ d0 \ AUTORUN.INF / s / d
mkdir "\\? \% ~ d0 \ RECYCLED \ LPT3"
attrib + S + H + R + A% ~ d0 \ RECYCLED / s / d
mkdir "\\? \% ~ d0 \ RECYCLER \ LPT3"
attrib + S + H + R + A% ~ d0 \ RECYCLER / s / dattrib -s -h -r autorun. *
del autorun. *
mkdir% ~ d0AUTORUN.INF
mkdir "?% ~ d0AUTORUN.INF ..."
attrib + s + h% ~ d0AUTORUN.INF

Save the result to a USB flash drive by naming the file locker.bat... After the dot there is an extension, it is extremely important and should look exactly like .bat... Open the USB flash drive through the explorer and launch the newly created file with the usual double click of the mouse. It will execute as a small program and create a protected AUTORUN.INF folder.

What does it do? By inserting a USB Flash Drive into an infected computer, there is no need to be afraid of the viruses on it that spread via USB. Such a virus will rush to overwrite the autorun.inf file, but it does not exist! Instead, a folder, and even protected.

It is important: viruses can write themselves to other places on the USB flash drive by changing other files. Therefore, when inserting it into a computer, check with an antivirus before opening it.

Radical way

If you have to connect a USB flash drive to someone else's computer, but only to drop files from it, the option of switching the file system to read-only mode is suitable. This is an effective, but, in most cases, inconvenient way, making the "send to removable disk" option and similar operations inoperative.

In order to apply this method, you must:

  • Format USB media to NTFS file system. Please note: all data from the flash drive will be deleted! If the flash drive is already in NTFS, skip this step.

  • Write down all the necessary data, put them in one folder.
  • Open the properties of the flash drive (right-click) and click on the "Change" button in the "Security" tab.

  • In the "Allow" column, uncheck all the boxes except for the items "List of folder contents" and "Read".
    Click "OK".

Now not a single virus will be able to register on the USB flash drive.

Using third-party programs

You can also protect USB media from malware using specially designed programs. For example, Panda USB Vaccine. This free utility is specially designed to protect removable media.

After downloading and running it, connect the USB flash drive that you want to protect to the computer. Follow 2 easy steps:

  1. In the drop-down menu, install the required USB-drive;
  2. Click on the Vaccinate USB button.

And that's it! The flash drive is protected from overwriting the autorun file. In fact, the program simply disables autorun, but it does so by pressing a couple of buttons in a user-friendly interface.

Output

Unfortunately, you cannot 100% protect your flash drive from viruses. The measures described in the article only prevent the automatic penetration of malware first onto a USB drive, and then onto your PC. Always keep your antivirus up to date and scan your flash drives before opening them in File Explorer.