【问题标题】:How do I get the *current* Tor exit node IP address over the control port?如何通过控制端口获取*当前* Tor 出口节点 IP 地址?
【发布时间】:2020-01-26 22:22:00
【问题描述】:

如何获取当前 Tor 出口节点(正在使用的节点)的外部 IP 地址 使用外部服务/网站(通过curl或其他),但只能通过 Tor 控制端口功能(使用 bash 或 python3)。

注意:我一直在寻找这个问题的答案,发现this one(列出所有出口节点)和this one提供当前出口的 IP 地址节点,但属于其他一些节点)。其他答案建议通过curl 或其他方式使用外部服务,这不是我想要的。

我正在使用 GNU/Linux。

【问题讨论】:

标签: ip tor stem


【解决方案1】:

cid - 是当前正在使用的电路 ID 或您想要的任何其他电路 ID。
1 - 通过 cid 我们检索带有电路状态的电路事件,我们获取退出节点的指纹(路径属性中的最后一个元素)。
2 - 检查网络状态并获取地址属性。

er = controller.get_circuit(cid).path[-1][0]
ip = controller.get_network_status(er).address

或者我还没试过,有

get_network_statuses - provides all presently available router status entries

希望对您有所帮助。 https://stem.torproject.org/api/control.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-12-01
    • 2019-11-22
    • 1970-01-01
    • 2010-12-30
    • 2011-01-08
    • 2014-12-29
    • 1970-01-01
    相关资源
    最近更新 更多