HTTP 和 HTTPS 協議
HTTP 協議
在 頭部會發送 host 就是要訪問的域名,可以用來被檢測。
HTTPS 協議
雖然會加密全部通訊,但是在握手之前還是明文傳輸。有證書特證可被檢測。
1, DNS 污染
通過 DNS 污染域名解析到錯誤的IP
進階
a,通過修改為正確的 DNS 如 8.8.8.8
但 DNS 使用 UDP 明文傳輸,很容易被篡改
b,DNS 使用加密隧道進行傳輸,本地自建 DNS 服務器 或 手動修改 hosts 文件
2, IP 封鎖
就算 DNS 能解析出正確的 IP ,但在和IP 進行通訊時還會被路由 RST, 或者根本就不轉發,或者發出垃圾數據。
進階
a, 一般的網站都有 CDN 加速,有多個 IP 都可以使用
可以通過修改 hosts 來解析到可以通的IP上。
3, HTTPS 證書黑名單
在 HTTPS 握手 時會發 服務器的證書信息
進階
使用加密隧道
使用ping 工具查詢所有 CDN 可用 ip
http://ping.chinaz.com/pan.baidu.com
使用 curl 進行測試
curl -H 'Host:pan.baidu.com' https://111.206.37.70 -k
<!DOCTYPE html>
curl -H 'Host:pan.baidu.com' https://pan.baidu.com -k
curl: (35) TCP connection reset by peer
[root@628a64b053f2 docker]# curl -H 'Host:pan2.baidu.com' http://112.34.111.108 -i
HTTP/1.1 500 Internal Server Error
Server: bfe
Date: Wed, 27 Mar 2019 03:25:36 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8
[root@628a64b053f2 docker]# curl -H 'Host:pan.baidu.com' http://112.34.111.108 -i
curl: (56) Recv failure: Connection reset by peer
[root@628a64b053f2 docker]# curl -H 'Host:pan2.baidu.com' http://220.181.57.216
<html>
<meta http-equiv="refresh" content="0;url=http://www.baidu.com/">
</html>
[root@628a64b053f2 docker]# curl -H 'Host:pan.baidu.com' http://220.181.57.216
curl: (56) Recv failure: Connection reset by peer
[root@628a64b053f2 docker]# ping baidu.com
PING baidu.com (220.181.57.216) 56(84) bytes of data.
最終得出結論,是基於 HTTP HTTPS 協議 的封鎖方法,就是最開始介紹的方式。
更新:
無線網卡:可以訪問度盤
有線網卡:內網辦公使用 erp git
拔掉有線,可以訪問度盤,但是不能用內網 erp git ,簡單說就是要修改躍點,可以満足要求,但是下面使用,修改路由表方式來實現,系統是 ubuntu 18。
route -v 內核 IP 路由表 目標 網關 子網掩碼 標志 躍點 引用 使用 接口 default _gateway 0.0.0.0 UG 100 0 0 enp1s0 default Hiwifi.lan 0.0.0.0 UG 600 0 0 wlp2s0 10.1.68.0 0.0.0.0 255.255.255.0 U 100 0 0 enp1s0 link-local 0.0.0.0 255.255.0.0 U 1000 0 0 wlp2s0 172.16.110.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet0 172.16.111.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0 192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp2s0 有線連接 enp1s0 網段 10.1.68.0 無線連接 wlp2s0 網段 192.168.1.0
使用 curl 訪問,發現在握手時被關閉連接
curl -v https://pan.baidu.com
* Rebuilt URL to: https://pan.baidu.com/
* Trying 180.149.145.241...
* TCP_NODELAY set
* Connected to pan.baidu.com (180.149.145.241) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to pan.baidu.com:443
* stopped the pause stream!
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to pan.baidu.com:443
為指定 IP 設置路由表 sudo route add -host 180.149.145.241 gw 192.168.1.1 route -v 內核 IP 路由表 目標 網關 子網掩碼 標志 躍點 引用 使用 接口 default bogon 0.0.0.0 UG 100 0 0 enp1s0 default bogon 0.0.0.0 UG 600 0 0 wlp2s0 10.1.68.0 0.0.0.0 255.255.255.0 U 100 0 0 enp1s0 link-local 0.0.0.0 255.255.0.0 U 1000 0 0 wlp2s0 172.16.110.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet0 172.16.111.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0 180.149.145.241 bogon 255.255.255.255 UGH 0 0 0 wlp2s0 192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp2s0
curl -v https://pan.baidu.com
* Rebuilt URL to: https://pan.baidu.com/
* Trying 180.149.145.241...
* TCP_NODELAY set
* Connected to pan.baidu.com (180.149.145.241) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: C=CN; ST=beijing; L=beijing; OU=service operation department; O=Beijing Baidu Netcom Science Technology Co., Ltd; CN=baidu.com
* start date: Jan 13 03:02:05 2020 GMT
* expire date: Jun 25 05:31:02 2020 GMT
* subjectAltName: host "pan.baidu.com" matched cert's "*.baidu.com"
* issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Organization Validation CA - SHA256 - G2
* SSL certificate verify ok.
> GET / HTTP/1.1
> Host: pan.baidu.com
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
可以訪問了,內網系統也可以使用。路由表用處還挺多的,自動分流什么的,這里不做太詳細的介紹。