dinsdag 24 mei 2011

Make your non-promiscuous WLAN interface promiscuous

Thanks to two easy commands, I was able to make my non-promiscuous WLAN-card promiscuous. The two command are:

  sudo iw dev wlan0 interface add mon0 type monitor
  sudo ifconfig mon0 up

(If 'iw' is not yet installed, install it using "sudo apt-get install iw")

After these commands, I was able to listen promiscuously on open (= unencrypted, non-WEP, non-WPA) WLANs using wireshark and tcpdump.

Alas I can't use mon0 with driftnet and iftop (complaining about not finding an IP address on mon0)

dinsdag 17 mei 2011

Whatsapp sends contact info and messages in plain text

Triggered by the discussion on the Dutch telco KPN telling it's using DPI to detect Whatsapp traffic, I thought it was a good idea to look at the Whatsapp traffic using Wireshark. Wireshark is a tool to see all network traffic.
I wanted to see which Whatsapp traffic can be read by a man-in-the-middle. A man-in-the-middle is anybody sniffing the network. So that can be a telco, but also others users on a (wireless) LAN used by whatsapp users.

So I built a high-tech setup man-in-the-middle network sniffer. Well, to be honest, I took a stone age old network hub: a Netgear EN104, made by Bay Networks, probably in 1998. A hub (not a switch) is needed in this setup because it will send all traffic to all ports.
I connected that hub between my Internet connection and a Wifi access point. I connected my Ubuntu machine, running Wireshark, to the hub. An Android phone running Whatsapp used the wireless access point.
Thanks to the hub, I could  see all traffic of the Android phone.


At first sight, things looked good: Whatsapp is using HTTPS and SSL to communicate. So, a man-in-the-middle can see someone is using Whatsapp (by looking for traffic with IP address 50.22.227.224, which is used by Whatsapp), but he/she can't see what's being said because SSL is used. So that looked good and nothing to worry about. But ... read on ... :-(

On my inspection, something strange occurred to me: the mobile number and the name of the person I was chatting with, was in the SSL package in plain text. See the included screendump (his mobile number 31620609... partly anonymized, his name "Arjan" still visible).


That means that someone sniffing the network can see the mobile numbers and names of persons chatting via Whatsapp. That's quite a privacy intrusion. The sniffer can collect that information, and could use it to add that person to his own address book to start spamming that person via Whatsapp. Or the sniffer could just call the mobile number for some social engineering; remember: the person's name is also known to the sniffer.

But now even worse: a further inspection showed that even the Whatsapp text messages themselves are in plain text. Still in the those SSL IP packets, of which you would expect encryption.

Proof #1: wireshark log of Whatsapp text "werkt het" (Dutch for "is it working") in plain text:


Proof #2: wireshark log of Whatsapp text "even wireshark vullen" (Dutch for "let's fill wireshark") in plain text:



So: using standard hardware, you can see the contents of Whatsapp messages, and the mobile number and name of the person being chatted with. On a Wifi network, you won't need the hub and you could just sniff the Whatsapp traffic using your laptop.

I don't know why the information is in plain text. And I really don't understand how and why that information is in plain text in a SSL IP packet.

http://www.whatsapp.com/faq/ does not say anything about encryption. :-(

Things to do:

  • you: be careful what you say via Whatsapp, especially on a Wifi network. 
  • me: write a tool to automatically harvest the information from Whatsapp traffic
  • Whatsapp company: encrypt all traffic
Things I wonder about:
  • what are the 10-digit numbers  (not the mobile numbers): "1305512345". Maybe they are the Whatsapp ID for the user? UPDATE: see comment below: it's just the time stamp in unix time format.
  • Is there encryption at all; maybe it's just port 443, and no encryption at all?


Technical stuff:

  • Whatsapp version 2.6.3762 running on HTC Wildfire with Android 2.2.1
  • Wireshark filter for all traffic by Android device on IP addres 192.168.178.31: "ip.src == 192.168.178.31 or ip.dst == 192.168.178.31"


FYI: I did not change anything on my phone nor in Whatsapp. I just listened to the network traffic using Wireshark

PS 1 (2011-05-18 11:00): Before blogging this information, I mailed Whatsapp about this subject. After not receiving any answer, I posted this blog 24 hours later. So far, I've not received a reply from Whatsapp.

PS 2 (2011-05-18 11:00): I have not tried this directly on a WLAN myself (without a hub, I mean). If you want to do that yourself, you need a network card that supports promiscuous mode. A lot of cards (most cards?) do not support promiscuous mode. Most easy way to check that, is to run "sudo iftop -p -i wlan0" and check whether you see the names of sites visited by other users on the WLAN. If not, your card does  not support promiscuous mode, and you won't see any traffic (and thus no Whatsapp traffic) using wireshark

PS 3 (2011-05-18 21:00): I got a reply from Whatsapp saying "Messages are encrypted through the underlying protocols such as 3G or Wi-Fi." ... implicitly confirming the lack of encryption at the Whatsapp application layer. :-(
As stated above, on 3G the telco can thus see all Whatsapp information, using DPI or other tools. On Wifi, when you have access, there is no encryption anymore.

PS 4 (2011-05-18 22:00): Someone has reproduced the above results on a plain iMac with wireshark listening to the wireless LAN. So this is the proof you can monitor Whatsapp traffic/contents in a hotspot with normal hardware.

PS 5: (2011-05-19 08:00): Webwereld picked this up. See http://webwereld.nl/nieuws/106723/whatsapp-lekt-06-nummers-en-chatberichten.html (Dutch)

PS 6 (2011-05-19 10:40): more websites, all Dutch:
http://www.nu.nl/internet/2518726/verkeer-whatsapp-niet-versleuteld.html
http://www.ad.nl/ad/nl/5595/Digitaal/article/detail/2433845/2011/05/19/Sms-dienst-WhatsApp-lekt-informatie-gebruikers.dhtml
http://www.nrc.nl/nieuws/2011/05/19/gegevens-whatsapp-gemakkelijk-af-te-tappen/
http://www.volkskrant.nl/vk/nl/2694/Internet-Media/article/detail/2433845/2011/05/19/Sms-dienst-WhatsApp-lekt-informatie-gebruikers.dhtml
http://www.rtl.nl/(/actueel/rtlnieuws/binnenland/)/components/actueel/rtlnieuws/2011/05_mei/19/binnenland/gegevens_whatsapp_makkelijk_achterhaalbaar_privacy.xml

PS 7: "Whatsapp" is now a trending topic on twitter in the Netherlands:


PS 8 (2011-05-22): there seem to be different protocols among Android and iPhone talking to the Whatsapp servers.

PS 9 (2011-05-23): the news has arrived in Spain:
http://carlosadlrs.wordpress.com/2011/05/22/whatsapp-revela-numeros-de-telefono-y-las-conversaciones/
http://www.ondacero.es/OndaCero/noticia.do?titular=&id=110523156&hit=1&automatic=true
http://www.eleconomista.es/tecnologia-internet/noticias/3095881/05/11/Un-fallo-de-seguridad-en-WhatsApp-permite-acceder-a-numeros-y-mensajes.html
... and Mexico:
http://www.pcworld.com.mx/Articulos/12986.htm


To be continued ...

zaterdag 14 mei 2011

I Love VLC

Eva gave me a new mug: I Love VLC

(If you want a I-Love-VLC mug yourself, go to ... Valencia, Spain)

zaterdag 7 mei 2011

Goedkoop mobiel Internet in het buitenland met een lokale prepaid-SIM met databundel

Goedkoop mobiel Internet in het buitenland met een lokale prepaid-SIM met databundel


Samenvatting: ga je naar Spanje, en wil je daar goedkoop mobiel Internet hebben, koop dan bij de Spaanse MediaMarkt een Spaanse Simyo-SIM voor 10 Euro, en stop die in je iPhone/Android-telefoon. Ik heb hiermee in een week tijd zo'n 2000 Euro bespaard.


Hoge kosten bij mobiel Internet in het buitenland

Als je met je iPhone/Android-toestel buiten Nederland bent, dan kan je natuurlijk daar gewoon je mobiele Internet via je Nederlandse provider (KPN, T-Mobile, Orange, Ben, Hi, Telfort) blijven gebruiken. Dat is makkelijk, maar het kost je wel zo'n 5 Euro per MB: dat zegt de SMS die ik van KPN krijg als ik in Spanje aankom.

Aangezien één webpagina al één MB kan zijn, betekent dat dat je factuur thuis makkelijk kan oplopen tot honderden Euro's. En dat is niet leuk, om het mild te zeggen.


Bespaar geld met een lokale SIM


Je kan veel geld besparen door in het buitenland een lokale prepaid-SIM met databundel te kopen. Ik heb dat gedaan in Spanje: ik heb een SIM van Simyo (www.simyo.es) gekocht. Voor 10 Euro kocht ik een prepaid ("prepago") Simyo-SIM inclusief 10 Euro bel/SMS/Internet-tegoed. Het Internet-gebruik kost via Simyo 0.03 Euro per MB (ofwel: 3 cent per MB). Via een lokale SIM Internetten is dus meer dan 100 keer zo goedkoop! Voor 10 Euro kon ik dus zo'n 333 MB gaan verbruiken. Prima deal!


Nodig: telefoon zonder SIM-lock


Aangezien je een SIM van een andere provider in je telefoon gaat stoppen, mag je telefoon geen SIM-lock hebben. Als je telefoon nog wel een SIM-lock heeft, maar je hebt te telefoon langer dan een jaar, dan kan je de unlock-code aanvragen bij je provider.


Simyo-SIM kopen


Het kopen van een prepaid-SIM in Spanje gaat helaas wat omslachtiger dan in Nederland.

Eerst ben ik naar de PhoneHouse gegaan. Na 40 minuten wachten vertelden ze me doodleuk dat ze geen Simyo verkochten (ondanks de aanbieding in hun folder).

Dus daarna naar de Spaanse MediaMarkt, en daar verkochten ze wel Simyo-SIMs. Om te die te kunnen kopen moest de MediaMarkt een paar formulieren invullen. De MediaMarkt had daarvoor mijn paspoortgegevens en een adres nodig. Aangezien mijn Nederlandse postcode werd geweigerd door het systeem, heb ik het adres opgegeven van een hotel waar ik verbleef. Daarmee kon ik de SIM kopen.


SIM in toestel


Ik heb daarna de SIM in mijn Android gestopt. Het toestel vraagt bij het opstarten om een PIN-code. Opgelet: dat is de PIN-code van je nieuwe kaart, niet je oude, eigen PIN-code. De PIN-code staat op het harde plastic kaartje waar de SIM in zat.


De APN stond al goed op gprs-service.com (gecontroleerd via Settings), dus ik kon gelijk Internetten. Natuurlijk werken Google Maps en Whatsapp ook goed.


Mijn Gmail klaagde dat hij niet kon inloggen. Als je klikt op die foutmelding, dan kan je je Gmail-wachtwoord opnieuw intypen. Daarna was alles goed. Misschien is dit een extra beveiliging van Gmail dat als de SIM-kaart wijzigt, dan ze opnieuw verificatie vragen.


Tethering


Tethering werkt ook goed; zowel een netbook als de iPad konden tetheren via de Android, en hadden dus ook Internet.


Tegoed opvragen


Om je Simyo-tegoed op te vragen, tik je "*1212#" en daarna <bellen> op je telefoon. Het tegoed verschijnt dan als een soort popup in beeld.

Je kunt ook 1212 bellen, maar dan krijg je een Spaanstalig menu/antwoord.


Het lijkt erop dat de tegoed-informatie periodiek (eens per etmaal?) wordt geupdate, dus je daadwerkelijke saldo kan lager zijn dan wat er gemeld wordt.


Tegoed opladen


Bij een tijdschriftenwinkel ("Open 365"?) heb ik mijn Simyo-tegoed opgeladen toen de 10 Euro verbruikt was: aan de kassa zeg je je mobiele nummer (begint met een 6, staat niet op de SIM, wel op de MediaMarkt-factuur) en het bedrag dat je wil storten (een veelvoud van 5 Euro). Daarna krijg je een SMS dat het tegoed verhoogd is. Dus je hoeft zelf niks in te typen op je telefoon. Da's handig.


Besparing


In week tijd heb ik in Spanje ongeveer 13 Euro Internet verbruikt. Dat is dus via het 0.03 Euro/MB-tarief, zo'n 400 MB. Als ik dat via mijn Nederlandse KPN-SIM had gedaan, dan had dat 2000 Euro gekost. Ik heb er nu 20 Euro voor betaald (twee stortingen van 10 Euro), dus een besparing van zo'n 2000 Euro.


Lokaal bellen


Met de Spaanse SIM kan je natuurlijk ook lokaal bellen voor lokaal tarief


Nadeel


Nadeel van deze methode is dat je niet bereikbaar bent op je eigen Nederlandse telefoonnumer. Ik ga dat de volgende keer oplossen door mijn Nederlandse SIM in een ander, oud toestel te gebruiken.

Echt mooi zou zijn een Android-toestel waarin twee SIMs gelijktijdig actief zijn: je Nederlandse SIM voor Nederlandse gesprekken, en je lokale SIM voor Internet (en lokale gesprekken).



Andere buitenlanden


Ik heb nog geen ervaring in andere 'buitenlanden'. Binnenkort ben ik in Frankrijk, dus dan ga ik daar op zoek naar een prepaid-SIM met Internet …

Of nog beter: ik ga nu kijken of ik via een website een Franse prepaid-SIM kan laten thuis bezorgen ...


Alvast even op simyo.fr gekeken, maar dat ziet er niet goed uit: "You can connect to Internet from your mobile phone simyo in France and costs 0.05 € / 10kb or € 5.12 / mo". Dus 5 Euro per MB?! Dat is even duur als Internetten met je Nederlandse SIM. In Frankrijk is Simyo dus geen oplossing. Verder zoeken dus.