Tiger-Workshop Blog

Archive for July, 2008

利用Windows限制為USB記憶體(閃存)免疫限制

by 虎~ on Jul.08, 2008, under Hardware, Software, Windows

利用Windows限制能做甚麼?

破壞?不!我就是要用此來防止手指中毒!看招!

實作

1. 把以下文字複製到記事本(注意不連虛線!)

然後存成”vaccine.bat” (注意要包括引號! 存哪裡都可以,桌面較方便)

第一行 Z: 請改成要安裝免疫的磁碟代號

2. 雙擊 vaccine.bat 應該會有一個黑色command視窗閃過

3. 想確實是否已安裝成功可以按WinKey+R

輸入Z:\autorun.inf (不是 Z: 的話請自動換掉…)

如果看到3個資料夾con、this_folder_is_a_vaccine和not_deleteable_via_normal_method就算成功了

==============================================

SET DRIVE=Z:

cd /D %DRIVE%

attrib autorun.inf -R -S -H
del autorun.inf /q
rd autorun.inf /q /s

md autorun.inf
cd autorun.inf

SET SEED=%random%%random%
md .\con\
md .\con\%SEED%
cd .\con\%SEED%\

SET SEED=%random%%random%
md .\con\
md .\con\%SEED%
cd .\con\%SEED%\

SET SEED=%random%%random%
md .\con\
md .\con\%SEED%
cd .\con\%SEED%\

attrib %DRIVE%\autorun.inf +R +S +H

cd %DRIVE%\autorun.inf
md %DRIVE%\autorun.inf\this_folder_is_a_vaccine
md %DRIVE%\autorun.inf\not_deleteable_via_normal_method

==============================================

原理

Windows結構上是有一堆保留檔案名不能用的

「CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9」

嘗試把資料夾改成以上檔案只會得到檔名不正確的錯誤訊息

USB手指病毒主要透過Windows的Autorun(自動播放)功能傳播,

而Autorun的主導就是根目錄下的Autorun.inf,因此播毒的罪魁禍首就是Autorun.inf,

只要在根目錄建立一個刪不掉的Autorun.inf就能防止手指受感染。

病毒(及其作者)都很聰明,會刪掉已存在的Autorun.inf然後再建立新的

而刪除資料夾需要刪除下層所有檔案,如果下層有檔案刪不掉,資料夾也就不能動了

而使用保留檔案名的檔案只能用特定方法建立/刪除

因此目前網上的病毒都是刪不掉的(我還未看過)

Autorun.inf刪不掉,病毒也不能籍此自動傳播了

此方法已測試能防kavo及其變種

這方法也只是防止病毒使用Autorun自動傳播,不能完全防止手指病毒!

看到手指上出見來歷不明的檔案還是請不要開啟

Leave a Comment : more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

    Archives

    All entries, chronologically...