搭建一个匿名的暗网站点 – Onion services 实用手册

Tor 是一个由虚拟通道组成的网络环境,可以大幅度提高自己在互联网上的隐私和安全性。Tor 会将流量通过 Tor 网络内的三个随机的服务器(也称节点)发送。链路中的最后一个中继(即“出口节点”)将流量发送到公共互联网。

大致节点架构图如下:

绿色的中间服务器代表了Tor网络中的中继,三个密钥代表用户和每个中继之前的加密层。

Onion services 洋葱服务(以前称为“hidden services”)是只能通过 Tor 网络访问的服务(如网站)。

与非私有网络上的普通服务相比,洋葱服务具有以下几个优势:

  1. 洋葱服务的位置和 IP 地址是隐藏的,使攻击者难以审查它们或识别其运营商。
  2. Tor 用户和洋葱服务之间的所有流量都是端到端加密的,因此您无需担心通过 HTTPS 进行连接。
  3. 洋葱服务地址自动生成,运营商无需购买域名;.onion URL 还帮助 Tor 确保它连接到正确的位置并且连接没有被篡改。

如何访问洋葱服务(Onion services)

访问洋葱服务,需要洋葱浏览器,这里是下载链接 https://www.torproject.org/ (需要翻墙)

就像任何其他网站一样,我们需要知道洋葱服务的地址才能连接到它。洋葱地址是一串 16 位(在 V3 格式中为 56 位),大部分是随机字母和数字,后面跟“.onion”。

当访问使用洋葱服务的网站时,Tor 浏览器将在 URL 栏中显示一个洋葱图标,显示您的连接状态:安全和使用洋葱服务。您可以通过查看电路显示了解有关您正在访问的洋葱站点的更多信息。

Onion-Location 是一个非标准的 HTTP 标头,网站可以使用它来允许对其进行申明。

如何搭建一个洋葱服务(Onion services)

Onion服务其实就是一种特定的方式的部署与请求而已

请求方需要使用 tor browser

响应方 需要使用 tor 的 hidden_service

下面将详细介绍如何把 Tor 部署到服务器,并在洋葱浏览器进行访问,这里大体分为三步:

  1. 搭建 Nginx
  2. 搭建 Tor Services
  3. 访问页面

搭建 Nginx

这里选用的是腾讯云香港的服务器(注意,国内屏蔽了 Tor 服务,所以搭建 Onion Service 服务器本身必须在境外)

安装 Nginx

yum install nginx

配置 Nginx

vim /etc/nginx/nginx.conf

重点是看看 root 目录在哪块,比如我这边默认安装的是  /usr/share/nginx/html

启动 Nginx

service nginx restart

搭建 Tor

安装 Tor (腾讯云默认yum源是有的,如果没有可以用 rpm命令更新源)

yum install tor

配置 Tor

vim /etc/tor/torrc

然后将 conf 文件中的 IP 注释删掉,并更新为自己的

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 instanceIP:80

启动 Tor

 service tor start

查看 hostname(tor 不同于传统服务搭建,我们可以通过命令行直接查到当前服务唯一生成的 .onion 地址)

cd /var/lib/tor/hidden_service/
cat hostname

验证并访问页面

修改HTML文件,打开浏览器并验证服务状态:

cd /usr/share/nginx/html
vim index.html



13 thoughts on “搭建一个匿名的暗网站点 – Onion services 实用手册”

  • I was recommended this website by my cousin. I’m no longer certain whether this put up is written via him as no one else understand such exact approximately my trouble. You are wonderful! Thanks!|

  • Hi, I do believe this is a great site. I stumbledupon it 😉 I’m going to come back yet again since I bookmarked it. Money and freedom is the greatest way to change, may you be rich and continue to guide other people.|

  • Definitely believe that which you said. Your favorite justification appeared to be on the internet the easiest thing to be aware of. I say to you, I definitely get annoyed while people think about worries that they just do not know about. You managed to hit the nail upon the top and defined out the whole thing without having side-effects , people can take a signal. Will likely be back to get more. Thanks|

  • Neat blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple adjustements would really make my blog stand out. Please let me know where you got your design. Thanks a lot|

  • Hey there, I think your site might be having browser compatibility issues. When I look at your blog site in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, awesome blog!|

  • Howdy would you mind sharing which blog platform you’re using? I’m planning to start my own blog in the near future but I’m having a tough time selecting between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design and style seems different then most blogs and I’m looking for something unique. P.S My apologies for getting off-topic but I had to ask!|

  • Have you ever considered creating an ebook or guest authoring on other blogs? I have a blog based upon on the same subjects you discuss and would love to have you share some stories/information. I know my viewers would appreciate your work. If you are even remotely interested, feel free to shoot me an e mail.|

发表评论

邮箱地址不会被公开。 必填项已用*标注

+ 15 = 23