011.编译随机指纹浏览器-禁用webRTC

修改chromium-禁用webRTC

一、WebRTC指纹是什么

  • 之前介绍过webRTC和如何修改webRTC的ip识别: https://blog.csdn.net/w1101662433/article/details/138001797

二、编译源码禁用webRTC

  • 第一篇文章写了如何编译chromium,假设你已经编译成功了。
  • 找到源码 \third_party\blink\renderer\modules\peerconnection\rtc_peer_connection.cc
1.找到下面的代码
ScriptPromise<IDLUndefined> RTCPeerConnection::setLocalDescription(
    ScriptState* script_state,
    const RTCSessionDescriptionInit* session_description_init,
    ExceptionState& exception_state) {
  if (closed_) {
    exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
                                      kSignalingStateClosedMessage);
    return EmptyPromise();
  }
2.替换为
ScriptPromise<IDLUndefined> RTCPeerConnection::setLocalDescription(
    ScriptState* script_state,
    const RTCSessionDescriptionInit* session_description_init,
    ExceptionState& exception_state) {
  if (!closed_) {
    exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
                                      kSignalingStateClosedMessage);
    return EmptyPromise();
  }

//if (closed_) {
  //  exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError,
  //                                    kSignalingStateClosedMessage);
  //  return ScriptPromise();
  //}

原理就是将webrtc的正常运行逻辑强行打断,无法正确返回。

3.编译
ninja  -C  out/Default chrome
  • 编译后再也没有网站可以窥探我的真实ip了,舒坦。

三、在线指纹验证网站:

  • https://browserleaks.com/webrtc
  • https://www.browserscan.net/

四、2025-05-08补充

  • 群友提供了更优秀的禁用方案,只需要启动时带上这2个参数即可:
./chrome.exe
--force-webrtc-ip-handling-policy
--webrtc-ip-handling-policy=disable_non_proxied_udp
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

王辉辉的猫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值