-
-
[原创]第十题
-
发表于: 2019-3-12 22:04 2803
-
.net crackme
拖入dnspy,得到全部源码
internal class a { // Token: 0x06000004 RID: 4 RVA: 0x00002076 File Offset: 0x00000276 public a() { } // Token: 0x06000005 RID: 5 RVA: 0x0000207E File Offset: 0x0000027E private static void a(string[] A_0) { Console.WriteLine("Please Input Serial:"); // 加密输入的序列号后是否等于4RTlF9Ca2+oqExJwx68FiA==,则成功 if (global::a.a(Console.ReadLine(), "Kanxue2019") == "4RTlF9Ca2+oqExJwx68FiA==") { Console.WriteLine("Congratulations! : )"); Console.ReadLine(); } } // Token: 0x06000006 RID: 6 RVA: 0x000020B8 File Offset: 0x000002B8 // AES算法 public static string a(string A_0, string A_1) { byte[] bytes = Encoding.UTF8.GetBytes("Kanxue2019CTF-Q1"); byte[] bytes2 = Encoding.UTF8.GetBytes(A_0); byte[] bytes3 = new PasswordDeriveBytes(A_1, null).GetBytes(32); ICryptoTransform transform = new RijndaelManaged { Mode = CipherMode.CBC }.CreateEncryptor(bytes3, bytes); MemoryStream memoryStream = new MemoryStream(); CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write); cryptoStream.Write(bytes2, 0, bytes2.Length); cryptoStream.FlushFinalBlock(); byte[] inArray = memoryStream.ToArray(); memoryStream.Close(); cryptoStream.Close(); return Convert.ToBase64String(inArray); } // Token: 0x04000003 RID: 3 private const int b = 256; // Token: 0x04000004 RID: 4 private const string a = "Kanxue2019CTF-Q1"; }
base64(AES(sn)) = '4RTlF9Ca2+oqExJwx68FiA=='就成功
解密后得序列号为Kanxue2019Q1CTF
internal class a { // Token: 0x06000004 RID: 4 RVA: 0x00002076 File Offset: 0x00000276 public a() { } // Token: 0x06000005 RID: 5 RVA: 0x0000207E File Offset: 0x0000027E private static void a(string[] A_0) { Console.WriteLine("Please Input Serial:"); // 加密输入的序列号后是否等于4RTlF9Ca2+oqExJwx68FiA==,则成功 if (global::a.a(Console.ReadLine(), "Kanxue2019") == "4RTlF9Ca2+oqExJwx68FiA==") { Console.WriteLine("Congratulations! : )"); Console.ReadLine(); } } // Token: 0x06000006 RID: 6 RVA: 0x000020B8 File Offset: 0x000002B8 // AES算法 public static string a(string A_0, string A_1) { byte[] bytes = Encoding.UTF8.GetBytes("Kanxue2019CTF-Q1"); byte[] bytes2 = Encoding.UTF8.GetBytes(A_0); byte[] bytes3 = new PasswordDeriveBytes(A_1, null).GetBytes(32); ICryptoTransform transform = new RijndaelManaged { Mode = CipherMode.CBC }.CreateEncryptor(bytes3, bytes); MemoryStream memoryStream = new MemoryStream(); CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write); cryptoStream.Write(bytes2, 0, bytes2.Length); cryptoStream.FlushFinalBlock(); byte[] inArray = memoryStream.ToArray(); memoryStream.Close(); cryptoStream.Close(); return Convert.ToBase64String(inArray); } // Token: 0x04000003 RID: 3 private const int b = 256; // Token: 0x04000004 RID: 4 private const string a = "Kanxue2019CTF-Q1"; }
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
赞赏
他的文章
- [原创]第十题 2804
- [原创]第一题 2796
- [原创]第1、3题(补) 3129
- [原创]CTF2017 第一题 2813
- [原创]第十八题分析 3398
看原图
赞赏
雪币:
留言: