GreatFire.org, who monitor the Great Firewall of China (GFW), also published a
blog post on their website earlier today saying:
This is clearly a malicious attack on Apple in an effort to gain access to usernames and passwords and consequently all data stored on iCloud such as iMessages, photos, contacts, etc.
Fake SSL Certificate
In their blog post GreatFire also linked a packet capture file, which we have analyzed in order to verify the MITM attack. We loaded the PcapNG file into NetworkMiner Professional and extracted the X.509 SSL certificate.
The extracted certificate can be downloaded from here. Also, here are a few details from this X.509 certificate:
$ openssl x509 -inform DER -in www.icloud.com.cer -noout -issuer -subject -startdate -enddate -fingerprint
notBefore=Oct 4 10:35:47 2014 GMT
notAfter=Oct 4 10:35:47 2015 GMT
As reported elsewhere, the certificate was self signed, which means that browsers and most iPhone apps will either inform the user about the connection being unsafe or simply close the connection (see update at the bottom of this blog post regarding the missing certificate verification in Apple iOS). This use of self signed certificates is consistent with previous SSL MITM attacks performed in China against GitHub, Google, Yahoo and live.com.
Location of the MITM Attack
By looking at host the information provided by NetworkMiner for the fake iCloud SSL server we can see that it is just six router hops away from the client (having an IP TTL value of 58). This indicates that the MITM attack is being performed within China, since we'd expect to see at least three more router hops if the packets were coming from outside China.
The same PCAP file also contains packets from the same IP address on TCP port 80, which have traveled 11 hops (IP TTL 53). We therefore assume that only traffic to TCP port 443 is being MITM'ed.
This TTL analysis also matches various TCP traceroutes we've seen to the MITM'ed iCloud SSL service on 18.104.22.168:443.
My traceroute [v0.85]mtr TCP 443 traceroute to 22.214.171.124 (source: http://pastebin.com/8Y6ZwfzG)
siyanmao-k29 (0.0.0.0) Sat Oct 18 19:26:07 2014
Host Loss% Snt Last Avg Best Wrst StDev
1. 192.168.1.1 0.0% 17 0.6 0.7 0.6 0.8 0.0
2. ------------- 0.0% 16 2.8 2.6 1.7 3.3 0.3
3. ------------- 0.0% 16 2.0 2.2 1.4 4.0 0.4
5. 126.96.36.199 0.0% 16 6.4 7.7 4.3 27.0 5.2
6. 188.8.131.52 25.0% 16 168.5 171.4 166.8 201.3 9.4
The mtr TCP traceroute above indicates that MITM attacks are performed in AS4134 (China Telecom).
bearice@Bearice-Mac-Air-Haswell ~tcptraceroute to 184.108.40.206 443 (source: bearice on GitHub)
%tcptraceroute 220.127.116.11 443
Selected device en0, address 192.168.100.16, port 52406 for outgoing packets
Tracing the path to 18.104.22.168 on TCP port 443 (https), 30 hops max
1 192.168.100.254 1.737 ms 0.793 ms 0.798 ms
2 22.214.171.124 2.893 ms 2.967 ms 2.422 ms
3 126.96.36.199 2.913 ms 2.893 ms 3.968 ms
4 188.8.131.52 4.824 ms 2.658 ms 3.902 ms
5 184.108.40.206 3.626 ms 6.532 ms 3.794 ms
6 220.127.116.11 27.539 ms 26.821 ms 27.661 ms
7 a23-59-94-46.deploy.static.akamaitechnologies.com (18.104.22.168) [open] 30.064 ms 29.899 ms 30.126 ms
The tcptraceroute above indicates that MITM attacks are also performed in AS4837 (China Unicom).
The Tcproute screenshot above shows that also CHINANET backbone network (China Telecom) seems to be used to carry out the MITM attacks.
Judging from these TCP traceroutes the MITM attacks seem to be taking place at several different locations rather centrally in the Chinese Internet infrastructure. To be more specific, it appears as if the MITM attacks are being performed on backbone networks belonging to China Telecom (CHINANET) as well as China Unicom.
UPDATE (October 22)
A vulnerability notice (CVE-2014-4449) has now been published, where Apple confirm that fake SSL certificates (like the Chinese fake one) were not verified by Apple iOS before 8.1. Apple released the first details about this vulnerability just a few hours after this blog post was published. Here's the text from the CVE description:
iCloud Data Access in Apple iOS before 8.1 does not verify X.509 certificates from TLS servers, which allows man-in-the-middle attackers to spoof servers and obtain sensitive information via a crafted certificate.This means that the Chinese MITM of iCloud could potentially have revealed a significant number of iCloud credentials as well as private data (images, videos, documents etc) to the attackers. Or, as @Exploit_This tweeted: "So china wants our nudes?"
Posted by Erik Hjelmvik on Monday, 20 October 2014 13:35:00 (UTC/GMT)