<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=FChallakhi</id>
	<title>Elvis Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://elvis.hcw.ac.at/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=FChallakhi"/>
	<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php/Special:Contributions/FChallakhi"/>
	<updated>2026-09-10T18:07:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.5</generator>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Keysy.jpg&amp;diff=6065</id>
		<title>File:Keysy.jpg</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Keysy.jpg&amp;diff=6065"/>
		<updated>2021-02-27T08:04:07Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=KeySy:_Copying_and_Replaying_RFID_Tags&amp;diff=6064</id>
		<title>KeySy: Copying and Replaying RFID Tags</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=KeySy:_Copying_and_Replaying_RFID_Tags&amp;diff=6064"/>
		<updated>2021-02-27T08:03:25Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
The KeySy is an low-frequency RFID duplicator by Tiny Labs, which can be used to store, replay and duplicate 125kHz RFID Tags. It comes with the KeySy remote and an additional rewriteable keyfob, onto which stored data can be duplicated.&lt;br /&gt;
&lt;br /&gt;
[[File: Keysy.jpg | 300 px]]&lt;br /&gt;
&lt;br /&gt;
== Hardware Used ==&lt;br /&gt;
&lt;br /&gt;
* KeySy RFID Duplicator (includes CR2032 battery)&lt;br /&gt;
* programmed 125 kHz RFID Tag&lt;br /&gt;
* empty 125 kHz RFID Tag&lt;br /&gt;
&lt;br /&gt;
== Copying RFID Tags ==&lt;br /&gt;
&lt;br /&gt;
==== Step 1 ====&lt;br /&gt;
&lt;br /&gt;
On the KeySy remote, press the button you wish to program until the light starts blinking red (approx. 8 seconds)&lt;br /&gt;
&lt;br /&gt;
==== Step 2 ====&lt;br /&gt;
Place the remote on the keycard to be copied until the light stops blinking.&lt;br /&gt;
If the copying process was successful, the light will now be green otherwise it will turn amber and you should proceed to Step 3.&lt;br /&gt;
&lt;br /&gt;
==== Step 3 ====&lt;br /&gt;
If the light turned amber, the copying process failed. Turn over the tag and repeat Steps 1 &amp;amp; 2 while slowly moving the KeySy remote over the tag.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; If the copying process keeps failing: &#039;&#039;&#039;&lt;br /&gt;
* Change the battery: &amp;lt;br /&amp;gt;Copying a tag uses a lot more energy than just replaying one. This means, even if the LED lights up, the battery could be too weak to complete the copying process.&lt;br /&gt;
* Check KeySy compatibility: &amp;lt;br /&amp;gt; The Tag you want to copy is simply not readable by the remote. Refer to Section [[#Hardware Limitations| Hardware Limitations]] or Tiny Labs website under KeySy compatibility for further information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039; Any buttons that have already been programmed can be rewritten using the same steps. It is not necessary to explicitly delete information from the remote beforehand.&lt;br /&gt;
&lt;br /&gt;
== Replaying and Duplicating Tags ==&lt;br /&gt;
&lt;br /&gt;
When you press one of the buttons on the KeySy remote, the LED will either flash red (there is nothing programmed on the button) or green (there is currently something programmed on this button). &lt;br /&gt;
&lt;br /&gt;
=== Replaying ===&lt;br /&gt;
To replay a stored RFID tag from the remote, simply press and release the corresponding button in front of the RFID reader. Replay distance of the KeySy is about 5cm. The reader should blink or beep when the tags has been read successfully.&lt;br /&gt;
&lt;br /&gt;
=== Duplicating Tags ===&lt;br /&gt;
The KeySy remote can also be used to program empty RFIDs tags with the information stored on one of the buttons.&lt;br /&gt;
&lt;br /&gt;
==== Step 1 ====&lt;br /&gt;
Position the remote on top of the empty RFID tag.&lt;br /&gt;
&lt;br /&gt;
==== Step 2 ====&lt;br /&gt;
Press the button you wish to copy 5 times, after which the LED will start blinking. &lt;br /&gt;
&lt;br /&gt;
==== Step 3 ====&lt;br /&gt;
When programming is finished the LED will blink 3 times green or red, if programming the keyfob failed. In this case please refer to Section [[#Copying RFID Tags| Copying RFID Tags]] Step 3.&lt;br /&gt;
&lt;br /&gt;
== Hardware Limitations ==&lt;br /&gt;
The KeySy is designed to only work with RFID Tags which operate on the 125kHz Frequency. This means, NFC tags which operate on &#039;&#039;&#039;13.56 MHz cannot be read or copied&#039;&#039;&#039;. While perimeter access control systems frequently use low-frequency RFID (e.g., gym cards, garage doors, building key cards), many building key cards provided by employers use NFC, because the require additional functionality such as authentication and are incompatible with the KeySy. Phones also use high frequency RFID, so as a rule of thumb you can remember: &#039;&#039;Any tag your phone can read, the KeySy cannot and vice versa&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
This limitation has been put on the KeySy purposefully for security reasons to prevent the copying of sensitive information, e.g., debit cards.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://tinylabs.io/keysy/&lt;br /&gt;
* https://www.iso.org/standard/56692.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Keysy.png&amp;diff=6063</id>
		<title>File:Keysy.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Keysy.png&amp;diff=6063"/>
		<updated>2021-02-27T07:58:44Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=KeySy:_Copying_and_Replaying_RFID_Tags&amp;diff=6062</id>
		<title>KeySy: Copying and Replaying RFID Tags</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=KeySy:_Copying_and_Replaying_RFID_Tags&amp;diff=6062"/>
		<updated>2021-02-27T07:58:13Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
The KeySy is an low-frequency RFID duplicator by Tiny Labs, which can be used to store, replay and duplicate 125kHz RFID Tags. It comes with the KeySy remote and an additional rewriteable keyfob, onto which stored data can be duplicated.&lt;br /&gt;
&lt;br /&gt;
[[File: Keysy.png | 300 px]]&lt;br /&gt;
&lt;br /&gt;
== Hardware Used ==&lt;br /&gt;
&lt;br /&gt;
* KeySy RFID Duplicator (includes CR2032 battery)&lt;br /&gt;
* programmed 125 kHz RFID Tag&lt;br /&gt;
* empty 125 kHz RFID Tag&lt;br /&gt;
&lt;br /&gt;
== Copying RFID Tags ==&lt;br /&gt;
&lt;br /&gt;
==== Step 1 ====&lt;br /&gt;
&lt;br /&gt;
On the KeySy remote, press the button you wish to program until the light starts blinking red (approx. 8 seconds)&lt;br /&gt;
&lt;br /&gt;
==== Step 2 ====&lt;br /&gt;
Place the remote on the keycard to be copied until the light stops blinking.&lt;br /&gt;
If the copying process was successful, the light will now be green otherwise it will turn amber and you should proceed to Step 3.&lt;br /&gt;
&lt;br /&gt;
==== Step 3 ====&lt;br /&gt;
If the light turned amber, the copying process failed. Turn over the tag and repeat Steps 1 &amp;amp; 2 while slowly moving the KeySy remote over the tag.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; If the copying process keeps failing: &#039;&#039;&#039;&lt;br /&gt;
* Change the battery: &amp;lt;br /&amp;gt;Copying a tag uses a lot more energy than just replaying one. This means, even if the LED lights up, the battery could be too weak to complete the copying process.&lt;br /&gt;
* Check KeySy compatibility: &amp;lt;br /&amp;gt; The Tag you want to copy is simply not readable by the remote. Refer to Section [[#Hardware Limitations| Hardware Limitations]] or Tiny Labs website under KeySy compatibility for further information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039; Any buttons that have already been programmed can be rewritten using the same steps. It is not necessary to explicitly delete information from the remote beforehand.&lt;br /&gt;
&lt;br /&gt;
== Replaying and Duplicating Tags ==&lt;br /&gt;
&lt;br /&gt;
When you press one of the buttons on the KeySy remote, the LED will either flash red (there is nothing programmed on the button) or green (there is currently something programmed on this button). &lt;br /&gt;
&lt;br /&gt;
=== Replaying ===&lt;br /&gt;
To replay a stored RFID tag from the remote, simply press and release the corresponding button in front of the RFID reader. Replay distance of the KeySy is about 5cm. The reader should blink or beep when the tags has been read successfully.&lt;br /&gt;
&lt;br /&gt;
=== Duplicating Tags ===&lt;br /&gt;
The KeySy remote can also be used to program empty RFIDs tags with the information stored on one of the buttons.&lt;br /&gt;
&lt;br /&gt;
==== Step 1 ====&lt;br /&gt;
Position the remote on top of the empty RFID tag.&lt;br /&gt;
&lt;br /&gt;
==== Step 2 ====&lt;br /&gt;
Press the button you wish to copy 5 times, after which the LED will start blinking. &lt;br /&gt;
&lt;br /&gt;
==== Step 3 ====&lt;br /&gt;
When programming is finished the LED will blink 3 times green or red, if programming the keyfob failed. In this case please refer to Section [[#Copying RFID Tags| Copying RFID Tags]] Step 3.&lt;br /&gt;
&lt;br /&gt;
== Hardware Limitations ==&lt;br /&gt;
The KeySy is designed to only work with RFID Tags which operate on the 125kHz Frequency. This means, NFC tags which operate on &#039;&#039;&#039;13.56 MHz cannot be read or copied&#039;&#039;&#039;. While perimeter access control systems frequently use low-frequency RFID (e.g., gym cards, garage doors, building key cards), many building key cards provided by employers use NFC, because the require additional functionality such as authentication and are incompatible with the KeySy. Phones also use high frequency RFID, so as a rule of thumb you can remember: &#039;&#039;Any tag your phone can read, the KeySy cannot and vice versa&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
This limitation has been put on the KeySy purposefully for security reasons to prevent the copying of sensitive information, e.g., debit cards.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://tinylabs.io/keysy/&lt;br /&gt;
* https://www.iso.org/standard/56692.html&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:ChameleonButton.PNG&amp;diff=6061</id>
		<title>File:ChameleonButton.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:ChameleonButton.PNG&amp;diff=6061"/>
		<updated>2021-02-27T07:51:28Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Chameleon_Mini_RevE_rebooted_Usage&amp;diff=6060</id>
		<title>Chameleon Mini RevE rebooted Usage</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Chameleon_Mini_RevE_rebooted_Usage&amp;diff=6060"/>
		<updated>2021-02-27T07:48:23Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: Added a description of the Chameleon Mini and more about the usage with the GUI in Window&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Functionality and usage of Chameleon Mini RevE rebooted&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Chameleon Mini RevE Rebooted&lt;br /&gt;
* Operating systems are referred as: &lt;br /&gt;
** Linux: Ubuntu 18.04 bionic amd64&lt;br /&gt;
** Windows: Windows 10 (tested in a VM)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
The RFID Multitool ChameleonMini is a powerful and portable RFID emulation and manipulation tool that can emulate RFID tags, read tokens and sniff the radio communication. The credit card-shaped housing and integrated battery make it suitable for mobile use. In addition, transmissions can be read out and all data can be conveniently processed on the computer. Using a freely available open-source application, the ChameleonMini can be conveniently configured via a graphical user interface. Otherwise, it can be connected to a smartphone via USB cable or, in part, via Bluetooth and can thus also be configured on the move. This makes it possible, for example, to read an access card in passing and emulate it directly with the ChameleonMini and thus open a (actually protected) door. The ChameleonMini hardware is capable of emulating various ISO 14443, NFC and ISO 15693 cards, as well as other types of RFID transponders operating at 13.56 MHz. The ChameleonMini hardware consists of a PCB antenna driven by power transistors on the board to generate a 13.56 MHz RFID field. They thus function as an active RFID reader. An integrated Li-Ion battery can be charged via USB and enables stand-alone operation. The core of the hardware is an Atmel ATXMega128A4U microcontroller. The AES and DES hardware engines in the microcontroller enable very fast calculation of the cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
[[File:Chameleon-Mini-RevE-Rebooted.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Functionality of Chameleon Mini RevE rebooted ===&lt;br /&gt;
&lt;br /&gt;
Chameleon Mini RevE rebooted has 8 card slots to simulate cards/UIDs, each slot can be set in an own configuration mode to&lt;br /&gt;
* simulate cards/UIDs to readers&lt;br /&gt;
* help getting a first auth key from a dialogue with a reader&lt;br /&gt;
* only first slot allows up to 4K dumps/uploads because of memory limitations&lt;br /&gt;
* the default firmware can only configure MIFARE cards&lt;br /&gt;
* RevE does not copy cards&lt;br /&gt;
&lt;br /&gt;
Chameleon Mini RevE rebooted is a stand-alone device powered by CR2032 button battery&lt;br /&gt;
&lt;br /&gt;
===Card configurations supported by default firmware===&lt;br /&gt;
&lt;br /&gt;
* NONE: No functionality, ChameleonMini does nothing, the current setting is skipped when cycling through the settings&lt;br /&gt;
* MF_ULTRALIGHT: Emulates a MiFare Ultralight card&lt;br /&gt;
* MF_ULTRALIGHT_EV1_80B: Emulates a MiFare Ultralight EV1 80B card&lt;br /&gt;
* MF_ULTRALIGHT_EV1_164B: Emulates a MiFare Ultralight EV1 164B card&lt;br /&gt;
* MF_CLASSIC_1K: Emulates a MiFare Classic 1k card&lt;br /&gt;
* MF_CLASSIC_4K: Emulates a MiFare Classic 4k card&lt;br /&gt;
* MF_CLASSIC_1K_7B: Emulates a MiFare Classic 1k card with 7b UID&lt;br /&gt;
* MF_CLASSIC_4K_7B: Emulates a MiFare Classic 4k card with 7b UID&lt;br /&gt;
* MF_DETECTION: Emulates a MiFare Classic 1k card and saves nonces which can be used for mfkey32 attack in GUI&lt;br /&gt;
    &lt;br /&gt;
(Source: https://github.com/iceman1001/ChameleonMini-rebooted/wiki/Configurations, Feb 2,2020)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Description ===&lt;br /&gt;
[[File:Chameleon mini.png|200px|thumb|left|Chameleon Mini RevE rebooted]]&lt;br /&gt;
&lt;br /&gt;
* Red Leds on left side: &lt;br /&gt;
: - 8 red LEDs which indicate the active slot&lt;br /&gt;
* Black Button - &amp;quot;KEY&amp;quot;:&lt;br /&gt;
: - “short press” referred as BUTTON in commands and GUI and let you switch the active slot &lt;br /&gt;
: - “long press” - BUTTON_LONG&lt;br /&gt;
: - “long press while plugging USB cable” - BOOTLOADER Mode&lt;br /&gt;
* Red Buttern - &amp;quot;POWER&amp;quot;:&lt;br /&gt;
: - used to power on the device when used stand-alone on battery&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Device Recognition ===&lt;br /&gt;
&lt;br /&gt;
==== Linux ====&lt;br /&gt;
The linux kernel recognizes a usb device from the idVendor 03eb with the product id 2fe4&lt;br /&gt;
&lt;br /&gt;
    dmesg | grep usb&lt;br /&gt;
    [  167.571731] usb 1-3: USB disconnect, device number 3&lt;br /&gt;
    [  180.768751] usb 1-3: new full-speed USB device number 11 using xhci_hcd&lt;br /&gt;
    [  180.917821] usb 1-3: New USB device found, idVendor=03eb, idProduct=2fe4, bcdDevice= 0.04&lt;br /&gt;
    [  180.917829] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0&lt;br /&gt;
    &lt;br /&gt;
The chameleon RevE is seen as a USB modem &lt;br /&gt;
&lt;br /&gt;
    lsusb&lt;br /&gt;
    Bus 001 Device 011: ID 03eb:2fe4 Atmel Corp. ATxmega32A4U DFU bootloader&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
* in the Windows device manager should appear an Atmel USB Device: ATxmega32A4U&lt;br /&gt;
![](https://i.imgur.com/EJXyvdJ.png)&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
===GUI Usage with Chameleon Mini GUI v1.3.0.5 in Windows===&lt;br /&gt;
First you need to install the software in order to have a GUI to use the Chameleon Mini. The Version 1.3.0.5 can be downloaded here (http://www.icesql.se/download/ChameleonMiniGUI/publish.htm) &lt;br /&gt;
Afterwards connect the Chameleon Mini RevE Rebooted with an USB-Cable to your PC. The first LED with the label &amp;quot;TAG1&amp;quot; now lights up red.&lt;br /&gt;
&lt;br /&gt;
==== Device Recognition  ====&lt;br /&gt;
On start of the Windows GUI the device should be recognized and following lines should appear in the output window&lt;br /&gt;
&lt;br /&gt;
        [=] Connecting to USB Serial Device (COMX) at COMX&lt;br /&gt;
        [+] Success, found Chameleon Mini device on &#039;COMX&#039; with Firmware RevE rebooted installed&lt;br /&gt;
&lt;br /&gt;
[[File:ChameleonMiniSuccess.PNG|500px]]&lt;br /&gt;
&lt;br /&gt;
If this is not the case and you are using Windows in a VM verify that the USB device is redirected to the VM and test to connect again in the submenu &amp;quot;Settings&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Use of the Chameleon Mini with the GUI in Window ====&lt;br /&gt;
&lt;br /&gt;
In the first tab &amp;quot;Operation&amp;quot; of the Chameleon Mini GUI, up to eight different memory slots can be freely configured. In order to change an entry, the corresponding box of the entry must first be marked. Then one of four different variants can be selected in the &amp;quot;Mode&amp;quot; selection and any ID can be entered in the UID input field as shown below in the screenshot.&lt;br /&gt;
&lt;br /&gt;
[[File:ChameleonOperation.PNG|500px]]&lt;br /&gt;
&lt;br /&gt;
Below this, you can configure what happens when the button is pressed briefly or for a long time.&lt;br /&gt;
[[File:ChameleonButton.PNG|300px]]&lt;br /&gt;
&lt;br /&gt;
To save the changes made, the &amp;quot;Apply&amp;quot; button must be clicked at the bottom. It is possible to edit several entries at the same time. To do this, simply select the corresponding checkboxes.&lt;br /&gt;
&lt;br /&gt;
To emulate an RFID tag, first press the red button on the ChameleonMini RevE Rebooted. Now the memory slot that was marked as active in the software is active. Accordingly, the red LED lights up. Alternatively, ChameleonMini RevE Rebooted is activated when an RFID reader is detected. Then it activates automatically and the corresponding LED lights up. Depending on how the buttons have been configured, it is possible to switch through to RFID emulation through the corresponding memory loads.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Command Line Interface==&lt;br /&gt;
&lt;br /&gt;
==== Command return codes ====&lt;br /&gt;
Status numbers beginning with a &#039;1&#039; denote an informational item and those beginning with a &#039;2&#039; denote an error.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Response 	&lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|100:OK 	&lt;br /&gt;
|The command has been successfully executed&lt;br /&gt;
|-&lt;br /&gt;
| 101:OK WITH TEXT 	&lt;br /&gt;
| The command has been successfully executed and this response is appended with an additional line of information, terminated with CR+LF&lt;br /&gt;
|-&lt;br /&gt;
| 110:WAITING FOR XMODEM 	&lt;br /&gt;
| The Chameleon is waiting for an XMODEM connection to be established&lt;br /&gt;
|-&lt;br /&gt;
| 120:FALSE 	&lt;br /&gt;
| The request is answered with false&lt;br /&gt;
|-&lt;br /&gt;
| 121:TRUE 	&lt;br /&gt;
| The request is answered with true&lt;br /&gt;
|-&lt;br /&gt;
| 200:UNKNOWN COMMAND 	&lt;br /&gt;
| This command is unknown to the Chameleon&lt;br /&gt;
|-&lt;br /&gt;
| 201:INVALID COMMAND USAGE 	&lt;br /&gt;
| This action is not supported by this command&lt;br /&gt;
|-&lt;br /&gt;
| 202:INVALID PARAMETER 	&lt;br /&gt;
| The format or value of the given parameter value is invalid&lt;br /&gt;
|-&lt;br /&gt;
| 203:TIMEOUT 	&lt;br /&gt;
| The timeout of the currently active command has expired &lt;br /&gt;
|+ Command response codes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Chameleon Mini: RevE Rebooted]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Wiki: https://github.com/iceman1001/ChameleonMini-rebooted/wiki&lt;br /&gt;
* Linux GUI: https://github.com/WolfgangMau/chamgo-qt/releases&lt;br /&gt;
* Windows GUI: https://github.com/iceman1001/ChameleonMini-rebootedGUI&lt;br /&gt;
* Product description: https://lab401.com/products/chameleon-mini-reve-rebooted&lt;br /&gt;
* https://scheible.it/chameleon-mini/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:ChameleonOperation.PNG&amp;diff=6059</id>
		<title>File:ChameleonOperation.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:ChameleonOperation.PNG&amp;diff=6059"/>
		<updated>2021-02-24T20:36:31Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: FChallakhi uploaded a new version of File:ChameleonOperation.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:ChameleonOperation.PNG&amp;diff=6058</id>
		<title>File:ChameleonOperation.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:ChameleonOperation.PNG&amp;diff=6058"/>
		<updated>2021-02-24T20:35:21Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=ChameleonMini_RevE_Rebooted&amp;diff=6057</id>
		<title>ChameleonMini RevE Rebooted</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=ChameleonMini_RevE_Rebooted&amp;diff=6057"/>
		<updated>2021-02-24T20:35:04Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: Added the chapter ChameleonMini in Use&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction == &lt;br /&gt;
&lt;br /&gt;
The RFID Multitool ChameleonMini is a powerful and portable RFID emulation and manipulation tool that can emulate RFID tags, read tokens and sniff the radio communication. The credit card-shaped housing and integrated battery make it suitable for mobile use. In addition, transmissions can be read out and all data can be conveniently processed on the computer. Using a freely available open-source application, the ChameleonMini can be conveniently configured via a graphical user interface. Otherwise, it can be connected to a smartphone via USB cable or, in part, via Bluetooth and can thus also be configured on the move. This makes it possible, for example, to read an access card in passing and emulate it directly with the ChameleonMini and thus open a (actually protected) door. The ChameleonMini hardware is capable of emulating various ISO 14443, NFC and ISO 15693 cards, as well as other types of RFID transponders operating at 13.56 MHz. The ChameleonMini hardware consists of a PCB antenna driven by power transistors on the board to generate a 13.56 MHz RFID field. They thus function as an active RFID reader. An integrated Li-Ion battery can be charged via USB and enables stand-alone operation. The core of the hardware is an Atmel ATXMega128A4U microcontroller. The AES and DES hardware engines in the microcontroller enable very fast calculation of the cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
[[File:Chameleon-Mini-RevE-Rebooted.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* ChameleonMini&lt;br /&gt;
* PC having Windows (it is also possible to use a Android Phone, but this setup will be will on a Windows-PC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
First you need to install the software in order to have a GUI to use the Chameleon Mini. The Version 1.3.0.5 can be downloaded here (http://www.icesql.se/download/ChameleonMiniGUI/publish.htm) &lt;br /&gt;
Afterwards connect the ChameleonMini RevE Rebooted with an USB-Cable to your PC.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
The first LED with the label &amp;quot;TAG1&amp;quot; now lights up red. Now switch to the &amp;quot;Settings&amp;quot; tab, a photo is displayed there and there is a green message with the designation &amp;quot;CONNECTED! In the lower area with the messages, &amp;quot;Success, found Chameleon Mini device on &#039;COMX&#039; with Firmware RevE rebooted installed&amp;quot; appears like in the screenshot below. The ChameleonMini RevE Rebooted is now ready for use.&lt;br /&gt;
&lt;br /&gt;
[[File:ChameleonMiniSuccess.PNG|500px]]&lt;br /&gt;
&lt;br /&gt;
== ChameleonMini in Use ==&lt;br /&gt;
&lt;br /&gt;
In the first tab &amp;quot;Operation&amp;quot; of the Chameleon Mini GUI, up to eight different memory slots can be freely configured. In order to change an entry, the corresponding box of the entry must first be marked. Then one of four different variants can be selected in the &amp;quot;Mode&amp;quot; selection and any ID can be entered in the UID input field as shown below in the screenshot.&lt;br /&gt;
&lt;br /&gt;
[[File:ChameleonOperation.PNG|500px]]&lt;br /&gt;
&lt;br /&gt;
Below this, you can configure what happens when the button is pressed briefly or for a long time.&lt;br /&gt;
[[File:ChameleonButton.PNG|300px]]&lt;br /&gt;
&lt;br /&gt;
To save the changes made, the &amp;quot;Apply&amp;quot; button must be clicked at the bottom. It is possible to edit several entries at the same time. To do this, simply select the corresponding checkboxes.&lt;br /&gt;
&lt;br /&gt;
To emulate an RFID tag, first press the red button on the ChameleonMini RevE Rebooted. Now the memory slot that was marked as active in the software is active. Accordingly, the red LED lights up. Alternatively, ChameleonMini RevE Rebooted is activated when an RFID reader is detected. Then it activates automatically and the corresponding LED lights up. Depending on how the buttons have been configured, it is possible to switch through to RFID emulation through the corresponding memory loads.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/iceman1001/ChameleonMini-rebootedGUI&lt;br /&gt;
* https://scheible.it/chameleon-mini/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=ChameleonMini_RevE_Rebooted&amp;diff=6056</id>
		<title>ChameleonMini RevE Rebooted</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=ChameleonMini_RevE_Rebooted&amp;diff=6056"/>
		<updated>2021-02-24T20:29:41Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: changed the size of the pictures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction == &lt;br /&gt;
&lt;br /&gt;
The RFID Multitool ChameleonMini is a powerful and portable RFID emulation and manipulation tool that can emulate RFID tags, read tokens and sniff the radio communication. The credit card-shaped housing and integrated battery make it suitable for mobile use. In addition, transmissions can be read out and all data can be conveniently processed on the computer. Using a freely available open-source application, the ChameleonMini can be conveniently configured via a graphical user interface. Otherwise, it can be connected to a smartphone via USB cable or, in part, via Bluetooth and can thus also be configured on the move. This makes it possible, for example, to read an access card in passing and emulate it directly with the ChameleonMini and thus open a (actually protected) door. The ChameleonMini hardware is capable of emulating various ISO 14443, NFC and ISO 15693 cards, as well as other types of RFID transponders operating at 13.56 MHz. The ChameleonMini hardware consists of a PCB antenna driven by power transistors on the board to generate a 13.56 MHz RFID field. They thus function as an active RFID reader. An integrated Li-Ion battery can be charged via USB and enables stand-alone operation. The core of the hardware is an Atmel ATXMega128A4U microcontroller. The AES and DES hardware engines in the microcontroller enable very fast calculation of the cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
[[File:Chameleon-Mini-RevE-Rebooted.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* ChameleonMini&lt;br /&gt;
* PC having Windows (it is also possible to use a Android Phone, but this setup will be will on a Windows-PC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
First you need to install the software in order to have a GUI to use the Chameleon Mini. The Version 1.3.0.5 can be downloaded here (http://www.icesql.se/download/ChameleonMiniGUI/publish.htm) &lt;br /&gt;
Afterwards connect the ChameleonMini RevE Rebooted with an USB-Cable to your PC.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
The first LED with the label &amp;quot;TAG1&amp;quot; now lights up red. Now switch to the &amp;quot;Settings&amp;quot; tab, a photo is displayed there and there is a green message with the designation &amp;quot;CONNECTED! In the lower area with the messages, &amp;quot;Success, found Chameleon Mini device on &#039;COMX&#039; with Firmware RevE rebooted installed&amp;quot; appears like in the screenshot below. The ChameleonMini RevE Rebooted is now ready for use.&lt;br /&gt;
&lt;br /&gt;
[[File:ChameleonMiniSuccess.PNG|500px]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/iceman1001/ChameleonMini-rebootedGUI&lt;br /&gt;
* https://scheible.it/chameleon-mini/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:ChameleonMiniSuccess.PNG&amp;diff=6055</id>
		<title>File:ChameleonMiniSuccess.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:ChameleonMiniSuccess.PNG&amp;diff=6055"/>
		<updated>2021-02-24T20:28:33Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Chameleon-Mini-RevE-Rebooted.jpg&amp;diff=6054</id>
		<title>File:Chameleon-Mini-RevE-Rebooted.jpg</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Chameleon-Mini-RevE-Rebooted.jpg&amp;diff=6054"/>
		<updated>2021-02-24T20:28:03Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=ChameleonMini_RevE_Rebooted&amp;diff=6053</id>
		<title>ChameleonMini RevE Rebooted</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=ChameleonMini_RevE_Rebooted&amp;diff=6053"/>
		<updated>2021-02-24T20:27:07Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: Created page with &amp;quot;== Introduction ==   The RFID Multitool ChameleonMini is a powerful and portable RFID emulation and manipulation tool that can emulate RFID tags, read tokens and sniff the rad...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction == &lt;br /&gt;
&lt;br /&gt;
The RFID Multitool ChameleonMini is a powerful and portable RFID emulation and manipulation tool that can emulate RFID tags, read tokens and sniff the radio communication. The credit card-shaped housing and integrated battery make it suitable for mobile use. In addition, transmissions can be read out and all data can be conveniently processed on the computer. Using a freely available open-source application, the ChameleonMini can be conveniently configured via a graphical user interface. Otherwise, it can be connected to a smartphone via USB cable or, in part, via Bluetooth and can thus also be configured on the move. This makes it possible, for example, to read an access card in passing and emulate it directly with the ChameleonMini and thus open a (actually protected) door. The ChameleonMini hardware is capable of emulating various ISO 14443, NFC and ISO 15693 cards, as well as other types of RFID transponders operating at 13.56 MHz. The ChameleonMini hardware consists of a PCB antenna driven by power transistors on the board to generate a 13.56 MHz RFID field. They thus function as an active RFID reader. An integrated Li-Ion battery can be charged via USB and enables stand-alone operation. The core of the hardware is an Atmel ATXMega128A4U microcontroller. The AES and DES hardware engines in the microcontroller enable very fast calculation of the cryptographic algorithms.&lt;br /&gt;
&lt;br /&gt;
[[File:Chameleon-Mini-RevE-Rebooted.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* ChameleonMini&lt;br /&gt;
* PC having Windows (it is also possible to use a Android Phone, but this setup will be will on a Windows-PC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
First you need to install the software in order to have a GUI to use the Chameleon Mini. The Version 1.3.0.5 can be downloaded here (http://www.icesql.se/download/ChameleonMiniGUI/publish.htm) &lt;br /&gt;
Afterwards connect the ChameleonMini RevE Rebooted with an USB-Cable to your PC.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
The first LED with the label &amp;quot;TAG1&amp;quot; now lights up red. Now switch to the &amp;quot;Settings&amp;quot; tab, a photo is displayed there and there is a green message with the designation &amp;quot;CONNECTED! In the lower area with the messages, &amp;quot;Success, found Chameleon Mini device on &#039;COMX&#039; with Firmware RevE rebooted installed&amp;quot; appears like in the screenshot below. The ChameleonMini RevE Rebooted is now ready for use.&lt;br /&gt;
&lt;br /&gt;
[[File:ChameleonMiniSuccess.PNG]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/iceman1001/ChameleonMini-rebootedGUI&lt;br /&gt;
* https://scheible.it/chameleon-mini/&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5902</id>
		<title>OPTIGA Trust X</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5902"/>
		<updated>2021-01-30T15:57:54Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction == &lt;br /&gt;
&lt;br /&gt;
OPTIGA Trust X is a turnkey security solution for embedded systems based on a secure&lt;br /&gt;
microcontroller. It can be deployed for smart homes, industrial control and automation&lt;br /&gt;
systems, consumer electronics and medical devices.&lt;br /&gt;
Through a unique elliptic curve keypair and a corresponding X.509 certificate on&lt;br /&gt;
each device, easy integration into existing PKI infrastructure is enabled by the OPTIGA Trust X.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OptigaTrustX.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Features and Benefits===&lt;br /&gt;
&lt;br /&gt;
The OPTIGA Trust X comes with some key feature and benefits:&lt;br /&gt;
&lt;br /&gt;
* High-end security controller &lt;br /&gt;
* Turnkey solution&lt;br /&gt;
* Network node protection such as TLS or DTLS&lt;br /&gt;
* Compliant with the USB Type-C™ Authentication standard&lt;br /&gt;
* I2C interface&lt;br /&gt;
* One-way authentication using ECDSA&lt;br /&gt;
* Cryptographic support: ECC256, AES128 (via on-chip DTLS client), SHA-256, TRNG, DRNG&lt;br /&gt;
* Up to 10 KB user memory&lt;br /&gt;
* Mutual authentication using DTLS client (IETF standard RFC 6347)&lt;br /&gt;
* Secure communication using DTLS&lt;br /&gt;
* Standard and extended temperature ranges&lt;br /&gt;
* PG-USON-10-2 package (3 x 3 mm)&lt;br /&gt;
* Full system integration support&lt;br /&gt;
* Lifetime for Industrial Automation and Infrastructure is 20 years and 15 years for other Application Profiles&lt;br /&gt;
* Cryptographic Tool Box based on ECC NIST P256, P384 and SHA256 (sign, verify, key generation, ECDH, session key derivation)&lt;br /&gt;
* Common Criteria Certified EAL6+ (high) hardware&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Use Cases===&lt;br /&gt;
&lt;br /&gt;
The OPTIGA Trust X has several use cases, including:&lt;br /&gt;
&lt;br /&gt;
* Network node protection such as TLS or DTLS&lt;br /&gt;
* Protect the Authenticity, Integrity and Confidentiality of your product, data and IP&lt;br /&gt;
* Mutual Authentication&lt;br /&gt;
* Secure Communication&lt;br /&gt;
* Datastore Protection&lt;br /&gt;
* Lifecycle Management&lt;br /&gt;
* Platform Integrity Protection&lt;br /&gt;
* Secure Updates \cite{AppNote}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
In this section we are going the the step that are needed to install the Optiga Trust X.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
The OPTIGA Trust X offers on their GitHub page, a repository that you can get via GIT and which contains the code you need to start the OPTIGA Trust X functions.&lt;br /&gt;
The repository can be found on https://github.com/Infineon/getstarted-optiga-trustx.git.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
For the project we use the DAVE IDE from Infineon, because for an OPTIGA project we need DAVE specific files and folders that help us to use the functions of the OPTIGA Trust X security chip. The DAVE software can be downloaded with a free Infineon account. &lt;br /&gt;
After downloading you can install DAVE by unpacking the downloaded file DAVE3.1.10.zip. In the Eclipse Folder there should be a DAVE-3.1.10.exe file. By double clicking it DAVE should start. After that choose a workspace as shown in the figure below. Now the DAVE development environment should be seen.&lt;br /&gt;
&lt;br /&gt;
[[File:DaveWorkspace.PNG|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Having DAVE open, open the following window &#039;&#039; File -&amp;gt; Import...&#039;&#039;. Choose then the folder &#039;&#039;Infineon&#039;&#039; and the file &#039;&#039;DAVE Project&#039;&#039; as shown in the picture.&lt;br /&gt;
&lt;br /&gt;
[[File:SelectDave.PNG|500px]]&lt;br /&gt;
&lt;br /&gt;
Next you should choose as root directory the repository you got from git and select all in the Project List. At the end press finish. &lt;br /&gt;
&lt;br /&gt;
[[File:DaveRepos.PNG|500px]]&lt;br /&gt;
&lt;br /&gt;
The final project should look like the picture below.&lt;br /&gt;
&lt;br /&gt;
[[File:finalproject.PNG|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Press &#039;&#039;Project -&amp;gt; Build Active Project&#039;&#039; menu item to build the project. In the picture you can see how the console output of building the project.&lt;br /&gt;
&lt;br /&gt;
[[File:Building.PNG|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
The OPTIGA Trust X has a build-in debugger that can be accessed via a Micro USB port on the XMC Microcontroller.&lt;br /&gt;
&lt;br /&gt;
To debug or flash the microcontroller, you have to create the debug configuration via the DAVE. To do this, press the green bug symbol in the instrument panel. Then a new &#039;&#039;GDB SEGGER J-Link debugging&#039;&#039; should be created. After that it should look like the picture below. You do not have to change something in the configuration just click Debug. The board should be connected to the PC while debugging. &lt;br /&gt;
&lt;br /&gt;
[[File:debug.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
The used hardware was the [[Optiga_Trust_X_evaluation_kit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Building.PNG&amp;diff=5901</id>
		<title>File:Building.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Building.PNG&amp;diff=5901"/>
		<updated>2021-01-30T15:35:57Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Finalproject.PNG&amp;diff=5900</id>
		<title>File:Finalproject.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Finalproject.PNG&amp;diff=5900"/>
		<updated>2021-01-30T15:35:46Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:DaveRepos.PNG&amp;diff=5899</id>
		<title>File:DaveRepos.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:DaveRepos.PNG&amp;diff=5899"/>
		<updated>2021-01-30T15:35:34Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:SelectDave.PNG&amp;diff=5898</id>
		<title>File:SelectDave.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:SelectDave.PNG&amp;diff=5898"/>
		<updated>2021-01-30T15:35:18Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:DaveWorkspace.PNG&amp;diff=5897</id>
		<title>File:DaveWorkspace.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:DaveWorkspace.PNG&amp;diff=5897"/>
		<updated>2021-01-30T15:35:01Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Debug.jpg&amp;diff=5896</id>
		<title>File:Debug.jpg</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Debug.jpg&amp;diff=5896"/>
		<updated>2021-01-30T15:34:07Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:OptigaTrustX.png&amp;diff=5895</id>
		<title>File:OptigaTrustX.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:OptigaTrustX.png&amp;diff=5895"/>
		<updated>2021-01-30T15:33:47Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5894</id>
		<title>OPTIGA Trust X</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5894"/>
		<updated>2021-01-30T15:32:43Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction == &lt;br /&gt;
&lt;br /&gt;
OPTIGA Trust X is a turnkey security solution for embedded systems based on a secure&lt;br /&gt;
microcontroller. It can be deployed for smart homes, industrial control and automation&lt;br /&gt;
systems, consumer electronics and medical devices.&lt;br /&gt;
Through a unique elliptic curve keypair and a corresponding X.509 certificate on&lt;br /&gt;
each device, easy integration into existing PKI infrastructure is enabled by the OPTIGA Trust X.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OptigaTrustX.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Key Features and Benefits===&lt;br /&gt;
&lt;br /&gt;
The OPTIGA Trust X comes with some key feature and benefits:&lt;br /&gt;
&lt;br /&gt;
* High-end security controller &lt;br /&gt;
* Turnkey solution&lt;br /&gt;
* Network node protection such as TLS or DTLS&lt;br /&gt;
* Compliant with the USB Type-C™ Authentication standard&lt;br /&gt;
* I2C interface&lt;br /&gt;
* One-way authentication using ECDSA&lt;br /&gt;
* Cryptographic support: ECC256, AES128 (via on-chip DTLS client), SHA-256, TRNG, DRNG&lt;br /&gt;
* Up to 10 KB user memory&lt;br /&gt;
* Mutual authentication using DTLS client (IETF standard RFC 6347)&lt;br /&gt;
* Secure communication using DTLS&lt;br /&gt;
* Standard and extended temperature ranges&lt;br /&gt;
* PG-USON-10-2 package (3 x 3 mm)&lt;br /&gt;
* Full system integration support&lt;br /&gt;
* Lifetime for Industrial Automation and Infrastructure is 20 years and 15 years for other Application Profiles&lt;br /&gt;
* Cryptographic Tool Box based on ECC NIST P256, P384 and SHA256 (sign, verify, key generation, ECDH, session key derivation)&lt;br /&gt;
* Common Criteria Certified EAL6+ (high) hardware&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Use Cases===&lt;br /&gt;
&lt;br /&gt;
The OPTIGA Trust X has several use cases, including:&lt;br /&gt;
&lt;br /&gt;
* Network node protection such as TLS or DTLS&lt;br /&gt;
* Protect the Authenticity, Integrity and Confidentiality of your product, data and IP&lt;br /&gt;
* Mutual Authentication&lt;br /&gt;
* Secure Communication&lt;br /&gt;
* Datastore Protection&lt;br /&gt;
* Lifecycle Management&lt;br /&gt;
* Platform Integrity Protection&lt;br /&gt;
* Secure Updates \cite{AppNote}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
In this section we are going the the step that are needed to install the Optiga Trust X.&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
The OPTIGA Trust X offers on their GitHub page, a repository that you can get via GIT and which contains the code you need to start the OPTIGA Trust X functions.&lt;br /&gt;
The repository can be found on https://github.com/Infineon/getstarted-optiga-trustx.git.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
For the project we use the DAVE IDE from Infineon, because for an OPTIGA project we need DAVE specific files and folders that help us to use the functions of the OPTIGA Trust X security chip. The DAVE software can be downloaded with a free Infineon account. &lt;br /&gt;
After downloading you can install DAVE by unpacking the downloaded file DAVE3.1.10.zip. In the Eclipse Folder there should be a DAVE-3.1.10.exe file. By double clicking it DAVE should start. After that choose a workspace as shown in the figure below. Now the DAVE development environment should be seen.&lt;br /&gt;
&lt;br /&gt;
[[File:DaveWorkspace.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
Having DAVE open, open the following window &#039;&#039; File -&amp;gt; Import...&#039;&#039;. Choose then the folder &#039;&#039;Infineon&#039;&#039; and the file &#039;&#039;DAVE Project&#039;&#039; as shown in the picture.&lt;br /&gt;
&lt;br /&gt;
[[File:SelectDave.PNG]]&lt;br /&gt;
&lt;br /&gt;
Next you should choose as root directory the repository you got from git and select all in the Project List. At the end press finish. &lt;br /&gt;
&lt;br /&gt;
[[File:DaveRepos.PNG]]&lt;br /&gt;
&lt;br /&gt;
The final project should look like the picture below.&lt;br /&gt;
&lt;br /&gt;
[[File:finalproject.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 4 ===&lt;br /&gt;
&lt;br /&gt;
Press &#039;&#039;Project -&amp;gt; Build Active Project&#039;&#039; menu item to build the project. In the picture you can see how the console output of building the project.&lt;br /&gt;
&lt;br /&gt;
[[File:Building.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 5 ===&lt;br /&gt;
&lt;br /&gt;
The OPTIGA Trust X has a build-in debugger that can be accessed via a Micro USB port on the XMC Microcontroller.&lt;br /&gt;
&lt;br /&gt;
To debug or flash the microcontroller, you have to create the debug configuration via the DAVE. To do this, press the green bug symbol in the instrument panel. Then a new &#039;&#039;GDB SEGGER J-Link debugging&#039;&#039; should be created. After that it should look like the picture below. You do not have to change something in the configuration just click Debug. The board should be connected to the PC while debugging. &lt;br /&gt;
&lt;br /&gt;
[[File:debug.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
The used hardware was the [[Optiga_Trust_X_evaluation_kit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5860</id>
		<title>OPTIGA Trust X</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5860"/>
		<updated>2021-01-24T22:50:24Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
OPTIGA Trust X is a turnkey security solution for embedded systems based on a secure&lt;br /&gt;
microcontroller. It can be deployed for smart homes, industrial control and automation&lt;br /&gt;
systems, consumer electronics and medical devices.&lt;br /&gt;
Through a unique elliptic curve keypair and a corresponding X.509 certificate on&lt;br /&gt;
each device, easy integration into existing PKI infrastructure is enabled by the OPTIGA Trust X.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
The OPTIGA Trust X offers on their GitHub page, a repository that you can get via GIT and which contains the code you need to start the OPTIGA Trust X functions.&lt;br /&gt;
The repository can be found on https://github.com/Infineon/getstarted-optiga-trustx.git.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
For the project we use the DAVE IDE from Infineon, because for an OPTIGA project we need DAVE specific files and folders that help us to use the functions of the OPTIGA Trust X security chip. The DAVE software can be downloaded with a free Infineon account. &lt;br /&gt;
After downloading you can install DAVE by unpacking the downloaded file DAVE3.1.10.zip. In the Eclipse Folder there should be a DAVE-3.1.10.exe file. By double clicking it DAVE should start. After that choose a workspace as shown in the figure below. Now the DAVE development environment should be seen.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
The used hardware was the [[Optiga_Trust_X_evaluation_kit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:SetupDriver.png&amp;diff=5652</id>
		<title>File:SetupDriver.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:SetupDriver.png&amp;diff=5652"/>
		<updated>2020-12-27T23:34:44Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:OperatingSystemsEU4206.png&amp;diff=5651</id>
		<title>File:OperatingSystemsEU4206.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:OperatingSystemsEU4206.png&amp;diff=5651"/>
		<updated>2020-12-27T23:34:31Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:DeviceManagerASIX.png&amp;diff=5650</id>
		<title>File:DeviceManagerASIX.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:DeviceManagerASIX.png&amp;diff=5650"/>
		<updated>2020-12-27T23:34:10Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5649</id>
		<title>OPTIGA Trust X</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5649"/>
		<updated>2020-12-27T23:30:55Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* Step 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
OPTIGA Trust X is a turnkey security solution for embedded systems based on a secure&lt;br /&gt;
microcontroller. It can be deployed for smart homes, industrial control and automation systems,&lt;br /&gt;
consumer electronics and medical devices. In this Article you will learn how to install it on your PC.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating systems: Windows XP. Windows Vista, Windows 7 or Windows 8/Windows8.1 (the Version that I have is not for Windows 10)&lt;br /&gt;
* CD/DVD ROM drive&lt;br /&gt;
* Router/Switch/Hub&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
For the installation you need to insert the installation CD into your computer&#039;s CD/DVD ROM drive and the the following picture should appear. If not check the autorun.exe on the CD. Click then on the picture of the USB Fast Etherenet adapter.&lt;br /&gt;
&lt;br /&gt;
[[File:WelcomeEU4208.png]]&lt;br /&gt;
&lt;br /&gt;
To begin the installation you have to select option &amp;quot;Setup Driver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:SetupDriver.png]]&lt;br /&gt;
&lt;br /&gt;
Then you need to select your operating system. As mentioned in the Requirements the installation is only for Windows XP, Windows Vista, Windows 7 or Windows8/Windows 8.1 possible.&lt;br /&gt;
&lt;br /&gt;
[[File:OperatingSystemsEU4206.png]]&lt;br /&gt;
&lt;br /&gt;
After finishing you may need to restart your computer.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
When the installation finished you have to connect the ethernet cable that is part of the [[Optiga_Trust_X_evaluation_kit]] to the ether port on the adapter which is also port of the kit.&lt;br /&gt;
&lt;br /&gt;
The other end of the Ethernet cable should be connected to your network hub, switch or router. &lt;br /&gt;
&lt;br /&gt;
Conntect the end of the Ethernet adapter to a free USB port of your computer. Then you will be notifed by a pop-up message that the installation is completed. The Link LED on the Microcontroller should light up in yellow to indicate a proper physical connection between the adapter and the network.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
To check if the driver of the adapter is verifed, open on Windows the Device Maanger.&lt;br /&gt;
&lt;br /&gt;
In the Network adapters group, an item named ASIX AX88772B USB2.0 to Fast Ethernet Adapter should be listed.&lt;br /&gt;
&lt;br /&gt;
[[File:DeviceManagerASIX.png]]&lt;br /&gt;
&lt;br /&gt;
In the case that there is a question or exclamation mark next to that item then the driver is not properly installed and you need to delete the item, unplug the adapter and repeat the installation steps. The driver can be uninstalled in the Programs and Features panel of Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
The used hardware was the [[Optiga_Trust_X_evaluation_kit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:WelcomeEU4208.png&amp;diff=5648</id>
		<title>File:WelcomeEU4208.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:WelcomeEU4208.png&amp;diff=5648"/>
		<updated>2020-12-27T23:30:34Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5647</id>
		<title>OPTIGA Trust X</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5647"/>
		<updated>2020-12-27T23:24:15Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: Inserted the text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
OPTIGA Trust X is a turnkey security solution for embedded systems based on a secure&lt;br /&gt;
microcontroller. It can be deployed for smart homes, industrial control and automation systems,&lt;br /&gt;
consumer electronics and medical devices. In this Article you will learn how to install it on your PC.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating systems: Windows XP. Windows Vista, Windows 7 or Windows 8/Windows8.1 (the Version that I have is not for Windows 10)&lt;br /&gt;
* CD/DVD ROM drive&lt;br /&gt;
* Router/Switch/Hub&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
For the installation you need to insert the installation CD into your computer&#039;s CD/DVD ROM drive and the the following picture should appear. If not check the autorun.exe on the CD. Click then on the picture of the USB Fast Etherenet adapter.&lt;br /&gt;
&lt;br /&gt;
[[File:WelcomeEU4206.png]]&lt;br /&gt;
&lt;br /&gt;
To begin the installation you have to select option &amp;quot;Setup Driver&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:SetupDriver.png]]&lt;br /&gt;
&lt;br /&gt;
Then you need to select your operating system. As mentioned in the Requirements the installation is only for Windows XP, Windows Vista, Windows 7 or Windows8/Windows 8.1 possible.&lt;br /&gt;
&lt;br /&gt;
[[File:OperatingSystemsEU4206.png]]&lt;br /&gt;
&lt;br /&gt;
After finishing you may need to restart your computer.&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
When the installation finished you have to connect the ethernet cable that is part of the [[Optiga_Trust_X_evaluation_kit]] to the ether port on the adapter which is also port of the kit.&lt;br /&gt;
&lt;br /&gt;
The other end of the Ethernet cable should be connected to your network hub, switch or router. &lt;br /&gt;
&lt;br /&gt;
Conntect the end of the Ethernet adapter to a free USB port of your computer. Then you will be notifed by a pop-up message that the installation is completed. The Link LED on the Microcontroller should light up in yellow to indicate a proper physical connection between the adapter and the network.&lt;br /&gt;
&lt;br /&gt;
=== Step 3 ===&lt;br /&gt;
&lt;br /&gt;
To check if the driver of the adapter is verifed, open on Windows the Device Maanger.&lt;br /&gt;
&lt;br /&gt;
In the Network adapters group, an item named ASIX AX88772B USB2.0 to Fast Ethernet Adapter should be listed.&lt;br /&gt;
&lt;br /&gt;
[[File:DeviceManagerASIX.png]]&lt;br /&gt;
&lt;br /&gt;
In the case that there is a question or exclamation mark next to that item then the driver is not properly installed and you need to delete the item, unplug the adapter and repeat the installation steps. The driver can be uninstalled in the Programs and Features panel of Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
The used hardware was the [[Optiga_Trust_X_evaluation_kit]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5646</id>
		<title>OPTIGA Trust X</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=OPTIGA_Trust_X&amp;diff=5646"/>
		<updated>2020-12-27T21:15:56Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: Created page with &amp;quot;== Summary ==   Description what this documentation is about  == Requirements ==  * Operating system: Ubuntu 18.04 bionic amd64 * Packages: git emacs  In order to complete the...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary == &lt;br /&gt;
&lt;br /&gt;
Description what this documentation is about&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* Operating system: Ubuntu 18.04 bionic amd64&lt;br /&gt;
* Packages: git emacs&lt;br /&gt;
&lt;br /&gt;
In order to complete these steps, you must have followed [[Some Other Documentation]] before.&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1 ===&lt;br /&gt;
&lt;br /&gt;
Enter these commands in the shell&lt;br /&gt;
&lt;br /&gt;
 echo foo&lt;br /&gt;
 echo bar&lt;br /&gt;
&lt;br /&gt;
=== Step 2 ===&lt;br /&gt;
&lt;br /&gt;
Make sure to read&lt;br /&gt;
&lt;br /&gt;
* War and Peace&lt;br /&gt;
* Lord of the Rings&lt;br /&gt;
* The Baroque Cycle&lt;br /&gt;
&lt;br /&gt;
== Used Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[Device to be used with this documentation]]&lt;br /&gt;
[[Maybe another device to be used with this documentation]]&lt;br /&gt;
&lt;br /&gt;
== Courses ==&lt;br /&gt;
&lt;br /&gt;
* [[A course where this documentation was used]] (2017, 2018)&lt;br /&gt;
* [[Another one]] (2018)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* https://wikipedia.org&lt;br /&gt;
* https://google.com&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Optiga_Trust_X_evaluation_kit&amp;diff=5335</id>
		<title>Optiga Trust X evaluation kit</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Optiga_Trust_X_evaluation_kit&amp;diff=5335"/>
		<updated>2020-12-20T20:54:56Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Device|device_name=Optiga Trust X evaluation kit|manufacturer=Infineon|link=|image_link=https://stuff.elvis.science/uploads/models/optigajpg.jpg|description=|technicalSpecification=|supportedTechnologies=|includedEquipment=}}&lt;br /&gt;
&lt;br /&gt;
wird bis 27.12.2020 fertiggestellt&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4331</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4331"/>
		<updated>2020-07-02T13:25:12Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* mitmproxy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
In the figure below you can see how the DNS query is displayed. You can view information such as time, type, domain, client, etc.&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File:ntopng_system.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.jpeg|800px]]&lt;br /&gt;
[[File: mitmproxy_option_search.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
Below is a little preview of what you get when you click on &amp;quot;Editing Options Alpha&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option_alpha.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4330</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4330"/>
		<updated>2020-07-02T13:24:54Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* mitmproxy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
In the figure below you can see how the DNS query is displayed. You can view information such as time, type, domain, client, etc.&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File:ntopng_system.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.jpeg|800px]]&lt;br /&gt;
[[File: mitmproxy_option_search.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
Below is a little preview of what you get when you click on &amp;quot;Editing Options Alpha&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option_alpha.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Mitmproxy_option_alpha.PNG&amp;diff=4329</id>
		<title>File:Mitmproxy option alpha.PNG</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Mitmproxy_option_alpha.PNG&amp;diff=4329"/>
		<updated>2020-07-02T13:24:18Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4328</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4328"/>
		<updated>2020-07-02T13:22:26Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* mitmproxy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
In the figure below you can see how the DNS query is displayed. You can view information such as time, type, domain, client, etc.&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File:ntopng_system.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.jpeg|800px]]&lt;br /&gt;
[[File: mitmproxy_option_search.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
Below is a little preview of what you get when you click on &amp;quot;Editing Options Alpha&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option_alpha.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4327</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4327"/>
		<updated>2020-07-02T13:18:23Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* Pi-hole */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
In the figure below you can see how the DNS query is displayed. You can view information such as time, type, domain, client, etc.&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File:ntopng_system.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.jpeg|800px]]&lt;br /&gt;
[[File: mitmproxy_option_search.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4326</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4326"/>
		<updated>2020-07-02T13:15:12Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* mitmproxy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File:ntopng_system.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.jpeg|800px]]&lt;br /&gt;
[[File: mitmproxy_option_search.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4325</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4325"/>
		<updated>2020-07-02T13:14:53Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* ntopng */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File:ntopng_system.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.jpeg|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.jpeg]]&lt;br /&gt;
[[File: mitmproxy_option_search.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4324</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4324"/>
		<updated>2020-07-02T13:14:07Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* ntopng */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File:ntopng_system.jpeg|200×269px]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.jpeg]]&lt;br /&gt;
[[File: mitmproxy_option_search.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4323</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4323"/>
		<updated>2020-07-02T13:09:23Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* mitmproxy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File: ntopng_system.jpeg]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.jpeg]]&lt;br /&gt;
[[File: mitmproxy_option_search.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Mitmproxy_option.jpeg&amp;diff=4322</id>
		<title>File:Mitmproxy option.jpeg</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Mitmproxy_option.jpeg&amp;diff=4322"/>
		<updated>2020-07-02T13:09:05Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Mitmproxy_option_search.jpeg&amp;diff=4321</id>
		<title>File:Mitmproxy option search.jpeg</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Mitmproxy_option_search.jpeg&amp;diff=4321"/>
		<updated>2020-07-02T13:08:44Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4320</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4320"/>
		<updated>2020-07-02T13:05:35Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: /* ntopng */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File: ntopng_system.jpeg]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.png]]&lt;br /&gt;
[[File: mitmproxy_option_search.png]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Ntopng_interface.jpeg&amp;diff=4319</id>
		<title>File:Ntopng interface.jpeg</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Ntopng_interface.jpeg&amp;diff=4319"/>
		<updated>2020-07-02T13:05:14Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Ntopng_system.jpeg&amp;diff=4318</id>
		<title>File:Ntopng system.jpeg</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Ntopng_system.jpeg&amp;diff=4318"/>
		<updated>2020-07-02T13:03:58Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4317</id>
		<title>Install c&#039;t&#039;-Raspion on Raspberry PI</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=Install_c%27t%27-Raspion_on_Raspberry_PI&amp;diff=4317"/>
		<updated>2020-07-02T13:00:10Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requirements ==&lt;br /&gt;
* Raspberry PI with Raspbian OS&lt;br /&gt;
* Internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: System Update ===&lt;br /&gt;
&lt;br /&gt;
In the command line interface enter:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Download ===&lt;br /&gt;
Download the latest version of Raspion:&lt;br /&gt;
&lt;br /&gt;
 wget ct.de/s/x5Pm -O raspion.zip &lt;br /&gt;
&lt;br /&gt;
=== Step 3: Installation ===&lt;br /&gt;
Unzip:&lt;br /&gt;
 unzip raspion.zip&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
 cd raspion&lt;br /&gt;
 ./install.sh or bash install.sh&lt;br /&gt;
&lt;br /&gt;
[[File:Install_Raspion.png]]&lt;br /&gt;
&lt;br /&gt;
At the end of the installation there is the wifi name and password of the c&#039;t-Raspion.&lt;br /&gt;
&lt;br /&gt;
=== Launch c&#039;t-Raspion web interface ===&lt;br /&gt;
Atfer connecting to the wifi of the c&#039;t&#039;-Raspion go to http://&amp;lt;ip-address of your Raspberry-PI&amp;gt;:81&lt;br /&gt;
&lt;br /&gt;
[[File:Raspion_webinterface.png]]&lt;br /&gt;
&lt;br /&gt;
== Services of the c&#039;t-Raspion ==&lt;br /&gt;
&lt;br /&gt;
=== Pi-hole ===&lt;br /&gt;
Pi-hole shows DNS-Requests. They can also be blocked.&lt;br /&gt;
&lt;br /&gt;
[[File:Pi-hole.png]]&lt;br /&gt;
&lt;br /&gt;
=== ntopng ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Here we see an example of an overview of the system in ntopng. As you can see, it displays information about the CPU, RAM, Last Log Trace of ntopng and so on:&lt;br /&gt;
[[File: ntopng_system.png]]&lt;br /&gt;
&lt;br /&gt;
In this screenshot we see the network information like devices, flows, total traffic, total packets of the interface &amp;quot;br0&amp;quot; and much else.&lt;br /&gt;
[[File: ntopng_interface.png]]&lt;br /&gt;
&lt;br /&gt;
=== Wireshark ===&lt;br /&gt;
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&#039;t-Raspion. The recorded network traffic will be saved in pcap-files.&lt;br /&gt;
 &lt;br /&gt;
=== mitmproxy ===&lt;br /&gt;
The mitm-Proxy can loop into the communication between the local and remote devices by the c&#039;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&lt;br /&gt;
8080 towards. The redirection is handled by firewall rules, which  can be activated and deactivated as required by clicking in the c&#039;t-Raspion web interface.&lt;br /&gt;
&lt;br /&gt;
There are many options for the search, as you can see in the 2 screenshots below.&lt;br /&gt;
&lt;br /&gt;
[[File: mitmproxy_option.png]]&lt;br /&gt;
[[File: mitmproxy_option_search.png]]&lt;br /&gt;
&lt;br /&gt;
== Ikea Tradfri Setup Sniff ==&lt;br /&gt;
For testing purposes an iphone was cleaned as far as possible. All uninstalable services were erased and synchronization plans were deactivated.&lt;br /&gt;
However iphones are not that good for this kind of tests because after all cleaning there were still some connections to apple servers.&lt;br /&gt;
&lt;br /&gt;
To use pihole for capturing the dns queries of the Tradfri Gateway itself you may use an USB networkadapter or an external router as wifi bride. Otherwise you cannot use the Tradfri Gateway due to the lack of connection possibilities. As an workaround outside the Raspion software package classic arpspoofing was used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary overview IP addressess:&lt;br /&gt;
&lt;br /&gt;
[[File:ip-config.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Immediately after power on the app is sending dns requests to get ip addresses for fw.ota.homesmart.ikea.net. In the dns answer the ip&#039;s to d262cmbxmzphsu.cloudfront.net were included which is an address belonging to amazons aws.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap1.png|700px]]&lt;br /&gt;
[[File:wireshark-cap2.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Also an http get request can be found:&lt;br /&gt;
[[File:wireshark-cap-http.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The data from fw.ota.homesmart.ikea.net/feed/version_info.json are not that spectacular. As the name implies it only consists of version information.&lt;br /&gt;
&lt;br /&gt;
As soon as the Ikea Smart Home App starts the setup it tries to find a Tradfri Gateway with mDNS queries.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-mDNS.png|550px]]&lt;br /&gt;
&lt;br /&gt;
The mDNS queries are not forwarded through our pihole setup so this technique finding the Tradfri Gateway fails. The app itself provides another way to find the Tradfri Gateway by entering the ip address directly. After submitting the input the app finds the gateway and asks you to scan the QR code on the bottom side of the divce or to enter the security code which can be found near the QR code.&lt;br /&gt;
&lt;br /&gt;
The QR code contains the security code which is used as the pre shared key of the DTLS connection. As soon as the app gets the security code the app and the gateway are initiating the DTLS connection. All applicationdata is send over this encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Same implies to connections of additional smart home devices: All data is sent over the encrypted connection.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-dtls-snap.png|550px]]&lt;br /&gt;
&lt;br /&gt;
As far as the initial setup goes there are only a few connections to the internet. This connections are all from app to some aws cloud addresses. It seems this is relating to the setup of a new device:&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-cap-aws.png|550px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data Transmission when using TRADFRI ==&lt;br /&gt;
&lt;br /&gt;
The IKEA TRADFRI Gateway was connected via LAN cable while the mobile phone running the IKEA app was connected wirelessly to the same network.&lt;br /&gt;
Overview of IP addresses used:&lt;br /&gt;
&lt;br /&gt;
[[File:ip_overview_muzik.png|550px]]&lt;br /&gt;
&lt;br /&gt;
Wireshark was used to record the traffic (using arpspoof because the IKEA TRADFRI Gateway requires a LAN connection so it is not possible to just monitor the Raspion WiFi) which was then filtered.&lt;br /&gt;
&lt;br /&gt;
It turns out that TRADFRI is rather well-behaved when it comes to sending data.&lt;br /&gt;
&lt;br /&gt;
For the most part it uses encrypted (DTLS) communication internally between the Gateway and the mobile phone. To initially find the Gateway after opening the mobile app, an MDNS request is sent out via multicast (224.x.x.x).&lt;br /&gt;
&lt;br /&gt;
However, 2 external connections or destinations could also be found:&lt;br /&gt;
&lt;br /&gt;
* IP address 13.227.156.82 / privacypolicy.config.homesmart.ikea.net (as the url indicates, this has the current policy one has to agree to before using the app)&lt;br /&gt;
* IP address 13.227.156.50 / supportdetails.config.homesmart.ikea.net (this is where the secure certificates are located, apparently).&lt;br /&gt;
&lt;br /&gt;
=== Wireshark caps ===&lt;br /&gt;
privacypolicy.config.homesmart.ikea.net Client Hello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-privacy policy-clientHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
supportdetails.config.homesmart.ikea.net ServerHello:&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-supportdetails-serverHello.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Certificate Information ===&lt;br /&gt;
The Server Hello contains the information regarding the .cer and .crl:&lt;br /&gt;
 http://ocsp.rootca1.amazontrust.com&lt;br /&gt;
 http://crt.rootca1.amazontrust.com/rootca1.cer&lt;br /&gt;
 http://crl.rootca1.amazontrust.com/rootca1.crl&lt;br /&gt;
Starfield Technologies, Inc.; Starfield Services Root Certificate Authority&lt;br /&gt;
&lt;br /&gt;
Also:&lt;br /&gt;
 http://crl.sca1b.amazontrust.com/sca1b.crl&lt;br /&gt;
 http://ocsp.sca1b.amazontrust.com&lt;br /&gt;
 http://crt.sca1b.amazontrust.com/sca1b.crt &lt;br /&gt;
&lt;br /&gt;
That&#039;s pretty much it. We couldn&#039;t find any unwanted connections.&lt;br /&gt;
&lt;br /&gt;
The app also checks for updates for the used devices, this is also indicated in the app when it happens, so this is very transparent. It is indicated in the app when an update is happening or when the app is checking for new updates as can be seen in the screenshot below. If a device happens to be unavailable, e.g. because it is currently disconnected/turned off, then the app does not report back the current version but instead says the device is unreachable (&#039;Nicht erreichbar&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Ikea-tradfri-update.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Turning devices on/off ===&lt;br /&gt;
When devices are turned on or off, the individual packet sequences are made up of packets that are the same in size but with some devices there are more packets sent when turning on than off. Let me illustrate this by comparing the on/off sequences of the light bulb (pretty much the same for on/off, although of course different packet content):&lt;br /&gt;
&lt;br /&gt;
Light Bulb ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Light Bulb OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-gluehbirne_aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
As opposed to the smart plug where the on sequence is longer than the off sequence:&lt;br /&gt;
&lt;br /&gt;
Smart Plug ON&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom ein.png|700px]]&lt;br /&gt;
&lt;br /&gt;
Smart Plug OFF&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Ikea-strom aus.png|700px]]&lt;br /&gt;
&lt;br /&gt;
(these were done using arpspoof on 192.168.0.106, 192.168.0.101 is the Internet Gateway, 192.168.0.104 is the TRADFRI Gateway, commands were sent via 192.168.0.103 - so keep in mind that you see duplicates of each packet in the Wireshark caps because they include the sniff and forward to the actual target device)&lt;br /&gt;
&lt;br /&gt;
== Interrupt Communication ==&lt;br /&gt;
This experiment will show if it is possible to interrupt or sniff the communication between the IKEA and the IKEA gateway. This is not possible with only a packet sniffer like Wireshark, because the communication is encrypted with DTLS. Two attacks were performed, a mitm proxy attack and a replay attack. For the mitm attack the mitm proxy from the c’t Raspion was used and for the replay attack a scapy script.  The network structure is as follows:&lt;br /&gt;
&lt;br /&gt;
IP overview:&lt;br /&gt;
&lt;br /&gt;
[[File:mitm_findings.png|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Structure ===&lt;br /&gt;
[[File:mitm-top.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Android can be operated as a virtual machine, or you can also use a smart phone that has the IKEA Smarthome app installed. If it is operated as a virtual machine, make sure that bridge mode is used, since the VM will then have its own IP. This has the advantage that you only have to analyze the traffic generated by Android and not that of the host system.&lt;br /&gt;
&lt;br /&gt;
In order to be able to use the mitm, certificates must be added to the key store on the android os. This can be done by opening the website mitm.it in the browser of android. If you are in the right network, you will see the following window.&lt;br /&gt;
&lt;br /&gt;
[[File:mitmproxy-cert.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Here you choose the right operating system and download the certificates.&lt;br /&gt;
&lt;br /&gt;
The official documentation can be found here[https://docs.mitmproxy.org/stable/concepts-certificates/#quick-setup].&lt;br /&gt;
&lt;br /&gt;
=== MitM Proxy ===&lt;br /&gt;
When you start the app in Wireshark you can see that the handshake for the DTLS connection is being carried out.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-dtls.png]]&lt;br /&gt;
&lt;br /&gt;
You can also observe that there are several connections to different servers outside the network.&lt;br /&gt;
&lt;br /&gt;
[[File:wireshark-tls.png]]&lt;br /&gt;
&lt;br /&gt;
The following messages can be decrypted.&lt;br /&gt;
&lt;br /&gt;
[[File:mitm-sniff.png]]&lt;br /&gt;
&lt;br /&gt;
Both include a JSON-file.&lt;br /&gt;
&lt;br /&gt;
[[File:Json-file-mitm.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* In the debug log, you can observe that there are additional TLS connections, but the mitm proxy couldn’t decrypt these.&lt;br /&gt;
&lt;br /&gt;
 192.168.24.241:59332: Client Handshake failed. The client may not trust the proxy&#039;s certificate for data.logentries.com.&lt;br /&gt;
 192.168.24.241:59332: ClientHandshakeException(&#039;Cannot establish TLS with client (sni: data.logentries.com): TlsException(&amp;quot;(-1, \&#039;Unexpected EOF\&#039;)&amp;quot;)&#039;)&lt;br /&gt;
 ::ffff:192.168.24.241:58971: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 192.168.24.241:59332: clientdisconnect&lt;br /&gt;
 ::ffff:192.168.24.241:40204: serverdisconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.50&#039;, 443)&lt;br /&gt;
 192.168.24.241:58971: clientdisconnect&lt;br /&gt;
 192.168.24.241:40204: clientdisconnect&lt;br /&gt;
 192.168.24.241:41657: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:41657: Establish TLS with client&lt;br /&gt;
 192.168.24.241:50453: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:50453: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.36&#039;, 443)&lt;br /&gt;
 192.168.24.241:42222: clientconnect&lt;br /&gt;
 ::ffff:192.168.24.241:42222: serverconnect&lt;br /&gt;
  -&amp;gt; (&#039;99.86.243.4&#039;, 443)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with server&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:42222: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN selected by server: -&lt;br /&gt;
 ::ffff:192.168.24.241:50453: Establish TLS with client&lt;br /&gt;
 ::ffff:192.168.24.241:42222: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: ALPN for client: b&#039;http/1.1&#039;&lt;br /&gt;
 ::ffff:192.168.24.241:50453: request&lt;br /&gt;
  -&amp;gt; Request(GET /US/en/getPolicyUpdate/?deviceType=android)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: request&lt;br /&gt;
  -&amp;gt; Request(GET /AppDetails)&lt;br /&gt;
 ::ffff:192.168.24.241:42222: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 44b)&lt;br /&gt;
 ::ffff:192.168.24.241:50453: response&lt;br /&gt;
  -&amp;gt; Response(200 OK, application/json, 374b)&lt;br /&gt;
&lt;br /&gt;
The DTLS connection between the app and the gateway, however, does not appear in the mitm log.&lt;br /&gt;
&lt;br /&gt;
=== Replay-Attack ===&lt;br /&gt;
In order to be able to carry out a replay attack, the data traffic between the device on which the IKEA app is running and the IKEA gateway must be recorded. Every time you close the app and open it again, a new transmission must be recorded. This is because this is a new session, so the IKEA Gateway and the App have a new shared secret. Then the SRC and DST in IP and MAC have to be adjusted accordingly. In this particular example, a sequence number is available in the DTLS protocol. This must also be adjusted so that it is preliminary. Since the payload is also included in the UDP checksum, it must be recalculated too. This attack was performed on the TKEA Gateway, where a socket was connected to. In the socket was light plugged in to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
[[File:replay-attack.png]]&lt;br /&gt;
&lt;br /&gt;
As you can see, the attack is unsuccessful because no response is sent from the gateway, which is likely to drop the packets.&lt;br /&gt;
&lt;br /&gt;
This may be because DTLS also uses MAC (message authentication code). The sequence number is used to calculate the MAC value. Unfortunately, this value cannot be recalculated without knowing the encryption.&lt;br /&gt;
&lt;br /&gt;
=== Change Sequence Number ===&lt;br /&gt;
To change the sequence number, we used a workaround in Wireshark. In Wireshark you can select multiple Packets and then copy them as hex dump. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-save-hexdump.png|700px]]&lt;br /&gt;
&lt;br /&gt;
 0000   dc a6 32 7d 1d 37 c0 ee fb 4a 9b b5 08 00 45 00&lt;br /&gt;
 0010   00 69 57 0a 40 00 40 11 47 f6 c0 a8 18 f1 c0 a8&lt;br /&gt;
 0020   01 42 a4 1a 16 34 00 55 ff 2e 17 fe fd 00 01 00&lt;br /&gt;
 0030   00 00 00 00 34 00 40 00 00 00 00 00 00 00 16 21&lt;br /&gt;
 0040   39 8a 8a c5 dd c3 3d 67 ba de a5 5f 0a 10 8c e2&lt;br /&gt;
 0050   75 da ca a1 db ae a2 08 c6 e6 a6 94 32 db d0 cd&lt;br /&gt;
 0060   d1 63 e6 bd 32 db 2f 14 1a a1 08 be e9 ac ff 43&lt;br /&gt;
 0070   48 1b 54 a9 f9 f7 4f&lt;br /&gt;
&lt;br /&gt;
After you have copied the packet you can put it into a texteditor and edit the part of the packet you want. In our case we changed the 00 00 00 00 00 34 in line 0020 and 0030 to the appropriate sequence number. We found out that after each full communication the number raised by four. So, when the last recorded sequence number was 48 the next one is 52 and then 56 and so on. This is the decimal number you have to convert it so hex and change it in the text editor and save it.&lt;br /&gt;
&lt;br /&gt;
In wireshark it is possible to import packets from a textfile with hexdump in it. &lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-import-hexdump2.png]]&lt;br /&gt;
&lt;br /&gt;
After you have imported the hexdump save the file as pcap file.&lt;br /&gt;
&lt;br /&gt;
In order to send the packets, edit the marked parts in the python script.&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/python3&lt;br /&gt;
 from scapy.all import *&lt;br /&gt;
 from scapy.utils import rdpcap&lt;br /&gt;
 import time&lt;br /&gt;
 &lt;br /&gt;
 pkts=rdpcap(&amp;quot;path of the pcap file&amp;quot;)  # reads the pcap file and saves the list in the pkts var&lt;br /&gt;
 &lt;br /&gt;
 # iterates through the list&lt;br /&gt;
 for pkt in pkts:&lt;br /&gt;
      pkt[Ether].src = &amp;quot;&#039;&#039;&#039;sender mac&#039;&#039;&#039;&amp;quot;  # MAC of the sender&lt;br /&gt;
      pkt[Ether].dst= &amp;quot;&#039;&#039;&#039;target mac&#039;&#039;&#039;&amp;quot;  # MAC of the target&lt;br /&gt;
 &lt;br /&gt;
      pkt[IP].src= &amp;quot;&#039;&#039;&#039;sender ip&#039;&#039;&#039;&amp;quot; # IP of the sender&lt;br /&gt;
      pkt[IP].dst = &amp;quot;&#039;&#039;&#039;target ip&#039;&#039;&#039;&amp;quot;  # IP of the target&lt;br /&gt;
 &lt;br /&gt;
      del pkt.chksum # deletes the current checksum in the IP header&lt;br /&gt;
      del pkt[UDP].chksum # deletes the checksum in UDP header&lt;br /&gt;
      pkt = pkt.__class__(bytes(pkt)) # scapy builds the packet new and calculates the missing checksums new&lt;br /&gt;
 &lt;br /&gt;
      sendp(pkt) # sending packet&lt;br /&gt;
      time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
After that the script can be executed.&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Pi-hole.png&amp;diff=4161</id>
		<title>File:Pi-hole.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Pi-hole.png&amp;diff=4161"/>
		<updated>2020-06-09T14:18:24Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: FChallakhi uploaded a new version of File:Pi-hole.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Pi-hole.png&amp;diff=4160</id>
		<title>File:Pi-hole.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Pi-hole.png&amp;diff=4160"/>
		<updated>2020-06-09T14:18:11Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: FChallakhi uploaded a new version of File:Pi-hole.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Pi-hole.png&amp;diff=4159</id>
		<title>File:Pi-hole.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Pi-hole.png&amp;diff=4159"/>
		<updated>2020-06-09T14:17:41Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: FChallakhi uploaded a new version of File:Pi-hole.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
	<entry>
		<id>https://elvis.hcw.ac.at/wiki/index.php?title=File:Pi-hole.png&amp;diff=4158</id>
		<title>File:Pi-hole.png</title>
		<link rel="alternate" type="text/html" href="https://elvis.hcw.ac.at/wiki/index.php?title=File:Pi-hole.png&amp;diff=4158"/>
		<updated>2020-06-09T14:17:33Z</updated>

		<summary type="html">&lt;p&gt;FChallakhi: FChallakhi uploaded a new version of File:Pi-hole.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>FChallakhi</name></author>
	</entry>
</feed>