123
返回列表 发新帖
楼主: 御坂14857号
收起左侧

[病毒样本] 可疑ps1脚本

[复制链接]
呼啸山庄
发表于 3 天前 | 显示全部楼层
图钉鱼 发表于 2025-6-10 23:04
这段PowerShell脚本执行明显的恶意特征:

1. 创建隐藏目录:在%APPDATA%\Microsoft\Credentials创建暂存 ...

喵,我是直接改原本的ps1搞出来的。md5: 8d5efb1a0fa37e96bf12fa6789017ecf  LightYellow4.pfx
  1. # 从加密数据中解密出证书压缩包
  2. $stagingDir = "."
  3. if (-not (Test-Path $stagingDir)) {
  4.     New-Item -ItemType Directory -Path $stagingDir -Force | Out-Null
  5. }

  6. $zipPath = Join-Path $stagingDir 'LightYellow4.zip'
  7. $data = [byte[]]::new($hexData.Length/2)
  8. for($i=0; $i -lt $data.Length; $i++) {
  9.     $data[$i] = [Convert]::ToByte($hexData.Substring($i*2,2),16)
  10. }
  11. [IO.File]::WriteAllBytes($zipPath, $data)

  12. # 睡眠
  13. Start-Sleep -Seconds (Get-Random -Minimum 4 -Maximum 9)

  14. # 解压出证书
  15. $extractPath = $stagingDir
  16. Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force

  17. # 睡眠
  18. Start-Sleep -Seconds (Get-Random -Minimum 3 -Maximum 7)

  19. # 解压恶意文件
  20. $drvFile = Join-Path $extractPath 'LightYellow4.pfx'
  21. $drvContent = [IO.File]::ReadAllBytes($drvFile)

  22. $startMarker = [byte[]]([System.Text.Encoding]::ASCII.GetBytes("<<MARINA_START>>"))
  23. $endMarker = [byte[]]([System.Text.Encoding]::ASCII.GetBytes("<<MARINA_END>>"))

  24. $startIndex = -1
  25. $endIndex = -1

  26. for ($i = 0; $i -lt ($drvContent.Length - $startMarker.Length); $i++) {
  27.     $match = $true
  28.     for ($j = 0; $j -lt $startMarker.Length; $j++) {
  29.         if ($drvContent[$i + $j] -ne $startMarker[$j]) {
  30.             $match = $false
  31.             break
  32.         }
  33.     }
  34.     if ($match) {
  35.         $startIndex = $i
  36.         break
  37.     }
  38. }

  39. for ($i = 0; $i -lt ($drvContent.Length - $endMarker.Length); $i++) {
  40.     $match = $true
  41.     for ($j = 0; $j -lt $endMarker.Length; $j++) {
  42.         if ($drvContent[$i + $j] -ne $endMarker[$j]) {
  43.             $match = $false
  44.             break
  45.         }
  46.     }
  47.     if ($match) {
  48.         $endIndex = $i + $endMarker.Length
  49.         break
  50.     }
  51. }

  52. $cleanDrvContent = if ($startIndex -ne -1 -and $endIndex -ne -1) {
  53.     $secondStartIndex = -1
  54.     for ($i = $endIndex; $i -lt ($drvContent.Length - $startMarker.Length); $i++) {
  55.         $match = $true
  56.         for ($j = 0; $j -lt $startMarker.Length; $j++) {
  57.             if ($drvContent[$i + $j] -ne $startMarker[$j]) {
  58.                 $match = $false
  59.                 break
  60.             }
  61.         }
  62.         if ($match) {
  63.             $secondStartIndex = $i
  64.             break
  65.         }
  66.     }
  67.    
  68.     if ($secondStartIndex -ne -1) {
  69.         $drvContent[$endIndex..$secondStartIndex]
  70.     } else {
  71.         $drvContent[$endIndex..$drvContent.Length]
  72.     }
  73. } else {
  74.     $drvContent
  75. }

  76. Start-Sleep -Seconds (Get-Random -Minimum 2 -Maximum 5)

  77. [IO.File]::WriteAllBytes($drvFile, $cleanDrvContent)
复制代码



评分

参与人数 1人气 +1 收起 理由
wwwab + 1

查看全部评分

ANY.LNK
发表于 前天 23:47 | 显示全部楼层
微软触发自动上报,后报告Trojan:Script/Wacatac.H!ml
两个DLL均自动上报4eaaf5f985f897a926fa85b08f0c8495c560ef1b1d62d34e84ab2def767f4714报告Trojan:Win32/Cloxer,另一个机器学习Trojan:Win32/Wacatac.H!ml
您需要登录后才可以回帖 登录 | 快速注册

本版积分规则

手机版|杀毒软件|软件论坛| 卡饭论坛

Copyright © KaFan  KaFan.cn All Rights Reserved.

Powered by Discuz! X3.4( 沪ICP备2020031077号-2 ) GMT+8, 2025-6-14 05:54 , Processed in 0.079416 second(s), 15 queries .

卡饭网所发布的一切软件、样本、工具、文章等仅限用于学习和研究,不得将上述内容用于商业或者其他非法用途,否则产生的一切后果自负,本站信息来自网络,版权争议问题与本站无关,您必须在下载后的24小时之内从您的电脑中彻底删除上述信息,如有问题请通过邮件与我们联系。

快速回复 客服 返回顶部 返回列表