找回密码
 新注册用户
搜索
查看: 4563|回复: 1

Majestic-12: 坑爹的 SSL Test

[复制链接]
发表于 2015-5-28 10:29:10 | 显示全部楼层 |阅读模式
最近想要归队 MJ12,不料每次都发现 SSL Test 失败。一怒之下拿出 ILSpy 全都反编译个遍,才发现 NodeLib 里的 Majestic12.WebCrawler.TestSSL 强行硬编码了 Google 的 robots.txt 做测试。
  1. // Majestic12.WebCrawler
  2. // Decomplied Using ILSpy, Copyright (c) Majestic-12 Ltd.
  3. private bool TestSSL()
  4. {
  5.         string sURL = "https://www.google.com/robots.txt";
  6.         string text = Utils.ResolveDirectory("ssltest.tmp");
  7.         bool result;
  8.         try
  9.         {
  10.                 Utils.Delete(text);
  11.                 try
  12.                 {
  13.                         WebHeaderCollection webHeaderCollection;
  14.                         Utils.GetURL(sURL, text, this.WEB_CRAWLER_USER_AGENT, false, out webHeaderCollection, false, false, 15, false, this.oMJ12nodeLib.oConfig.Connection.UseProxyForCrawlingOnly);
  15.                 }
  16.                 catch (Exception ex)
  17.                 {
  18.                         Utils.WriteLine("SSL test failed: {0}", new object[]
  19.                         {
  20.                                 ex.Message
  21.                         });
  22.                         result = false;
  23.                         return result;
  24.                 }
  25.                 if (File.Exists(text))
  26.                 {
  27.                         string text2 = Utils.LoadFromFile(text).Trim().ToLower();
  28.                         if (!text2.Contains("user-agent"))
  29.                         {
  30.                                 Utils.WriteLine("SSL test failed: have not found expected text in file {0}", new object[]
  31.                                 {
  32.                                         text
  33.                                 });
  34.                                 result = false;
  35.                         }
  36.                         else
  37.                         {
  38.                                 Utils.Delete(text);
  39.                                 result = true;
  40.                         }
  41.                 }
  42.                 else
  43.                 {
  44.                         Utils.WriteLine("SSL test failed: file {0} does not exist", new object[]
  45.                         {
  46.                                 text
  47.                         });
  48.                         result = false;
  49.                 }
  50.         }
  51.         catch (Exception ex2)
  52.         {
  53.                 Utils.WriteLine("SSL test failed, reason: {0}", new object[]
  54.                 {
  55.                         ex2.Message
  56.                 });
  57.                 result = false;
  58.         }
  59.         return result;
  60. }
复制代码
考虑到这是 SSL,Hosts 糊弄到百度之类的看来是不可能了,只能等我非法地编译回去改一下了……

cc @StephDC
回复

使用道具 举报

 楼主| 发表于 2015-5-28 10:59:53 | 显示全部楼层
本帖最后由 arthur200000 于 2015-5-28 11:05 编辑

反编译出一堆语法错误,我也懒得管 IL 本身多奇葩了,就自己直接 dump IL 然后查找替换删 pubkeytoken 吧……

WTF,我手上居然没 ilasm?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 新注册用户

本版积分规则

论坛官方淘宝店开业啦~

Archiver|手机版|小黑屋|中国分布式计算总站 ( 沪ICP备05042587号 )

GMT+8, 2024-3-29 00:40

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表