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
| {Исправление в службах в реестре, значения ImagePath.
Данный скрипт распространяется свободно и может быть модицифирован по согласованию с авторами - представителями SafeZone.cc
При публикации скрипта данный комментарий и ссылка на SafeZone.cc обязателена. }
var DescriptionTextWuauServ, DispayNameTextWuauServ, DescriptionTextBITS: String;
DispayNameTextBITS, FullPathSystem32, NameFolderSystem32, FileServiceDll: String;
ImagePathStr, RootStr, SubRootStr, LangID: string;
AllRoots, AllKeys, RootsRestored, KeysRestored, KeysFixed: integer;
FinishMsg, RestoreMsg, FixMsg, CheckMsg: String;
RegSectMsg, ParamMsg, ParamValueMsg, InRegSectMsg, CorrectMsg, RestMsg: String;
procedure CheckAndRestoreSection(Root: String);
begin
Inc(AllRoots);
if RegKeyExistsEx('HKLM', Root) then
RegKeyResetSecurity('HKLM', Root)
else
begin
Inc(RootsRestored);
RegKeyCreate('HKLM', Root);
AddToLog(RegSectMsg + Root + RestMsg);
end;
end;
procedure CheckAndRestoreSubSection;
begin
CheckAndRestoreSection(SubRootStr);
end;
procedure RestoredMsg(Root, Param: String);
begin
AddToLog(ParamMsg + Param + InRegSectMsg + Root + RestMsg);
Inc(KeysRestored);
end;
procedure FixedMsg(Root, Param: String);
begin
AddToLog(ParamValueMsg + Param + InRegSectMsg + Root + CorrectMsg);
Inc(KeysFixed);
end;
procedure RestoreStrParam(Root, Param, Value: String);
begin
RegKeyStrParamWrite('HKLM', Root, Param, Value);
RestoredMsg(Root, Param);
end;
procedure CheckAndRestoreStrParam(Root, Param, Value: String);
begin
Inc(AllKeys);
if not RegKeyParamExists('HKLM', Root, Param) then
RestoreStrParam(Root, Param, Value);
end;
procedure CheckAndRestoreIntParam(Root, Param: String; Value: Integer);
begin
Inc(AllKeys);
if not RegKeyParamExists('HKLM', Root, Param) then
begin
RegKeyIntParamWrite('HKLM', Root, Param, Value);
RestoredMsg(Root, Param);
end;
end;
procedure CheckAndRestoreMultiSZParam(Param, Value: String);
begin
Inc(AllKeys);
if not RegKeyParamExists('HKLM', RootStr, Param) then
begin
ExecuteFile('REG ADD HKLM\' + RootStr + ' /v ' + Param + Value, '', 0, 10000, true);
RestoredMsg(RootStr, Param);
end;
end;
// Исправление значения параметра ImagePath для служб 'wuauserv' и 'BITS'
procedure ImagePathFix(Node, Srv: String);
var RegStr: String;
begin
RegStr := 'SYSTEM\' + Node + '\Services\' + Srv;
if RegKeyExistsEx('HKLM', RegStr) then
begin
Inc(AllKeys);
RegKeyResetSecurity('HKLM', RegStr);
RegKeyStrParamWrite('HKLM', RegStr, 'ImagePath', ImagePathStr);
FixedMsg(RegStr, 'ImagePath');
end;
end;
{ Выполнение исправление всех ключей в ветках -
'HKLM\SYSTEM\CurrentControlSet\Services\BITS' и 'HKLM\SYSTEM\CurrentControlSet\Services\wuauserv'}
procedure CorrectRegistryRoot(DescriptionText, DisplayNameText, Srv: String);
var FileServiceDll, CCSNumber: string;
i : integer;
begin
if Srv = 'BITS' then
FileServiceDll := FullPathSystem32 + 'qmgr.dll'
else
FileServiceDll := FullPathSystem32 + 'wuauserv.dll';
RootStr:= 'SYSTEM\CurrentControlSet\Services\' + Srv;
CheckAndRestoreSection(RootStr);
CheckAndRestoreStrParam(RootStr, 'Description', DescriptionText);
CheckAndRestoreStrParam(RootStr, 'DisplayName', DisplayNameText);
CheckAndRestoreStrParam(RootStr, 'ObjectName', 'LocalSystem');
Inc(AllKeys);
if not RegKeyParamExists('HKLM', RootStr, 'ImagePath') then
RestoreStrParam(RootStr, 'ImagePath', ImagePathStr)
else
begin
Dec(AllKeys);
if LowerCase(RegKeyStrParamRead('HKLM', RootStr, 'ImagePath')) <> LowerCase(ImagePathStr) then
for i:= 0 to 999 do
begin
if i > 0 then
CCSNumber := FormatFloat('ControlSet000', i)
else
CCSNumber := 'CurrentControlSet';
ImagePathFix(CCSNumber, Srv);
end;
end;
CheckAndRestoreIntParam(RootStr, 'ErrorControl', 1);
CheckAndRestoreIntParam(RootStr, 'Start', 2);
CheckAndRestoreIntParam(RootStr, 'Type', 32);
if Srv = 'BITS' then
begin
CheckAndRestoreMultiSZParam('DependOnService', ' /t REG_MULTI_SZ /d RpcSs');
CheckAndRestoreMultiSZParam('DependOnGroup', ' /t REG_MULTI_SZ');
end;
SubRootStr:= RootStr + '\Enum';
CheckAndRestoreSubSection;
CheckAndRestoreStrParam(SubRootStr, '0', 'Root\LEGACY_' + UpperCase(Srv) + '\0000');
CheckAndRestoreIntParam(SubRootStr, 'Count', 1);
CheckAndRestoreIntParam(SubRootStr, 'NextInstance', 1);
SubRootStr := RootStr + '\Security';
CheckAndRestoreSubSection;
Inc(AllKeys);
if not RegKeyParamExists('HKLM', SubRootStr, 'Security') then
begin
RegKeyBinParamWrite('HKLM', SubRootStr, 'Security', '01,00,14,80,78,00,00,00,84,00,00,00,14,00,00,00,30,00,00,00,02,00,1c,00,01,00,00,00,02,80,14,00,ff,00,0f,00,01,01,00,00,00,00,00,01,00,00,00,00,02,00,48,00,03,00,00,00,00,00,14,00,9d,00,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00,00,00,14,00,ff,01,0f,00,01,01,00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00');
RestoredMsg(SubRootStr, 'Security');
end;
SubRootStr:= RootStr + '\Parameters';
CheckAndRestoreSubSection;
Inc(AllKeys);
if not RegKeyParamExists('HKLM', SubRootStr, 'ServiceDll') then
begin
RegKeyParamWrite('HKLM', SubRootStr, 'ServiceDll', 'REG_EXPAND_SZ', FileServiceDll);
RestoredMsg(SubRootStr, 'ServiceDll');
end
else if LowerCase(RegKeyStrParamRead('HKLM', SubRootStr, 'ServiceDll')) <> LowerCase(FileServiceDll) then
begin
RegKeyParamWrite('HKLM', SubRootStr, 'ServiceDll', 'REG_EXPAND_SZ', FileServiceDll);
FixedMsg(SubRootStr, 'ServiceDll');
end
end;
{ Главное выполнение }
begin
ExecuteFile('net.exe', 'stop tcpip /y', 0, 15000, true);
SearchRootkit(true, true);
SetAVZGuardStatus(True);
QuarantineFileF('C:\Program Files\Content Defender', '*.exe, *.dll, *.sys, *.bat, *.vbs, *.js', true, '', 0 ,0);
QuarantineFileF('C:\Program Files\Zaxar', '*.exe, *.dll, *.sys, *.bat, *.vbs, *.js', true, '', 0 ,0);
QuarantineFile('C:\Program Files\Content Defender\cd.exe', '');
QuarantineFile('C:\Program Files\Zaxar\ZaxarGameBrowser.exe', '');
DeleteFile('C:\Program Files\Content Defender\cd.exe', '32');
DeleteFile('C:\Program Files\Zaxar\ZaxarGameBrowser.exe', '32');
ClearLog;
ExpRegKey('HKLM', 'SYSTEM\CurrentControlSet\Services\wuauserv', 'wuauserv.reg');
ExpRegKey('HKLM', 'SYSTEM\CurrentControlSet\Services\BITS', 'BITS.reg');
LangID:= RegKeyStrParamRead('HKLM', 'SYSTEM\CurrentControlSet\Control\Nls\Language', 'InstallLanguage');
if LangID = '0419' then
begin
DescriptionTextWuauServ := 'Включает загрузку и установку обновлений Windows. Если служба отключена, то на этом компьютере нельзя будет использовать возможности автоматического обновления или веб-узел Центра обновления Windows.';
DispayNameTextWuauServ := 'Автоматическое обновление';
DescriptionTextBITS := 'Обеспечивает передачу данных между клиентами и серверами в фоновом режиме. Если служба BITS отключена, такие возможности, как Windows Update, не могут правильно работать.';
DispayNameTextBITS := 'Фоновая интеллектуальная служба передачи (BITS)';
AddToLog('Операционная система - русская');
FinishMsg := '–––– Восстановление завершено ––––';
RestoreMsg := 'Восстановлено разделов\параметров: ';
FixMsg := 'Исправлено параметров: ';
CheckMsg := 'Проверено разделов\параметров: ';
RegSectMsg := 'Раздел реестра HKLM\';
ParamMsg := 'Параметр ';
ParamValueMsg := 'Значение параметра ';
InRegSectMsg := ' в разделе реестра HKLM\';
CorrectMsg := ' исправлено на оригинальное.';
RestMsg := 'восстановлен.';
end
else if LangID = '0409' then
begin
DescriptionTextWuauServ := 'Enables the download and installation of Windows updates. If this service is disabled, this computer will not be able to use the Automatic Updates feature or the Windows Update Web site.';
DispayNameTextWuauServ := 'Automatic Updates';
DescriptionTextBITS := 'Transfers data between clients and servers in the background. If BITS is disabled, features such as Windows Update will not work correctly.';
DispayNameTextBITS := 'Background Intelligent Transfer Service';
AddToLog('Operation system - english');
FinishMsg := '–––– Restoration finished ––––';
RestoreMsg := 'Sections\parameters restored: ';
FixMsg := 'Parameters corrected: ';
CheckMsg := 'Sections\parameters checked: ';
RegSectMsg := 'Registry section HKLM\';
ParamMsg := 'Parameter ';
ParamValueMsg := 'Value of parameter ';
InRegSectMsg := ' in registry section HKLM\';
CorrectMsg := ' corrected on original.';
RestMsg := ' restored.';
end;
AddToLog('');
{ Определение папки X:\Windows\System32\ }
NameFolderSystem32 := RegKeyStrParamRead('HKLM', 'SYSTEM\CurrentControlSet\Control\Windows', 'SystemDirectory');
ImagePathStr := NameFolderSystem32 + '\svchost.exe -k netsvcs';
Delete(NameFolderSystem32, 1, pos('\', NameFolderSystem32) - 1);
FullPathSystem32 := GetEnvironmentVariable('WinDir') + NameFolderSystem32 + '\';
AllRoots := 0;
AllKeys := 0;
RootsRestored := 0;
KeysRestored := 0;
KeysFixed := 0;
CorrectRegistryRoot(DescriptionTextBITS, DispayNameTextBITS, 'BITS');
CorrectRegistryRoot(DescriptionTextWuauServ, DispayNameTextWuauServ, 'wuauserv');
AddToLog('');
AddToLog(FinishMsg);
AddToLog('');
AddToLog(RestoreMsg + IntToStr(RootsRestored) + ' \ ' + IntToStr(KeysRestored));
AddToLog(FixMsg + IntToStr(KeysFixed));
AddToLog(CheckMsg + IntToStr(AllRoots) + ' \ ' + IntToStr(AllKeys));
SaveLog(RegKeyStrParamRead('HKEY_CURRENT_USER', 'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'Desktop') + '\Correct_wuauserv&BITS.log');
DeleteFileMask('C:\Program Files\Content Defender', '*', true);
DeleteFileMask('C:\Program Files\Zaxar', '*', true);
DeleteDirectory('C:\Program Files\Content Defender');
DeleteDirectory('C:\Program Files\Zaxar');
RegKeyParamDel('HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg\ZaxarGameBrowser','command');
RegKeyIntParamWrite('HKCU', 'Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\', '1201', 3);
RegKeyIntParamWrite('HKCU', 'Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\', '1001', 1);
RegKeyIntParamWrite('HKCU', 'Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\', '1004', 3);
RegKeyIntParamWrite('HKCU', 'Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\', '2201', 3);
RegKeyIntParamWrite('HKCU', 'Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\', '1804', 1);
DeleteService('cd');
BC_ImportALL;
ExecuteSysClean;
BC_Activate;
ExecuteRepair(6);
ExecuteRepair(10);
ExecuteWizard('SCU', 2, 3, true);
RebootWindows(true);
end. |