eseigi vinc iyenebs McAfee-s icis rom kvirashi sadgac 3-4jer sachiroa virus definition-ebis update. Ratqmaunda sheidzleba miutito titoeul klients gadmoiceros sdatXXXX.exe NAI-s saitidan (an ftp-dan) magram uketesi iqneboda ertxel gadmocera da mere klientebis gaaxleba lokaluri qselidan (an lokaluri FTP-dan).
Problemaa iyo is rom McAfee ar gazlevs sashualebas mag sdatXXXX.exe-s egadmoceris da shenaxvis, amitomac momicia rame solutionis naxva. UNIX_sze eg iyo ioli, magram windowsze gamichirda FTP-dan failis gadmocera, mitumetes cinascar ar ici ra versiaa, anu ra failia gadmosaceri. magalitad dges bolo versia aris sdat4341.exe, da shemdegi ki sdat4342.exe. amitomac jer unda gadmoicero delta.ini romelshic ceria current version, shemdeg ki gadmoicero shesabamisi faili. Visual Basic-ze gamomivida eg (VBScript-zec maqvs da UNIX shell scriptzec [csh, bash]. Tu vinmes esachiroeba an rameti daexmareba eg namushavari didi siamovnebit mogexmarebit

P.S. amis dascheduleba windows-shi ar gauchirdeba sys admins, an kide sheizleba NAI-s sdat notification-ze subscribe-s gaketeba, mere oulook-shi Msg Rule-s acyoba rom roca modis notification axal sdat-is shesaxeb automatiurad gaushvas eg programa/scripti. UNIX_shi an crontabis gamoyeneba an kide mail tracking

"******************************** VB *************************************************
Public Sub Proceed()
Dim WorkDir
Dim UserName
Dim Password
Dim ServerName
Dim FileName
WorkDir = "C:\nai"
UserName = "anonymous"
Password = "something@somewhere.com"
ServerName = "ftp.nai.com"
FileName = "CommonUpdater/delta.ini"
ListText = "open " & ServerName & "|" & UserName & "|" & Password & "|bin|lcd " & WorkDir & "|get " & FileName & "|bye|quit|"
Dim fso
Set fso = CreateObject("Scripting.FilesystemObjecT")
Dim outfile
Set outfile = fso.CreateTextFile(WorkDir & "\FTP.txt", 1)
outfile.Write Replace(ListText, "|", vbCrLf)
outfile.Close
Dim WSH
Set WSH = CreateObject("Wscript.Shell")
Set Process = WSH.Environment("Process")
Dim WinDir
WinDir = Process("WinDir")
Dim retval As String
retval = Dir$(WorkDir & "\delta.ini")
If retval = "delta.ini" Then
Kill WorkDir & "\delta.ini"
End If
Set exec = WSH.exec(WinDir & "\System32\ftp.exe -s:" & WorkDir & "\FTP.txt")
Do While exec.Status = 0
Sleep 1000
Loop
Dim Delta, Version As String
Delta = "c:\nai\delta.ini"
KeyWord = "CurrentVersion"
Open Delta For Input As #1
While Not EOF(1)
Line Input #1, MyLine
If InStr(1, LCase(MyLine), LCase(KeyWord), vbTextCompare) Then
Version = Right(MyLine, 4)
End If
Wend
Close #1
Sdat = "sdat" & Version & ".exe"
Dim retval1 As String
retval1 = Dir$(WorkDir & "\" & Sdat)
If retval1 <> Sdat Then
FileName = "CommonUpdater/" & Sdat
ListText = "open " & ServerName & "|" & UserName & "|" & Password & "|bin|lcd " & WorkDir & "|get " & FileName & "|bye|quit|"
Dim fso1
Set fso1 = CreateObject("Scripting.FilesystemObjecT")
Dim outfile1
Set outfile1 = fso.CreateTextFile(WorkDir & "\sdat.txt", 1)
outfile1.Write Replace(ListText, "|", vbCrLf)
outfile1.Close
Set exec = WSH.exec(WinDir & "\System32\ftp.exe -s:" & WorkDir & "\sdat.txt")
Do While exec.Status = 0
Sleep 1000
Loop
End If
Set WSH = Nothing
Set fso = Nothing
Set fso1 = Nothing
End Sub
In Module:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
"***********************************End of VB*******************************************
exla ki UNIX/LINUX
# ******************** UNIX SCRIPT ***************************************************
SHAREFOLDER=/home/temp/nai
TEMPFOLDER=/home/temp/nai
cd $TEMPFOLDER
rm update.ini
VERSION=`wget -O $SHAREFOLDER/update.ini
ftp://ftp.nai.com/virusdefs/4.x/update.ini && grep DATVersion= < update.ini | cut -c 12-15 | sort -u`
if [ -f "$SHAREFOLDER/sdat$VERSION.exe" ]
then
echo "sdat$VERSION.exe - File Already Exist"
exit 1
else
rm $SHAREFOLDER/sdat$VERSION.exe
wget -O $SHAREFOLDER/sdat$VERSION.exe
ftp://ftp.nai.com/CommonUpdater/sdat$VERSION.exe wget -O $SHAREFOLDER/dat-$VERSION.zip
ftp://ftp.nai.com/pub/datfiles/english/dat-$VERSION.zip echo $VERSION | mail -s "DAT Has been updated and ready for replication" roma@marriott.ge
exit 0
fi
#*************************** END OF UNIX SCRIPT *********************
This post has been edited by imap on 24 Mar 2004, 11:07