This configuration prevents Safe Browsing warnings on Mozilla Firefox during phishing simulation campaigns. It uses Group Policy Objects in Active Directory.
Unlike Chrome and Edge, Firefox does not apply the urlclassifier.skipHostnames preference if distributed via Registry/Preferences GPO (the preference appears in about:policies but not in about:config on Firefox 140+). The only working method is to write a user.js file directly in the user profile folder, distributed via a PowerShell script as a Startup Script of the GPO.
Prerequisites
- Active Directory Domain Services (AD DS) running
- Domain Admin credentials
- Mozilla Firefox installed on clients (version 102 ESR or later)
- Access to Group Policy Management Console (gpmc.msc)
- Ability to enable PowerShell script execution via GPO
ℹ️ Note: For this configuration, Firefox ADMX templates are not required. The urlclassifier.skipHostnames preference is managed entirely via a PowerShell script that writes the user.js file in user profiles.
Step 1: Enable PowerShell script execution via GPO
By default, Windows blocks the execution of unsigned PowerShell scripts. Without this configuration, the whitelist script will not run.
- Open Group Policy Management Console (gpmc.msc)
- Create or modify the target GPO (see Step 2 to create it)
- Navigate to:
Computer Configuration → Policies → Administrative Templates
→ Windows Components → Windows PowerShell
- Open Turn on Script Execution → Select Enabled → Choose
Allow all scripts→ OK - Go back to:
Computer Configuration → Policies → Administrative Templates
→ System → Scripts
- Open Allow logon scripts when NetBIOS or WINS is disabled → Enabled → OK
Step 2: Create and link the GPO
- Open Group Policy Management Console (gpmc.msc)
- Navigate to the target OU (Organizational Unit)
- Right-click on OU → Create a GPO in this domain, and Link it here
- Type the name:
Cyber Guru SafeBrowsing Whitelist - Firefox - Click OK
Step 3: Create the PowerShell script and copy it to SYSVOL
The script writes the user.js file in all Firefox profiles of all users on the client. It must be stored in the SYSVOL folder of the GPO (NOT in a local path on the Domain Controller, otherwise clients will not be able to reach it).
- From the GPMC console, right-click on the GPO
Cyber Guru SafeBrowsing Whitelist - Firefox→ Edit - Navigate to:
Computer Configuration → Policies → Windows Settings → Scripts (Startup/Shutdown)
- Double-click on Startup → Click the PowerShell Scripts tab → Click Show Files...
- The SYSVOL folder of the GPO will open (e.g.
\\<domain>\SysVol\<domain>\Policies\{GUID}\Machine\Scripts\Startup\) - In this folder, create a new file named
CyberGuru_Firefox_SafeBrowsing.ps1with the following content:
# CyberGuru_Firefox_SafeBrowsing.ps1
# Distributes user.js in all Firefox profiles of all users
$logFile = "C:\Windows\Temp\CyberGuru_Firefox.log"
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
Add-Content -Path $logFile -Value "--- Execution: $timestamp ---"
$domini = '10eurodisconto.com,admin-help.info,agenziaesattoriale.it,amazonn.cloud,amazonws.it,antifrodi.it,apple-cl0ud.com,bn-k.eu,bn-k.org,bolletta-digitale.it,bulanmisa.com,comunicazioni-sicure.it,courierxpress.eu,cyberguru.eu,cyberguru.it,dropcloud.it,er9.es,er9.eu,er9.it,faceb00k.it,fast-shipping.it,fotocloud.net,g0ogle.eu,go0gle.store,goolge-secure.com,human-resource.tech,icloud-secure.eu,iscrizionigratuite.it,lnkedin.eu,macrosotf.com,mastercardz.com,netfliix.org,newsupdate.cloud,oultook.cloud,pagamenti-f24.it,remote-otp.com,security-service.cloud,securetracking.online,spotfy.org,telecomunicazioniitaliane.it,tribunaleroma.eu,urgente.eu,w0rld.info'
$userJsContent = 'user_pref("urlclassifier.skipHostnames", "' + $domini + '");'
Get-ChildItem "C:\Users" -Directory | ForEach-Object {
$profilesDir = Join-Path $_.FullName "AppData\Roaming\Mozilla\Firefox\Profiles"
if (Test-Path $profilesDir) {
Get-ChildItem $profilesDir -Directory -Filter "*.default*" | ForEach-Object {
$userJs = Join-Path $_.FullName "user.js"
try {
Set-Content -Path $userJs -Value $userJsContent -Force
Add-Content -Path $logFile -Value "OK: $userJs"
} catch {
Add-Content -Path $logFile -Value "ERROR: $userJs - $_"
}
}
}
}
Add-Content -Path $logFile -Value "--- End ---"
- Return to the Startup Properties window → Click Add... → Browse... → Select
CyberGuru_Firefox_SafeBrowsing.ps1from the path\\<domain>\SysVol\<domain>\Policies\{GUID}\Machine\Scripts\Startup\just created. - Click OK twice to save
⚠️ IMPORTANT: The
.ps1file must be located in the SYSVOL folder opened from "Show Files...". If a local DC path is referenced (e.g.C:\Users\Administrator\Downloads\firefox.ps1), clients will not be able to reach it and the script will not run.
Step 4: Verification on endpoint
- On a Windows client with Firefox installed, apply the policy and restart the PC (the Startup Script runs only at boot,
gpupdate /forcedoes not re-run it):
gpupdate /force
shutdown /r /t 0
- After restart, verify that the script has been executed by opening:
C:\Windows\Temp\CyberGuru_Firefox.log
Lines like OK: C:\Users\<user>\AppData\Roaming\Mozilla\Firefox\Profiles\<profile>.default-release\user.js should appear
- Open Firefox and navigate to:
about:config
Search for urlclassifier.skipHostnames — it must contain the list of 43 Cyber Guru domains.
- Navigate to a whitelisted domain (e.g.
dropcloud.it) → no red Safe Browsing warning.
Troubleshooting
urlclassifier.skipHostnames appears in about:policies but NOT in about:config:
- The Registry/Preferences GPO method does not work on Firefox 140+. You must use the PowerShell script with
user.js(Step 3) - Verify that the
user.jsfile exists in the profile in use (check which one is active fromabout:profiles) - Close Firefox completely (also from Task Manager) and reopen it
The PowerShell script does not run (log missing):
- Verify that
.ps1has been copied to the SYSVOL folder of the GPO (not to local DC paths). Reopen "Show Files..." to check - Verify that the Execution Policy has been enabled via GPO (Step 1)
-
gpupdate /forcereloads policies but does not re-run Startup Scripts: a full client restart is required - Run
gpresult /h report.htmlon the client to confirm that the GPO is applied
The script runs but user.js is not written:
- The script runs as SYSTEM:
$env:APPDATApoints to the system profile, not user profiles. The provided script (Step 3) correctly scansC:\Users\for each profile - Verify permissions on user folders (normally SYSTEM has full access)
Safe Browsing warnings still present on subdomains:
-
urlclassifier.skipHostnamesrequires exact domain match. Add specific subdomains to the list (e.g.ciao.dropcloud.it)
user.js exists but is ignored:
- Verify that Firefox has been completely closed before opening. The
user.jsis read only at startup - Verify that the modified profile is actually the one in use (
about:profiles→ "This is the profile in use")