阻止 TOR 服务器 [英] Block TOR Servers
问题描述
我需要一个脚本来阻止 php
中的 TOR 服务器
...我需要获取服务器列表并阻止它们.
I need a script that blocks TOR servers
in php
... I need to get the list of servers and block them.
或者,任何安装在服务器 (centos) 上的解决方案.
Or, any solution to install on the server (centos).
推荐答案
这里有关于 TorDNSEL 的更多信息 https://www.torproject.org/projects/tordnsel.html.en 以及如何构建查询.
Here is more information about TorDNSEL https://www.torproject.org/projects/tordnsel.html.en and how to structure query.
下面是我在网上找到的可以执行动态检查的函数.
And below is function I found on the net that can perform dynamic checks.
(https://check.torproject.org/ 必须使用与此类似的内容).
( https://check.torproject.org/ must use something similar to this ).
我不确定在流量较大的情况下的性能.
I am not sure about performance under heavier traffic.
function IsTorExitPoint(){
if (gethostbyname(ReverseIPOctets($_SERVER['REMOTE_ADDR']).".".$_SERVER['SERVER_PORT'].".".ReverseIPOctets($_SERVER['SERVER_ADDR']).".ip-port.exitlist.torproject.org")=="127.0.0.2") {
return true;
} else {
return false;
}
}
function ReverseIPOctets($inputip){
$ipoc = explode(".",$inputip);
return $ipoc[3].".".$ipoc[2].".".$ipoc[1].".".$ipoc[0];
}
这篇关于阻止 TOR 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!