• 010.编译指纹浏览器-绕过常见无头检测


    修改webdriver

    • 打开文件 third_party\blink\renderer\core\frame\navigator.cc
    //bool Navigator::webdriver() const {
    //  if (RuntimeEnabledFeatures::AutomationControlledEnabled())
    //    return true;
    //
    //  bool automation_enabled = false;
    //  probe::ApplyAutomationOverride(GetExecutionContext(), automation_enabled);
    //  return automation_enabled;
    //}
    
    bool Navigator::webdriver() const {
      return false;
    }
    

    修改rtt

    • 打开文件 third_party/blink/renderer/modules/netinfo/network_information.cc
    //uint32_t NetworkInformation::rtt() {
    //  MaybeShowWebHoldbackConsoleMsg();
    //  std::optional override_rtt =
    //      GetNetworkStateNotifier().GetWebHoldbackHttpRtt();
    //  if (override_rtt) {
    //    return GetNetworkStateNotifier().RoundRtt(Host(), override_rtt.value());
    //  }
    //
    //  if (!IsObserving()) {
    //    return GetNetworkStateNotifier().RoundRtt(
    //        Host(), GetNetworkStateNotifier().HttpRtt());
    //  }
    //
    //  return http_rtt_msec_;
    //}
    
    uint32_t NetworkInformation::rtt() {
      return 150;
    }
    

    修改Notification.permission

    • 打开文件 third_party/blink/renderer/modules/notifications/notification.cc
    String Notification::PermissionString(
        mojom::blink::PermissionStatus permission) {
      switch (permission) {
        case mojom::blink::PermissionStatus::GRANTED:
          return "granted";
        case mojom::blink::PermissionStatus::DENIED:
          //return "denied";
          return "default";
        case mojom::blink::PermissionStatus::ASK:
          return "default";
      }
    
      NOTREACHED();
      //return "denied";
      return "default";
    }
    

    修改user-agent

    针对无头浏览器的HeadlessChrome:

    • 打开文件C:\src\chromium\src\headless\lib\browser\headless_browser_impl.cc
      修改:
    //const char kHeadlessProductName[] = "HeadlessChrome";
    const char kHeadlessProductName[] = "Chrome";
    
    

    针对无头的plugin检测

    • 修改third_party\blink\renderer\modules\plugins\navigator_plugins.cc
    // static
    //DOMPluginArray* NavigatorPlugins::plugins(Navigator& navigator) {
    //  return NavigatorPlugins::From(navigator).plugins(navigator.DomWindow());
    //}
    
    // static
    DOMPluginArray* NavigatorPlugins::plugins(Navigator& navigator) {
      DOMPluginArray* pluginsArray = NavigatorPlugins::From(navigator).plugins(navigator.DomWindow());
      pluginsArray->UpdatePluginData();
      return pluginsArray;
    }
    
    • 再修改 third_party\blink\renderer\modules\plugins\dom_plugin_array.cc
    void DOMPluginArray::UpdatePluginData() {
      if (should_return_fixed_plugin_data_) {
        dom_plugins_.clear();
        //if (IsPdfViewerAvailable()) {
          // See crbug.com/1164635 and https://github.com/whatwg/html/pull/6738.
          // To reduce fingerprinting and make plugins/mimetypes more
          // interoperable, this is the spec'd, hard-coded list of plugins:
          Vector<String> plugins{"PDF Viewer", "Chrome PDF Viewer",
                                 "Chromium PDF Viewer", "Microsoft Edge PDF Viewer",
                                 "WebKit built-in PDF"};
          for (auto name : plugins)
            dom_plugins_.push_back(MakeFakePlugin(name, DomWindow()));
        //}
        return;
      }
      
    
  • 相关阅读:
    Centos 优化ulimit
    低代码如何在新时代为企业实现数字化转型
    泰裤辣!!!手摸手教学,如何训练一个你的专属AI歌姬~
    用AI魔法打败AI魔法
    java学习第209天,第四部分学习第9天,Linux学习第9天,p91-106(0911)-8h
    还在用双层for循环吗?太慢了
    docker容器健康状态健康脚本
    Java多线程_多线程的补充
    Java实用类(五) -Math类和指定范围的随机数
    怎么恢复移走的u盘数据?可以尝试这三种方法
  • 原文地址:https://blog.csdn.net/w1101662433/article/details/139345179