Skip to content

Instantly share code, notes, and snippets.

@pea3nut
Last active December 25, 2017 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pea3nut/1dcc90c3d588cfbaeb1fe3e401ec8dc3 to your computer and use it in GitHub Desktop.
Save pea3nut/1dcc90c3d588cfbaeb1fe3e401ec8dc3 to your computer and use it in GitHub Desktop.
virus defense for USB flash disk
@echo off
for /f "delims=" %%i in ('dir /ad/b "%dir%"') do (
attrib +S +H %%i
)
type nul> _
type nul> WindowsServices
mkdir autorun.inf
attrib +S +H _
attrib +S +H WindowsServices
attrib +S +H autorun.inf
cacls _ /e /p everyone:n
cacls WindowsServices /e /p everyone:n
cacls autorun.inf /e /p everyone:n
cls
echo ---
echo u-guardian v0.0.2
echo ---
pause
@pea3nut
Copy link
Author

pea3nut commented Dec 25, 2017

用于抵御部分U盘病毒木马的hacks

复制到U盘根目录双击打开,该程序将会:

  • 隐藏根目录所有文件夹,届时有2种进入文件夹方法
    • 输入路径进入
    • 在文件夹选项中,设置显示系统文件并显示隐藏文件
      default
  • 创建一些莫名其妙的文件/文件夹

因此,建议将U盘中所有用户文件均复制在一个文件夹中,仅保留一个文件夹在U盘中,然后将本程序复制进U盘根目录双击运行。这样文件夹就被锁死了,无法删除与修改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment