Ubuntu 桌機的 Split DNS

Split DNS 指的是某個 DNS domain 使用另外一組 DNS servers,常用在 Partial Route 的 VPN 上,讓內部網域的 DNS domain 正確的被解出來。一般商業的 VPN Software 都會處理掉這塊,不過有時候還是希望可以自己設定...

Ubuntu 桌機上的 Split DNS 可以透過 Dnsmasq 做到,在我的機器上因為透過 ps awx | grep dnsmasq 可以看到 --conf-dir=/etc/NetworkManager/dnsmasq.d,表示設定的目錄在 /etc/NetworkManager/dnsmasq.d 下,所以我把檔案 mysplit 放到 /etc/NetworkManager/dnsmasq.d 下:

#
server=/mysplit.com/10.1.2.3

然後在 dnsmasq 的 manpage 裡面有提到,SIGUSR{1,2} 是拿來分析用的,而 SIGHUP 不是拿來給你重新讀設定檔用的 XDDD

SIGHUP does NOT re-read the configuration file.

所以就砍掉他,隨便對 NetworkManager 做個動作,就會重新把 dnsmasq 帶起來了,或者重開機也可以... 再跑 dig 查的時候就可以查到資訊了。

VPC VPN 的新功能

Amazon VPC 的 VPN 推出新功能了:「EC2 VPC VPN Update – NAT Traversal, Additional Encryption Options, and More」。

其中「Reusable CGW IP Addresses」這個功能讓大家等超久的:(CGW 是 Customer Gateway,通常是放在自己的機房裡跟 Amazon VPC 設 site-to-site VPN 對接)

You no longer need to specify a unique IP address for each customer gateway connection that you create. Instead, you can now reuse an existing IP address. Many VPC users have been asking for this feature and I expect it to be well-used.

之前得弄一堆 IP address 來接來接去,現在總算是改善了...

在攻擊時總是挑最弱的一環:NSA 對 DH 的攻擊

在「How is NSA breaking so much crypto?」這邊提到了 2012 年有文章說明 NSA 有能力解開部份的加密通訊,而後來 Snowden 所提供的資料也證實了這點:

In 2012, James Bamford published an article quoting anonymous former NSA officials stating that the agency had achieved a “computing breakthrough” that gave them “the ability to crack current public encryption.” The Snowden documents also hint at some extraordinary capabilities: they show that NSA has built extensive infrastructure to intercept and decrypt VPN traffic and suggest that the agency can decrypt at least some HTTPS and SSH connections on demand.

但在這之前一直都不清楚是怎麼解出來的,直到最近才猜測應該是 Diffie-Hellman 的強度以及實作問題:「Imperfect Forward Secrecy: How Diffie-Hellman Fails in Practice」。

而成果其實非常驚人,由於強度不夠以及實作問題,有相當可觀的數量是可被攻擊的:

We go on to consider Diffie-Hellman with 768- and 1024-bit groups. We estimate that even in the 1024-bit case, the computations are plausible given nation-state resources. A small number of fixed or standardized groups are used by millions of servers; performing precomputation for a single 1024-bit group would allow passive eavesdropping on 18% of popular HTTPS sites, and a second group would allow decryption of traffic to 66% of IPsec VPNs and 26% of SSH servers. A close reading of published NSA leaks shows that the agency’s attacks on VPNs are consistent with having achieved such a break. We conclude that moving to stronger key exchange methods should be a priority for the Internet community.

作者群給的建議有三個方向,一個是把長度加長到 2048 bits,另外一個是改用 ECDH,而最差的情況 (如果還是需要使用 1024 bits DH) 則是避免使用固定的 prime number。

Cisco 會將硬體寄送到貨運商,以提高 NSA 攔截安裝後門的難度

在「To Avoid NSA Interception, Cisco Will Ship To Decoy Addresses」這篇看到的報導,出自「Cisco posts kit to empty houses to dodge NSA chop shops」這篇。

去年 Snowden 揭露的資料顯示 NSA 會攔截 Cisco 的硬體,並且在上面安裝後門再打包寄出:「Greenwald alleges NSA tampers with routers to plant backdoors」:

"The NSA routinely receives – or intercepts – routers, servers and other computer network devices being exported from the US before they are delivered to the international customers."

The agency then implants backdoor surveillance tools, repackages the devices with a factory seal and sends them on. The NSA thus gains access to entire networks and all their users.

不過 Cisco 的反應好慢,去年五月就有的消息,現在才提出改善方案。

改善的方法是寄送到集散地,再請人去拿。讓 NSA 之類的單位想要攔截的成本提高。

用 Facebook Chat 當作 VPN tunnel...

在同一天的 Hacker News Daily 上看到這兩篇,這是怎樣 XDDD:

RMS 對 Facebook 的意見就不提了,來討論後面這個專案:

The idea of this project is to tunnel Internet traffic through Facebook chat (packets are sent as base64), the main component is tuntap and also the Google's Gumbo parser which does the interaction with Facebook (login, send/receive messages, etc.).

用 C++ 寫的... 不過 Facebook 可以通的環境通常可以有其他的 VPN 選擇吧 @_@

利用 WebRTC 取得瀏覽器端的 IP address

TorrentFreak 上看到的:「Huge Security Flaw Leaks VPN Users' Real IP-Addresses」。

可以在「https://diafygi.github.io/webrtc-ips/」這邊測試,就算你在 NAT 以及 VPN 後面也可以取得真實的 Public IP 資訊。

Google Chrome 的使用者可以裝「WebRTC Block」阻擋 WebRTC,而 Firefox 則可以透過 about:config 的設定關閉 media.peerconnection.enabled 這個值:

目前還不太會用到 WebRTC,先擋起來之後再說...

pfSense 2.2

pfSense 出新版了:「pfSense 2.2-RELEASE Now Available!」。

之前一直用 RC 版本,看起來可以換過去了。從維基百科更新的資料「pfSense」也可以看到許多改變。

主要是從 FreeBSD 8.3 換到 10.1,於是支援 PV on HVM

而 VPN 類的升級也是讓人心動的一點,換成 strongSwan了。所以該找時間測試效能了,不知道能不能超越 OpenVPN 的 200Mbps...

iOS 上可以跑 OpenVPN 了...

pfSense 的 blog 上看到的:「OpenVPN client now available on Apple iOS!」,應用程式是這個:「OpenVPN Connect」。

剛裝好跑起來是這樣:

看起來要先生出 .ovpn 檔案才能用,晚點再來測看看...

增加無線網路的安全性

在「Don’t Have a False Sense of Security: 5 Insecure Ways to Secure Your Wi-Fi」這篇文章裡面提到了五個「不安全的安全措施」:

  • 使用 WEP
  • 隱藏 SSID
  • 過濾 Mac Address。
  • 使用 Static IP。
  • 使用 WPA 或 WPA2 但仍使用短密碼或弱密碼。

無線網路不太好搞啊... 有些公司是直接限制無線網路只能連到 VPN server,利用 IPSec VPN 或是 SSLVPN 保護。

在 Ubuntu 10.10 x86_64 下連 Cisco AnyConnect

老舊的 Notebook 是跑 32bits 版本 (因為 CPU 根本就不支援 64bits),把 Java 開起來 (我平常是關掉的),連上 SSLVPN 後就會自動安裝了 (安裝的過程中會跳視窗出來要 sudo permission),但在 x86_64 下面卻一直跑不起來,就沒辦法連回公司內部網路...

網路上找了找發現這篇:「Manual Installation only for Ubuntu Linux 10.10 64-bit」,居然要裝 32bits Firefox XDDD

自己亂翻以後發現 vpnc - client for cisco vpn concentrator 可以用,而且有被整合進 Network Manager,測了以後發現沒問題,這樣我的 Notebook 也換成 vpnc 好了...

Update:剛剛在 Notebook 上重設,發現不是 vpnc 連上去 (這是 IPSec VPN),而是 OpenConnect...

接下來要找 Juniper SSLVPN 的 solution 了...