Wednesday, May 22, 2013

Quick Malware Defense

The HOSTS file on computers is an 'old fashioned' way computers talk to each other. If you're not managing a HOST file for anything and it's left to default, you can use it to provide a cheap, easy way to defend against some malware.

Below is a simple AHK script that grabs a HOSTS file from and places it into your HOSTS file. This is quick and provides some defense.

Just cut and paste what's between the lines and place into a notepad document and save as an AHK fike. As before, you need to download Autohotkey first.


#SingleInstance Force
FileDelete, %A_temp%\hosts
UrlDownLoadToFile,, %a_Temp%\hosts
Filecopy, %A_Temp%\hosts, %windir%\System32\drivers\etc,1
FileDelete, %a_temp%\hosts
FileGetTime, QTime, %windir%\System32\drivers\etc\HOSTS
FormatTime, HTime, %QTime%, d MMM yy | h mm tt
MsgBox,,HOSTS File Protect,Updated HOSTS file:`n %HTime%, 30


I have not tested this against anything but WinXP and Win7.
Post a Comment