After my last post, I got busy for a few weeks and didn't have any more time to think about my request. I am still very interested in a log to syslog component.
In the mean time, I've created a windows command line language script file that uses the Blat open source command line emailer to log scan results to the Window Application log and send a message to one or more email accounts. This is all done from the command line, so the Windows at or schtasks commands can be used to run the scan at pre-defined times without user interaction.
I'm posting my procedures and script below.
First, download Blat from here: https://www.blat.net/
Second, create a Blat profile for your script to use. Instructions are here: https://www.blat.net/examples/
Next, I created the following batch script. Please feel free to use this as a template and modify it to suit your needs. If you have some suggestions for improvement, please feel free to post those too.
Here's my batch script:
echo off
cls
echo this script was created by Vaughn L. Reid III on June 6, 2008
echo Batch Script using open source anti-virus and public domain mailer software to check computer for viruses and report status
echo this batch script uses clamwin anti-virus, available at http://www.clamwin.com
echo this batch script uses blat mailer software, available at http://www.blat.net/
cls
echo checking Documents and Settings Folder for viruses and sending summary email
c:\"Program Files"\clamwin\bin\clamscan.exe --database="C:\Documents and Settings\All Users\.clamwin\db" --recursive "C:\Documents and Settings" >c:\clam-results.txt 2>&1
goto answer%errorlevel%
:answer0
echo No Viruses found in scan of c:\documents and settings
eventcreate /l APPLICATION /so clamwin /t INFORMATION /id 1 /d "No viruses found in scan of c:\documents and settings"
C:\scripts\blat262\full\blat.exe c:\clam-results.txt -to email_address_here -subject "Virus Scan Complete" -p blat_mail_profile
echo Scan complete
echo Check c:\clam-results.txt for more info
goto end
:answer1
echo Possible virus found in scan of c:\documents and settings
eventcreate /l APPLICATION /so clamwin /t WARNING /id 2 /d "Possible Virus found in scan of c:\documents and settings"
C:\scripts\blat262\full\blat.exe c:\clam-results.txt -to email_address_here -subject "Virus Found" -p blat_mail_profile
echo Scan complete Possible viruses found
echo Check c:\clam-results.txt for more info
goto end
:end
exit |
Basically, the batch file runs a scan and then writes messages into the Windows Application log and sends an email based upon the results of the scan. I'm not a programmer, but I'm posting this because someone might find the information listed above helpful.
--Vaughn Reid III