Difference between revisions of "Install c't'-Raspion on Raspberry PI"
Line 51: | Line 51: | ||
The mitm-Proxy can loop into the communication between the local and remote devices by the c't-Raspion redirecting all access from the internal network on TCP ports 80 and 443 to the mitm-Proxy. It takes the redirected accesses to port | The mitm-Proxy can loop into the communication between the local and remote devices by the c't-Raspion redirecting all access from the internal network on TCP ports 80 and 443 to the mitm-Proxy. It takes the redirected accesses to port | ||
8080 towards. The redirection is handled by firewall rules, which can be activated and deactivated as required by clicking in the c't-Raspion web interface. | 8080 towards. The redirection is handled by firewall rules, which can be activated and deactivated as required by clicking in the c't-Raspion web interface. | ||
== Kommunikation entschlüsseln == | |||
Bei diesem Versuch wird geschaut ob es möglich ist die Kommunikation, zwischen der IKEA App und dem IKEA Gateway mitzuhören. Nur mit einem Packet Sniffer ist dies nicht möglich, da die Kommunikation per DTLS verschlüsselt wird. Es kam zum Einsatz der MITM Proxy, welcher bei dem c’t-Raspion dabei ist. | |||
=== Aufbau === | |||
[[File:mitm-top]] | |||
Android kann als eine Virtuelle Maschine betrieben werden, oder es kann auch ein Smart Phone benutzt werden welches die IKEA Smarthome App installiert hat. Wenn es als Virtuelle Maschine betrieben wird, ist drauf zu achten, dass der Bridge Mode benutzt wird, da dann die VM eine eigene IP erhält. Dies hat den Vorteil, dass man nur den Traffic analysieren muss, welcher von Android erzeugt wird und nicht dem des Host Systems. | |||
Um den MITM benutzten zu können, müssen die Zertifikaten zu dem Key-Store hinzugefügt werden. Dies kann getan werden in dem man die Website mitm.it ansurft. Ist man in dem richtigen Netzwerk sieht man folgendes Fenster. | |||
[[File:mitmproxy-cert]] | |||
Hier wählt man das richtige Betriebssystem und lädt die Zertifikate herunter. | |||
Die offizielle Dokumentation findet man hier[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup]. | |||
=== Findings === | |||
Beim Starten der App kann man in Wireshark stehen, dass der Handshake für die DTLS Verbindung durchgeführt wird. | |||
[[File:wireshark-dtls]] | |||
Ebenso kann man beobachten, dass mehrere Verbindungen mit verschiedenen Servern nach draußen aufgebaut werden. | |||
[[File:wireshark-tls]] | |||
Die Nachrichten zu diesen Servern können durch den MITM entschlüsselt werden. | |||
[[File:mitm-sniff]] | |||
Beide Nachrichten beinhalten eine JSON-Datei. | |||
{ | |||
"descriptionText": "That’s why we have updated the terms and conditions. Please agree below in order to continue. You can find the updated legal information in Settings or you can read more below.", | |||
"lastUpdatedTimestampCookie": 1568799375000, | |||
"lastUpdatedTimestampPP": 1568798738000, | |||
"lastUpdatedTimestampTnC": 1568798786000, | |||
"titleText": "We’ve changed the name of our app! " | |||
} | |||
{ | |||
"versionCode": "44", | |||
"versionName": "1.11.3" | |||
} | |||
Im debug log kann beobachtet werden, dass weitere TLS Verbindung aufgebaut werden jedoch nicht entschlüsselt werden können. | |||
192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy's certificate for data.logentries.com. | |||
192.168.24.241:59332: ClientHandshakeException('Cannot establish TLS with client (sni: data.logentries.com): TlsException("(-1, \'Unexpected EOF\')")') | |||
::ffff:192.168.24.241:58971: serverdisconnect | |||
-> ('99.86.243.4', 443) | |||
192.168.24.241:59332: clientdisconnect | |||
::ffff:192.168.24.241:40204: serverdisconnect | |||
-> ('99.86.243.50', 443) | |||
192.168.24.241:58971: clientdisconnect | |||
192.168.24.241:40204: clientdisconnect | |||
192.168.24.241:41657: clientconnect | |||
::ffff:192.168.24.241:41657: Establish TLS with client | |||
192.168.24.241:50453: clientconnect | |||
::ffff:192.168.24.241:50453: serverconnect | |||
-> ('99.86.243.36', 443) | |||
192.168.24.241:42222: clientconnect | |||
::ffff:192.168.24.241:42222: serverconnect | |||
-> ('99.86.243.4', 443) | |||
::ffff:192.168.24.241:42222: Establish TLS with server | |||
::ffff:192.168.24.241:50453: Establish TLS with server | |||
::ffff:192.168.24.241:42222: ALPN selected by server: - | |||
::ffff:192.168.24.241:42222: Establish TLS with client | |||
::ffff:192.168.24.241:50453: ALPN selected by server: - | |||
::ffff:192.168.24.241:50453: Establish TLS with client | |||
::ffff:192.168.24.241:42222: ALPN for client: b'http/1.1' | |||
::ffff:192.168.24.241:50453: ALPN for client: b'http/1.1' | |||
::ffff:192.168.24.241:50453: request | |||
-> Request(GET /US/en/getPolicyUpdate/?deviceType=android) | |||
::ffff:192.168.24.241:42222: request | |||
-> Request(GET /AppDetails) | |||
::ffff:192.168.24.241:42222: response | |||
-> Response(200 OK, application/json, 44b) | |||
::ffff:192.168.24.241:50453: response | |||
-> Response(200 OK, application/json, 374b) | |||
Die DTLS Verbindung zwischen der App und dem Gateway, erscheint jedoch nicht in dem Log des MITM. |
Revision as of 14:33, 11 May 2020
Requirements
- Raspberry PI with Raspbian OS
- Internet connection
Description
Step 1: System Update
In the command line interface enter:
sudo apt-get update && sudo apt-get upgrade
Step 2: Download
Download the latest version of Raspion:
wget ct.de/s/x5Pm -O raspion.zip
Step 3: Installation
Unzip:
unzip raspion.zip
Install:
cd raspion ./install.sh or bash install.sh
At the end of the installation there is the wifi name and password of the c't-Raspion.
Launch c't-Raspion web interface
Atfer connecting to the wifi of the c't'-Raspion go to http://<ip-address of your Raspberry-PI>:81
Services of the c't-Raspion
Pi-hole
Pi-hole shows DNS-Requests. They can also be blocked.
ntopng
They include the involved communication partners, the network protocol and information on duration and volume. ntopng does not show the contents of the packages. But it analyses the flows and provides information about which application is communicating, such as Skype, BitTorrent etc., and provides statistics.
Wireshark
Wireshark offers a deeper analysis of the network traffic as ntopng. The program allows recording and analyzing network traffic down to the last bit and can be operated via browser as a special feature of c't-Raspion. The recorded network traffic will be saved in pcap-files.
mitmproxy
The mitm-Proxy can loop into the communication between the local and remote devices by the c't-Raspion redirecting all access from the internal network on TCP ports 80 and 443 to the mitm-Proxy. It takes the redirected accesses to port 8080 towards. The redirection is handled by firewall rules, which can be activated and deactivated as required by clicking in the c't-Raspion web interface.
Kommunikation entschlüsseln
Bei diesem Versuch wird geschaut ob es möglich ist die Kommunikation, zwischen der IKEA App und dem IKEA Gateway mitzuhören. Nur mit einem Packet Sniffer ist dies nicht möglich, da die Kommunikation per DTLS verschlüsselt wird. Es kam zum Einsatz der MITM Proxy, welcher bei dem c’t-Raspion dabei ist.
Aufbau
Android kann als eine Virtuelle Maschine betrieben werden, oder es kann auch ein Smart Phone benutzt werden welches die IKEA Smarthome App installiert hat. Wenn es als Virtuelle Maschine betrieben wird, ist drauf zu achten, dass der Bridge Mode benutzt wird, da dann die VM eine eigene IP erhält. Dies hat den Vorteil, dass man nur den Traffic analysieren muss, welcher von Android erzeugt wird und nicht dem des Host Systems. Um den MITM benutzten zu können, müssen die Zertifikaten zu dem Key-Store hinzugefügt werden. Dies kann getan werden in dem man die Website mitm.it ansurft. Ist man in dem richtigen Netzwerk sieht man folgendes Fenster.
File:Mitmproxy-cert Hier wählt man das richtige Betriebssystem und lädt die Zertifikate herunter.
Die offizielle Dokumentation findet man hier[1].
Findings
Beim Starten der App kann man in Wireshark stehen, dass der Handshake für die DTLS Verbindung durchgeführt wird.
Ebenso kann man beobachten, dass mehrere Verbindungen mit verschiedenen Servern nach draußen aufgebaut werden.
Die Nachrichten zu diesen Servern können durch den MITM entschlüsselt werden.
Beide Nachrichten beinhalten eine JSON-Datei.
{
"descriptionText": "That’s why we have updated the terms and conditions. Please agree below in order to continue. You can find the updated legal information in Settings or you can read more below.", "lastUpdatedTimestampCookie": 1568799375000, "lastUpdatedTimestampPP": 1568798738000, "lastUpdatedTimestampTnC": 1568798786000, "titleText": "We’ve changed the name of our app! "
} {
"versionCode": "44", "versionName": "1.11.3"
}
Im debug log kann beobachtet werden, dass weitere TLS Verbindung aufgebaut werden jedoch nicht entschlüsselt werden können.
192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy's certificate for data.logentries.com. 192.168.24.241:59332: ClientHandshakeException('Cannot establish TLS with client (sni: data.logentries.com): TlsException("(-1, \'Unexpected EOF\')")') ::ffff:192.168.24.241:58971: serverdisconnect -> ('99.86.243.4', 443) 192.168.24.241:59332: clientdisconnect ::ffff:192.168.24.241:40204: serverdisconnect -> ('99.86.243.50', 443) 192.168.24.241:58971: clientdisconnect 192.168.24.241:40204: clientdisconnect 192.168.24.241:41657: clientconnect ::ffff:192.168.24.241:41657: Establish TLS with client 192.168.24.241:50453: clientconnect ::ffff:192.168.24.241:50453: serverconnect -> ('99.86.243.36', 443) 192.168.24.241:42222: clientconnect ::ffff:192.168.24.241:42222: serverconnect -> ('99.86.243.4', 443) ::ffff:192.168.24.241:42222: Establish TLS with server ::ffff:192.168.24.241:50453: Establish TLS with server ::ffff:192.168.24.241:42222: ALPN selected by server: - ::ffff:192.168.24.241:42222: Establish TLS with client ::ffff:192.168.24.241:50453: ALPN selected by server: - ::ffff:192.168.24.241:50453: Establish TLS with client ::ffff:192.168.24.241:42222: ALPN for client: b'http/1.1' ::ffff:192.168.24.241:50453: ALPN for client: b'http/1.1' ::ffff:192.168.24.241:50453: request -> Request(GET /US/en/getPolicyUpdate/?deviceType=android) ::ffff:192.168.24.241:42222: request -> Request(GET /AppDetails) ::ffff:192.168.24.241:42222: response -> Response(200 OK, application/json, 44b) ::ffff:192.168.24.241:50453: response -> Response(200 OK, application/json, 374b)
Die DTLS Verbindung zwischen der App und dem Gateway, erscheint jedoch nicht in dem Log des MITM.