如何制作MD5批处理病毒扫描程序? [英] how to make a MD5 batch virus scanner?

查看:168
本文介绍了如何制作MD5批处理病毒扫描程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我对md5进行了研究,发现此文件 PieSub引用了MD5生成代码;

So I have done my research on md5 and found this which PieSub quoted MD5 generation code;

@echo off  
for /r %%f in (*) do md5.exe %%f >> output.txt

当我尝试为某个目录中的文件生成md5代码时,将这批(md5.bat)放在结果中看起来像这样;

which when I try to generate md5 code for the files in a certain directory this batch (md5.bat) was placed in the result looks like this;

8232D53AB6DF337DC341A589EF1FA687  C:\Users\User\Downloads\md5\index.html
695D352F6D8974463855443E83B6F000  C:\Users\User\Downloads\md5\main.c
6C35472B8D3FDC82BF6AEDD2E6AC855E  C:\Users\User\Downloads\md5\Makefile
F3A54C9B5AC78F44CF22095D448E7712  C:\Users\User\Downloads\md5\md5.bat
AB5E72E19362E8E60E41F05B9D192A58  C:\Users\User\Downloads\md5\md5.c
8D443F2E93A3F0B67F442E4F1D5A4D6D  C:\Users\User\Downloads\md5\md5.exe
4CFADCA7BC0717091EDDCBF19D2E065F  C:\Users\User\Downloads\md5\md5.h
036D9462A58BEE6F0F404BC4A569108B  C:\Users\User\Downloads\md5\md5.png
A1F984ABE556555208BA3036496ED74B  C:\Users\User\Downloads\md5\md5.sln
83FFA789C81056966980ED58D9E0726A  C:\Users\User\Downloads\md5\md5.vcproj
16596D5330EF48A9E53944749BED44DE  C:\Users\User\Downloads\md5\md5s.png
69390C0E13ECFE8818BB29B108ACA751  C:\Users\User\Downloads\md5\rfc1321.html
754B9DB19F79DBC4992F7166EB0F37CE  C:\Users\User\Downloads\md5\rfc1321.txt

因此,基本上,我想要一个脚本,该脚本将md5哈希与 md5数据库进行比较并删除任何恶意文件.

So basically, I want a script that compares the md5 hash with this md5 database and deletes any malicious file.

推荐答案

下载病毒数据库时:

@echo off
set "$base=HashBase.txt"

for /r %%f in (*) do md5.exe %%f >> output.txt

for /f "tokens=1* delims= " %%a in (output.txt) do find /i "%%a" "%$base%" >nul && echo del "%%b"

我在del之前放了echo.因此,您可以进行非破坏性测试. 如果输出正常,则将其删除.

I putted an echo before the del. So you can make a non-destructiv test. If the output is OK remove it.

这篇关于如何制作MD5批处理病毒扫描程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆