📜 ⬆️ ⬇️

AUTOSTOP - script to protect the flash drive from autorun-viruses

I propose my version of the fight against autorun-viruses on flash drives, because Current solutions do not suit me for several reasons.

The main existing methods can be divided into 3 categories:

It was the third method that was taken by me as a basis, and refined. Outwardly, everything looks like this:

Indication
')
The principle of the script is as follows:

2 directories are created on the flash drive: AUTORUN.INF and AUTOSTOP. Each of them is protected from deletion by creating subdirectories with “incorrect” names:

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


With the same attempt to rename the AUTORUN.INF directory with a virus, I am fighting as follows: in the above directory, a desktop.ini file is created with the following content:

[.ShellClassInfo]
IconFile="..\AUTOSTOP\disable.ico"
IconIndex=0
InfoTip=" AUTOSTOP"


The disable.ico icon is placed in the AUTOSTOP directory (in the AUTOSTOP directory itself, a desktop.ini of similar content is created, with a link to the enable.ini icon located in the AUTORUN.INF directory).

Thus, the two directories mentioned above result in a “round robin”: when renaming the AUTORUN.INF folder, the indicator icon on the AUTOSTOP folder disappears (see figure), which indicates that the autorun virus has infected the flash drive (i.e., there is a file on the flash drive autorun.inf) and that the computer to which the USB flash drive is currently connected is infected.

For objectivity, from inconvenience, I note the need to press F5 in the explorer after connecting the USB flash drive, and before removing it (to update the contents of the USB flash drive, and, therefore, the status of the indicators).

The script page in my LiveJournal is mechanicuss.livejournal.com/195192.html , the download link is also there (I don’t give a direct link, because I regularly modify and update the script by adding the version number to the file name).

For those who ask why they should foster such vegetable gardens - you can use other, simpler and more reliable methods, I will say the following:


- - - - - - - - - - - - - - - - - - - - - - - - - - -

UPD:


Thanks to the idea of FloppyFormator , which consists in using one directory and the absolute path to the icon ( IconFile = ".. \ AUTORUN.INF \ minus.ico ), the display has been improved, and version 2.1 of the script has been written. Now everything looks like this - much easier and more convenient:



I also want to sincerely thank dreamhelg for the invite, and dedicate version 2.1 to it (release date - March 8 :)

Friends, thank you for your attention to the script and ideas for its improvement - thanks to this, the effect of using the script increases.

Source: https://habr.com/ru/post/53642/


All Articles