batch Anti-Virus

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
FlareMalware
Posts: 3
Joined: 29 Jul 2015 08:55

batch Anti-Virus

#1 Post by FlareMalware » 29 Jul 2015 09:10

MOD EDIT: This post has been approved, but because this is your first post and you aren't yet known here
the download link is disabled as it has an unknown binary file in the RAR file.

If you describe what you need to do, with the text pasted into the post, then you will get some assistance.


Hello and thank you for taking a look at my thread.

I have a project however im kinda stuck, a little help would be nice :)

My project is a anti virus in batch that can detect and remove viruses, i know this is not really possible in batch so i have some c++ in the mix.

Please download my project so you can work with it and understand it!
https://mega.co.nz/#!ws8XHQyT!2N9K85c2I ... 6jXIBYeFQQ

The problem in facing is this:

I have a database.txt, it contains md5 hashes of real viruses, those that need to be removed. here is how it looks right now

Image

Note: these are test subjects, the real database has over 10,000 lines in it.

if you downloaded the files above, please put it in the C: folder, this is required atm for the c++ program to work. Now open the bat file, it will then scan the computer, right? After that you will get a scannedfiles.txt, it contains all the files on your own computer. Now we need to compare the 2 text files and see if any lines in the database.txt match the scannedfiles.txt. then we need to auto delete the files.

I have tried and tried, i cant code it with my knowledge, here is some codes i have tried:

Code: Select all

@echo off
for /F "tokens=*" %%a in ('findstr /G:database.txt scannedfiles.txt') do del "%%a"


Code: Select all

FOR /F "tokens=* delims= " %%a in ('database.txt') do (set database=%%a)

FOR /F "tokens=* delims= " %%z in ('type scannedfiles.txt ^| findstr %%a')


Any help would be very nice! :D


MOD EDIT: This is the batch script inside the RAR file FWIW

Code: Select all

@echo off
title Flarus Beta 0.0.8
echo You need to run the following program in admin mode, or this will not work.
timeout /t 2 /nobreak>nul
cls

:Menu1
echo 1. Scan mode.
echo 2. Scan and auto delete mode.
echo 3. Scan and manual delete mode.
echo 4. Debug mode.
echo 5. Update Database.

choice /c 12345>nul

if "%errorlevel%"=="1" call :Scanmode
if "%errorlevel%"=="2" call :Scanautodelete
if "%errorlevel%"=="3" call :scanmanualdelete
if "%errorlevel%"=="4" call :Debugmode
if "%errorlevel%"=="5" call :Update
goto eof

:Scanmode
cls
cd C:\Antivirus
fciv -md5 -add C: -r -type *.exe -type *.dll -type *.bat>scannedfiles.txt
del fciv.err

:Scanautodelete
cls
cd C:\Antivirus
fciv -md5 -add C: -r -type *.exe -type *.dll -type *.bat>scannedfiles.txt
del fciv.err

:scanmanualdelete
cls
cd C:\Antivirus
fciv -md5 -add C: -r -type *.exe -type *.dll -type *.bat>scannedfiles.txt
del fciv.err

:Debugmode
cls
cd C:\Antivirus
fciv -md5 -add C: -r -type *.exe -type *.dll -type *.bat>scannedfiles.txt

:Update
cls
bitsadmin.exe /transfer "Flarus Update" http://goo.gl/MIPYFu C:\Antivirus\Database.txt
pause

FlareMalware
Posts: 3
Joined: 29 Jul 2015 08:55

Re: batch Anti-Virus

#2 Post by FlareMalware » 29 Jul 2015 14:32

MOD EDIT: This post has been approved, but because this is your first post and you aren't yet known here
the download link is disabled as it has an unknown binary file in the RAR file.

Hello! If you are talking about the fciv.exe file, it is signed by Microsoft Corporation and it was downloaded from microsoft.com, here is the link :)

https://www.microsoft.com/en-us/downloa ... x?id=11533

If you describe what you need to do, with the text pasted into the post, then you will get some assistance.


I need to compare the 2 text files and see if any lines in the database.txt match the scannedfiles.txt, if any files are found the found files shall be deleted. :D

Aacini
Expert
Posts: 1914
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: batch Anti-Virus

#3 Post by Aacini » 29 Jul 2015 17:19

I thought that the code I provided in your original question at SO site worked correctly. If not, please indicate the specific points at this code fails, in order to fix it. You may post a segment of the input files, the output shown by previous method and what the correct output should be.

Antonio

FlareMalware
Posts: 3
Joined: 29 Jul 2015 08:55

Re: batch Anti-Virus

#4 Post by FlareMalware » 29 Jul 2015 19:31

I got it working, but i think it was because it removed the dir after the md5 hash

I think the problem is that it cannot detect the line?

Post Reply