日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CTF dotNet逆向分析

發布時間:2023/12/2 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CTF dotNet逆向分析 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

題目來源http://ctf.idf.cn/index.php?g=game&m=article&a=index&id=36

.NET逆向第一題?
嗯,看名字就應該明白了,快去下載吧!

http://pan.baidu.com/s/1bnvVbp9

下載后是一個DotNetCrackMe1.exe文件。


分析

逆向分析的基礎問題,可以參考以下資源列表 豆瓣逆向分析基礎總結:https://www.douban.com/note/214872071/ 看雪逆向精華區:http://bbs.pediy.com/forumdisplay.php?viewgoodnees=1&f=4&prefixid=phpforce_20 看雪破解精華區:http://bbs.pediy.com/forumdisplay.php?viewgoodnees=1&f=37下面從頭講講這個小題的解決思路: 1.安裝.net4.0、ILSPY2.3 or 更高版本 2.用ILSPY2.3打開DotNetCrackMe1.exe

3.展開DotNetCrackMe1,看到這個.net程序很簡單,就一個WindowsFormsApplication1,里面就一個Form1,Form1下有button1_click方法,其中的判斷語句 if ("fOCPTVF0diO+B0IMXntkPoRJDUj5CCsT" == this.Encode(this.textBox1.get_Text()))
  • 1
  • 1
意味著它提交一個用戶輸入值進行Encode(),然后判斷是否與"fOCPTVF0diO+B0IMXntkPoRJDUj5CCsT"相同,若相同后就“OK"了。

4.再看一下Encode()函數,可以看出來是一個DES加密過程,最后又進行了base64的編碼。 public string Encode(string data) {string result;try{byte[] bytes = Encoding.get_ASCII().GetBytes("wctf{wol");byte[] bytes2 = Encoding.get_ASCII().GetBytes("dy_crack}");DESCryptoServiceProvider dESCryptoServiceProvider = new DESCryptoServiceProvider();int keySize = dESCryptoServiceProvider.get_KeySize();MemoryStream memoryStream = new MemoryStream();CryptoStream cryptoStream = new CryptoStream(memoryStream, dESCryptoServiceProvider.CreateEncryptor(bytes, bytes2), 1);StreamWriter streamWriter = new StreamWriter(cryptoStream);streamWriter.Write(data);streamWriter.Flush();cryptoStream.FlushFinalBlock();streamWriter.Flush();result = Convert.ToBase64String(memoryStream.GetBuffer(), 0, (int)memoryStream.get_Length());}catch{result = "http://weibo.com/woldy";}return result; }
  • 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
  • 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
5.那么解決過程顯然是根據上面的編碼進行解碼。網上已經有人解決了,我轉載一下: 來源:http://blog.csdn.net/u010379510/article/details/44496995 public string Decode(string data) { string result; byte[] byte1; try { byte1 = Convert.FromBase64String("fOCPTVF0diO+B0IMXntkPoRJDUj5CCsT"); byte[] bytes = Encoding.ASCII.GetBytes("wctf{wol"); byte[] bytes2 = Encoding.ASCII.GetBytes("dy_crack}"); DESCryptoServiceProvider dESCryptoServiceProvider = new DESCryptoServiceProvider(); MemoryStream memoryStream = new MemoryStream(); CryptoStream cryptoStream = new CryptoStream(memoryStream, dESCryptoServiceProvider.CreateDecryptor(bytes, bytes2), CryptoStreamMode.Write); cryptoStream.Write(byte1, 0, byte1.Length); cryptoStream.FlushFinalBlock(); System.Text.Encoding encoding = System.Text.Encoding.UTF8; result = encoding.GetString(memoryStream.ToArray()); } catch { result = "http://weibo.com/woldy"; } return result; }
  • 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
  • 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
另外,如果單獨解決base64的編、解碼問題,可以參考:http://blog.csdn.net/morewindows/article/details/11922473

最后附上逆向工具ILSPY的下載地址:?
http://pan.baidu.com/share/link?shareid=505596871&uk=1376014793

答案:解碼得到wctf{dotnet_crackme1}

總結

以上是生活随笔為你收集整理的CTF dotNet逆向分析的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。