Total Pageviews

Friday 24 October 2014

Tor“重返”中国:翻墙与进入“深网”

在美剧《纸牌屋》第二季第二集里,当新闻报主编Lucas Goodwin苦于寻找一个黑客,企图黑入美国电信服务器窃取副总统和已故女友的通话记录时,同事告诉他,网络世界中还存在着一个类似于但丁《神曲》所里描述的混沌狱(LIMBO)一般的,游离于普通互联网之外的“深网”(Deep Web),在那里,能够获取几乎一切的需求。

用户通过特殊的技术手段隐匿用户信息(如IP地址等)登陆“深网”以后,就能完全脱离世间法律或NSA(美国国家安全局)等政府管制力量的钳制和监管,在那里,你可以通过网站肆意的购买枪支弹药,可以发布悬赏杀人的告示,可以购买冰毒和可卡因,可以随意浏览儿童色情网站,也可以办理各种假证伪造身份。仅有4%的网络数据是可以通过搜索引擎找到的,其他的都深藏在“深网”中。
96%的网络数据都是无法用使用搜索引擎查找的。

但这些网站的服务器实体可能分布在互联网管制薄弱的东欧国家,背后由深谙网络安全技术的黑客维护,多以 .onion作为域名,采用特殊的加密机制,不能通过搜索引擎查找,即使知道域名也无法采用传统的HTTP方式直接访问,必须采用特殊手段才能接入,就好像只有游吟诗人维吉尔的引领,但丁才可以窥见Limbo里的曲径通幽处。

而今天我们所要介绍的这个引路人就是—Tor(The Onion Router),直译过来为“洋葱路由”。

Tor:匿名上网

说起Tor,就不得不介绍一下他的来历,就好像本拉登等基地组织是美国军方一手训练出来的一样,这个目前让美国国家安全局和美国联邦调查局头疼不已的玩意也是美国军方一手炮制的。1995年,美国海军研究试验室(United States Naval Research Laboratory-http://www.nrl.navy.mil/)和国防部高级研究项目署(DARPA-http://www.darpa.mil/default.aspx)资助研究一种匿名的互联网通讯工具,可以避免人们的行迹在Internet上被追踪到。他们把这个技术叫做“洋葱路由”(Tor)。(PS:大名鼎鼎的美国海军研究实验室是因大发明家爱迪生的倡导而设立的,实验室大门还塑有爱迪生半身铜像。)

“洋葱路由”利用P2P网络, 把网络流量随机的通过P2P的节点进行转发, 这样可以掩盖源地址与目标地址的路径。 使得在Internet上难以确定使用者的身份和地址这就好像你送一封匿名信, 不是自己送或者通过邮差送, 而是大街上随便找一个不认识的人让他帮你送,然后这个不认识的人再找一个不认识的人帮忙送信,这个转送的过程总共进行三次,此时的收信人几乎不可能知晓原始的发件人是谁。

Tor之所以被称为洋葱,就是因为它的这种转发机制跟洋葱的结构一样,其数据核心被一层层的加密措施包围,上图所示,客户电脑接入 Tor 之后会选择三个节点层层转发并加密,最后才到达目标服务器。
斯诺登的笔记本电脑右上角贴有 Tor 的标记


最初这个项目仅仅是用来保护军方情报人员通过互联网匿名通信不被第三方监听和侦破,到2004年美国海军将此项目转为民用并将其开源,成为电子前哨基金会(Electronic Frontier Foundation-https://www.eff.org/)旗下的一个项目。

“棱镜门”的主角爱德华斯诺登身为前NSA的设备分析师,也正是通过 TOR 来掩盖自己在互联网上的行踪,甚至在出事前,他还在檀香山领导这一个名为“Crypto Party”的组织来向周边的居民推广如何Tor匿名使用互联网。


用Tor接入深网

Tor的早期产品需要复杂的设定才能通过浏览器连接,这对于普通用户来说是一个较高的门槛,但现在TorProject已经推出了以 Firefox ESR 的专属浏览器: Tor Browser Bundle(简称TBB),将Tor和 Firefox 浏览器进行捆绑,使用者只需要通过网站下载 最新的4.0 版本到本地,解压缩安装以后就可以直接上网浏览,省去了其中复杂繁琐的过程。
 https://www.torproject.org/dist/torbrowser/4.0.3/torbrowser-install-4.0.3_en-US.exe
 https://www.torproject.org/dist/torbrowser/4.0.3/torbrowser-install-4.0.3_zh-CN.exe

TBB 对linxu、Mac和Windows各平台都有良好的支持,整个安装过程也十分简单,不在复述,下面介绍一下具体的接入方法:

安装完毕以后,首先应该点击会进入第一个网络设置界面,是询问你当前使用的互联网接入是否受限,是否需要通过代理才能接入 Internet 网,中国大陆的网民都在GFW的墙内,因此选择第二项“需要代理或者桥接”。
接下来会询问你是否需要代理才能接入 Internet,一般情况下无论是家庭还是公司网络都是不需要的,点击进入下一步。
接下来会问ISP(移动电信之类)是否屏蔽了互联网接入,因为有 GFW 的存在,我们要选择“yes”。
下面到了最关键的一步,TBB 4.0 最大的更新就是采用了meek插件的混淆机制(如果想了解更多关于 meek 的细节请点击这里)因为GFW把Tor绝大部分的节点都屏蔽掉了,因此在以前的版本中,Tor要么需要费力的设置网桥,要么就必须要搭配其他的翻墙工具进行双重代理才可以使用。
而这一次 TBB 利用微软的Azure和Amazon的VPS或ETC2搭建了代理平台,并对流量进行了混淆加密使得GFW无法识别。
因此选择第一项“需要桥接”,然后选择“meek-amazon”或者“meek-azure”即可(google服务器已经在今年年中被GFW墙掉,而微软和亚马逊的服务器暂时还不会被屏蔽,否则对国内影响太大)
点击“Connect“,系统开始连接,第一次连接需要的时间稍长一些,最后弹出如下图中的浏览器的界面就表示成功了。

深网深几许

既然已经通过 Tor 打开了“深网”的大门,那么让我们就将其一窥究竟,因为广大的深网网站都无法被搜索引擎收录,所以我们必须要找到一个收录各类深网网站的索引站点,“Hidden Wiki”就是其中较为出名的一个,它收录了各类深网网站地址。
将下面的链接地址复制到 Tor 浏览器当中:
http://zqktlwi4fecvo6ri.onion/wiki/
如果这个网站无法访问,还可以浏览它的镜像网站:
http://torlinkbgs6aabns.onion/
http://wikitjerrta4qgz4.onion/
http://jh32yv5zgayyyts3.onion/
Hiddeen Wiki收录了各类网站,我们打开两个网站为例(以下网站都需要用 Tor 打开):譬如,这个网站售卖枪支弹药,一只沙漠之鹰手枪公开叫卖1.836BTC,因为比特币(BTC) 有着无法查询交易记录的优势,因此深海网站多用它作为交易工具,按照最近的BTC对美元的汇率,应该在700美元左右,而网站上标准的市场价格在1500 美元左右,看来网销渠道的优势在黑市上继续得到发扬。除了武器以外,通过深海网站贩卖毒品和违禁药物也得到广泛运用,号称有“毒品亚马逊“之称的 Silk Road (丝绸之路)在查禁前每年的销售额已经突破3亿美元,通过深海网站订货,然后使用快递发货已经成为了美国毒品贩卖的新渠道。而这个网站站上明目张胆的公开售卖各类高纯度可卡因,冰毒和致幻药物。通过wiki还可以找到办理假证的,雇佣杀手的,销赃的(主要是Iphone手机),兑换比特币的(BTC),还有各种成人色情网站,就不在这里一一列举了。

同时还发现,深网网站开始向大陆渗透,其中就发现了一个中文深网站点号称是中国深网第一站,上面架设了一个论坛,不过还没有发布任何有效信息,有兴趣的朋友可以访问。

最后要声明的是,以上内容是让各位认识“深网”和 Tor 技术,本人是坚决反对以上非法网站存在的,也请各位读者谨慎使用,不要将 Tor 技术用于非法途径。

总之,TBB 4.0 的发布为广大网友又增加了一条翻墙的途径,meek 流量混淆插件的使用使得这个老牌的翻墙工具重新焕发青春,也为GFW墙后的网友安全使用网络提升了保障.

from https://pao-pao.net/article/230

相关帖子:http://briteming.blogspot.com/2013/11/deep-web.html
--------------

“深网”和“暗网”的区别

很多人”深网””暗网”傻傻分不清楚;加上互联网上很多阴谋论的不入流科普文导致很多人把暗网无端端神话,变成了一个普通人不可能进入的”互联网地下世界”。和几个超自然爱好者交流过后发现他们的确在这件事上的认知偏差很大。为了给净化中文互联网做一点微小的工作,我决定站出来成为
IDOL(科普者)。希望这篇文可以让无意点进来的读者有所收获。不喜欢概念分析的可以直接跳到后面的谣言部分。当然此文只做概念分析没有具体教程
PS:我不是深度暗网使用者,只是花了几个小时翻了下资料而已。所以本文也不会有啥特别的深度,主要就是驳斥几个比较常见的谣言。可能有些地方会有错误,欢迎勘误(不过前提是你在暗网上确实有实际体验过,没有进过任何一个网站只凭着别人的网帖就大言不惭地指点江山的就别怪我不客气了)

什么是深网

根据维基百科相关词条的解释:

深网(英语:Deep Web、Dark Web,又称:不可见网、隐藏网)是指互联网上那些不能被标准搜索引擎索引的非表面网络内容。

可以看出这深网并不仅仅是指网络站点,它的范围远大于一般的网站,它包括所有不能被搜索引擎抓取到的网络内容,比如:你的QQ聊天记录,你微博私信记录,MC私服,诸如SSH、VPN等非标准80或443端口且不走标准HTTP/HTTPS协议的内容等等。因此对于普通用户来说他们每时每刻都在和深网打交道,所谓”深网深不可测”自然是个笑话。而且实际上深网这个概念对用户来说毫无意义,因为不同用户”能抓取到的内容不同”,A的聊天记录被B来说就是”深网”;你女神对你屏蔽的朋友圈对你来说也是”深网”,而对她自己来说自然就是个普通的表层网络。所以讨论”深网”的时候只能取绝对参照物——搜索引擎,深网其实是一个仅针对搜索引擎的概念,表示不能被其抓取到的私有内容

什么是暗网

暗网是深网的子集,根据维基上的解释:暗网(英语:Darknet或Dark Web)是指只使用非常规协议和端口以及可信节点进行连接的私有网络,暗网是不能通过”常规方式”访问的——当然你用TOR浏览器就不算常规方式了。而根据wiki还有别的方式比如FreenetRetroShareGNUnetOneSwarmTribler等等就不一一列举了。对普通大众来说最简单的方法还是Tor浏览器
暗网的重点在于”暗”,属于网络上的黑市,这里面有很多暴力,色情,黑产等相关的东西,比如军火、假护照、信用卡、用户信息、0day等等。网络上大部分阴谋论相关的文章也都是从暗网这些阴暗点做切入点进行发散创作

谣言

由于进入暗网需要的一点点技术门槛(国外是TOR国内是VPN+TOR)导致很多文章都开始搞阴谋论和超自然分析夺人眼球。这里选几个比较经典的做下解释

暗网和深网是同一个东西

这个是最常见的,往往标题里写着”深网”结果写着写着就成了”暗网”。比如这两篇,就是典型的误导人:
一篇关于 DEEP WEB 的简易指南》、《暗网,一个比你想象中恐怖100倍的互联网世界》。
前面也说过,暗网是深网的子集,但深网里的绝大多数网站都是普通用户可以直接接触到的内容;和暗网这种必须借助第三方工具才能访问的不一样。

暗网的内容占了互联网全部内容的96%

这个是上面那个谣言的变种。其实也是”深网””暗网”弄混了而已。这句话原话出自纸牌屋:”Deep Web is 96 percent of the Internet, with us plebes only seeing a mere 4 percent.”,可见原文说的是”深网的内容占了互联网内容的4%”而不是”暗网”。
事实上这个谣言本身也是相当好反驳的:
  1. 因为暗网本身的用户量就是相当少,可能只占网民的x万分之一,这种比例下他们的内容产出不可能超越作为大多数的普通网民所构建的普通网络
  2. Apple、Google、Facebook、Amazon、腾讯、阿里巴巴、百度等公司每年在硬件和带宽上的成本至少加起来上百亿人民币,如果暗网本身内容是表层网络的几十倍的话,那他们的成本就更可怕了。然而全部暗网的流水加起来估计都覆盖不了这里的零头。而如果是深网的话这句话是没有多少问题的,这里先不论4%这个数字是否准确(因为按照有些人的计算google收录的不只4%,然而这点不好证伪,所以姑且认为是4%吧)。因为互联网大部分用户数据对搜索引擎而言都是不公开的。

暗网是非公开的,一般人很难进去

这个其实是很难证伪的论点,因为有个”没有真正的苏格兰人”的诡辩点在:你举出的例子对方都可以用”这不是真正的暗网”来死缠烂打,所以具体不深入。
单纯说下”非公开”这点:这是个认知错误。其实暗网依旧是公开站点,它只是与普通的公网相隔绝而已。真正的非公开站点应该是那些纯局域网内的站点。而”普通人很难接触这点”,由于通过TOR浏览器就可以直接访问了,因此也是故意夸大难度好渲染阴谋论而已。网上很多帖子只说自己看到的各种光怪陆离的东西而从来不给链接可能也就是因为给了后大概立马就要被打脸了。
事实上访问暗网真正的难点其实在于获取URL,因为很多网站都是过几天就换一个域名。对于大众来说只能依靠hidden wiki的帮助,而真正的暗网深度人士大概会有其他的获取渠道,比如IRC聊天室,专门的发布页面等等。(这个只是个人猜测而已)

暗网上有相当多的血腥恐怖的内容

这个本质上其实不能算谣言。但我拿出来就是因为这部分内容被媒体过于渲染,把少数当多数。
这个说法的问题出在于相当多,虽然暗网上确实有部分血腥暴力的站点,但是就和表站里也有很多小众站点如食人,撒旦教等等一样,这部分站点在暗网里也只是占了极少数。从暗网的大部分hidden wiki页面来看,暗网的主流内容还是各种交易市场:比特币、毒品、枪支、信用卡等等;再就是色情站点等,买凶相关的站点也有,但是非常血腥主题的确实基本上看不到(有些人大概会认为这说明他们藏的更深,找不到不代表就没有。但是这也从侧面证明了它们的小众,由这种极小部分人群作为暗网代表,我觉得相当缺乏说服力)
而根据wiki上Dark web里的相关数据表明,暗网站点里数量前三的是”Drugs”、”Market”、”Fraud”,即药品、交易、欺诈前三,可以说明那些极度血腥反人类的真的只是极少数

总结

写到这里就算完成了。这文里我之所以根本没提另一个”Shadow Web”是因为找不到这个更详细的说明,而从作者把”Deep WEB”当”Dark WEB”的水准来说,我估计他可能本来就是想讲暗网。由于里面阴谋论和都市传说的内容太多,所以我就不继续深入了。
那个所谓的暗网最深层的Marianas Web同理。如果有人有明确的网站能证明这个等级存在的话麻烦给个链接。个人对这个分级说法本身持怀疑态度。
另外贴几张相关的暗网页面截图吧。免得被人说我根本没去过就是瞎扯淡。
首先是The Uncensored Hidden Wiki(需要TOR。另外这种导航页其实有很多,各位可以自行挖掘)
The Uncensored Hidden Wiki
The Uncensored Hidden Wiki
另一个导航站点:HDWIKI
其次是某些站点的截图。有军火、Drug、假护照、信用卡等
假护照
枪支
信用卡
不过也不是所有站点都是违法犯罪的,也有些画风比较清奇的比如这个:
PS4固件
这说明其实你也完全可以在暗网搭个网站放动画片。不过有没有人看就是另一回事了

参考文档

---------------------------

Configuring Hidden Services for Tor


Tor allows clients and relays to offer hidden services. That is, you can offer a web server, SSH server, etc., without revealing your IP address to its users. In fact, because you don't use any public address, you can run a hidden service from behind your firewall.
If you have Tor installed, you can see hidden services in action by visiting this sample site.
This page describes the steps for setting up your own hidden service website. For the technical details of how the hidden service protocol works, see our hidden service protocol page.

Step Zero: Get Tor working


Before you start, you need to make sure:
  1. Tor is up and running,
  2. You actually set it up correctly.
Windows users should follow the Windows howto, OS X users should follow the OS X howto, and Linux/BSD/Unix users should follow the Unix howto.

Step One: Install a web server locally


First, you need to set up a web server locally. Setting up a web server can be complex. We're not going to cover how to setup a web server here. If you get stuck or want to do more, find a friend who can help you. We recommend you install a new separate web server for your hidden service, since even if you already have one installed, you may be using it (or want to use it later) for a normal website.
You need to configure your web server so it doesn't give away any information about you, your computer, or your location. Be sure to bind the web server only to localhost (if people could get to it directly, they could confirm that your computer is the one offering the hidden service). Be sure that its error messages don't list your hostname or other hints. Consider putting the web server in a sandbox or VM to limit the damage from code vulnerabilities.
Once your web server is set up, make sure it works: open your browser and go to http://localhost:8080/, where 8080 is the webserver port you chose during setup (you can choose any port, 8080 is just an example). Then try putting a file in the main html directory, and make sure it shows up when you access the site.

Step Two: Configure your hidden service


Next, you need to configure your hidden service to point to your local web server.
First, open your torrc file in your favorite text editor. (See the torrc FAQ entry to learn what this means.) Go to the middle section and look for the line
    ############### This section is just for location-hidden services ###
    
This section of the file consists of groups of lines, each representing one hidden service. Right now they are all commented out (the lines start with #), so hidden services are disabled. Each group of lines consists of one HiddenServiceDir line, and one or more HiddenServicePort lines:
  • HiddenServiceDir is a directory where Tor will store information about that hidden service. In particular, Tor will create a file here named hostname which will tell you the onion URL. You don't need to add any files to this directory. Make sure this is not the same directory as the hidserv directory you created when setting up thttpd, as your HiddenServiceDir contains secret information!
  • HiddenServicePort lets you specify a virtual port (that is, what port people accessing the hidden service will think they're using) and an IP address and port for redirecting connections to this virtual port.
Add the following lines to your torrc:
    HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/
    HiddenServicePort 80 127.0.0.1:8080
    
You're going to want to change the HiddenServiceDir line, so it points to an actual directory that is readable/writeable by the user that will be running Tor. The above line should work if you're using the OS X Tor package. On Unix, try "/home/username/hidden_service/" and fill in your own username in place of "username". On Windows you might pick:
    HiddenServiceDir C:\Users\username\Documents\tor\hidden_service
    HiddenServicePort 80 127.0.0.1:8080
    
Now save the torrc and restart your tor.
If Tor starts up again, great. Otherwise, something is wrong. First look at your logfiles for hints. It will print some warnings or error messages. That should give you an idea what went wrong. Typically there are typos in the torrc or wrong directory permissions (See the logging FAQ entry if you don't know how to enable or find your log file.)
When Tor starts, it will automatically create the HiddenServiceDir that you specified (if necessary), and it will create two files there.
private_key
First, Tor will generate a new public/private keypair for your hidden service. It is written into a file called "private_key". Don't share this key with others -- if you do they will be able to impersonate your hidden service.
hostname
The other file Tor will create is called "hostname". This contains a short summary of your public key -- it will look something like duskgytldkxiuqc6.onion. This is the public name for your service, and you can tell it to people, publish it on websites, put it on business cards, etc.
If Tor runs as a different user than you, for example on OS X, Debian, or Red Hat, then you may need to become root to be able to view these files.
Now that you've restarted Tor, it is busy picking introduction points in the Tor network, and generating a hidden service descriptor. This is a signed list of introduction points along with the service's full public key. It anonymously publishes this descriptor to the directory servers, and other people anonymously fetch it from the directory servers when they're trying to access your service.
Try it now: paste the contents of the hostname file into your web browser. If it works, you'll get the html page you set up in step one. If it doesn't work, look in your logs for some hints, and keep playing with it until it works.

Step Three: More advanced tips


If you plan to keep your service available for a long time, you might want to make a backup copy of the private_key file somewhere.
If you want to forward multiple virtual ports for a single hidden service, just add more HiddenServicePort lines. If you want to run multiple hidden services from the same Tor client, just add another HiddenServiceDir line. All the followingHiddenServicePort lines refer to this HiddenServiceDir line, until you add another HiddenServiceDir line:
    HiddenServiceDir /usr/local/etc/tor/hidden_service/
    HiddenServicePort 80 127.0.0.1:8080

    HiddenServiceDir /usr/local/etc/tor/other_hidden_service/
    HiddenServicePort 6667 127.0.0.1:6667
    HiddenServicePort 22 127.0.0.1:22
    
Hidden services operators need to practice proper operational security and system administration to maintain security. For some security suggestions please make sure you read over Riseup's "Tor hidden services best practices" document. Also, here are some more anonymity issues you should keep in mind:
  • As mentioned above, be careful of letting your web server reveal identifying information about you, your computer, or your location. For example, readers can probably determine whether it's thttpd or Apache, and learn something about your operating system.
  • If your computer isn't online all the time, your hidden service won't be either. This leaks information to an observant adversary.
  • It is generally a better idea to host hidden services on a Tor client rather than a Tor relay, since relay uptime and other properties are publicly visible.
  • The longer a hidden is online, the higher the risk that its location is discovered. The most prominent attacks are building a profile of the hidden service's availability and matching induced traffic patterns.
Another common issue is whether to use HTTPS on your relay or not. Have a look at this post on the Tor Blog to learn more about these issues.
Finally, feel free to use the [tor-onions] mailing list to discuss the secure administration and operation of Tor hidden services.
from https://www.torproject.org/docs/tor-hidden-service.html.en