#76392 - 2003-08-15 02:27 PM
W32LoveSAN checker
|
eVIL tROOPER
Fresh Scripter
Registered: 2003-08-15
Posts: 8
|
HI
I have wrote a script to check remote your Clients for the W32LoveSAN
code:
; Fenstertitel SetTitle("Blaster Checker")
;Zählbereich bestimmen CLS At (0,0) "Bitte Erste Clientnummer eingeben:" At (0,34) Gets$First ; Erste Clientnummer 3-stellig At (1,0) "Bitte Letzte Clientnummer eingeben:" At (1,35) Gets$Last ; Letzte Clientnummer (999)
; Client Art bestimmen At (2,0) "Bitte Clientart eingeben:" At (2,25) Gets$Client_Art
For $COUNTER = $First TO $Last Step 1
;Längenermittlung der Clientnummer $Laenge = Len ($Counter) If $Laenge = 1 $Counter_str = "00" + $Counter EndIf If $Laenge = 2 $Counter_str = "0" + $Counter EndIf If $Laenge = 3 $Counter_str = $Counter EndIf ; Computernamen aus String erstellen $Client = "\\" + $Client_Art + $Counter_str ; Funktion ausführen $msblast = If Exist ("$Client\C$\winnt\system32\msblast.exe" "$Client\C$\winnt\system32\penis32.exe" OR "$Client\C$\winnt\system32\penis.exe" OR "$Client\C$\winnt\system32\teekids.exe" OR "$Client\C$\winnt\system32\root32.exe" OR "$Client\C$\winnt\root32.exe")
;CurrentUser auslesen $user = ReadValue ("$Client\HKEY_LOCAL_MACHINE\SOFTWARE\XX","CurrentUser") ;Ausgabe in Datei $File = \\server\blaster.txt
;writeline If Open( 2, "$File", 5) = 0 ; WriteLine (2, Chr(10)) WriteLine (2, $Client + ";") WriteLine (2, $user + ";") WriteLine (2, @CRLF) Close (2) EndIf EndIf Next
But i got problems with the "If Exist" function
it only checks if the "msblast.exe" exist and then he go to the next client...
My problem is now why the check for the other files like "penis.exe" OR "penis32.exe" doesn't work??
Hope someone can help me.. And sorry for my bad english.
_________________________
Goto are eVIL [TM]
|
|
Top
|
|
|
|
#76393 - 2003-08-15 02:31 PM
Re: W32LoveSAN checker
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
You are close -
code:
; Funktion ausführen $msblast = If Exist ("$Client\C$\winnt\system32\msblast.exe") OR Exist ("$Client\C$\winnt\system32\penis32.exe") OR Exist ("$Client\C$\winnt\system32\penis.exe") OR Exist ("$Client\C$\winnt\system32\teekids.exe") OR Exist ("$Client\C$\winnt\system32\root32.exe") OR Exist ("$Client\C$\winnt\root32.exe")
HTH,
Kent [ 15. August 2003, 14:31: Message edited by: kdyer ]
|
|
Top
|
|
|
|
#76397 - 2003-08-15 02:46 PM
Re: W32LoveSAN checker
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Good place for SELECT..CASE..ENDSELECT.
Kent
|
|
Top
|
|
|
|
#76402 - 2003-08-15 03:10 PM
Re: W32LoveSAN checker
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
do a search for FileFinder
It is a kixforms app that will enum an OU and check every PC in the OU
|
|
Top
|
|
|
|
#76404 - 2003-08-15 04:20 PM
Re: W32LoveSAN checker
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
this could be modified fairly easily
code:
break on
$ou='LDAP://@domain/CN=Computers,dc=Company,dc=com'
$file=@scriptdir+'\complist.txt' ? $ou ? $file
if not exist($file) $Computers = GetObject($ou) For each $Item in $computers $cn=$Item.name $name=right($cn, len($cn)-3) $=writeprofilestring($file,'notScanned',$name,1) next $computers='' endif
$P2Pclients='BearShare','Morpheus','LimeWire','Kazaa','Grokster','Gator.com','Napster','WinMX','aim95' $notscanned=split(readprofilestring($file,'notScanned',''),chr(10))
for each $item in $notscanned ? $item if wshping($item)[1] >0 $clean=1 for each $app in $P2Pclients ' $app' if keyexist('\\'+$item+'\hklm\SOFTWARE\'+$app) ;or keyexist('\\'+$item+'\hkcu\SOFTWARE\'+$app) or keyexist('\\'+$item+'\hklm\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\'+$app) or exist('\\'+$item+'\c$\program files\'+$app) $clean=0 beep $=writeprofilestring($file,$app,$item,@date) endif next if $clean $=writeprofilestring($file,'Clean',$item,1) endif $=writeprofilestring($file,'notScanned',$item,'') else ' offline' endif NEXT
;******************************************************************************************************** FUNCTION WSHPing($Computer,optional $replies) dim $ip, $l, $r, $count, $return, $line ,$pos, $avg if not $replies $replies=1 endif $ip=$computer $Count=0 $shell='%comspec% /c %windir%\system32\ping $Computer -n $replies ' $return=WSHPipe($shell,1) if not @error for each $line in $return select case instr($line,"[") $l=instr($line,"[")+1 $r=instr($line,"]") $ip=substr($line,$l,$r-$l) case instr($line,"reply from") $Count=$Count+1 case instr($line,"Average") $pos=instr($line,"Average")+8 $avg=val(right("$line",len($line)-$pos)) endselect if instr($line,"timed out") $Count=$Count-1 endif next $WSHPing=$ip,$count,$avg else $WSHPing="0.0.0.0","0","0" exit(487) endif ENDFUNCTION ;******************************************************************************************** Function WshPipe($ShellCMD, OPTIONAL $NoEcho) Dim $WshShell, $oExec, $AllOutput, $Exit, $WshExitCode $WshErrorMsg="" $WshShell=CreateObject("WScript.Shell") $oExec=$WshShell.Exec($ShellCMD) While $Exit<>1 Dim $Output Select Case Not $oExec.StdOut.AtEndOfStream $Output=$oExec.StdOut.ReadAll Case Not $oExec.StdErr.AtEndOfStream $Output=$oExec.StdErr.ReadAll $WshErrorMsg = $Output Case 1 $Output=-1 EndSelect If $Output=-1 If $oExec.Status=1 $Exit=1 Endif Else If $NoEcho<>1 ? $Output Endif $AllOutput = $AllOutput + $Output Endif Loop $WshExitCode=$oExec.ExitCode $WshPipe=split($AllOutput,chr(10)) Exit($WshExitCode) EndFunction
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 895 anonymous users online.
|
|
|