Browser Hijacking: Analysis of Three Techniques
Detection stack
- AIDR
- Alert
- ETL
- Query
Summary
The article explores three different techniques used by browser hijackers to manipulate user browsers on Windows. It covers direct tampering with browser preference files, scripted keypress emulation that remotely drives the browser UI, and misuse of Chromium command-line switches to sideload malicious extensions. Each method is accompanied by representative artifacts and code examples. The primary objective of these hijacks is ad-injection and unauthorized redirection, rather than credential theft or direct data exfiltration.
Investigation
The researcher reviewed malware associated with the TamperedChef/BaoLoader campaigns and identified a native module, UtilityAddon.node, leveraged to collect system identifiers and alter Firefox and Chrome preference files. A second sample showcased a browser remote access tool (BRAT) that fakes keyboard shortcuts to change the address bar, spawn new tabs, and generate fraudulent ad clicks. The third scenario involved a VBS/PowerShell-based hijacker that sets up scheduled tasks, monitors process creation via WMI, disables Chrome updates, and forces a rogue extension to load through a now-deprecated Chromium command-line switch.
Mitigation
Defenders should remove or quarantine hijacker components such as UtilityAddon.node, malicious .reg entries, and suspicious PowerShell scripts. Disable or delete scheduled tasks that invoke unknown or untrusted scripts. Restore browser preference files from known-good backups and apply strict file permissions. Monitor or block attempts to use the legacy Chromium –load-extension switch and verify that Chrome’s automatic update mechanisms remain enabled.
Response
On detection, look for the artifacts described and track changes to browser preference files, registry values that interfere with updates, and atypical browser command-line parameters. Isolate impacted machines, capture volatile evidence, and perform a thorough review of installed and actively loaded extensions. Use automated remediation scripts to reset browser settings to secure defaults and re-enable update services. Finally, monitor any related network indicators that could signal command-and-control activity.
"graph TB %% Class definitions classDef action fill:#99ccff %% Node definitions action_create_scheduled_task["<b>Action</b> – <b>T1037 Boot or Logon Initialization Scripts</b><br/>Create scheduled task using configuration.ps1 for persistence"] class action_create_scheduled_task action action_wmi_subscription["<b>Action</b> – <b>T1546.003 WMI Event Subscription</b><br/>Set up WMI event subscription that monitors chrome.exe and edge.exe processes"] class action_wmi_subscription action action_terminate_relaunch["<b>Action</b> – <b>T1547.014 Shortcut Modification / T1176 Browser Extensions</b><br/>Terminate the browser and relaunch it with a malicious extension loaded"] class action_terminate_relaunch action action_load_extension["<b>Action</b> – <b>T1176 Browser Extensions</b><br/>Load malicious extension via –loadu2011extension switch (policy DisableLoadExtensionCommandLineSwitch)"] class action_load_extension action action_disable_updates["<b>Action</b> – <b>T1176 Browser Extensions</b><br/>Disable Chrome automatic updates by applying a crafted .reg file"] class action_disable_updates action action_gather_hmac["<b>Action</b> – <b>T1548.006 Component Object Model Hijacking</b><br/>UtilityAddon.node collects SID and volume serial number, computes HMAC for Secure Preferences"] class action_gather_hmac action action_keypress_sim["<b>Action</b> – <b>T1185 Man in the Browser</b><br/>BRAT component simulates keyu2011presses to control the browser"] class action_keypress_sim action action_ad_injection["<b>Action</b> – <b>Result</b><br/>Manipulate address bar, inject ads, and steal data"] class action_ad_injection action %% Connections action_create_scheduled_task –>|enables| action_wmi_subscription action_wmi_subscription –>|triggers| action_terminate_relaunch action_terminate_relaunch –>|uses| action_load_extension action_terminate_relaunch –>|uses| action_disable_updates action_create_scheduled_task –>|provides data for| action_gather_hmac action_gather_hmac –>|supports| action_keypress_sim action_keypress_sim –>|leads to| action_ad_injection "
Attack Flow
Detections
Suspicious Browser Extension Load Activity (via cmdline)
View
IOCs (HashSha256) to detect: Browser Hijacking: Three Technique Studies
View
Browser Hijacking via Preference File Modification [Windows File Event]
View
PowerShell Script Monitoring and Terminating Browser Processes [Windows Powershell]
View
Simulation Execution
Prerequisite: The Telemetry & Baseline Pre‑flight Check must have passed.
-
Attack Narrative & Commands:
The adversary has previously dropped a malicious PowerShell script named configuration.ps1 into%LOCALAPPDATA%DiagnosticNET. The script continuously monitors for browser processes (Chrome, Edge, Firefox) and terminates them, forcing the user’s browser to restart and load a malicious extension the attacker previously placed in the user’s profile. To trigger the detection, the attacker launches the script via a direct PowerShell call:- Create the hidden folder and drop the malicious script.
- Execute the script with
powershell.exeusing a clear‑text command line that matches the rule’s condition. - The script logs its activity to the console (for demo purposes) and kills the target browsers.
-
Regression Test Script:
# --------------------------------------------------------- # Regression script – reproduces the detection‑triggering activity # --------------------------------------------------------- # 1. Prepare the hidden directory $targetDir = "$env:LOCALAPPDATADiagnosticNET" if (-not (Test-Path $targetDir)) { New-Item -Path $targetDir -ItemType Directory -Force | Out-Null # Hide the directory (Get-Item $targetDir).Attributes = 'Hidden','Directory' } # 2. Drop the malicious configuration.ps1 $scriptPath = Join-Path $targetDir "configuration.ps1" @' # Malicious configuration script – terminates browsers $browsers = @("chrome", "msedge", "firefox") foreach ($proc in $browsers) { Get-Process -Name $proc -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue } Write-Output "Browser processes terminated." '@ | Set-Content -Path $scriptPath -Encoding UTF8 # 3. Execute the script via PowerShell – this should fire the Sigma rule $cmd = "$env:WINDIRSystem32WindowsPowerShellv1.0powershell.exe -ExecutionPolicy Bypass -File `"$scriptPath`"" Write-Host "Executing malicious script:" $cmd & $env:WINDIRSystem32WindowsPowerShellv1.0powershell.exe -ExecutionPolicy Bypass -File $scriptPath -
Cleanup Commands:
# --------------------------------------------------------- # Cleanup – removes artifacts created by the regression test # --------------------------------------------------------- # Stop any stray browser processes that may have been terminated # (No action needed – browsers can be restarted manually) # Remove the malicious script and hidden folder $targetDir = "$env:LOCALAPPDATADiagnosticNET" if (Test-Path $targetDir) { Remove-Item -Path $targetDir -Recurse -Force } # Optionally, clear PowerShell command‑line history Clear-History