痴迷系列 将李代桃大法:新式“白行使”华晨远控木马分析

痴迷系列 将李代桃大法:新式“白行使”华晨远控木马分析

痴迷系列

国产偷拍自拍在线0x00 弁言

“白行使”是木马起义主动谨防类软件的一种常用手法。国内较早一批“白行使”木马是通过系统文献rundll32.exe启动一个木马dll文献,之后又发展出劫持正当软件的dll组件来加载木马dll的挫折面容。

跟着安全软件对“白行使”的谨防机制日益完善,木马也在神志蜕变。近期,360QVM引擎团队发现“华晨同步民众”远控木马眷属汲取了比较另类的“白行使”本事:该木马行使白文献加载dll文献后,再次启动白文献并卸载白程度内存空间,然后再行填充病毒代码实际。

这种“将李代桃”的手法,使得病毒代码均通过白程度主模块实际,大概绕过大宗安全软件的主动谨防礼貌,具有较强的存活才调。以下是对此木马详实的本事分析:

0x01 木马分析

该木马伪装成“好意思女图片”通过酬酢软件、电子邮件等面容传播,一朝中招,电脑将被黑客发送提醒实际录像头监控、屏幕监控等辛苦远离行为。当今已知该木马主要变种达到22个。

enter image description here

图:“华晨同步民众”远控木马及变种

enter image description here

图:木马实际经过

“华晨同步民众”木马文献:

enter image description here

enter image description here

好意思女图片.exe:运行后会开释update.exe、ETComm.dll、wc.dat这三个文献,并运行update.exe。这种“三合一”的打包面容比拟压缩包更利于木马传播。

update.exe:汜博网罗的ET语音启动循序 ETComm.dll:用于劫持汜博循序的木马dll文献 wc.dat:zlib压缩加密的辛苦远离木马

咱们最初从ETComm.dll开端分析:

ETComm.dll分析经过

DllMain中最初取得模块圆善旅途

enter image description here

比较自己圆善旅途是否为C:\$WinBackUP.H1502\BinBackup\Images\update.exe 要是不在C:\$WinBackUP.H1502\BinBackup\Images目次下则将ETComm.dll、wc.dat、update.exe拷贝昔日,接下来凯旋参预100016A0

enter image description here

100016A0进来以后最初看望C:\$WinBackUP.H1502\BinBackup\Images\wc.dat

enter image description here

苦求一段内存后将wc.dat的内容读进去

enter image description here

将读出来的文献内容的前四位与0x36异或,得出0x14E00

enter image description here

将解密出来的0x14e00给到一个变量

紧接着就苦求出来一块0x14E00大小的内存

之后将这些数据四肢参数传递到Zlib的解压函数中

enter image description here

解出来的数据如下

enter image description here

由此咱们不错得出wc.dat的结构,第一个DWORD存放的是UnpackFileSize,之后的数据存放的是压缩后的文献数据,此时是最佳的dump时机。

Dump出来的文献:

enter image description here

接下来是为内存运行exe作念准备了

alignPEToMem函数主要作用为加载PE到内存,该函数主要内容为对其exe节数据进行启动化操作。AttachPE主要作用为创建外壳程度(汜博网罗ET语音启动循序),并替换程度数据然后实际简直的病毒代码

enter image description here

咱们要点来看下AttachPE函数的行为:

最初挂起样式再次运行C:\$WinBackUP.H1502\BinBackup\Images\update.exe

enter image description here

调用GetThreadContext取得信息决议程度的线程句柄

enter image description here

得到的信息存放在结构体lpContext中,接着读取了决议程度的lpContext结构体中Ebx+8的数据。

[lpContext.Ebx+8]处存的是外壳程度的加载基址,该决议程度的基址为0x00400000

enter image description here

动态取得ntdll的ZwUnmapViewOfSection并调用,卸载决议程度原外壳内存数据

enter image description here

再行在决议傀儡程度中苦求傀儡代码用到的内存,0x00400000大小为2C000

enter image description here

enter image description here

内存苦求告捷后在傀儡程度的Context.ebx+8中写入新的基址(因为两个文献基址皆为0x400000,是以这一步并莫得什么用,可是要是关于两个基址不雷同的文献这一步就终点必要了)

enter image description here

然后在新苦求的内存中写入依然伸开了统统节数据的病毒代码,大小为0x2C000

enter image description here

重置运行环境中的进口地址,新的OEP为基址+0x0002A820

enter image description here

更新傀儡程度运行环境后归附傀儡程度运行

enter image description here

至此ETComm.dll的任务依然完成,凯旋退出了程度

enter image description here

接下来咱们来分析被偷梁换柱的update.exe程度

从进口点咱们不错看出是UPX加壳

enter image description here

凯旋ESP定律到循序OEP,进口点代码不错看出是VC6.0所编译

enter image description here

来到Main函数咱们不错看到先是调用了一些sleep(0)

enter image description here

后头有一些字符串单字节赋值,咱们不错看出他拼出来的字符串是Kernel32.dll和GetMoudleFileNameA,分辩给到了变量LibFileName和ProcName

enter image description here

动态取得GetMoudleFileNameA

enter image description here

通过GetMoudleFileNameA取得到文献场所旅途后,将该旅途写入注册表四肢启动项,启动项称呼为“Realtek玄妙晰音频解决器”

enter image description here

enter image description here

取得资源中的名为“dll”的资源

enter image description here

enter image description here

解密算法为

xor 0xF1
add 0xF1

中间有好多sleep(0)作念烦闷

enter image description here

解出来的文献

enter image description here

Dump出来是dll省略不雅察发现是华晨远控(Gh0st修改)

enter image description here

接续往下便是内存加载dll。消除系统的LoadLibrary和GetProcAddress来我方达成则会使dll无谓落地,其见解是规避安全软件的云查杀。

LoadLibrary的达成经过如下:

苦求内存,写入PE头数据

enter image description here

轮回拷贝各个节数据

enter image description here

处理重定位

enter image description here

读取dll的引入表部分,加载引入表部分需要的,并填充需要的函数进口的果真地址

enter image description here

dll

enter image description here

修改各个节内存属性,单独建立其对应内存页的属性

enter image description here

enter image description here

实际DllMain函数

enter image description here

enter image description here

GetProcAddress达成经过:

enter image description here

调用自写GetProcAddress取得“Fi”导出函数并调用

enter image description here

Fi函数庄重将通盘远控实际起来了。

以下是远控基本信息:

远控上线地址:dddd.ndiii.com
端口:2012
分组称呼:Default
远控官网:1cfK9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8Y4N6%4N6#2)9J5k6h3A6A6L8X3A6A6L8X3N6D9N6s2y4Z5i4K6u0W2j5$3!0E0i4K6u0r3

“华晨同步民众”官网堪称“领有国度政府机关认证,与稠密安全厂商均有和洽”,骨子上迷漫是其握造的。

enter image description here

enter image description here

0x02 回想

通过以上分析咱们看出,“华晨同步民众”远控木马的新颖之处,在于行使白程度内存运行exe,内存运行dll,简直的病毒文献并不落地,仅存活在内存当中,具有较强的免杀才调。

左证VirusTotal对此木马较新变种样本的扫描成果,57款杀毒软件中有17款不错将其检出,检出率约为30%:

enter image description here痴迷系列