mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
149 lines
10 KiB
HTML
149 lines
10 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head><meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
<title>Trojan基本原理 - Trojan-Go Docs</title>
|
|
<meta name="description" content="An unidentifiable mechanism that helps you bypass GFW. ">
|
|
<meta name="generator" content="Hugo 0.69.2" />
|
|
<link href="https://p4gefau1t.github.io/trojan-goindex.xml" rel="alternate" type="application/rss+xml">
|
|
<link rel="canonical" href="https://p4gefau1t.github.io/trojan-go/basic/trojan/">
|
|
<link rel="stylesheet" href="https://p4gefau1t.github.io/trojan-go/css/theme.min.css">
|
|
<script src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
|
|
<link rel="stylesheet" href="https://p4gefau1t.github.io/trojan-go/css/chroma.min.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/jquery.easing@1.4.1/jquery.easing.min.js"></script>
|
|
<script src="https://p4gefau1t.github.io/trojan-go/js/bundle.js"></script><style>
|
|
:root {}
|
|
</style>
|
|
<meta property="og:title" content="Trojan基本原理" />
|
|
<meta property="og:description" content="这个页面将会简单讲述Trojan协议的基本工作原理。如果你对于GFW和Trojan的工作方式不感兴趣,可以跳过这一小节。但为了更好地保护你的" />
|
|
<meta property="og:type" content="article" />
|
|
<meta property="og:url" content="https://p4gefau1t.github.io/trojan-go/basic/trojan/" />
|
|
<meta property="og:image" content="https://p4gefau1t.github.io/trojan-go/images/og-image.png"/>
|
|
<meta property="og:site_name" content="Trojan-Go Docs" />
|
|
<meta name="twitter:card" content="summary_large_image"/>
|
|
<meta name="twitter:image" content="https://p4gefau1t.github.io/trojan-go/images/og-image.png"/>
|
|
|
|
<meta name="twitter:title" content="Trojan基本原理"/>
|
|
<meta name="twitter:description" content="这个页面将会简单讲述Trojan协议的基本工作原理。如果你对于GFW和Trojan的工作方式不感兴趣,可以跳过这一小节。但为了更好地保护你的"/>
|
|
<meta itemprop="name" content="Trojan基本原理">
|
|
<meta itemprop="description" content="这个页面将会简单讲述Trojan协议的基本工作原理。如果你对于GFW和Trojan的工作方式不感兴趣,可以跳过这一小节。但为了更好地保护你的">
|
|
|
|
<meta itemprop="wordCount" content="1235">
|
|
<meta itemprop="image" content="https://p4gefau1t.github.io/trojan-go/images/og-image.png"/>
|
|
|
|
|
|
|
|
<meta itemprop="keywords" content="" /></head>
|
|
<body><div class="container"><header>
|
|
<h1>Trojan-Go Docs</h1>
|
|
|
|
<span class="version">Version 0.4.8</span>
|
|
<a href="https://github.com/p4gefau1t/trojan-go" class="github"><i class="fab fa-github"></i></a>
|
|
<p class="description">An unidentifiable mechanism that helps you bypass GFW. </p>
|
|
|
|
</header>
|
|
<div class="global-menu">
|
|
<nav>
|
|
<ul>
|
|
<li><a href="/trojan-go/">Home</a></li>
|
|
<li><a href="https://github.com/p4gefau1t">GitHub</a></li></ul>
|
|
</nav>
|
|
</div>
|
|
<div class="content-container">
|
|
<main><h1>Trojan基本原理</h1>
|
|
<p>这个页面将会简单讲述Trojan协议的基本工作原理。如果你对于GFW和Trojan的工作方式不感兴趣,可以跳过这一小节。但为了更好地保护你的通讯安全性和节点的隐蔽性,我还是建议你阅读。</p>
|
|
<h2 id="为什么shadowsocks容易遭到封锁">为什么Shadowsocks容易遭到封锁</h2>
|
|
<p>防火墙在早期仅仅只是对出境流量进行截获和审查,也即<strong>被动检测</strong>。Shadowsocks的加密协议设计使得传输的数据包本身几乎没有任何特征,看起来类似于完全随机的比特流,这在早一些年的确能有效绕过GFW。</p>
|
|
<p>目前的GFW已经开始采用<strong>主动探测</strong>的方式。具体来说,当GFW发现一个可疑的无法识别的连接时(大流量,随机字节流,高位端口等特征),将会<strong>主动连接</strong>这个服务器端口,重放之前捕获到的流量(或者经过一些精心修改后重放)。Shadowsocks服务器检测到不正常的连接,将连接断开。这种不正常的流量和断开连接的行为被视作可疑的Shadowsocks服务器的特征,于是该服务器被加入GFW的可疑名单中。这个名单不一定立即生效,而是在某些特殊的敏感时期,可疑名单中的服务器会遭到暂时或者永久的封锁。该可疑名单是否封锁,可能由人为因素决定。</p>
|
|
<p>如果你想了解更多,可以参考<a href="https://gfw.report/blog/gfw_shadowsocks/">这篇文章</a>。</p>
|
|
<h2 id="trojan如何绕过gfw">Trojan如何绕过GFW</h2>
|
|
<p>与Shadowsocks相反,Trojan不使用自定义的加密协议来隐藏自身。相反,使用特征明显的TLS协议(TLS/SSL),使得流量看起来与正常的HTTPS网站相同。TLS是一个成熟的加密体系,HTTPS即使用TLS承载HTTP流量。使用<strong>正确配置</strong>的加密TLS隧道,可以保证传输的</p>
|
|
<ul>
|
|
<li>
|
|
<p>保密性(GFW无法得知传输的内容)</p>
|
|
</li>
|
|
<li>
|
|
<p>完整性(一旦GFW试图篡改传输的密文,通讯双方都会发现)</p>
|
|
</li>
|
|
<li>
|
|
<p>不可抵赖(GFW无法伪造身份冒充服务端或者客户端)</p>
|
|
</li>
|
|
<li>
|
|
<p>前向安全(即使密钥泄露,GFW也无法解密先前的加密流量)</p>
|
|
</li>
|
|
</ul>
|
|
<p>对于被动检测,Trojan协议与HTTPS协议流量的特征和行为完全一致,而HTTPS流量占据了目前互联网流量的一半以上,且HTTPS握手成功后流量是加密的,几乎不存在可行方法从其中分辨出Trojan协议流量。</p>
|
|
<p>对于主动检测,当防火墙主动连接Trojan服务器进行检测时,Trojan可以正确识别非Trojan协议的流量。与Shadowsocks等代理不同的是,此时Trojan不会断开连接,而是将这个连接代理到一个正常的Web服务器。在GFW看来,该服务器的行为和一个普通的HTTPS网站行为完全相同,无法判断是否是一个Trojan代理节点。这也是Trojan推荐使用合法的域名、使用CA签名的HTTPS证书的原因: 这让你的服务器完全无法被GFW使用主动检测判定是一个Trojan服务器。</p>
|
|
<p>因此,就目前的情况来看,若要识别并阻断Trojan的连接,只能使用无差别封锁(封锁某个IP段,某一类证书,某一类域名,甚至阻断全国所有出境HTTPS连接)或发动大规模的中间人攻击(劫持所有TLS流量并劫持证书,审查内容)。对于中间人攻击,可以使用Websocket的双重TLS应对,高级配置中有详细讲解。</p>
|
|
<div class="edit-meta">
|
|
|
|
<br><a href="https://github.com/p4gefau1t/trojan-go/docs/edit/master/content/basic/trojan.md" class="edit-page"><i class="fas fa-pen-square"></i> Edit on GitHub</a></div><nav class="pagination"><a class="nav nav-prev" href="https://p4gefau1t.github.io/trojan-go/basic/" title="基本配置"><i class="fas fa-arrow-left" aria-hidden="true"></i> Prev - 基本配置</a>
|
|
<a class="nav nav-next" href="https://p4gefau1t.github.io/trojan-go/basic/config/" title="正确配置Trojan-Go">Next - 正确配置Trojan-Go <i class="fas fa-arrow-right" aria-hidden="true"></i></a>
|
|
</nav><footer><p class="powered">Powered by <a href="https://gohugo.io">Hugo</a>. Theme by <a href="https://themes.gohugo.io/hugo-theme-techdoc/">TechDoc</a>. Designed by <a href="https://github.com/thingsym/hugo-theme-techdoc">Thingsym</a>.</p>
|
|
</footer>
|
|
</main><div class="sidebar">
|
|
|
|
<nav class="open-menu">
|
|
<ul>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go">Home</a></li>
|
|
|
|
<li class="parent"><a href="https://p4gefau1t.github.io/trojan-go/basic/">基本配置</a>
|
|
|
|
<ul class="sub-menu">
|
|
<li class="active"><a href="https://p4gefau1t.github.io/trojan-go/basic/trojan/">Trojan基本原理</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/basic/config/">正确配置Trojan-Go</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/basic/fullconfig/">完整的配置文件</a></li>
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/">高级配置</a>
|
|
|
|
<ul class="sub-menu">
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/mux/">启用多路复用提升并发性能</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/websocket/">使用Websocket进行CDN转发和抵抗中间人攻击</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/router/">国内直连和广告屏蔽</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/relay/">流量中继</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/forward/">隧道和反向代理</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/advance/nginx-relay/">一种基于SNI代理的多路径分流中继方案</a></li>
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/">实现细节和开发指南</a>
|
|
|
|
<ul class="sub-menu">
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/overview/">基本介绍</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/build/">编译和自定义Trojan-Go</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/trojan/">Trojan协议</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/mux/">多路复用</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/websocket/">Websocket</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/simplesocks/">SimpleSocks协议</a></li>
|
|
<li class=""><a href="https://p4gefau1t.github.io/trojan-go/developer/api/">API</a></li>
|
|
</ul>
|
|
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
|
|
|
|
<div class="sidebar-footer"></div>
|
|
</div>
|
|
</div><a href="#" id="backtothetop-fixed" class="backtothetop"
|
|
data-backtothetop-duration="600"
|
|
data-backtothetop-easing="easeOutQuart"
|
|
data-backtothetop-fixed-fadeIn="1000"
|
|
data-backtothetop-fixed-fadeOut="1000"
|
|
data-backtothetop-fixed-bottom="10"
|
|
data-backtothetop-fixed-right="20">
|
|
<span class="fa-layers fa-fw">
|
|
<i class="fas fa-circle"></i>
|
|
<i class="fas fa-arrow-circle-up"></i>
|
|
</span></a>
|
|
</div>
|
|
</body>
|
|
</html>
|