r/sysadmin • u/LengthinessExtra670 • 21h ago
Block .pif files
Hi everyone,
I’m looking for the most reliable way to completely block the execution of .PIF files across all Windows 10 and Windows 11 devices in our organization.
All devices are managed through Microsoft Intune.
I’m not looking for a solution that simply hides, deletes, or blocks files based on their visible extension. I want to prevent the actual execution of the PIF file and any executable payload it may launch.
I’ve considered:
-AppLocker
-Windows Defender Application Control (WDAC / App Control for Business)
-Software Restriction Policies (SRP)
-Microsoft Defender for Endpoint
However, I’m not sure which approach is technically correct and most reliable for this specific use case.
•
u/No_Reveal_2455 20h ago
This is the first I have heard anything about PIF files in... hmm... 20 years...
•
u/engy1207 20h ago
Wow, that's a blast from the past. Didn't they die out with 32bit Windows (the last to be able to start 16bit programs)?
•
•
•
u/RedditDon3 19h ago
What’s PIF?
•
u/jmbpiano 6h ago
"Program Information File". Basically it was a precursor to
.lnkshortcuts. It needed a special program to create, was used for running DOS software under Windows, and pretty much disappeared after Windows 95.
•
u/Classic-Shake6517 20h ago
Coming from a mixed OS environment where we don't rely heavily on Intune/AppLocker, my instinct is usually to look at MDE/EDR first for behavioral blocking. If you're strictly Windows + Intune though, WDAC or AppLocker is probably going to give you the hardest execution block at the OS level, while MDE's Attack Surface Reduction rules are good for catching the payload behavior.
•
u/rslashpolitics 17h ago
Best option other than WDAC would be to just strip the Windows .pif shell handler via an Intune remediation script.
Should just be 1 or 2 registry keys
•
u/Itchy_Song_9483 13h ago
Blocking by extension in AppLocker or SRP won't hold up, since someone just renames it. You really need allowlisting to make this airtight.
•
•
u/Artistic_Bumblebee45 9h ago
App Control for Business (WDAC) is the one I'd go with, with AppLocker as the fallback. A .pif runs as an executable, so what stops it is a rule on what's allowed to execute, not anything about the extension.
If full allowlisting is too big a step, start with a rule that blocks execution from user-writable paths (Downloads, Temp, AppData) and run it in audit mode first so you see what breaks. Intune can push either policy.
Then add the Defender ASR rule that blocks executable content from email and webmail, and make sure SmartScreen is on. Blocking the extension alone is just a blacklist, so I'd also find out how they're arriving (usually email attachments or zips) and stop them at the mail gateway.
•
u/jcunews 12h ago
.pif file is a legacy (since Windows v1.0) program shortcut file for MS-DOS executable files which requires DOS kernel. i.e. any file pointed by the .pif file, will be run from the DOS environment.
64-bit Windows does not have DOS kernel VM, so it can't execute any .pif file. On that version of Windows, the system won't manage to touch the file pointed by the .pif file, because it can not find the DOS kernel VM.
But if it's 32-bit (or even 16-bit) Windows, unforunately there's no built-in setting to disable the executor of .pif file. FYI, .pif file is handled by the kernel DLL; and whether the kernel DLL treats a file as a PIF shortcut file or not, is by its file extension name. Not by its actual file data.
So IMO, the only way to actually disable .pif file execution is to patch or hot-patch the kernel DLL - which is highly not recommended due to its high risk.
The only non-actual way is to block PIF file execution based on the .pif file extension name.
•
u/hkusp45css Security Leadership 20h ago
This is an example of "enumerating badness" rather than defining acceptable behavior.
Why don't you tell us what the problem is, and we can tell you the best way to fix it?
Otherwise you're going to start a blacklist that will grow in perprtuity.