admin 管理员组文章数量: 1184232
RavMon.exe是一个强制不显示系统的隐藏文件的 简单 病毒,顽固且有备份,涉及到很多操作。
网络安全课上的学习研究成果
运行环境:Windows XP
病毒的特性:分别见两种方式的注释
处理该病毒可以直接写 bat
也可以将 bat改为C++(vb没学过就先不考虑了)
一、批处理
@echo off
cls
echo "杀毒软件正在运行"
rem 强制结束 用户名为 当前用户的 svchost.exe这个进程
taskkill /F /FI "username eq %username%" /IM svchost.exe
rem 删除启动项里的病毒开机自启
reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v svchost /f
rem 还原病毒修改的注册表项
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL /v CheckedValue /t reg_dword /d 1 /f
rem 去掉源病毒文件的各项属性
attrib %windir%\mdm.exe -r -h -s
attrib %windir%\SVCHOST.exe -r -h -s
attrib %windir%\SVCHOST.ini -r -h -s
rem 强制删除源病毒文件
del %windir%\mdm.exe
del %windir%\SVCHOST.exe
del %windir%\SVCHOST.ini
rem 删除其它分区的病毒文件
for %%a in (c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do (
for %%b in (RavMon.exe,AutoRun.inf) do (
if exist %%a:\%%b (
attrib %%a:\%%b -s -r -h
del %%a:\%%b /q
)
)
)
pause二、C++
#include<cstdlib> //system()
#include<iostream>
#include<cstring>
#include<windows.h> //SetFileAttributes() 设置文件属性
#include<io.h> //access()
using namespace std;
int main() {
cout << "--------------------Anti-virus software is running--------------------" << endl;
//进程处理复杂,而且 目前找不到“获取进程的用户名的方法”,遂用命令行代替
system("taskkill /F /FI \"username eq %username%\" /IM svchost.exe");
//-------------------任务一:删除病毒注册表开机自启项-------------------
//system("reg delete HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run /v svchost /f");
HKEY hKEY;//一个句柄
//RegOpenKeyEx() 打开指定的注册表项。
//如果函数成功,则返回值为 ERROR_SUCCESS
if (ERROR_SUCCESS ==
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_SET_VALUE,
&hKEY)) {
// 删除 Run 子键下键值 SVCHOST
if (ERROR_SUCCESS == RegDeleteValue(hKEY, "SVCHOST")) {
printf("删除键值 SVCHOST 成功\n");
}
}
RegCloseKey(hKEY);
//-------------------任务二:修改文件夹注册表CheckedValue显示项-------------------
//system("reg add HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\Folder\\Hidden\\SHOWALL /v CheckedValue /t reg_dword /d 1 /f");
char value[4] = {01, 00, 00, 00};//要赋予注册表CheckedValue的二进制值
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\Folder\\Hidden\\SHOWALL",
0, KEY_SET_VALUE, &hKEY)) {
if (ERROR_SUCCESS == RegSetValueEx(hKEY, "CheckedValue", 0, REG_DWORD, (BYTE *) value, 4)) {
printf("修改键值 CheckedValue 成功\n");
}
}
RegCloseKey(hKEY);
//-------------------任务三:解除病毒“只读”、“隐藏”、“系统”的文件属性,并删除C:\Windows下的病毒文件-------------------
// system("attrib C:\\Windows\\mdm.exe -r -h -s");
// system("attrib C:\\Windows\\SVCHOST.exe -r -h -s");
// system("attrib C:\\Windows\\SVCHOST.ini -r -h -s");
const char *file1 = "C:\\Windows\\MDM.EXE";
const char *file2 = "C:\\Windows\\SVCHOST.exe";
const char *file3 = "C:\\Windows\\SVCHOST.ini";
//“只读”、“隐藏”、“系统”、“存档”为文件的四种基本属性。
// FILE_ATTRIBUTE_NORMAL属性 设定为一般 (取消前四种属性)
SetFileAttributes(file1, FILE_ATTRIBUTE_NORMAL);
SetFileAttributes(file2, FILE_ATTRIBUTE_NORMAL);
SetFileAttributes(file3, FILE_ATTRIBUTE_NORMAL);
// system("del %windir%\\mdm.exe");
// system("del %windir%\\SVCHOST.exe");
// system("del %windir%\\SVCHOST.ini");
if (remove(file1) == 0) { //如果成功返回 0,失败返回“EOF”( -1)
cout << "删除" << file1 << "成功!" << endl;
} else {
cout << "删除病毒备份" << file1 << "失败" << endl;
}
if (remove(file2) == 0) {
cout << "删除" << file2 << "成功!" << endl;
} else {
cout << "删除病毒备份" << file2 << "失败" << endl;
}
if (remove(file3) == 0) {
cout << "删除" << file3 << "成功!" << endl;
} else {
cout << "删除病毒备份" << file3 << "失败" << endl;
}
//-------------------任务四:删除病毒在每个盘根目录下的备份-------------------
// system("for %%a in (c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do (for %%b in (RavMon.exe,AutoRun.inf) do (if exist %%a:\\%%b (attrib %%a:\\%%b -s -r -h)))");
// system("for %%a in (c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do (for %%b in (RavMon.exe,AutoRun.inf) do (if exist %%a:\\%%b (del %%a:\\%%b /q)))");
string file4 = "C:\\RavMon.exe";
string file5 = "C:\\AutoRun.inf";
for (char c = 'C'; c <= 'Z'; ++c) {//0是a, 2是c, 25是z
const string s = string(1, c); //string( size_type length, char ch ); 即length个ch
file4.replace(0, 1, s);//循环 替换盘符
file5.replace(0, 1, s);
//cout<<file4<<" "<<file5<<endl;
if (access(file4.c_str(), 0) == 0) { //判断 RavMon.exe 是否存在
SetFileAttributes(file4.c_str(), FILE_ATTRIBUTE_NORMAL);//设置文件属性
remove(file4.c_str());
cout << "删除" << file4 << "成功!" << endl;
}
if (access(file5.c_str(), 0) == 0) { //判断 AutoRun.inf 是否存在
SetFileAttributes(file5.c_str(), FILE_ATTRIBUTE_NORMAL);//设置文件属性
remove(file5.c_str());
cout << "删除" << file5 << "成功!" << endl;
}
}
cout << endl << "按回车结束" << endl;
system("pause");
}
三、运行结果
①、批处理方式
②、C++方式(操作其实都一样,只不过C++在调试的时候多了很多输出)
版权声明:本文标题:解救被RavMon.exe控制的Adobe Flash Player! 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1771886812a3549686.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论