<?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>espressif - Hard Wired</title>
	<atom:link href="https://www.hardwired.dev/tag/espressif/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.hardwired.dev</link>
	<description></description>
	<lastBuildDate>Wed, 12 Mar 2025 11:40:01 +0000</lastBuildDate>
	<language>cs</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.hardwired.dev/wp-content/uploads/2022/10/android-chrome-256x256-1-150x150.png</url>
	<title>espressif - Hard Wired</title>
	<link>https://www.hardwired.dev</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ESP32 neobsahuje backdoor</title>
		<link>https://www.hardwired.dev/2025/03/10/esp32-neobsahuje-backdoor/</link>
		
		<dc:creator><![CDATA[Valentino Hesse OK2HSS]]></dc:creator>
		<pubDate>Mon, 10 Mar 2025 09:15:53 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Cyber Security]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[IOT]]></category>
		<category><![CDATA[Raspberry]]></category>
		<category><![CDATA[Různé]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[bezdrátová komunikace]]></category>
		<category><![CDATA[bezpečnost]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[elektronika]]></category>
		<category><![CDATA[embedded systémy]]></category>
		<category><![CDATA[esp32]]></category>
		<category><![CDATA[espressif]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[harvardská architektura]]></category>
		<category><![CDATA[iot]]></category>
		<category><![CDATA[kyberbezpečnost]]></category>
		<category><![CDATA[mikrokontrolér]]></category>
		<category><![CDATA[Rootcon]]></category>
		<category><![CDATA[smart home]]></category>
		<category><![CDATA[soc]]></category>
		<category><![CDATA[Tarlogic]]></category>
		<category><![CDATA[Wi-Fi]]></category>
		<guid isPermaLink="false">https://www.hardwired.dev/?p=2672</guid>

					<description><![CDATA[<p>ESP32: Backdooru v populárním čipu Úvod V posledních dnech se odbornou i laickou veřejností šířily znepokojivé zprávy o možném backdooru &#62;&#62;&#62;</p>
<p>The post <a href="https://www.hardwired.dev/2025/03/10/esp32-neobsahuje-backdoor/">ESP32 neobsahuje backdoor</a> first appeared on <a href="https://www.hardwired.dev">Hard Wired</a>.</p>]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><h1>ESP32: Backdooru v populárním čipu</h1>
<h2>Úvod</h2>
<p>V posledních dnech se odbornou i laickou veřejností šířily znepokojivé zprávy o možném backdooru v čipu ESP32 od čínské společnosti Espressif. Vzhledem k tomu, že těchto čipů bylo celosvětově distribuováno přibližně miliarda kusů a nacházejí se v širokém spektru IoT zařízení, vyvolala tato informace značné obavy. Následující analýza objasňuje, co se skutečně zjistilo a proč se nejedná o závažné bezpečnostní riziko.</p>
<h2>Co je ESP32?</h2>
<p>ESP32 představuje tzv. &quot;system on chip&quot; (SoC) - kompletní mikrokontrolér integrovaný v jediném čipu o rozměrech přibližně 8×8 mm. Při maloobchodní ceně kolem 50 Kč nabízí mimořádný výkon a funkcionalitu:</p>
<ul>
<li>Velké množství vstupně-výstupních (GPIO) pinů pro připojení senzorů a ovládacích prvků</li>
<li>Integrovanou podporu Wi-Fi a Bluetooth pro snadné připojení do sítě</li>
<li>Podporu komunikačních standardů jako SPI, I2C, CAN-BUS a další</li>
<li>Vynikající dokumentaci a vývojářskou podporu</li>
<li>Příznivý poměr cena/výkon</li>
</ul>
<p>Díky těmto vlastnostem se ESP32 stal dominantním čipem v oblasti IoT zařízení, chytrých domácností a řady dalších aplikací. Jeho hlavními konkurenty jsou některé čipy od Texas Instruments a pravděpodobně Raspberry Pi Pico 2TV.</p>
<h2>Co bylo skutečně objeveno?</h2>
<p>Na konferenci Rootcon konané 6.-8. března v Madridu prezentovali dva španělští výzkumníci objev nedokumentovaných příkazů v čipu <a href="https://www.hardwired.dev/2024/10/13/zakladni-prehled-espcek/" title="ESP32">ESP32</a>. Tyto příkazy umožňují provádět některé nízkoúrovňové operace jako zápis do paměti nebo odesílání specifických Bluetooth paketů.</p>
<p><a href="https://www.hardwired.dev/wp-content/uploads/2025/03/diagram.webp"><img fetchpriority="high" decoding="async" src="https://www.hardwired.dev/wp-content/uploads/2025/03/diagram.webp" alt="" width="751" height="534" class="aligncenter size-full wp-image-2679" srcset="https://www.hardwired.dev/wp-content/uploads/2025/03/diagram.webp 751w, https://www.hardwired.dev/wp-content/uploads/2025/03/diagram-300x213.webp 300w" sizes="(max-width: 751px) 100vw, 751px" /></a></p>
<p>Je důležité zdůraznit, že existence nedokumentovaných příkazů je v hardwarových i softwarových řešeních běžná. Většina komplexnějších systémů obsahuje interní pomocné rutiny a metody, které nejsou určeny pro koncové uživatele, ale slouží k vnitřnímu fungování systému, ladění a podobným účelům.</p>
<h2>Proč se nejedná o bezpečnostní riziko?</h2>
<p>Klíčovým faktem je, že k využití těchto nedokumentovaných příkazů musí mít útočník již plnou kontrolu nad zařízením. To znamená:</p>
<ol>
<li>
<p><strong>Fyzický přístup k zařízení</strong> - Pro nahrání vlastního kódu do ESP32 je často nutné zařízení fyzicky rozebrat a připojit se k UART pinům na základní desce.</p>
</li>
<li>
<p><strong>Překonání bezpečnostních mechanismů</strong> - ESP32 umožňuje implementaci kontroly digitálního podpisu firmware, kdy čip odmítne spustit kód, který není podepsán správným klíčem.</p>
</li>
<li>
<p><strong>Harvardská architektura jako ochrana</strong> - Na rozdíl od běžných počítačů s von Neumannovou architekturou používá ESP32 harvardskou architekturu s oddělenou pamětí pro kód a data, což znesnadňuje spuštění škodlivého kódu.</p>
</li>
</ol>
<h2>Jak došlo k nedorozumění?</h2>
<p><a href="http://https://www.tarlogic.com/news/hidden-feature-esp32-chip-infect-ot-devices/" title="Společnost Tarlogic">Společnost Tarlogic</a>, mateřská organizace zmíněných výzkumníků, vydala původně bombastickou tiskovou zprávu hovořící o &quot;ohrožení stovek milionů IoT zařízení&quot;. Tuto zprávu převzal server Bleeping Computer, který v titulku navýšil počet potenciálně ohrožených zařízení na miliardy. Následně se informace lavinovitě šířila dalšími médii.</p>
<p>Po bližším prozkoumání problematiky byly původní články staženy a přeformulovány, aby lépe odrážely skutečnou závažnost situace. Nicméně, původní senzační zprávy už stihly vyvolat značné obavy.</p>
<p><a href="https://www.tarlogic.com/news/hidden-feature-esp32-chip-infect-ot-devices/" title="https://www.tarlogic.com/news/hidden-feature-esp32-chip-infect-ot-devices/">https://www.tarlogic.com/news/hidden-feature-esp32-chip-infect-ot-devices/</a><br />
<a href="https://www.bleepingcomputer.com/news/security/undocumented-commands-found-in-bluetooth-chip-used-by-a-billion-devices/" title="https://www.bleepingcomputer.com/news/security/undocumented-commands-found-in-bluetooth-chip-used-by-a-billion-devices/">https://www.bleepingcomputer.com/news/security/undocumented-commands-found-in-bluetooth-chip-used-by-a-billion-devices/</a></p>
<h2>Závěr</h2>
<p>Používání čipu ESP32 je nadále bezpečné. Přítomnost nedokumentovaných příkazů nepředstavuje sama o sobě bezpečnostní riziko, protože k jejich využití je nutná plná kontrola nad zařízením, což by útočníkovi umožnilo i mnohem závažnější zásahy do systému bez ohledu na existenci těchto příkazů.</p>
<p>Bezpečnost zařízení s ESP32 závisí primárně na kvalitě jejich návrhu:</p>
<ul>
<li>Zařízení, která byla navržena s důrazem na bezpečnost, zůstávají bezpečná i nadále</li>
<li>Zařízení s bezpečnostními nedostatky byla zranitelná již před tímto objevem</li>
</ul>
<p>Uživatelé zařízení s ESP32 mohou tedy pokračovat v jejich používání bez obav a vývojáři mohou nadále implementovat tento čip do svých konstrukcí.</p>

<div class="twitter-share"><a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.hardwired.dev%2F2025%2F03%2F10%2Fesp32-neobsahuje-backdoor%2F&#038;via=hessevalentino&#038;related=hessevalentino%3AValentino%20Hesse%20OK2HSS" class="twitter-share-button">Tweet</a></div><p>The post <a href="https://www.hardwired.dev/2025/03/10/esp32-neobsahuje-backdoor/">ESP32 neobsahuje backdoor</a> first appeared on <a href="https://www.hardwired.dev">Hard Wired</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSH připojení pomocí ESP32</title>
		<link>https://www.hardwired.dev/2024/09/25/ssh-pripojeni-pomoci-esp32/</link>
		
		<dc:creator><![CDATA[John Doe]]></dc:creator>
		<pubDate>Wed, 25 Sep 2024 12:09:47 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[IOT]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[esp32]]></category>
		<category><![CDATA[espressif]]></category>
		<category><![CDATA[home-automation]]></category>
		<category><![CDATA[iot]]></category>
		<category><![CDATA[libssh-esp32]]></category>
		<category><![CDATA[platformio]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[wifi]]></category>
		<guid isPermaLink="false">https://www.hardwired.dev/?p=2356</guid>

					<description><![CDATA[<p>V dnešním článku se podíváme na to, jak se z ESP32 development boardu připojit pomocí SSH ke vzdálenému počítači. Pro &#62;&#62;&#62;</p>
<p>The post <a href="https://www.hardwired.dev/2024/09/25/ssh-pripojeni-pomoci-esp32/">SSH připojení pomocí ESP32</a> first appeared on <a href="https://www.hardwired.dev">Hard Wired</a>.</p>]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>V dnešním článku se podíváme na to, jak se z <a href="https://vi.aliexpress.com/item/1005001621773806.html">ESP32 development boardu</a> připojit pomocí <a href="https://cs.wikipedia.org/wiki/Secure_Shell">SSH</a> ke vzdálenému počítači.</p>
<p>Pro vývoj je použito <a href="https://platformio.org/">PlatformIO</a>.</p>
<h1>platformio.ini</h1>
<pre><code class="language-ini">[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps = ewpa/LibSSH-ESP32@^4.2.0</code></pre>
<h1>main.cpp</h1>
<p>Jediná externí závislost je <code>libssh-esp32</code>. </p>
<pre><code class="language-cpp">#include &lt;Arduino.h&gt;
#include &lt;WiFi.h&gt;
#include &lt;libssh_esp32.h&gt;
#include &quot;libssh_esp32_config.h&quot;
#include &lt;libssh/libssh.h&gt;
#include &lt;vector&gt;
#include &lt;string&gt;</code></pre>
<p>Budeme potřebovat SSID WiFi sítě a heslo.</p>
<pre><code class="language-cpp">const char *ssid = &quot;ssid-vasi-wifi&quot;;
const char *password = &quot;vase-nejtajnejsi-heslo&quot;;</code></pre>
<p>Potřebujeme nastavit přihlašovací údaje pro SSH a příkaz který po přihlášení provedeme.</p>
<pre><code class="language-cpp">const int ssh_port = 22;
const char *ssh_username = &quot;pi&quot;;
const char *ssh_password = &quot;super-tajne-heslo&quot;;
const char *ssh_command = &quot;ls -l&quot;;</code></pre>
<p>Dále seznam IP adres serverů na které se chceme připojit.</p>
<pre><code class="language-cpp">std::vector&lt;std::string&gt; server_ips = {
    &quot;192.168.1.254&quot;,
};</code></pre>
<p>Vytvoříme funkci pro připojení k WiFi. Na konci vypíšeme do konzole MAC adresu přístupového bodu, ke kterému jsme se připojili.</p>
<pre><code class="language-cpp">void connectToWiFi()
{
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED)
    {
        delay(1000);
        Serial.println(&quot;Connecting to WiFi..&quot;);
    }
    Serial.print(&quot;Připojeno k AP s MAC: &quot;);
    Serial.println(WiFi.BSSIDstr());
}</code></pre>
<p>Ted ta nejdelší část. Funkce co vytvoří SSH spojení, provede příkaz a výsledek vypíše na standardní výstup. Funkce si po sobě uklízí.</p>
<pre><code class="language-cpp">/**
 * Execute SSH Command
 *
 * @param ip Server IP
 * @param username SSH Username
 * @param password SSH Password
 * @param command Command to execute
 */
void executeSSHCommand(const char *ip, const char *username, const char *password, const char *command)
{
    // Create a new SSH session
    ssh_session session = ssh_new();
    if (session == NULL)
    {
        Serial.println(&quot;Failed to create SSH session&quot;);
        return;
    }

    // Set SSH options for the session
    ssh_options_set(session, SSH_OPTIONS_HOST, ip);
    ssh_options_set(session, SSH_OPTIONS_USER, username);

    // Connect to SSH server
    int rc = ssh_connect(session);
    if (rc != SSH_OK)
    {
        Serial.println(&quot;Failed to connect to SSH server&quot;);
        return;
    }

    // Verify the server&#039;s identity
    rc = ssh_userauth_password(session, NULL, password);
    if (rc != SSH_AUTH_SUCCESS)
    {
        Serial.println(&quot;Failed to authenticate&quot;);
        return;
    }

    // Create a new SSH channel
    ssh_channel channel = ssh_channel_new(session);
    if (channel == NULL)
    {
        Serial.println(&quot;Failed to create SSH channel&quot;);
        return;
    }

    // Open a new SSH session
    rc = ssh_channel_open_session(channel);
    if (rc != SSH_OK)
    {
        Serial.println(&quot;Failed to open SSH session&quot;);
        return;
    }

    // Execute the command
    rc = ssh_channel_request_exec(channel, command);
    if (rc != SSH_OK)
    {
        Serial.println(&quot;Failed to execute command&quot;);
        return;
    }

    // Read the output of the command
    char buffer[256];
    int nbytes; // Number of bytes read
    nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
    while (nbytes &gt; 0)
    {
        if (write(1, buffer, nbytes) != nbytes) // Write to stdout
        {
            Serial.println(&quot;Failed to write to stdout&quot;);
            return;
        }
        nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
    }

    // Check if there was an error reading from the channel
    if (nbytes &lt; 0)
    {
        Serial.println(&quot;Failed to read from SSH channel&quot;);
        return;
    }

    // Send EOF and close the channel
    ssh_channel_send_eof(channel);

    // Close the channel
    ssh_channel_close(channel);

    // Free the channel
    ssh_channel_free(channel);

    // Disconnect the session
    ssh_disconnect(session);

    // Free the session
    ssh_free(session);
}</code></pre>
<p>Teď potřebujeme funkci která provede SSH příkaz pro všechny naše servery, které jsou definované v <code>server_ips</code>.</p>
<pre><code class="language-cpp">/**
 * Execute SSH Command on all servers
 * 
 * @param username SSH Username
 * @param password SSH Password
 * @param command Command to execute
 */
void executeSSHCommandOnAllServers(const char *username, const char *password, const char *command)
{
    for (std::string ip : server_ips)
    {
        executeSSHCommand(ip.c_str(), username, password, command);
    }
}</code></pre>
<p>Teď už jen zbývá provést vše při startu ESPčka.</p>
<pre><code class="language-cpp">void setup()
{
    Serial.begin(115200);
    while (!Serial)
    {
        ; // Wait for serial to be ready
    }

    connectToWiFi();
    ssh_init();
    executeSSHCommandOnAllServers(ssh_username, ssh_password, ssh_command);
}</code></pre>
<p>Hlavní smyčku programu pro tento příklad necháme odpočívat.</p>
<pre><code class="language-cpp">void loop()
{
    delay(1000); // Delay for 1 second
}</code></pre>
<p>To je vše. Po kompilaci, nahrání kódu a spuštění ESPčka se připojí k WiFi a poté provede SSH připojení na zadané IP adresy a provede <code>ls -l</code> příkaz. Ten vypíše do konzole.</p>
<h1>main.cpp full</h1>
<pre><code class="language-cpp">#include &lt;Arduino.h&gt;
#include &lt;WiFi.h&gt;
#include &lt;libssh_esp32.h&gt;
#include &quot;libssh_esp32_config.h&quot;
#include &lt;libssh/libssh.h&gt;
#include &lt;vector&gt;
#include &lt;string&gt;

// WiFi Credentials
const char *ssid = &quot;ssid-vasi-wifi&quot;;
const char *password = &quot;vase-nejtajnejsi-heslo&quot;;

// SSH Credentials
const int ssh_port = 22;
const char *ssh_username = &quot;pi&quot;;
const char *ssh_password = &quot;super-tajne-helso&quot;;
const char *ssh_command = &quot;ls -l&quot;;

// Server IPs List
std::vector&lt;std::string&gt; server_ips = {
    &quot;192.168.1.254&quot;,
};

/**
 * Connect to WiFi
 */
void connectToWiFi()
{
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED)
    {
        delay(1000);
        Serial.println(&quot;Connecting to WiFi..&quot;);
    }
    Serial.print(&quot;Připojeno k AP s MAC: &quot;);
    Serial.println(WiFi.BSSIDstr());
}

/**
 * Execute SSH Command
 *
 * @param ip Server IP
 * @param username SSH Username
 * @param password SSH Password
 * @param command Command to execute
 */
void executeSSHCommand(const char *ip, const char *username, const char *password, const char *command)
{
    // Create a new SSH session
    ssh_session session = ssh_new();
    if (session == NULL)
    {
        Serial.println(&quot;Failed to create SSH session&quot;);
        return;
    }

    // Set SSH options for the session
    ssh_options_set(session, SSH_OPTIONS_HOST, ip);
    ssh_options_set(session, SSH_OPTIONS_USER, username);

    // Connect to SSH server
    int rc = ssh_connect(session);
    if (rc != SSH_OK)
    {
        Serial.println(&quot;Failed to connect to SSH server&quot;);
        return;
    }

    // Verify the server&#039;s identity
    rc = ssh_userauth_password(session, NULL, password);
    if (rc != SSH_AUTH_SUCCESS)
    {
        Serial.println(&quot;Failed to authenticate&quot;);
        return;
    }

    // Create a new SSH channel
    ssh_channel channel = ssh_channel_new(session);
    if (channel == NULL)
    {
        Serial.println(&quot;Failed to create SSH channel&quot;);
        return;
    }

    // Open a new SSH session
    rc = ssh_channel_open_session(channel);
    if (rc != SSH_OK)
    {
        Serial.println(&quot;Failed to open SSH session&quot;);
        return;
    }

    // Execute the command
    rc = ssh_channel_request_exec(channel, command);
    if (rc != SSH_OK)
    {
        Serial.println(&quot;Failed to execute command&quot;);
        return;
    }

    // Read the output of the command
    char buffer[256];
    int nbytes; // Number of bytes read
    nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
    while (nbytes &gt; 0)
    {
        if (write(1, buffer, nbytes) != nbytes) // Write to stdout
        {
            Serial.println(&quot;Failed to write to stdout&quot;);
            return;
        }
        nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
    }

    // Check if there was an error reading from the channel
    if (nbytes &lt; 0)
    {
        Serial.println(&quot;Failed to read from SSH channel&quot;);
        return;
    }

    // Send EOF and close the channel
    ssh_channel_send_eof(channel);

    // Close the channel
    ssh_channel_close(channel);

    // Free the channel
    ssh_channel_free(channel);

    // Disconnect the session
    ssh_disconnect(session);

    // Free the session
    ssh_free(session);
}

/**
 * Execute SSH Command on all servers
 *
 * @param username SSH Username
 * @param password SSH Password
 * @param command Command to execute
 */
void executeSSHCommandOnAllServers(const char *username, const char *password, const char *command)
{
    for (std::string ip : server_ips)
    {
        executeSSHCommand(ip.c_str(), username, password, command);
    }
}

void setup()
{
    Serial.begin(115200);
    while (!Serial)
    {
        ; // Wait for serial to be ready
    }

    connectToWiFi();
    ssh_init();
    executeSSHCommandOnAllServers(ssh_username, ssh_password, ssh_command);
}

void loop()
{
    delay(1000); // Delay for 1 second
}
</code></pre>

<div class="twitter-share"><a href="https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.hardwired.dev%2F2024%2F09%2F25%2Fssh-pripojeni-pomoci-esp32%2F&#038;via=hessevalentino" class="twitter-share-button">Tweet</a></div><p>The post <a href="https://www.hardwired.dev/2024/09/25/ssh-pripojeni-pomoci-esp32/">SSH připojení pomocí ESP32</a> first appeared on <a href="https://www.hardwired.dev">Hard Wired</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
