Tor 浏览器无法绑定 SOCKS 端口 9050:如何更改浏览器设置?(不是 torrc)

Tor 浏览器无法绑定 SOCKS 端口 9050:如何更改浏览器设置?(不是 torrc)

我遇到了一个非常令人沮丧的问题。我现在没有路由器,只能听任 ISP 网关的摆布,他们不允许使用 9050 端口。启动 Tor 浏览器时,我立即意外关闭/出错,没有任何日志消息。但手动运行 tor.exe 后,我发现了这个问题。

我将 torrc SOCKS 端口更改为 443,它运行正常,tor.exe 正在启动。但是,实际的浏览器无法启动,它给出了相同的意外错误。Tor 服务实际上可以运行,如果我将本地代理手动输入到我的标准浏览器中,它会访问洋葱链接。但这并不是真正的解决方案。我尝试查看 prefs.js 和 sqlite 文件,但找不到任何代理设置或“9050”选项。我可以手动更改代理端口而不启动 TorBrowser/FF 吗?

(全新捆绑包也不会启动)

编辑:tor.exe 输出

Feb 12 00:51:09.042 [notice] Tor 0.4.2.5 (git-bede4ea1008920d8) running on Windows 8 [or later] with Libevent 2.1.8-stable, OpenSSL 1.1.1d, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
Feb 12 00:51:09.043 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Feb 12 00:51:09.052 [notice] Configuration file "xxx" not present, using reasonable defaults.
Feb 12 00:51:09.052 [warn] Path for GeoIPFile (<default>) is relative and will resolve to xxx. Is this what you wanted?
Feb 12 00:51:09.052 [warn] Path for GeoIPv6File (<default>) is relative and will resolve to xxx. Is this what you wanted?
Feb 12 00:51:09.053 [notice] Opening Socks listener on 127.0.0.1:9050
Feb 12 00:51:09.053 [warn] Could not bind to 127.0.0.1:9050: Permission denied [WSAEACCES ]
Feb 12 00:51:09.053 [warn] Failed to parse/validate config: Failed to bind one of the listener ports.
Feb 12 00:51:09.053 [err] Reading config failed--see warnings above.

现在有了 torrc 和 SocksPort 443:

Feb 12 00:53:01.083 [notice] Tor 0.4.2.5 (git-bede4ea1008920d8) running on Windows 8 [or later] with Libevent 2.1.8-stable, OpenSSL 1.1.1d, Zlib 1.2.11, Liblzma N/A, and Libzstd N/A.
Feb 12 00:53:01.084 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Feb 12 00:53:01.094 [notice] Read configuration file "xxx".
Feb 12 00:53:01.094 [warn] Skipping obsolete configuration option "SocksListenAddress".
Feb 12 00:53:01.099 [notice] Opening Socks listener on 127.0.0.1:443
Feb 12 00:53:01.099 [notice] Opened Socks listener on 127.0.0.1:443
Feb 12 00:53:01.000 [notice] Parsing GEOIP IPv4 file xxx.
Feb 12 00:53:01.000 [notice] Parsing GEOIP IPv6 file xxx.
Feb 12 00:53:01.000 [notice] Bootstrapped 0% (starting): Starting
Feb 12 00:53:03.000 [warn] Your configuration excludes 99% of all possible guards. That's likely to make you stand out from the rest of the world.
Feb 12 00:53:03.000 [notice] Starting with guard context "restricted"
Feb 12 00:53:04.000 [notice] Bootstrapped 3% (conn_proxy): Connecting to proxy
Feb 12 00:53:04.000 [notice] Bootstrapped 4% (conn_done_proxy): Connected to proxy
Feb 12 00:53:04.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay
Feb 12 00:53:04.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay
Feb 12 00:53:04.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done
Feb 12 00:53:04.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
Feb 12 00:53:04.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
Feb 12 00:53:04.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
Feb 12 00:53:05.000 [notice] Bootstrapped 100% (done): Done

资源管理器显示端口 9050 未被使用,防火墙已打开。最终,我认为问题不在我的电脑上

答案1

这可能不是端口被防火墙或 ACL 阻止的问题,也不是另一个程序使用该端口的问题,而是 Windows NAT 服务以 100 个块为单位保留端口供自己使用,有时在给定时间内会保留许多这样的块。如果您安装了 Hyper-V、WSL 和/或 Docker,您很可能会遇到这种情况。

这个问题以及有关保留端口的相关答案提供了以下命令。

首先,netsh在管理员cmd.exePowerShell窗口中运行此命令来确定端口是否存在重叠:

netsh int ipv4 show excludedportrange tcp

接下来,停止并启动 Windows NAT 服务以强制其放弃保留端口:

net stop winnat
net start winnat

最后,再次检查保留端口列表。它应该小得多:

netsh int ipv4 show excludedportrange tcp

这是我运行上述命令之前的输出;为了简洁起见,我删去了几十行。包含的行8985-9084阻止默认 tor.exe 端口绑定,下一行9085-9184阻止 Tor 浏览器分配的端口绑定。

PS C:\WINDOWS\system32> netsh int ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      1124        1223
      1224        1323
      1324        1423
      1424        1523
      ...
      8081        8180
      8181        8280
      8281        8380
      8381        8480
      8481        8580
      8581        8680
      8681        8780
      8781        8880
      8884        8884
      8885        8984
      8985        9084
      9085        9184
     10000       10099
     10100       10199
     10200       10299
     10300       10399
     10400       10499
     10500       10599
     10600       10699
     ...

以下是我运行后的输出:

PS C:\WINDOWS\system32> netsh int ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      8884        8884
     50000       50059     *

* - Administered port exclusions.

我要指出的是,我遵循了各种论坛、帮助网站和社交媒体上许多人的建议,重启、删除并重新安装,以及调整配置。这是非常微妙的事情,所以很多人忽视它并不奇怪。

我知道这已经过去了四年,希望您从提出问题后找到了进入 Tor 网络的方法。也许您还会遇到它。我希望您和其他人会发现这个答案很有用。

相关内容