Flash media andpreventing autorun.inf malware

Everyones-a-Wally

Honorary Master
Joined
Jul 18, 2008
Messages
51,633
After lots of head scratching, I have finally come up with my favourite method to prevent these annoying infections:

There are two things to do:

1) Disable autorun. Autorun is a pain in the butt and very insecure. Copy and paste the text below into a file with .reg extension, then double click the file to integrate it into the Windoze registry:
Code:
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf]
@="@SYS:DoesNotExist"
This prevents autorun from launching malware from any USB stick.

2) Prevent your own USB stick from becoming infected:
Create a folder on each volume on your stick called autorun.inf
This prevents malware from creating it's own autorun.inf file. It's likely there may be one or two that have catered for this by deleting any autorun.inf files / folders before creating it's own - i'm not aware of any myself. This will prevent any malware present on your stick from an infection from running on any other system. Note that the malware may actually attempt to infect and indeed infect the stick, but since it can't be automatically run on insertion of the stick, it won't spread easily. You should also be able to scan and clean it easily enough when you get it back to your own clean / safe PC .
 

The_Unbeliever

Honorary Master
Joined
Apr 19, 2005
Messages
103,197
While you're busy with this, create the following folders as well :

Documents.lnk
Music.lnk
new folder .exe
new folder.exe
New Folder.lnk
Passwords.lnk
Pictures.lnk
Video.lnk

Create the following (empty) plain files in the root of your USB/flash drive :

USB Vault
temp
recycler

This will stop most nasties from writing their junk to your stick. Those who use random filenames you can do nothing about, except run a good antivirus scanner on the stick before copying files off.



Or use Linux. :D
 
Last edited:

Everyones-a-Wally

Honorary Master
Joined
Jul 18, 2008
Messages
51,633
While you're busy with this, create the following folders as well :

Documents.lnk
Music.lnk
new folder .exe
new folder.exe
New Folder.lnk
Passwords.lnk
Pictures.lnk
Video.lnk

Create the following (empty) plain files in the root of your USB/flash drive :

USB Vault
temp
recycler

This will stop most nasties from writing their junk to your stick. Those who use random filenames you can do nothing about, except run a good antivirus scanner on the stick before copying files off.



Or use Linux. :D

Thanks oom ook!
Although I must admit, my flash stick looks like a bergie's handbag after this ROFL
 

HavocXphere

Honorary Master
Joined
Oct 19, 2007
Messages
33,156
Format to NTFS and mark security descriptors on the autorun.inf to "no owner" & "no access". With a bit of luck that will even crash the malware trying to write to the file.
 
Top