`
oldrev
  • 浏览: 230727 次
  • 性别: Icon_minigender_1
  • 来自: 昆明
社区版块
存档分类
最新评论

D语言破解 Thunderbird 的小秘密

阅读更多
Firefox 的同门兄弟 Thunderbird 是一款优秀的电子邮件客户端。可是我在使用中却发现这家伙竟然使用 Base64 编码来加密敏感数据,真是服了它了。
要想揪出 Thunderbird 的小辫子,请 follow 以下步骤:
  1. 请搜索 \Documents and Settings\*\Application Data\Thunderbird\Profiles\ 目录下一个叫  signons.txt 的文件,秘密就藏在里面。
  2. 打开 signons.txt 你会看到 ~***= 的内容,其中 *** 就是被 base64编码后的字符串。要解码可以使用下面的简单D语言程序:

D代码
 
  1. import std.base64;  
  2. import std.stdio;  
  3.   
  4. void main()  
  5. {  
  6.     writefln(decode("***")); // 请自行替换 ***  
  7. }  
哈哈,真好玩!
分享到:
评论
2 楼 oldrev 2007-03-23  
忘记格式化了:wink:


完整解密程序:

import std.stdio;
import std.stream;
import std.regexp;
import std.base64;

const char[] Path =
`C:\Documents and Settings\****yourName****\Application Data\Thunderbird\Profiles\******\signons.txt`;
// 您的 signons.txt 文件路径

void main()
{
auto rawFile = new File;
rawFile.open(Path);
auto file = new BufferedStream(rawFile);
char[] fileContent;

while(!file.eof)
fileContent ~= file.readLine;

foreach(m; RegExp(`mailbox://(.*)@(.*)\\=username=\\~\*\\=password=\\~(.*=)\.`).search(fileContent))
{
writefln("UserName=%s Host=%s Password=%s", m.match(1), m.match(2), decode(m.match(3)));
}

} 
1 楼 oldrev 2007-03-23  
完整解密程序:

import std.stdio;
import std.stream;
import std.regexp;
import std.base64;

const char[] Path =
    `C:\Documents and Settings\****yourName****\Application Data\Thunderbird\Profiles\******\signons.txt`;
// 您的 signons.txt 文件路径

void main()
{
    auto rawFile = new File;
    rawFile.open(Path);
    auto file = new BufferedStream(rawFile);
    char[] fileContent;
   
    while(!file.eof)
        fileContent ~= file.readLine;

    foreach(m; RegExp(`mailbox://(.*)@(.*)\\=username=\\~\*\\=password=\\~(.*=)\.`).search(fileContent))
    {
        writefln("UserName=%s   Host=%s   Password=%s", m.match(1), m.match(2), decode(m.match(3)));
    }

}

相关推荐

Global site tag (gtag.js) - Google Analytics