"Christoph Schneegans" <
chri...@schneegans.de> schrieb:
> Stefan Kanthak schrieb:
>
>> [ Windows Defender Application Control (WDAC) ]
>>
>>> %windir% gebe ich bewusst nicht frei - die Dateien darin sind ohnehin
>>> alle signiert, und Microsofts Vorlage definiert etliche "Signer".
>>
>> Wegen Letzteren laeuft der von den VOLLIDIOTEN aus Redmond in JEDES
>> Benutzerprofil gekuebelte SCHROTT wie Teams (IGITT!) oder OneDrive.
>
> Teams ist unter Windows 11 eine (vorinstallierte) Store-App.
Dann muesste sie (spaetestens waehrend der Installation vor der ersten
Benutzeranmeldung, z.B. per SetupComplete.cmd) deprovisioniert werden
koennen.
--- SetupComplete.cmd ---
Rem Copyright © 2009-2022, Stefan Kanthak <
stefan....@nexgo.de>
Rem Prevent accidental execution
If Not "%USERNAME%" == "SYSTEM" Exit /B
If /I Not "%USERPROFILE%" == "%SystemRoot%\System32\Config\SystemProfile" Exit /B
If /I Not "%~f0" == "%SystemRoot%\Setup\Scripts\SetupComplete.Cmd" Exit /B
Call :REDIRECT %* 0<NUL: 1>"%SystemRoot%\Setup\Scripts\SetupComplete.Out" 2>"%SystemRoot%\Setup\Scripts\SetupComplete.Err"
Exit /B
:REDIRECT
Rem Remove provisioned apps
"%SystemRoot%\System32\DISM.Exe" /Online /Get-ProvisionedAppxPackages /Format:Table | "%SystemRoot%\System32\FindStr.Exe" /B
/C:"PackageName: " 1>"%SystemRoot%\Setup\Scripts\SetupComplete.Tmp"
For /F "Tokens=2 UseBackQ" %%? In ("%SystemRoot%\Setup\Scripts\SetupComplete.Tmp") Do "%SystemRoot%\System32\DISM.Exe" /Online
/Remove-ProvisionedAppxPackage /PackageName:%%?
RmDir "%SystemRoot%\System32\Microsoft\Crypto\RSA\MachineKeys"
Rem Disable offer for permanent ACL change on inaccessible directories in 'File Explorer' (KB950934)
For %%? In ("%SystemRoot%\Security\Audit"
"%SystemRoot%\ServiceProfiles\LocalService"
"%SystemRoot%\ServiceProfiles\NetworkService"
"%SystemRoot%\SystemTemp"
"%SystemRoot%\Temp") Do "%SystemRoot%\System32\Attrib.Exe" +H +R +S "%%?"
For %%? In ("%SystemRoot%\SystemTemp"
"%SystemRoot%\Temp") Do ("%SystemRoot%\System32\CACLs.Exe" "%%?" /S
Rem "%SystemRoot%\System32\ICACLs.Exe" "%%?" /Deny *S-1-1-0:(IO)(OI)(X))
--- EOF ---
> %LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe existiert aber auch in
> Windows 11.
Das wird von dem bei jeder Benutzeranmeldung mit neuem Profil gestarteten
%SystemRoot%\SysWoW64\OneDriveSetup.exe dorthin gerotzt.
Abhilfe ohne SAFER/AppLocker/WDAC: diese Datei per SetupComplete.cmd
loeschen, und fuer den Fall, dass sie von einem Update wiederhergestellt
werden sollte, den Registry-Eintrag im "RunOnce"-Schluessel des Default-
Benutzerprofils loeschen.
Abhilfe mit SAFER/AppLocker/WDAC: diese Datei per Pfadregel blockieren.
Ob die von den Spezial-Eksperten mitgelieferte Leiche
"%SystemRoot%\System32\Tasks\OneDrive Standalone Update Task-S-1-5-21-506450434-4066129981-3206064658-500"
noch Unheil anrichtet weiss ich nicht mehr...
>> Sollten Signaturregeln (wie bei SAFER/AppLocker) Vorrang vor Pfadregeln
>> haben, denn liesse sich dieses UEBLE DREXZEUX auch nicht mehr mit einer
>> expliziten Verbotsregel fuer %SystemDrive%\Users\ bzw. %USERPROFILE%,
>> %LOCALAPPDATA%, %APPDATA%, %TEMP% etc. (d.h. umleitbare Verzeichnisse)
>> blockieren.
>
> Sowohl
>
> New-CIPolicyRule -Deny -FilePathRule "%OSDrive%\Users\*";
>
> als auch
>
> New-CIPolicyRule -Deny -FilePathRule "OneDrive.exe";
>
> blockieren OneDrive.exe;
>
> New-CIPolicyRule -Deny -FilePathRule "%OSDrive%\Program Files\WindowsApps\MicrosoftTeams*";
>
> blockiert Teams.
SCHOEHOEHOEN!
Stefan
--
<
https://www.duden.de/rechtschreibung/Kanthaken>