Аннотация
В данной статье приведено описание механизма защиты файлов Windows (WFP).
Дополнительная информация
Защита файлов Windows (WFP) служит для предотвращения перезаписи программами важных файлов операционной системы. Такие файлы нельзя перезаписывать, поскольку они используются как самой операционной системой, так и другими программами. Защита таких файлов необходима для предупреждения возможных неполадок в работе операционной системы и установленного программного обеспечения.
Механизм WFP отвечает за защиту важных системных файлов, устанавливаемых вместе с Windows (например, файлы с расширениями dll, exe, ocx и sys, а также некоторые шрифты True Type). Проверка правильности версии защищенных системных файлов производится с помощью подписей файлов и файлов каталога, созданных в процессе подписывания. Замена защищенных файлов операционной системы возможна только посредством следующих механизмов.
-
При установке пакетов обновления для Windows с помощью программы Update.exe.
-
При установке исправлений с помощью программ Hotfix.exe и Update.exe.
-
При обновлении операционной системы с помощью программы Winnt32.exe.
-
При использовании веб-узла Windows Update.
Если для замены защищенного файла используется другой способ, функция WFP восстанавливает исходные файлы. При установке важных системных файлов установщик Windows не устанавливает и не заменяет их самостоятельно, а всегда использует механизм WFP, обращаясь к нему с запросом установки или замены защищенных файлов.
Принцип работы механизма защиты файлов Windows
Для защиты файлов операционной системы в WFP предусмотрены два механизма. Первый механизм работает в фоновом режиме и активируется после того, как WFP получает уведомление об изменении папки для файла из защищенной папки. После получения этого уведомления WFP определяет, какой файл был изменен. Если был изменен защищенный файл, WFP находит в файле каталога подпись защищенного файла для проверки правильности версии нового файла. Если версия является неправильной, новый файл заменяется исходным из папки кэша (если он там имеется) или источника установки. Поиск файла допустимой версии производится в следующем порядке.
-
Папка кэша (по умолчанию %systemroot%\system32\dllcache).
-
Путь к сетевому источнику установки, если он был использован для установки операционной системы.
-
Компакт-диск Windows, если он был использован для установки операционной системы.
Если файл удается найти в папке кэша или выполняется автоматическое обнаружение источника установки, файл заменяется без уведомления пользователя. Если WFP не удается автоматически найти файл ни в одном из этих местоположений, пользователь получает одно из следующих сообщений, в которых имя_файла — это имя замененного файла, а продукт — это используемый продукт Windows.
-
Защита файлов WindowsФайлы, нужные для правильной работы Windows, были заменены неизвестными версиями. Для обеспечения стабильной работы системы Windows необходимо восстановить оригинальные версии этих файлов. Вставьте компакт-диск продукт.
-
Защита файлов WindowsФайлы, нужные для правильной работы Windows, были заменены неизвестными версиями. Для обеспечения стабильной работы системы Windows необходимо восстановить оригинальные версии этих файлов. Сетевая папка, из которой необходимо скопировать эти файлы, \\сервер\общий_ресурс, недоступна. Обратитесь к системному администратору или вставьте компакт-диск продукт.
Примечание. Если вход в систему был выполнен с учетной записью, которая не дает прав администратора, описанные выше диалоговые окна не отображаются. В таком случае эти диалоговые окна отображаются только после входа в систему с правами администратора. WFP ждет входа в систему администратора в следующих ситуациях.
-
Запись реестра SFCShowProgress отсутствует или содержит значение 1, а сервер настроен на проверку при каждом запуске компьютера; в таком случае WFP ждет входа с консоли, поэтому сервер RPC не запускается, пока не будет выполнена проверка. В течение этого времени компьютер не защищен.
Примечание. При этом сохраняется возможность подключения сетевых дисков и использования системных файлов, и для входа на сервер можно использовать службы терминалов. WFP не считает эти операции консольным входом и находится в состоянии ожидания неограниченно долго.
-
WFP должен восстановить файл из общего сетевого ресурса. Такая ситуация может возникнуть в случае, если в папке Dllcache нет требуемого файла или он поврежден. В этом случае у WFP может не быть требуемых учетных данных для доступа к общему ресурсу на носителе для установки по сети.
В качестве второго механизма защиты, обеспечиваемого WFP, используется средство проверки системных файлов (файл Sfc.exe). В конце работы режима графического интерфейса программы установки это средство проверяет, не были ли защищенные файлы изменены программами, установленными автоматически. Кроме того, программа Sfc.exe проверяет все файлы каталога, используемые для отслеживания правильных версий файлов. В случае отсутствия или повреждения любого из файлов каталога он переименовывается и восстанавливается из папки кэша. Если в папке кэша файл найти не удается, WFP запрашивает установку соответствующего носителя с новой копией файла каталога.
Средство проверки системных файлов предоставляет администратору возможность проверить версии всех защищенных файлов. Кроме того, это средство проверяет и повторно заполняет папку кэша (по умолчанию — %SystemRoot%\System32\Dllcache) Если папка кэша повреждена или стала непригодной для использования, для восстановления ее содержимого используется команда sfc /scanonce или sfc /scanboot.
Параметр SfcScan из раздела системного реестра
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon может принимать три значения. Возможные значения параметра SfcScan:
-
0x0 — не проверять защищенные файлы после перезагрузки системы (по умолчанию);
-
0x1 — проверять все защищенные файлы после каждой перезагрузки системы (устанавливается после запуска команды sfc /scanboot).
-
0x2 — проверить все защищенные файлы после перезагрузки системы (устанавливается после запуска команды sfc /scanonce).
По умолчанию резервные копии всех системных файлов хранятся в папке кэша, размер которой составляет 400 МБ (по умолчанию). Хранение резервных копий всех системных файлов не всегда желательно с точки зрения наличия свободного места на диске. Для изменения размера кэша измените значение параметра SFCQuota в следующем разделе реестра:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon. WFP хранит проверенные версии файлов на жестком диске в папке Dllcache. Количество хранимых файлов определяется значением параметра SFCQuota (по умолчанию 0xFFFFFFFF или 400 Мбайтов). Администратор может увеличивать или уменьшать значение параметраSFCQuota по своему усмотрению. Обратите внимание, что если для параметра SFCQuota установлено значение 0xFFFFFFFF, WFP хранит все защищенные файлы (приблизительно 2700 файлов).
Отсутствие в папке кэша копий некоторых системных файлов (независимо от значения параметра SFCQuota) возможно по двум причинам.
-
Недостаточно места на диске.
На компьютере под управлением Windows XP запись в папку Dllcache прекращается, когда на жестком диске объем оставшегося свободного места меньше суммы (600 МБ + максимальный размер файла подкачки). На компьютере под управлением Windows 2000 запись в папку Dllcache прекращается, когда на жестком диске остается менее 600 МБ свободного места.
-
Сетевая установка.
Если ОС Windows 2000 или Windows XP установлена по сети, файлы из папки i386\lang не заносятся в папку Dllcache.
Кроме того, все драйверы в файле Driver.cab являются защищенными, но в папку Dllcache не записываются. WFP восстанавливает эти файлы непосредственно из файла Driver.cab без вывода пользователю запроса на предоставление носителя исходных файлов, однако при выполнении команды sfc /scannow файлы, содержащиеся в файле Driver.cab, записываются в папку Dllcache.
Если WFP обнаруживает изменение файла, не входящего в папку кэша, выполняется проверка версии измененного файла, используемой операционной системой в текущий момент. Если используемый в текущий момент файл имеет допустимую версию, он копируется в папку кэша. Если версия файла не является допустимой или файл отсутствует в папке кэша, WFP выполняет поиск источника установки. Если его найти не удается, WFP предлагает администратору установить соответствующий носитель для замены версии файла, находящегося в папке кэша.
Местонахождение папки Dllcache указывается параметром SFCDllCacheDir (REG_EXPAND_SZ) из следующего раздела реестра:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon По умолчанию параметр SFCDllCacheDir имеет значение %SystemRoot%\System32. В качестве значения параметра SFCDllCacheDir может быть использован путь к папке на локальном диске. По умолчанию параметр SFCDllCacheDir в разделе HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon отсутствует. Таким образом, для изменения местонахождения папки кэша этот параметр необходимо добавить самостоятельно.
При запуске Windows значения параметров из раздела
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Windows File Protection WFP копируются в соответствующие параметры в разделе
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon. Следовательно, если в разделе HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Windows File Protection присутствуют параметры SfcScan, SFCQuota или SFCDllCacheDir, их значения имеют преимущество перед значениями аналогичных параметров в подразделе HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon.
Для получения дополнительных сведений о механизме WFP щелкните следующий номер статьи базы знаний Майкрософт:
222473 Настройки реестра для защиты файлов WindowsДля получения дополнительных сведений о средстве проверки системных файлов в Windows XP и Windows Server 2003 щелкните следующий номер статьи базы знаний Майкрософт:
310747 Описание средства проверки системных файлов Windows XP и Windows Server 2003 (Sfc.exe)Для получения дополнительных сведений о средстве проверки системных файлов в Windows 2000 щелкните следующий номер статьи базы знаний Майкрософт:
222471 Описание средства проверки системных файлов Windows 2000 (Sfc.exe) (Эта ссылка может указывать на содержимое полностью или частично на английском языке)
Для получения дополнительных сведений о механизме WFP посетите веб-узел корпорации Майкрософт по адресу:
http://msdn2.microsoft.com/en-us/library/aa382551.aspxДля получения дополнительных сведений об установщике Windows и механизме WFP посетите веб-узел корпорации Майкрософт по адресу:
http://msdn2.microsoft.com/en-us/library/aa372820.aspx
Нужна дополнительная помощь?
Нужны дополнительные параметры?
Изучите преимущества подписки, просмотрите учебные курсы, узнайте, как защитить свое устройство и т. д.
From Wikipedia, the free encyclopedia
Windows File Protection (WFP), a sub-system included in Microsoft Windows operating systems of the Windows 2000 and Windows XP era, aims to prevent programs from replacing critical Windows system files.[1][2][3] Protecting core system files mitigates problems such as DLL hell with programs and the operating system. Windows 2000, Windows XP and Windows Server 2003 include WFP under the name of Windows File Protection; Windows Me includes it as System File Protection (SFP).
With Windows File Protection active, replacing or deleting a system file that has no file lock to prevent it getting overwritten causes Windows immediately and silently to restore the original copy of the file. The original version of the file is restored from a cached folder which contains backup copies of these files. The Windows NT family uses the cached folder %SystemRoot%\System32\Dllcache. Windows Me caches its entire set of compressed cabinet setup files and stores them in the %windir%\Options\Install folder.
WFP covers all files which the operating system installs (such as DLL, EXE, SYS, OCX etc.), protecting them from deletion or from replacement by older versions. The digital signatures of these files are checked using code signing and the signature catalog files stored in the %SystemRoot%\system32\CatRoot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE} folder. Only certain operating system components such as the Package Installer (Update.exe) or Windows Installer (Msiexec.exe) can replace these files. Changes made using any other methods in order to replace these files are reverted and the files are silently restored from the cache. If Windows File Protection cannot automatically find the file in the cached folder, it searches the network path or prompts the user for the Windows installation disc to restore the appropriate version of the file.
WFP integrates with the System File Checker (sfc.exe) utility.
Windows Vista and later Windows systems do not include Windows File Protection, but they include Windows Resource Protection which protects files using ACLs. Windows Resource Protection aims to protect core registry keys and values and prevent potentially damaging system configuration changes, besides operating system files.
The non-use of ACLs in Windows File Protection was a design choice: Not only did it allow operation on non-NTFS systems, but it prevented those same «bad» installers from failing completely from a file access error.
- ^ Configuring Windows 2000 without Active Directory. Syngress. 2001. pp. 99–105. ISBN 978-0-08-047672-8. Retrieved 2025-03-01.
- ^ Carvey, H. (2012). Windows Forensic Analysis Toolkit: Advanced Analysis Techniques for Windows 7. Syngress. p. 180. ISBN 978-1-59749-728-2. Retrieved 2025-03-01.
- ^ Hart-Davis, G. (2006). Mastering Windows XP Home Edition. Wiley. p. 439. ISBN 978-0-7821-5059-9. Retrieved 2025-03-01.
- Overview of Windows File Protection
- Registry settings for Windows File Protection
- Whitepaper on Windows File Protection
- Overview of System File Protection (Windows Me)
- Hacking Windows File Protection
- Effective Files Protection Tool
Материал из РУВИКИ — свободной энциклопедии
Защита файлов Windows (англ. Windows File Protection, WFP) — технология, позволяющая запретить программам изменять или удалять наиболее важные системные файлы операционных систем семейства Windows. Защита критически важных системных файлов позволяет избежать ряда серьёзных проблем и сбоев в работе операционной системы и прикладного программного обеспечения, например, DLL hell.
Названия в различных версиях Windows:
- Защита файлов Windows — Windows 2000, Windows XP, Windows Server 2003.
- System File Protection — Windows ME.
- Защита ресурсов Windows — Windows Vista. Строго говоря, является другой технологией, но принцип работы схожий: на основе ACL проверяется, может ли тот или иной пользователь осуществлять операции с файлами (не только системными). Ещё одна цель — защита ключевых значений реестра.
Когда Windows File Protection активна, перезапись или удаление незаблокированного системного файла приводит к немедленному восстановлению его оригинальной версии, которая хранится в специальной системной папке. В операционных системах семейства Windows NT это %WINDIR%\system32\Dllcache
, в Windows ME — %SYSTEMROOT%\Options\Install
.
Все файлы, устанавливаемые операционной системой, защищены от изменения или удаления. Цифровая подпись этих файлов хранится в каталоге %SYSTEMROOT%\system32\catRoot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}
. Изменение вышеназванных системных файлов разрешено только немногочисленным специальным компонентам, например, Установщик Windows или Установщик пакетов (англ. Package Installer). В противном случае файл возвращается в исходное состояние без каких-либо запросов или сообщений. Лишь тогда, когда Windows File Protection не удаётся найти требуемый файл самостоятельно, производится поиск в локальной сети, Интернете или выдаётся запрос пользователю с просьбой вставить установочный диск в дисковод.
- Защита ресурсов Windows
- System File Checker
- ACL
- Идентификатор безопасности
- Описание механизма защиты файлов Windows (рус.)
- Настройки реестра для защиты файлов Windows (рус.)
- Описание механизма защиты файлов системы (Windows Me) (рус.)
-
Home
-
Knowledge Base
- What Is Windows File Protection (WFP)? How to Enable/Disable It?
By Daisy | Follow |
Last Updated
What is Windows File Protection? How to disable or enable it on Windows? How does it work? If you are looking for the answers to the above questions, you can refer to this post. This post provides details about Windows File Protection for you.
What Is Windows File Protection
What is Windows File Protection? It is also called WFP. Windows File Protection first debuted with Windows 2000, followed by other subsequent versions of Windows, such as Windows XP and Windows Server 2003.
Tips:
Tip: To get more information about Windows operating systems, you can go to the MiniTool official website.
It prevents programs from replacing critical Windows system files. Programs must not overwrite these files because they are used by the operating system and other programs. Protecting these files prevents problems with programs and the operating system.
WFP protects critical system files installed as part of Windows (for example, files with .dll, .exe, .ocx, and .sys extensions, and some True Type fonts). WFP uses code signing-generated file signatures and catalog files to verify that protected system files are the correct Microsoft versions. Replacing protected system files is supported only through the following mechanisms:
- Install Windows Service Packs using Update.exe
- Hotfixes are installed using Hotfix.exe or Update.exe
- Upgrading the Operating System Using Winnt32.exe
- Windows update
How Does Windows File Protection Work
The WFP feature uses two mechanisms to protect system files. The first mechanism runs in the background. This protection is triggered after WFP receives a directory change notification for a file in the protected directory.
After WFP receives this notification, WFP determines which file was changed. If the file is protected, WFP looks for the file signature in the catalog file to determine if the new file is the correct version.
If the file version is incorrect, WFP replaces the new file with the file from the cache folder (if it is there) or from the installation source. WFP searches for the correct file in the following locations, in the following order:
- Cache folder (by default, %systemroot%\system32\dllcache).
- Network installation path, if the system was installed using network installation.
- Windows CD-ROM, if the system was installed from a CD-ROM.
The second protection mechanism provided by the WFP feature is the System File Checker tool. At the end of GUI mode installation, the System File Checker tool scans all protected files to ensure that they have not been modified by programs that used unattended installation.
The System File Checker tool also checks all catalog files to track correct file versions. If any catalog file is missing or corrupted, WFP will rename the affected catalog file and retrieve the cached version of the file from the cache folder. If a cached copy of the catalog file is not available in the cache folder, WFP functionality requests the appropriate media to retrieve a new copy of the catalog file.
How to Enable/Disable Windows File Protection
You may have to turn the Windows File Protection feature on or off in some configurations. You can enable or disable Windows File Protection via Registry Editor. Here is how to do that:
Step 1: Press the Windows key and the R key at the same time to open the Run dialog.
Step 2: Type regedit and then press Enter to open Registry Editor. You’ll be prompted for permission and please click Yes to open it.
Step 3: Navigate to the following registry key:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Step 4: Find the SFCDisable key and double-click it. If it doesn’t exist, create it by right-clicking the Winlogon folder and choosing New > DWORD (32-bit value).
Step 5: Set the value to one of the following based on your needs:
- 1 – disabled, prompt at boot to re-enable
- 2 – disabled at next boot only, no prompt to re-enable
- 4 – enabled, with popups disabled
- ffffff9d – for completely disabled
- 0 – Enabled
Step 6: Restart Windows. You may receive a message at startup that says “Windows File Protection is not active on this system. Would you like to enable Windows File Protection now? This will enable Windows File Protection until the next system restart.” Choosing Yes will reactivate Windows File Protection and the message will appear at every login until SFCDisable is set to 0 again.
Tips:
Tip: There is another way to protect your files and folder – back up them regularly. To do that, it’s recommended to use the professional backup program – MiniTool ShadowMaker. It supports backing up files, folders, partitions, as well as systems. Now, download and try it.
MiniTool ShadowMaker TrialClick to Download100%Clean & Safe
About The Author
Position: Columnist
Having been an editor at MiniTool since graduating college as an English major, Daisy specializes in writing about data backups, disk cloning, and file syncing as well as general computer knowledge and issues. In her free time, Daisy enjoys running and going with friends to the amusement park.
Understanding Windows File Protection (WFP)
Greetings, tech enthusiasts and computer users alike! Today, we’re delving into the world of Windows File Protection (WFP) and uncovering the mysteries behind this essential feature found in Microsoft Windows operating systems.
Have you ever wondered what happens when a critical system file on your Windows computer gets corrupted or maliciously altered? That’s where Windows File Protection steps in to save the day! Let’s dive into the nitty-gritty details and discover how this incredible feature works.
Key Takeaways:
- Windows File Protection (WFP) is a built-in feature in Microsoft Windows operating systems that helps protect critical system files from corruption or unauthorized modifications.
- WFP constantly monitors the integrity of critical system files and restores them to their original state if any modifications are detected.
How does Windows File Protection work?
In a nutshell, Windows File Protection is like a guardian angel watching over your precious system files and ensuring their well-being. If any unauthorized modifications or alterations are made to these critical files, WFP has got your back.
Here’s a glimpse into how Windows File Protection works its magic:
- Monitoring: WFP constantly monitors the integrity of critical system files by checking their digital signatures against a catalog of known good files. This catalog acts as a reference, ensuring that the files haven’t been tampered with.
- Restoration: If Windows File Protection detects any modifications to these critical files, it immediately swings into action. It restores the original, unmodified version of the file from a cache that is stored on the system.
- Protection: This process ensures the stability and security of the Windows operating system. By guarding against unauthorized modifications, Windows File Protection helps maintain system reliability and prevents potential security vulnerabilities.
Why is Windows File Protection important?
Windows File Protection plays a vital role in the overall performance and security of your Windows computer. Here are a couple of key reasons why this feature is so important:
- System Stability: By constantly monitoring and restoring critical system files, Windows File Protection ensures the stability of your operating system. It prevents incompatible, modified, or corrupted files from causing system crashes or errors.
- Security: Unauthorized modifications to system files can potentially introduce security vulnerabilities. Windows File Protection safeguards against such alterations, reducing the risk of malware attacks and unauthorized access to your system.
With Windows File Protection silently safeguarding your system files, you can rest easy knowing that your Windows operating system is being protected from potential disasters.
Conclusion
We hope this article has shed some light on the importance and functionality of Windows File Protection. By constantly monitoring critical system files, WFP ensures system stability and safeguards against potential security risks. So, next time you boot up your Windows computer, thank Windows File Protection for silently doing its job in the background!
Thank you for reading, and stay tuned for more exciting tech insights coming your way.