-
-
[原创]第十题
-
发表于: 2019-3-12 22:04 2963
-
.net crackme
拖入dnspy,得到全部源码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | 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" ; } |
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
赞赏
他的文章
- [原创]第十题 2964
- [原创]第一题 2962
- [原创]第1、3题(补) 3240
- [原创]CTF2017 第一题 2909
- [原创]第十八题分析 3487
赞赏
雪币:
留言: