update README.md
This commit is contained in:
parent
d276407530
commit
116970c654
57
README.md
57
README.md
@ -1,7 +1,7 @@
|
||||
# Shadow-TLS
|
||||
### TLS伪装代理 -- 包装任意TCP连接为真正合法域名的TLS连接
|
||||
## 基本原理
|
||||
与服务端连接后,服务端会请求指定合法的HTTPS域名(例如www.apple.com)并转发TLS握手流量,与客户端TLS握手成功后后续将转发实际的TCP流量,对审计设备(防火墙/上网行为管理软件/零信任网关)而言你是访问一个合法且是真实证书的HTTPS网站.
|
||||
与服务端连接后,服务端会请求指定合法的HTTPS域名(例如www.apple.com)并转发TLS握手流量(给防火墙/审计设备表演一个真正的TLS握手),与客户端TLS握手成功后后续将转发实际的TCP流量,对审计设备(防火墙/上网行为管理软件/零信任网关)而言你是访问一个合法且是真实证书的HTTPS网站.
|
||||
|
||||
## 使用场景
|
||||
- 在有域名白名单的情况下需要将流量转发出去
|
||||
@ -18,15 +18,60 @@
|
||||
```shell
|
||||
./shadowtls client -l 0.0.0.0:11222 -s 145.142.63.32:443 -d www.apple.com
|
||||
```
|
||||
## 使用Nginx将本服务和其他443端口服务并存
|
||||
- 编译带有stream和stream_ssl_preread模块的nginx
|
||||
- 参考以下配置
|
||||
```nginx
|
||||
stream {
|
||||
map $ssl_preread_server_name $backend_pool {
|
||||
www.apple.com shadow;
|
||||
defalut local_server;
|
||||
}
|
||||
|
||||
## 功能特性
|
||||
- ~~TLS连接多路复用,减少TLS握手次数~~(存在特征已经移除)
|
||||
upstream shadow{
|
||||
server api.weixin.qq.com:443;
|
||||
}
|
||||
upstream local_server{
|
||||
server 127.0.0.1:8443;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443;
|
||||
ssl_preread on;
|
||||
proxy_pass $backend_pool;
|
||||
proxy_connect_timeout 15s;
|
||||
proxy_timeout 15s;
|
||||
proxy_next_upstream_timeout 15s;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
...
|
||||
|
||||
server {
|
||||
listen 127.0.0.1:8443 ssl http2;
|
||||
server_name file.evan.run;
|
||||
charset utf-8;
|
||||
|
||||
ssl_certificate cert.crt;
|
||||
ssl_certificate_key private.key;
|
||||
|
||||
location / {
|
||||
root /root/file;
|
||||
autoindex on;
|
||||
autoindex_exact_size off;
|
||||
autoindex_localtime on;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
## 安全性特别说明
|
||||
- 包装的TCP流量没有加密,如有需求请加密后再转发
|
||||
- ~~多路复用特性使用了smux的框架,有协议特征,有更进一步需求需修改源码二次加密~~(已经移除多路复用,如有需求请在外层处理)
|
||||
- ~~TLS后续流量没有进行Application Data封装,深层次的协议分析可以发现此特征~~(已经封装,已与标准的TLS协议一致)
|
||||
- 包装的TCP流量没有加密,因由上层处理,推荐配合gost使用
|
||||
|
||||
## 特别说明
|
||||
- 感谢v2ex网友ihciah的思路灵感.
|
||||
|
Loading…
Reference in New Issue
Block a user