<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by biero llagas on Medium]]></title>
        <description><![CDATA[Stories by biero llagas on Medium]]></description>
        <link>https://medium.com/@biero-llagas?source=rss-83fd72d5c11d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*IOaolHUcO5F689z7saYqhg.jpeg</url>
            <title>Stories by biero llagas on Medium</title>
            <link>https://medium.com/@biero-llagas?source=rss-83fd72d5c11d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 01:10:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@biero-llagas/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Evolution in Password Protection for Project Files in EWS Software: The Case of Schneider Electric…]]></title>
            <link>https://medium.com/@biero-llagas/evolution-in-password-protection-for-project-files-in-ews-software-the-case-of-schneider-electric-b3fed1ca5fe6?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3fed1ca5fe6</guid>
            <category><![CDATA[schneider-electric]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[dnspy]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ics-security]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Fri, 17 Jul 2026 16:35:19 GMT</pubDate>
            <atom:updated>2026-07-17T16:35:19.654Z</atom:updated>
            <content:encoded><![CDATA[<h3>Evolution in Password Protection for Project Files in EWS Software: The Case of Schneider Electric Part 2: crypto method in EcoStruxure Machine Expert Basic .smbp file.</h3><h3>Foreword</h3><p>This article is part of a series of articles focused on reverse engineering EWS software to determine the security of project files and potentially bypass the security measures applied to them.</p><p>If you whant the different part of the series , <a href="https://medium.com/@biero-llagas/list/ewss-reverse-engineering-5a03e4156f95">here are the list</a></p><p>Additional note: I’m writing these articles as my research progresses. Just to remind you, I don’t claim that my work is completely exhaustive. There are surely still things left to discover, so if you like the series, don’t hesitate to dive into the CIL yourself.</p><h3>Introductions</h3><p>In Part 2, we will take a closer look at the Schneider Ecostruxure Basic software, specifically the methods used to hash the various passwords that could be applied to the project and the different actions that require one.</p><h4>Storage of secret</h4><p>Here is the list of actions that require a password:</p><ul><li>Uploading the project to the PLC.</li><li>Downloading the project from the PLC.</li><li>Editing the project file.</li><li>Opening the project file.</li></ul><p>Let’s get back to the .smbp file.</p><p>Once the project file has been decrypted (or if it wasn’t encrypted to begin with), you can see at the end of the file that there are hashed values labeled as passwords (if you have enable all the possble security).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*KRmTCFDW6E192PgUM0aV_g.png" /></figure><p>These encrypted passwords correspond to the following items</p><h4>ApplicationsProtections || Method 2</h4><ul><li>Password (liked to Read Protections || first password)</li><li>DowloadPassword (Linked to Write Protections || second password)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*VZcfzdJUpG6aYF5souMVCg.png" /></figure><h4>ProjectProtections || Method 3</h4><ul><li>Password (Modifications password || second password)</li></ul><p>the first password is the project file password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*Dhng7hT9uPYIJ0U8HRQ7kA.png" /></figure><p>Now that we’ve established that, we need to discuss the encryption method that leads to these results. I’m not going to beat around the bush (this is a technical blog post)</p><p>There appear to be two encryption methods for these passwords and a variant of the file encryption method discussed in Part 1.</p><h4>Methode 1 variant: one method to rule the file.</h4><p>This method isn’t related to the password, but I wanted to go over it a little more. As a reminder, here’s what it looks like as whe see in part 1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/0*sjlNOusLU_XAG86E.png" /></figure><p>After continuing my search, I came across a variation of this method involving a different file format (.bin).</p><p>When the application starts, you can see that two files are passed to the LoadXMLFromCryptedFile function, which is a function used in the decryption chain of Method 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*mChmB7TI1al2FfKg4KSV2w.png" /></figure><p>Here is the password for AES256 CBC encryption, it is fixed and is “SoMachineBasic” (awnsering the questions why there is fixed password in the code)</p><p>The interesting thing here is that the input file is not an XML file, but a .bin file, so it does not need to be parsed.</p><p>To date, I have found that the following two files</p><ul><li>C:\ProgramData\Schneider Electric\EcoStruxure Machine Expert — Basic\autorisations_M221.bin</li><li>C:\ProgramData\Schneider Electric\EcoStruxure Machine Expert — Basic\autorisations_Xintu.bin</li></ul><p>These two files are related to the application’s system settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFPU3t2sWXihujm4cvTypw.png" /></figure><p>This is because, when you decrypt them, the activation key information is present in plain text.</p><p>The keys are linked to a text field that the user can fill in, so I think they could have other values, these would be potentially interesting elements to retrieve.</p><p>Furthermore, it’s not just these bin files that use this same variation of Method 1, but also an XML file that appears to correspond to the list of different hardware module in the system settings.</p><ul><li>C:\Program Files (x86)\Schneider Electric\EcoStruxure Machine Expert — Basic\CatalogResources\Module.xml</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*_a6F34OIzJKmvrZwSfoUVQ.png" /></figure><p>This crypto method seems to be a recurring one, and there are undoubtedly other files that can be decrypted using this method.</p><p>This method may also be used in other Schneider software to decrypt data.</p><h4>Methode 2: The salt and only</h4><p>This method is used to secure the download of the program to and from the PLC and it’s a hashing method not a crypto one.</p><p>It’s pretty easy to understand. First, the password is hashed using SHA256.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zR2AAiOrzmfXleub5Gx91w.png" /></figure><p>Next, take the string “EcoStruxure Machine Expert — Basic” and append it to the hash we just generated, then re-hash it, which will yield the hash found in the decrypted smbp file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ygnJDfZFAR3_SVR014T1qw.png" /></figure><p>To help you visualize it better, here is a Mermaid flowchart of the hashing method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/281/1*JCxYLziDK4BqLXimzZUk_g.png" /></figure><p>They call it salt , but this is not really a salt because its value is static.</p><h4>Method 3: crypto-encoding-ceptions</h4><p>For the third method, here’s how it works (who is used for the ProjectProtections password).<br>A function called DynamicHash will generate a salt that will be used later on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*2m7n8IDS5QQfqHf3HYSpXQ.png" /></figure><p>Once the salt has been generated, a function named PBKDFS2Sha256GetByte is called and invoked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*gNk-NW5IV1dY_3NCx0hBAw.png" /></figure><p>As a reminder, here is the Wikipedia page for PBKDF2:</p><p><a href="https://en.wikipedia.org/wiki/PBKDF2">https://en.wikipedia.org/wiki/PBKDF2</a></p><p>And a lovely video on the subject.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcMykd0jScSY%3Fstart%3D19%26feature%3Doembed%26start%3D19&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcMykd0jScSY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcMykd0jScSY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba7b1f1fee03b5e0e272c7b0dab8db5b/href">https://medium.com/media/ba7b1f1fee03b5e0e272c7b0dab8db5b/href</a></iframe><p>The actual PBKDF2 functions.</p><pre>  private static byte[] PBKDF2Sha256GetBytes(int dklen, byte[] password, byte[] salt, int iterationCount)<br>  {<br>   byte[] result;<br>   using (HMACSHA256 hmacsha = new HMACSHA256(password))<br>   {<br>    int num = hmacsha.HashSize / 8;<br>    if ((hmacsha.HashSize &amp; 7) != 0)<br>    {<br>     num++;<br>    }<br>    int num2 = dklen / num;<br>    if ((long)dklen &gt; (long)((ulong)-1 * (ulong)((long)num)) || dklen &lt; 0)<br>    {<br>     throw new ArgumentOutOfRangeException(&quot;dklen&quot;);<br>    }<br>    if (dklen % num != 0)<br>    {<br>     num2++;<br>    }<br>    byte[] array = new byte[salt.Length + 4];<br>    Buffer.BlockCopy(salt, 0, array, 0, salt.Length);<br>    using (MemoryStream memoryStream = new MemoryStream())<br>    {<br>     for (int i = 0; i &lt; num2; i++)<br>     {<br>      array[salt.Length] = (byte)(i + 1 &gt;&gt; 24 &amp; 255);<br>      array[salt.Length + 1] = (byte)(i + 1 &gt;&gt; 16 &amp; 255);<br>      array[salt.Length + 2] = (byte)(i + 1 &gt;&gt; 8 &amp; 255);<br>      array[salt.Length + 3] = (byte)(i + 1 &amp; 255);<br>      byte[] array2 = hmacsha.ComputeHash(array);<br>      Array.Clear(array, salt.Length, 4);<br>      byte[] array3 = array2;<br>      for (int j = 1; j &lt; iterationCount; j++)<br>      {<br>       array2 = hmacsha.ComputeHash(array2);<br>       for (int k = 0; k &lt; array3.Length; k++)<br>       {<br>        byte[] array4 = array3;<br>        int num3 = k;<br>        array4[num3] ^= array2[k];<br>       }<br>      }<br>      memoryStream.Write(array3, 0, array3.Length);<br>      Array.Clear(array2, 0, array2.Length);<br>      Array.Clear(array3, 0, array3.Length);<br>     }<br>     byte[] array5 = new byte[dklen];<br>     memoryStream.Position = 0L;<br>     memoryStream.Read(array5, 0, dklen);<br>     memoryStream.Position = 0L;<br>     for (long num4 = 0L; num4 &lt; memoryStream.Length; num4 += 1L)<br>     {<br>      memoryStream.WriteByte(0);<br>     }<br>     Array.Clear(array, 0, array.Length);<br>     result = array5;<br>    }<br>   }<br>   return result;<br>  }</pre><p>At one point, I wondered why they had implemented this method manually when .NET supports it, so I asked my good friend Claude, and that what he respond</p><blockquote>At one point in time, the native Rfc2898DeriveBytes class in .NET only supported SHA-1. Anyone who wanted PBKDF2-SHA256 had to rewrite it by hand.</blockquote><p>Okay, that might explain it.</p><p>One interesting point is that PBKDF2 uses iterations to consume more resources, which theoretically slows down brute-force attacks, the number of iterations here is hardcoded and capped at 50,000 iterations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*gDzYiVz6okYMq-4UG4W4yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*5CqX5NSjB8zaw3flnN0oJg.png" /></figure><p>This number of iterations can be retrieved from memory (0x0000C350) when the function is called.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*4afi4Si3u25aQLDtcr0bbw.png" /></figure><p><a href="https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html">According to the OWASP fundations</a> , and based on a security standard (<a href="https://en.wikipedia.org/wiki/FIPS_140">https://en.wikipedia.org/wiki/FIPS_140</a>) a number of iterations of 600k is optimal, so there is maybe a issue here.</p><p><a href="https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html">Password Storage - OWASP Cheat Sheet Series</a></p><p>Note that the passphrase is simply “pottermodfiy” in hexadecimal.</p><p>By the way, shout-out to cyberchef for integrating a PBKDF2 key derivator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJCyrWto-iujxashpiiHAw.png" /></figure><p>Once the key generations is complete, the key and salt must be encoded in Base64.</p><p>Here we have the Base64-encoded representations of the key and salt, which are appended together, they will then be encoded in Base64 again to form the password that will be stored.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*pfUridM1vwVUwFfH_trokA.png" /></figure><p>Here is the flowchart illustrating the encryption process, to make it clearer and easier to understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/241/1*jRR-QawJtD45TqbfNHymsQ.png" /></figure><h4>Not in my memory.</h4><p>I’d like to point out an interesting detail here: this method isn’t just used to store the password on the disk, but also in memory.</p><p>Here’s an example: these are the passwords before they are confirmed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*n_OiM2fQOe9CFPwZ6XyAeg.png" /></figure><p>And there you have it — once it’s encrypted, this corresponds to the encrypted and encoded password. In memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*8yQGi5kfGPX55dXS9e0Jfw.png" /></figure><p>As proof, I’d like to see a memory analysis using Cheat Engine to search for the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*sHYADrmAW4qAbpgnUR9wyA.png" /></figure><h4>Script evolution</h4><p>NOTE: The script is not currently available I am waiting for a disclosure period with Schneider electric.</p><p>The script presented in Part 1 has evolved and now allows you to perform the following actions:</p><ul><li>Check whether security measures are enabled or not.</li><li>Extract the various hashes and offer to brute-force them.</li><li>Decrypt files that are not directly in XML format.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvW_DREf1cUSI0cCp6NLrw.png" /></figure><p>Just a reminder: this is a tool intended solely as a proof of concept, it isn’t really optimized for brute-force attacks. To do that, it would need to be rewritten in a compiled language.</p><p>Exemple:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OIG4xcob82rTFnCmdy3y3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*KRmTCFDW6E192PgUM0aV_g.png" /></figure><p><strong>NOTE: if you whant the tool i will gladly give it to you , just send me a request on my discord (biero is my handle , and send me a message containgin the request in the first message. or send me a mp on my linkedin)</strong></p><h3>Note on the warez</h3><p>One of the initial goals of this series of articles is to understand why the warez scene don’t includes a more Schneider software in its list of offerings. A preliminary answer may therefore lie in the almost systematic use of symmetric encryption rather than secret comparison.</p><p>Another objective was to track the evolution of security implementations and analyze the state of the art in this field, that is why the rest of this series will focus more on EcoStruxure Control Expert Basic.</p><p>If new items are found and linked to Parts 1 and 2, they will be added to those sections as they become available; therefore, the articles are not set in stone.</p><h3>Conclusions</h3><p>To conclude this section, I would like to say that the use of different encryption methods, with varying levels of complexity, could be explained by non-standardized development processes, or by multiple teams implementing their own methods.</p><p>But it may also be symptomatic of an evolutionary process, because even though one of the “salts” is fixed in Method 2, it is not in Method 3 which is evidence that cybersecurity considerations are being taken into account.</p><p>Another example is that the PBKDF2 function was not present in SoMachine Basic.</p><h3>About the Author</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>I am a freelance ICS security consultant and a teacher available for assignments in this field.</p><p>If you are interested, DM me on LinkedIn.<br><a href="https://www.linkedin.com/in/erwan-cordier/">https://www.linkedin.com/in/erwan-cordier/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3fed1ca5fe6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evolution in Password Protection for Project Files in EWS Software: The Case of Schneider Electric…]]></title>
            <link>https://medium.com/@biero-llagas/evolution-in-password-protection-for-project-files-in-ews-software-the-case-of-schneider-electric-66fdc15922f7?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/66fdc15922f7</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ecostruxure]]></category>
            <category><![CDATA[schneider-electric]]></category>
            <category><![CDATA[ics-security]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Tue, 30 Jun 2026 13:10:44 GMT</pubDate>
            <atom:updated>2026-07-06T08:06:19.999Z</atom:updated>
            <content:encoded><![CDATA[<h3>Evolution in Password Protection for Project Files in EWS Software: The Case of Schneider Electric Part 1: SoMachine Basic (V1.4/V1.6) and EcoStruxure Machine Expert Basic</h3><h3>Foreword</h3><p>This article is part of a series of articles focused on reverse engineering EWS software to determine the security of project files and potentially bypass the security measures applied to them.</p><p>If you whant the different part of the series , <a href="https://medium.com/@biero-llagas/list/ewss-reverse-engineering-5a03e4156f95">here are the list</a></p><p>The software we’ll be discussing here is SoMachine Basic, which allows you to develop and upload programs to Schneider Electric’s M221 series PLCs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*EyQhVJY374-SUCLG" /><figcaption>M221 PLC</figcaption></figure><p>The software underwent a rebranding in 2019 and is now called EcoStruxure Machine Expert Basic (SoMachine Basic). Version 1.4 has been discoutinued since 2021.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U3GFRkMzZ_0LS8DPWzVGyA.png" /></figure><p>There is already existing documentation on the subject, but it focuses more on security between the PLC and the software than on the project file itself.</p><ul><li><a href="https://www.levelblue.com/blogs/spiderlabs-blog/attacking-scada-part-ii-vulnerabilities-in-schneider-electric-ecostruxure-machine-expert-and-m221-plc/">Attacking SCADA Part II: Vulnerabilities in Schneider Electric EcoStruxure Machine Expert and M221 PLC</a></li><li><a href="https://fr.claroty.com/team82/research/vulnerabilities-found-in-schneider-m221-plcs">Hardening Schneider M221 PLCs Against Attack</a></li></ul><p>The goal here, therefore, is to focus not on PLCs, but directly on the software and especially on managing project file passwords.</p><h3>Tools</h3><ul><li><a href="https://github.com/dnspy/dnspy">dnspy</a></li><li><a href="https://github.com/horsicq/detect-it-easy">Detect It Easy</a></li></ul><h3>Introductions</h3><p>While researching warez related to control and monitoring software, I was surprised by how few resources are available for Schneider Electric software. This is quite surprising when you consider the figures that position Schneider Electric as a global giant in the industry.</p><p><a href="https://www.gminsights.com/fr/industry-analysis/programmable-logic-controller-market">https://www.gminsights.com/fr/industry-analysis/programmable-logic-controller-market</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ohb8klNGKfeDOQmnfC_I3w.png" /></figure><p>The only one I’ve seen used in crack services is Vijeo Designer, so I wanted to look into this software to find out why the scene isn’t really interested in it — is it because it’s more secure, or has it simply remained under the radar of attackers?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*pSBT6mx46nKYrRs2ayUcOg.png" /><figcaption>Sevice proposal to remove password of vijeo desinger project.</figcaption></figure><h4>Software install.</h4><p>It is possible to download the software mentioned in the introduction from the Schneider Electric website.</p><p><a href="https://www.se.com/my/en/download/document/MachineExpertBasicV1_4/">https://www.se.com/my/en/download/document/MachineExpertBasicV1_4/</a></p><p><a href="https://www.se.com/be/fr/faqs/FA348569/">Is there a download link for SoMachine Basic 1.6? | Schneider Electric Belgium</a></p><p>If you can’t find them, use your imagination, the internet is vast.</p><h4>file structure.</h4><p>To start, let’s focus on what interests us most: the project file itself. In the Ecostruxure MachineExpert Basic and SoMachine Basic software, the file format is .smbp; it is actually an XML file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*yonbiSPJ4eWKx_qWUrBVvA.png" /><figcaption>uncyphered SoMachine Basic projefct</figcaption></figure><p>Here is an example of a .smbp project that has been encrypted; as you can see, it is not the file itself that is encrypted, but a data blob (<strong><em>i will use this term when i refer to the cyphered data between the crypted xml beacon</em></strong>) contained in an XML beacon named “Crypted.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*STMxme2KdjReqFoGsWV2Lg.png" /><figcaption>cyphered project</figcaption></figure><p>The important thing here is that the blob ends with “==,” which is characteristic of Base64 encoding.</p><p>NOTE: the ProjectVersion depend on the versions of SoMachine Basic or MachineExpert Basic that you are using, an older verison like 1.7.0.0 can be vulnerable to an clear text comparaision like we will se on the SoMachine Basic 1.4</p><h4>Triage</h4><p>To start any good reverse engineering session, you must first go through the sorting phase. This phase allows you to determine the nature of the executable, which in turn helps you choose the right tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*DhTADTeGGlz0gy8GnKa3HA.png" /></figure><p>NOTE: The three pieces of software analyzed are all written in C# in JIT mode without any obfuscation at the CIL level.</p><h4>Why C# is easy to reverse ?</h4><p>C# is a language that is first compiled into CIL (Common Intermediate Language) by the Roslyn compiler. CIL is a standard intermediate format shared by several languages (C#, F#, VB.NET). At runtime, the JIT (Just-In-Time) compiler compiles this CIL into native machine code. The advantage is portability; the JIT compiler knows the architecture on which it is running and adapts the CIL compilation accordingly.</p><p>The advantage for reverse engineering is that CIL code still contains a lot of information that wouldn’t be present in fully compiled code, such as function names and inheritance, you can use tools to clearly restructure the C# code from a file containing CIL — assuming, of course, that it isn’t obfuscated or that it wasn’t compiled using AOT (Ahead-Of-Time: the CIL is compiled into machine code at build time instead of at runtime, and the final binary no longer contains CIL). The .NET runtime is embedded in the executable. The downside is that portability is lost and you must compile for each target architecture.)</p><p>There are tools available for reading the CIL format; the best-known ones are DNSpy and Dotpeek. DNSpy is completely open source, so I’m going to focus on that tool.</p><p>Il existe des remédiations a celas , la plus connue et d’appliquer de l’obfuscations au CIL , se qui rend le reverse plus fastidieux ,</p><ul><li><a href="https://www.softanics.com/net-obfuscation/techniques">.NET Obfuscation Techniques: A Technical Overview</a></li><li><a href="https://github.com/BinaryScary/NET-Obfuscate">GitHub - BinaryScary/NET-Obfuscate: Obfuscate ECMA CIL (.NET IL) assemblies to evade Windows Defender AMSI</a></li></ul><p>But with modern tools (AI), this obfuscation process might not be as burdensome as that.</p><p><a href="https://github.com/AgentSmithers/DnSpy-MCPserver-Extension">GitHub - AgentSmithers/DnSpy-MCPserver-Extension: AgentSmithers DnSpyEx MCPServer extension</a></p><p>Another technique would be to use AOT (Ahead of Time) compilation it’s just another way of referring to compilations. In this case, C# is compiled directly without requiring the .NET framework, so it avoids the “drawbacks” of CIL in terms of readability; however, it loses some portability between different architectures.</p><h4>Some DNSpy shortcut.</h4><ul><li>Ctrl + Alt + P || attack to a process</li><li>Ctrl + Alt + K || search in assembly</li></ul><p>And many more</p><p><a href="https://github.com/qcjxberin/dnSpy-1/blob/master/README.md">dnSpy-1/README.md at master · qcjxberin/dnSpy-1</a></p><h4>SoMachine Basic 1.4</h4><p>I won’t spend too much time on this, but to put it simply, in this version there’s an explicit comparison in a function called ApplyCommandExecute.</p><p>The idea here was to search for the string “Incorrect password,” see which function instantiated it, and trace the execution flow back to find where the comparison was taking place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGqYyO9sPyutIwV6VoaGQA.png" /></figure><p>The problem with these systems is that they are legacy systems, and therefore must be supported even if they are not secure. I’d like to take a moment here to explain that a project file must always be usable. In later versions of the software, the file upload functions to the PLC must support as many file versions as possible.</p><p>For example, the “Upload” function uses the “TryToUnloadPlcToApplicationForUpload” function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EQX8u3k7QQneB8MmMaCD0Q.png" /></figure><p>And when we look at this function, we can see that there are several ways to unlock it, the first of which is a simple password comparison.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o8RGgxIXZaL1mowTPJM7YQ.png" /></figure><h3>SoMachineBasic 1.6</h3><p>During the reverse phase, I focused on the crypto functions, because those were the ones that were called during the comparison.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*CT_4Vh09ZVZiKJh2qhoOaQ.png" /></figure><p>One interesting thing here is that the data blob is first compressed before being encrypted.</p><pre>// SchneiderElectric.Automation.SoMachineBasic.Common.CommonUtility.Cryptography.EncryptionHelper<br>// Token: 0x0600000A RID: 10 RVA: 0x0000274C File Offset: 0x0000094C<br>public static byte[] CompressAndEcrypt(byte[] descriptorBytes)<br>{<br> byte[] result;<br> using (RijndaelManaged rijndaelManaged = new RijndaelManaged())<br> {<br>  rijndaelManaged.Key = EncryptionHelper.GetKey();<br>  byte[] buffer = Compressor.CompressBytes(descriptorBytes);<br>  byte[] array = Crypto.EncryptBytesToBytes(buffer, rijndaelManaged.Key, rijndaelManaged.IV);<br>  using (MemoryStream memoryStream = new MemoryStream())<br>  {<br>   memoryStream.Write(array, 0, array.Length);<br>   memoryStream.Write(rijndaelManaged.IV, 0, rijndaelManaged.IV.Length);<br>   result = memoryStream.ToArray();<br>  }<br> }<br> return result;<br>}</pre><pre>  public static byte[] CompressBytes(byte[] buffer)<br>  {<br>   byte[] result;<br>   using (MemoryStream memoryStream = new MemoryStream())<br>   {<br>    using (GZipStream gzipStream = new GZipStream(memoryStream, CompressionMode.Compress, true))<br>    {<br>     gzipStream.Write(buffer, 0, buffer.Length);<br>    }<br>    memoryStream.Position = 0L;<br>    byte[] array = new byte[memoryStream.Length];<br>    memoryStream.Read(array, 0, array.Length);<br>    byte[] array2 = new byte[array.Length + 4];<br>    Buffer.BlockCopy(array, 0, array2, 4, array.Length);<br>    Buffer.BlockCopy(BitConverter.GetBytes(buffer.Length), 0, array2, 0, 4);<br>    result = array2;<br>   }<br>   return result;<br>  }</pre><h4>Crypto time</h4><p>Here is the `EncryptBytesToBytes` function, which is the main encryption function.</p><pre>// SchneiderElectric.Automation.SoMachineBasic.Common.CommonUtility.Cryptography.Crypto<br>// Token: 0x06000007 RID: 7 RVA: 0x00002474 File Offset: 0x00000674<br>[SuppressMessage(&quot;Microsoft.Usage&quot;, &quot;CA2202&quot;, Justification = &quot;CryptoStream don&#39;t Dispose the Stream&quot;)]<br>public static byte[] EncryptBytesToBytes(byte[] buffer, byte[] key, byte[] iv)<br>{<br> if (buffer == null || buffer.Length &lt;= 0)<br> {<br>  throw new ArgumentNullException(&quot;buffer&quot;);<br> }<br> if (key == null || key.Length &lt;= 0)<br> {<br>  throw new ArgumentNullException(&quot;key&quot;);<br> }<br> if (iv == null || iv.Length &lt;= 0)<br> {<br>  throw new ArgumentNullException(&quot;iv&quot;);<br> }<br> byte[] result;<br> using (RijndaelManaged rijndaelManaged = new RijndaelManaged())<br> {<br>  rijndaelManaged.Key = key;<br>  rijndaelManaged.IV = iv;<br>  ICryptoTransform transform = rijndaelManaged.CreateEncryptor(rijndaelManaged.Key, rijndaelManaged.IV);<br>  using (MemoryStream memoryStream = new MemoryStream())<br>  {<br>   using (CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, CryptoStreamMode.Write))<br>   {<br>    cryptoStream.Write(buffer, 0, buffer.Length);<br>    cryptoStream.FlushFinalBlock();<br>    result = memoryStream.ToArray();<br>   }<br>  }<br> }<br> return result;<br>}</pre><p>The following function uses <a href="https://www.computerhope.com/jargon/r/rijndael-encryption.htm">Rijndael encryption</a>, (AES is a variant of Rijndael). Note that here the key size is 32, and that the IV and the key size are verified using other functions; therefore, the issues associated with the use of Rijndael are potentially minimized (though, of course, I am not a cryptograph).</p><p><a href="https://stackoverflow.com/questions/13486109/rijndaelmanaged-vs-aescryptoserviceprovider-aes-encryption">RijndaelManaged vs AesCryptoServiceProvider (AES Encryption)</a></p><h4>Hey that is not a salt !!!</h4><p>During my analysis, I came across two functions that got me thinking.</p><p>NOTE: These two functions are not used in the context of decrypting the project file, which contains a password that was intentionally set, but they appear to be used for project files without a password that have nevertheless been encrypted.</p><p>The first one is ENcryptSha256.</p><pre>// SchneiderElectric.Automation.SoMachineBasic.Common.CommonUtility.Cryptography.EncryptionHelper<br>// Token: 0x06000012 RID: 18 RVA: 0x000029BC File Offset: 0x00000BBC<br>public static string EncryptSha256(string password)<br>{<br> StringBuilder stringBuilder = new StringBuilder();<br> foreach (byte b in new SHA256Managed().ComputeHash(Encoding.UTF8.GetBytes(password)))<br> {<br>  stringBuilder.Append(string.Format(&quot;{0:x2}&quot;, b));<br> }<br> return stringBuilder.ToString();<br>}</pre><p>The 2nd and EncryptSha256Salted</p><pre>// SchneiderElectric.Automation.SoMachineBasic.Common.CommonUtility.Cryptography.EncryptionHelper<br>// Token: 0x06000013 RID: 19 RVA: 0x00002A14 File Offset: 0x00000C14<br>public static string EncryptSha256Salted(string password)<br>{<br> return EncryptionHelper.EncryptSha256(EncryptionHelper.EncryptSha256(password) + &quot;EcoStruxure Machine Expert - Basic&quot;);<br>}</pre><p>So, I’m still not a cryptograph, but shouldn’t a salt be random? Thanks, Schneider, for saving me from having to post a meme the following screenshot says the same thing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*i7sFHY5mhGPPMD1l24OUmg.png" /></figure><h4>IV and KEY</h4><p>Value and IV stored in buffer of 16 and 32 byte , lenght for AES256 cypher.</p><p>The key (who is the user imput for the password) is append to himself together until they reach 32 bytes , and that make the rijndael key.</p><p>testtesttest = \x74\x65\x73\x74\x74\x65\x73\x74\x74\x65\x73\x74</p><p>Therefore, hashing is not used in this version of MachineExpert Basic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zs_ReNfdCR236pYno4BJIw.png" /><figcaption>IV and</figcaption></figure><p>Note that the data blob uses padding to fill the last block if it is less than 16 octets; to do this, it uses the PKCS#7 padding method.</p><p><a href="https://pentesterlab.com/glossary/pkcs7-padding">PKCS#7 Padding: Definition &amp; Security Context | PentesterLab Glossary</a></p><p>which could trigger an Oracle Padding Attack</p><p><a href="https://pentesterlab.com/glossary/padding-oracle-attack">Padding Oracle Attack: Definition &amp; Security Context | PentesterLab Glossary</a></p><p>This might be the subject of a future article.</p><h4>Extraction of the IV</h4><p>Given the AES configuration in CBC mode, it is important to understand that the IV is public information; the idea here is to retrieve the IV in order to decrypt the data, without having to retrieve it from memory.</p><p>It turns out that the issue of making the IV available is a real concern.</p><p>In our case, the IV is appended to the end of the encrypted data blob.</p><p><a href="https://stackoverflow.com/questions/10283637/how-to-append-to-aes-encrypted-file">https://stackoverflow.com/questions/10283637/how-to-append-to-aes-encrypted-file</a></p><p>So all we need to do is extract the last 16 bytes.</p><p>In the following screenshot, we can see that the blog encrypted, decoded in Base64, and then converted to hex matches the IV retrieved during execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*kL7BrD_MCCkUr8frz7-Rxg.png" /></figure><h4>unzip functions</h4><p>While the soft use the `DecompresseBytes` function, we can see that the program takes all the bytes in the blob except for the first 4 (which, spoiler alert, correspond to the file size) and then decompresses them using gzip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*s67ZwVjXsSW1q5Ub4ZDskA.png" /></figure><h4>Decypher and decompress workflow</h4><p>So here is the complete workflow for decryption and decompression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*J02M5G2Bgzc6y9ZZvpG4fg.png" /></figure><p>If you want to take a closer look, here’s a little tool that lets you perform a brute-force attack</p><p><a href="https://github.com/biero-el-corridor/Schneider_MachineExpert-basic_smbp_file_password_bruteforce">GitHub - biero-el-corridor/Schneider_MachineExpert-basic_smbp_file_password_bruteforce: Simple tool to bruteforce .smbp password protected file</a></p><h3>Optimisations</h3><p>Since I had some time to kill, I wondered how to optimize the brute-force phase.</p><p>The encryption mode is AES CBC, which means that the data blob is decrypted in 16-byte blocks. Since what we want is to detect a magic number (in our case, “1f 8B” for gzip), and since the padding only affects the last block, what we can do is simply take the first 16 bytes — which correspond to the first block — decrypt them with the key (the brute-force value), and check if we get the magic number + compression method 08 + flag (00).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*2sm8GHRJxD4Sbyae.png" /></figure><h3>EcoStruxure Machine Expert basic</h3><p>I reserve this software for part 2</p><h3>Conclusion</h3><p>In conclusion, I would say that symmetric encryption is one of the best ways to protect this type of file, but the need for backward compatibility means that some applications must continue to support features that are insecure by default. Still, we should remain optimistic — things are changing, very slowly, but they are changing.</p><p>This article is not completed yet , i may have to updat it. if you have critics, or questions dont hesitate to dm me on linkedin.</p><h3>About the Author</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>I am a freelance ICS security consultant and a teacher available for assignments in this field.</p><p>If you are interested, DM me on LinkedIn.<br><a href="https://www.linkedin.com/in/erwan-cordier/">https://www.linkedin.com/in/erwan-cordier/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66fdc15922f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI/LLM as assistant in monitoring SCADA system Part 2: setup and secure a test environment.]]></title>
            <link>https://medium.com/@biero-llagas/ai-llm-as-assistant-in-monitoring-scada-system-part-2-setup-and-secure-a-test-environment-7ea106d936ce?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ea106d936ce</guid>
            <category><![CDATA[ics-security]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[scada]]></category>
            <category><![CDATA[opc-ua]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 10:29:44 GMT</pubDate>
            <atom:updated>2026-04-10T13:41:12.832Z</atom:updated>
            <content:encoded><![CDATA[<h3>Foreword</h3><p>This article is a continuation of the following one :</p><p><a href="https://medium.com/@biero-llagas/ai-llm-as-assistant-in-monitoring-scada-system-part-1-opportunities-risks-0f51c8b926ed">AI/LLM as assistant in monitoring SCADA system Part 1: Opportunities &amp; Risks.</a></p><p>I encourage you to read it before starting this one.</p><h3>Glossary :</h3><ul><li><strong>LLM :</strong> Large Language Models are advanced AI systems based on deep learning (typically Transformer architectures) pre-trained on massive, diverse datasets to understand and generate human-like text</li><li><strong>ML :</strong> Machine learning is a subset of artificial intelligence (AI) focusing on algorithms that learn patterns from data to make predictions or decisions without being explicitly programmed for every task</li><li><strong>MCP </strong>: The Model Context Protocol (MCP) is an open standard, that connect AI models (LLMs) to external data and tools (databases, APIs, local files). It streamlines integration, reduces hallucinations, and enables AI systems to act on real-time data via a client-server architecture.</li><li><strong>RAG :</strong> Retrieval-Augmented Generation is an AI framework that improves Large Language Model (LLM) accuracy and relevance by retrieving data from external, trusted sources before generating a response.</li><li><strong>Defense in depth :</strong> is a cybersecurity strategy employing multiple, layered security controls (administrative, technical, and physical) to protect data integrity and network availability</li><li><strong>Siemens TIA Portal :</strong>(Totally Integrated Automation Portal) is an engineering framework that integrates PLC programming (STEP 7), HMI visualization (WinCC), and drive configuration (Startdrive) into a single software environment.</li><li><strong>Node-RED :</strong> <a href="https://nodered.org/">Node-RED</a> is an open-source, low-code programming tool for event-driven applications, allowing users to connect hardware devices, APIs, and online services via a visual browser-based editor.</li><li><strong>Factory IO:</strong> Factory IO is a 3D factory simulation that can be used to create industrial scene.</li><li><strong>UaExpert :</strong> <a href="https://www.unified-automation.com/products/development-tools/uaexpert.html">UaExpert</a> is <em>a full-featured OPC UA Client.</em></li><li><strong>opcua-asyncio :</strong> <a href="https://pypi.org/project/asyncua/">opcua-asyncio</a> is an asyncio-based asynchronous OPC UA client and server based on python-opcua, removing support of python &lt; 3.8. Asynchronous programming allows for simpler code (e.g. less need for locks) and can potentially provide performance improvements.</li></ul><h3>Disclaimer</h3><p>This article offers some thoughts on LLMs as assistant for supervision and monitoring systems in industrial settings.</p><p>It is not intended to provide an exhaustive overview or to serve as a definitive guide. Please consider what is written here as a perspective and a framework for setting up an environment.</p><p>For now, when I talk about AI, I’m referring to a large lenguage model running on a computer within a specific context that can interact with the physics system via MCP or tooling interface.</p><h3>The lab and its contents.</h3><p>I propose setting up a lab based once again on the Purdue model, with Levels 0 and 1 represented by a LAN hosting the physical system emulator and the PLC, and a LAN representing Level 2 hosting the EWS and the language model with the MCP</p><p>In addition to this, I have imposed some additional constraints on myself.</p><ul><li>Using OPC UA for PLC control and monitoring adds a bit of complexity to the initial setup, but it makes it easier to add security.</li><li>I’ll be using the hardware I already have on hand — specifically a Siemens S7–1200 but don’t worry, there’s an emulator in TIA Portal; you just need to find a version that works for you <strong>(WARNING: At one point, I encountered an issue with the OPC UA server when compiling and uploading the file to the PLC. This was due to a bug in certain versions of TIA Portal from V16 to V19, so I recommend using version 20 or applying the patches as explained in the following link.)</strong></li></ul><p><a href="https://support.industry.siemens.com/cs/document/109971630/tia-portal-crash-when-compiling-the-plc?dti=0&amp;lc=en-FR">SIOS</a></p><ul><li>2 setups for LLM, One remote and one local.</li></ul><p>As you can see, the lab has been symbolically divided into two parts: the standard system and the LLM with its connector. The first part will be very similar to one of my previous articles (but oriented on OPC-UA) , so sorry for the redundancy.</p><p><a href="https://medium.com/@biero-llagas/setup-exploit-and-harden-a-physical-ics-lab-s7comm-part3-s7-1200-node-red-monitoring-and-a270b56aabe8">Setup , exploit and harden a Physical ICS LAB: S7comm: Part3 | s7–1200 , node red monitoring and…</a></p><p>For the lab setup, I’ll keep it fairly standard, with monitoring via Node-RED, simulations via Factory IO, OPC-UA debugging via UA Expert, and asyncio-asyncua (if we want to scale and use some asynchronous processing, that’s always preferable), which will serve as an OPC-UA client connected to the MCP so that Claude and the local LLM can interface with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p28PnX42VGjmBM68if4p8Q.png" /></figure><h3>LAB setup:</h3><p>NOTE: To save you the trouble of configuring everything, I’m providing the various files here. I’ll let you know which files to use as we go through the article.</p><p><a href="https://github.com/biero-el-corridor/OPC-UA_MCP_scene_example">GitHub - biero-el-corridor/OPC-UA_MCP_scene_example: This is a sample scene for testing the OPC UA control and monitoring via an s7-1200 siemens PLC (real or simulated).</a></p><h4>Factory IO:</h4><p>The factory IO scene will be intentionally simple, as that is not the goal of this lab.</p><p>All you need to do is place a water tank on your scene — that’s it. The scene file will not be provided.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KsrqAkqggmh0ErckSsBmSA.png" /><figcaption>Configurations Drivers S7–1200</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*GBSUzFNm2I23r0INmcVeAg.png" /><figcaption>I/O and network configurations for the scene.</figcaption></figure><p>NOTE: There is a recurring issue that I haven’t been able to resolve: Factory IO temporarily disconnects when a new client connects to the OPC-UA server using a certificate and password.<strong><em> I should note that a connection from a client without authentication or signature encryption will not cause this crash.</em></strong> The disconnection is only temporary and therefore does not really affect the simulation; it just blocks it if you do not set up an auto-connection and do not specify</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hWb9hMI9l_dLzA38ZBedrQ.png" /></figure><h4>TIA Portal:</h4><p>The TIA Portal project file is available on the repository at the following URL.</p><p><a href="https://github.com/biero-el-corridor/OPC-UA_MCP_scene_example/blob/main/file/Project_S7_1200_Water_Tank.7z">OPC-UA_MCP_scene_example/file/Project_S7_1200_Water_Tank.7z at main · biero-el-corridor/OPC-UA_MCP_scene_example</a></p><p>Here are the capture that can interest you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZMGsn_jWkUate7SGlFlAJQ.png" /><figcaption>Main bloc program</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5892iyxzXxT89-RSNFaLog.png" /><figcaption>list of the tag.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LFcrSRhMWoLGBQ4TmI9QeQ.png" /><figcaption>OPC UA server interface.</figcaption></figure><p>As for server configuration and managing the interface with the PLC, I won’t go into that here; I recommend reviewing Part 3 of the S7–1200 lab setup article listed above.</p><p>NOTE: I recommend running an initial test without security on OPC-UA to verify that the scene is working properly.</p><h4>setup OPC-UA scurity and test with UAexpert</h4><p>So far, in my previous articles, I haven’t discussed implementing security on OPC-UA. Here, I’ll cover a simplified security implementation.</p><p>I won’t be discussing the <a href="https://reference.opcfoundation.org/Core/Part2/v104/docs/8.1.4">GDS server</a> nor advanced concept; instead, I’ll focus on adding certificates for signing and encrypting connections, as well as a password for authentication.</p><p>NOTE: The username and password I’ll be using for this article are biero:SXxKvSixpEzyvJboPB5aHd1IjTw1JHj</p><h4>TIA setup</h4><p>To set up OPC-UA authentication in TIA Portal, go to:</p><ul><li>Parameter / General / OPC UA / Security / User authentifications</li><li>Parameter / General / OPC UA / Security / Certificate</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*_Sh14urTVYNnrviAoMwisA.png" /></figure><p>And the screenshot for the security policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VhEfXDrfwb0BtPBDLb1zBQ.png" /></figure><p>NOTE: In my case, I tested certificate management using Basic256 — Sign and Basic256 — Sign &amp; Encrypt. We won’t be using them here, but it’s still worth testing.</p><p>Furthermore, we won’t be filtering the different certificates (theoretically, we could filter the certificates to add an extra layer of authentication).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXCAEqpESUtJV4kWrSHQIw.png" /></figure><p>After that, we just need to go to Online / Online &amp; Diagnostics (this is the tab where we’ll see the client certificates appear).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8QUZ5n1-8EeOQZ01cF7rQ.png" /></figure><h4>UAexpert</h4><p>An UA expert and an OPC-UA client that allows you to connect to a server; here, we will use it to test connections with the server.</p><p><a href="https://www.unified-automation.com/downloads/undefined">https://www.unified-automation.com/downloads/undefined</a></p><p>Once installed and launched, you can create a new connection or add a new connection using custom discovery mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*dBDpf0YXVLDCIwRWeAqU3A.png" /><figcaption>Anonymous test connexions</figcaption></figure><p>Once selected you can choose the type of connexions you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*RnGA9OUL9p1xMby96Oyl7A.png" /></figure><p>Here an example of password authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*WuKe2uUUz2u4ZYWY37g3Ng.png" /></figure><p>Dont forget to click on “TRUST CENTER CERTIFICATE”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*V1RBEc0BHzRhP8bQxMUgbQ.png" /></figure><p>Then ignore and ignore , and you will see the certificate that is requested in ther server (go online in your TIA portal interface to see that)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fIedn652nIYqL_pW34H4EA.png" /></figure><p>Yayyy your are now connected (export the 3 tag and you can modify them)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*43th8Gm2wB7I1HySNvKL3w.png" /></figure><p>Proof of work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_5p8kS1RlGTNeSvIQpntgQ.jpeg" /></figure><h4>NODE RED:</h4><p>Node-RED provides a simple dashboard for monitoring our system. I won’t go into detail about how Node-RED works here; I recommend reviewing Part 3 of the S7–1200 lab setup article listed above.</p><p>The node palette I’m using for this project and the next one.</p><p><a href="https://flows.nodered.org/node/node-red-contrib-opcua">node-red-contrib-opcua</a></p><p>Here is the final Node-RED graph I’m proposing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*7BPtxMA_JAAT-yiIBZ3VfA.png" /></figure><p>It’s fairly simple, but it provides the basics for configuring these nodes.</p><p>Don’t forget to configure the settings for packet encryption and signing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*x0WXmEd0TTrY5pCTdGkYvw.png" /><figcaption>Parameter of the node write functions.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*KitGkVQYF-ltSfdHEY4TYA.png" /><figcaption>Parameter of the Endpoint</figcaption></figure><p>The JSON file is available on this project’s GitHub repository.</p><p><a href="https://github.com/biero-el-corridor/OPC-UA_MCP_scene_example/blob/main/file/node_red_opc-ua_water_tank.json">OPC-UA_MCP_scene_example/file/node_red_opc-ua_water_tank.json at main · biero-el-corridor/OPC-UA_MCP_scene_example</a></p><h3>LLM:</h3><h4>Options 1: remote hosting.</h4><p>Option 1 is based on the assumption that you don’t mind using a hosted model on a system you don’t control. Remember, the cloud is just someone else’s computer. A bit extreme example, but this is one.</p><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=twitter&amp;url=https%3A//x.com/LSaillans/status/2041139991695212685&amp;image=" width="500" height="281" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e6bc73f80484cf44703b2a1106d1352/href">https://medium.com/media/4e6bc73f80484cf44703b2a1106d1352/href</a></iframe><p>So for that, you’ll need<a href="https://claude.com/download"> Claude Desktop</a>. Personally, I’m running Debian; apparently, a <a href="https://github.com/aaddrick/claude-desktop-debian">port was recently released</a>.</p><p>you can go on the setting / developer / local MCP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zsxaTzUwBOtO74HSs2CNXw.png" /></figure><p>Here my claude_desktop_config.json (go on “Edit Config”, if not exist create it).</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;Industrial-station&quot;: {<br>      &quot;command&quot;: &quot;/path/to/you/python3&quot;,<br>      &quot;args&quot;: [<br>        &quot;/path/to/you/script/server.py&quot;<br>      ]<br>    }<br>  },<br>  &quot;preferences&quot;: {<br>    &quot;coworkScheduledTasksEnabled&quot;: true,<br>    &quot;ccdScheduledTasksEnabled&quot;: true,<br>    &quot;sidebarMode&quot;: &quot;task&quot;,<br>    &quot;coworkWebSearchEnabled&quot;: true<br>  }<br>}</pre><h4>server.py</h4><p>As for the server.py script, it’s pretty easy to understand.</p><ul><li>Definitions of global variables (OPC-UA URL and parameter name dictionary for the various nodes, definition of the MCP name and credential + certt)</li><li>1 functions to generate and write the cert and the private key.</li><li>1 functions to connect to the opc ua server.</li><li>2 functions: one to read a node’s values, and one to write to a node,</li><li>1 function using a <a href="https://www.w3schools.com/python/python_decorators.asp">decorator</a> to be called by the <a href="https://gofastmcp.com/getting-started/welcome">FastMCP</a> lib (i encourage you to read the doc), which will retrieve the node’s values (read).</li><li>1 function using a <a href="https://www.w3schools.com/python/python_decorators.asp">decorator</a> to be called by the MCP library (it will translate natural language into parameters for the function) and which will write the values to the nodes</li></ul><p>NOTE : i know that you can generate your certificate one time , but there i was getting error with this method i dont know why, so i try with regenerate a certificate and a key every time, and it’s seem to work.</p><pre>&quot;&quot;&quot;<br>Water Tank Control - MCP Server<br>OPC UA secure connection to S7-1200<br>&quot;&quot;&quot;</pre><pre>import os<br>import datetime<br>import socket</pre><pre>from mcp.server.fastmcp import FastMCP</pre><pre># --- Config ---<br>CERT_DIR = &quot;/tmp&quot;<br>CERT_PATH = os.path.join(CERT_DIR, &quot;client_cert.pem&quot;)<br>KEY_PATH = os.path.join(CERT_DIR, &quot;client_key.pem&quot;)<br>OPC_URL = &quot;opc.tcp://10.1.1.13:4840&quot;<br>OPC_USER = &quot;biero&quot;<br>OPC_PASS = &quot;SXxKvSixpEzyvJboPB5aHd1IjTw1JHj&quot;</pre><pre># --- MCP Server ---<br>mcp = FastMCP(&quot;water-tank&quot;)<br></pre><pre># --- Certificate generation ---<br>def generate_certificates():<br>    if os.path.exists(CERT_PATH) and os.path.exists(KEY_PATH):<br>        return</pre><pre>    from cryptography import x509<br>    from cryptography.x509.oid import NameOID<br>    from cryptography.hazmat.primitives import hashes, serialization<br>    from cryptography.hazmat.primitives.asymmetric import rsa</pre><pre>    os.makedirs(CERT_DIR, exist_ok=True)<br>    hostname = socket.gethostname()</pre><pre>    key = rsa.generate_private_key(public_exponent=65537, key_size=2048)</pre><pre>    subject = issuer = x509.Name([<br>        x509.NameAttribute(NameOID.COMMON_NAME, &quot;AsyncuaClient&quot;),<br>    ])</pre><pre>    cert = (<br>        x509.CertificateBuilder()<br>        .subject_name(subject)<br>        .issuer_name(issuer)<br>        .public_key(key.public_key())<br>        .serial_number(x509.random_serial_number())<br>        .not_valid_before(datetime.datetime.now(datetime.UTC))<br>        .not_valid_after(datetime.datetime.now(datetime.UTC) + datetime.timedelta(days=365))<br>        .add_extension(<br>            x509.SubjectAlternativeName([<br>                x509.UniformResourceIdentifier(&quot;urn:example.org:FreeOpcUa:opcua-asyncio&quot;),<br>                x509.DNSName(hostname),<br>            ]),<br>            critical=False,<br>        )<br>        .add_extension(<br>            x509.BasicConstraints(ca=False, path_length=None),<br>            critical=True,<br>        )<br>        .add_extension(<br>            x509.KeyUsage(<br>                digital_signature=True,<br>                key_encipherment=True,<br>                content_commitment=True,<br>                data_encipherment=True,<br>                key_agreement=False,<br>                key_cert_sign=False,<br>                crl_sign=False,<br>                encipher_only=False,<br>                decipher_only=False,<br>            ),<br>            critical=True,<br>        )<br>        .add_extension(<br>            x509.ExtendedKeyUsage([<br>                x509.oid.ExtendedKeyUsageOID.CLIENT_AUTH,<br>            ]),<br>            critical=False,<br>        )<br>        .sign(key, hashes.SHA256())<br>    )</pre><pre>    with open(KEY_PATH, &quot;wb&quot;) as f:<br>        f.write(key.private_bytes(<br>            serialization.Encoding.PEM,<br>            serialization.PrivateFormat.TraditionalOpenSSL,<br>            serialization.NoEncryption(),<br>        ))</pre><pre>    with open(CERT_PATH, &quot;wb&quot;) as f:<br>        f.write(cert.public_bytes(serialization.Encoding.PEM))<br></pre><pre># --- OPC UA connection helper ---<br>async def opc_connect():<br>    from asyncua import Client<br>    from asyncua.crypto.security_policies import SecurityPolicyBasic256Sha256<br>    from asyncua.ua import MessageSecurityMode</pre><pre>    client = Client(url=OPC_URL, timeout=10)<br>    await client.set_security(<br>        SecurityPolicyBasic256Sha256,<br>        certificate=CERT_PATH,<br>        private_key=KEY_PATH,<br>        mode=MessageSecurityMode.Sign,<br>    )<br>    client.set_user(OPC_USER)<br>    client.set_password(OPC_PASS)<br>    await client.connect()<br>    return client<br></pre><pre># --- MCP Tools ---<br>@mcp.tool()<br>async def get_tank_level() -&gt; str:<br>    &quot;&quot;&quot;Get the current water tank level. Always use this when asked about tank level.&quot;&quot;&quot;<br>    try:<br>        client = await opc_connect()<br>        level = await client.get_node(&quot;ns=4;i=12&quot;).read_value()<br>        entry = await client.get_node(&quot;ns=4;i=23&quot;).read_value()<br>        exit_v = await client.get_node(&quot;ns=4;i=34&quot;).read_value()<br>        await client.disconnect()<br>        return f&quot;Tank level: {level} liters. Entry valve: {entry}%. Exit valve: {exit_v}%.&quot;<br>    except Exception as e:<br>        return f&quot;Error: {e}&quot;<br></pre><pre>@mcp.tool()<br>async def set_valve(valve_type: str, percentage: int) -&gt; str:<br>    &quot;&quot;&quot;Control a valve. valve_type is &#39;entry&#39; or &#39;exit&#39;. percentage is 0 to 100.<br>    Use this when asked to open, close, or adjust a valve.&quot;&quot;&quot;<br>    try:<br>        from asyncua import ua</pre><pre>        if percentage &lt; 0 or percentage &gt; 100:<br>            return &quot;Error: percentage must be between 0 and 100.&quot;</pre><pre>        client = await opc_connect()</pre><pre>        if valve_type == &quot;entry&quot;:<br>            node = client.get_node(&quot;ns=4;i=23&quot;)<br>        elif valve_type == &quot;exit&quot;:<br>            node = client.get_node(&quot;ns=4;i=34&quot;)<br>        else:<br>            await client.disconnect()<br>            return &quot;Error: valve_type must be &#39;entry&#39; or &#39;exit&#39;.&quot;</pre><pre>        dv = ua.DataValue(ua.Variant(int(percentage), ua.VariantType.Int16))<br>        await node.write_value(dv)<br>        await client.disconnect()<br>        return f&quot;Success: {valve_type} valve set to {percentage}%.&quot;<br>    except Exception as e:<br>        return f&quot;Error: {e}&quot;<br></pre><pre># --- Startup ---<br>generate_certificates()</pre><pre>if __name__ == &quot;__main__&quot;:<br>    mcp.run(transport=&quot;stdio&quot;)</pre><p>After that run a new discussions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*2lSuf_VEodu10paKc2CwRA.png" /></figure><p>Once you’ve done that, you can start talking to your LLM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*p9io2auH2KpVBMcObAwSBw.png" /></figure><p>Hurray that work, Also note how he asks for my permission to enter values.</p><h4>Pros and cons</h4><p>Given the obvious advantage and the speed at which actions take place — it should take less than 5 seconds for an action to be performed and for the model to respond ,it can also provide contextual elements.</p><p>Furthermore, if we had a much larger scene, it could effectively manage the differences between various actuators within a natural language context.</p><p>The obvious drawback is that I’ve just opened a file on my computer that a remote model can use , a model that I don’t control fully and is hosted on a system that isn’t mine.</p><p>I don’t need to explain why this is a problem.</p><h4>Options 2: local hosting.</h4><p>For local hosting, I decided to go with a fairly compact model since I only have a laptop (which does have 64GB of RAM and an 11th-generation i7 processor, but no dedicated graphics card).</p><p>I settled on the Mistral model with 3 billion parameters, so I choose the <a href="https://docs.mistral.ai/models/ministral-3-3b-25-12">Mistral 3 3B</a>.</p><p>The reasons are pretty simple: first of all, Mistral is a French company, and I really like its AI, “Le Chat.”, also the fact that this model is Apache 2.0 licenced it’s quite cool.</p><p>I’ll admit the choice is somewhat arbitrary a benchmark comparing the different models for various use cases could be a good topic for an article.</p><p>As for the interface, I’m going to use <a href="https://openwebui.com/">OpenWebUI</a> to get a nice graphical interface and establish connections between Mistral 3 and 3B and Python connectors.</p><p>For the installation.</p><pre># Ollama install<br>curl -fsSL https://ollama.com/install.sh | sh<br>systemctl enable ollama<br>systemctl start ollama</pre><pre># pull Mistral 3 3b (the qunatized one)<br># <a href="https://huggingface.co/docs/optimum/concept_guides/quantization">https://huggingface.co/docs/optimum/concept_guides/quantization</a><br>ollama pull ministral-3:3b-instruct-2512-q4_K_M<br>ollama serve<br># test the ollama with mistral 3B<br>ollama run ministral-3:3b-instruct-2512-q4_K_M &quot;what&#39;s yellow and waiting ? &quot;</pre><pre># OpenWebUI once installed go on the url. <br>docker run -d --network=host \<br>            -e OLLAMA_BASE_URL=http://127.0.0.1:11434 \<br>            -v open-webui:/app/backend/data \<br>            --name open-webui --restart always \<br>            ghcr.io/open-webui/open-webui:main</pre><p>NOTE 1: We dont have the right python lib installed in the docker so we need to install it so go to Docker and generate one using the following command.</p><p>NOTE 2: If you have trouble generating a certificate using the Python script, you can simply generate one using OpenSSL. All you need to do is specify the path (in the docker) to the certificate and the private key that you have just generated in the script.</p><pre># install python depedency<br>apt install pip <br>pip install asyncua<br>mkdir -p /app/backend/cert<br>openssl req -x509 -newkey rsa:2048 -keyout /app/backend/cert/client_key.pem -out /app/backend/cert/client_cert.pem -days 365 -nodes -subj &quot;/CN=AsyncuaClient&quot;</pre><p>Normally, you’ll see this option in the following url: <a href="http://localhost:8080/">http://localhost:8080/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*eX1RfvLgbWnXhuvKOxzvDQ.png" /></figure><p>Next, go to Workspace &gt; Tools &gt; New Tool</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*TdYTWHImwzQYjncsRD1a_g.png" /></figure><p>To avoid repeating myself, I won’t describe the script here — it’s essentially the same as the one for Claude. I’ll just give you the code directly.</p><p><a href="https://github.com/biero-el-corridor/OPC-UA_MCP_scene_example/blob/main/file/OpenWebUI_tool_water_tank.py">OPC-UA_MCP_scene_example/file/OpenWebUI_tool_water_tank.py at main · biero-el-corridor/OPC-UA_MCP_scene_example</a></p><p>NOTE: As explained at the beginning, we can assign access to the use of the tool.</p><p><a href="https://docs.openwebui.com/features/authentication-access/">Authentication &amp; Access / Open WebUI</a></p><p>Once you’ve done that, you can create a new conversation and click the four small dots in a square below the chat text box, then select the tool you want to add.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*kk8mv_G1QOemHwyrMFR7Ow.png" /></figure><p>Actually, it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N0Dj3K6x0E2oX08awRP3Gg.png" /></figure><h4>Pros and cons</h4><p>So, I’m going to say the exact opposite of what Claude said: here we have a very high latency ,about 20 seconds to trigger the action and maybe between 30 and 40 seconds to get feedback. This means that when the valve is fully open, I have a very poor view of what’s happening in my tank.</p><p>However, I can improve this issue with a graphics card and a PC that has a better CPU. Since we host our own model, the security issue (which, in my opinion, is the most important) is partially resolved.</p><p>It’s also worth noting that we can apply identity access management to the tools in the Open Web UI.</p><h3>About the Author</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>I am a freelance ICS security consultant and a teacher available for assignments in this field.</p><p>If you are interested, DM me on LinkedIn.<br><a href="https://www.linkedin.com/in/erwan-cordier/">https://www.linkedin.com/in/erwan-cordier/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ea106d936ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI/LLM as assistant in monitoring SCADA system Part 1: Opportunities & Risks.]]></title>
            <link>https://medium.com/@biero-llagas/ai-llm-as-assistant-in-monitoring-scada-system-part-1-opportunities-risks-0f51c8b926ed?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f51c8b926ed</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[scada]]></category>
            <category><![CDATA[ics-security]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 10:16:46 GMT</pubDate>
            <atom:updated>2026-04-10T13:28:40.205Z</atom:updated>
            <content:encoded><![CDATA[<h3>Foreword</h3><p>In the foreword, I wanted to make a joke about how fictional worlds have tackled this topic, but instead of making the joke, I’m going to list some films that address this subject, which I highly recommend.</p><ul><li><a href="https://en.wikipedia.org/wiki/Terminator_(franchise)">Terminator</a></li><li><a href="https://en.wikipedia.org/wiki/The_Animatrix">The animatrix</a></li><li><a href="https://en.wikipedia.org/wiki/WarGames">War Game</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TPqUQdIhBT2jepef.png" /></figure><p>So, after the obligatory joke about Skynet and AI, let’s try to think about this topic a bit, since it’s going to try to impose itself on us. Let’s try to approach it critically rather than just making fun of it.</p><p>NOTE: This article is divided into two parts, a theoretical part on LLM reflections in an industrial environment and a tutorial part on setting up the environment.</p><p>I encourage you to read the part 2 after reading this one.</p><p><a href="https://medium.com/@biero-llagas/ai-llm-as-assistant-in-monitoring-scada-system-part-2-setup-and-secure-a-test-environment-7ea106d936ce">AI/LLM as assistant in monitoring SCADA system Part 2: setup and secure a test environment.</a></p><h3>Glossary :</h3><ul><li><strong>LLM :</strong> Large Language Models are advanced AI systems based on deep learning (typically Transformer architectures) pre-trained on massive, diverse datasets to understand and generate human-like text</li><li><strong>ML :</strong> Machine learning is a subset of artificial intelligence (AI) focusing on algorithms that learn patterns from data to make predictions or decisions without being explicitly programmed for every task</li><li><strong>MCP </strong>: The Model Context Protocol (MCP) is an open standard, that connect AI models (LLMs) to external data and tools (databases, APIs, local files). It streamlines integration, reduces hallucinations, and enables AI systems to act on real-time data via a client-server architecture.</li><li><strong>RAG :</strong> Retrieval-Augmented Generation is an AI framework that improves Large Language Model (LLM) accuracy and relevance by retrieving data from external, trusted sources before generating a response.</li><li><strong>Defense in depth :</strong> is a cybersecurity strategy employing multiple, layered security controls (administrative, technical, and physical) to protect data integrity and network availability</li></ul><h3>Disclaimer</h3><p>This article offers some thoughts on LLMs as assistant for supervision and monitoring systems in industrial settings.</p><p>It is not intended to provide an exhaustive overview or to serve as a definitive guide. Please consider what is written here as a perspective and a framework for setting up an environment.</p><p>For now, when I talk about AI, I’m referring to a large lenguage model running on a computer within a specific context that can interact with the physics system via MCP or tooling interface.</p><h3>Introductions</h3><p>For the past few months, I’ve noticed a trend in my industrial security news feed: AI (or rather, large language models) is starting to make an appearance.</p><p>I’m not talking here about machine learning or defensive or purely offensive AI in the context of security — no, in that context, it’s nothing new, especially in detection systems. Here are a few examples.</p><iframe src="https://drive.google.com/viewerng/viewer?url=https%3A//arxiv.org/pdf/2305.09678&amp;embedded=true" width="600" height="780" frameborder="0" scrolling="no"><a href="https://medium.com/media/22d7ba51fa645ae550bf6254f55472e7/href">https://medium.com/media/22d7ba51fa645ae550bf6254f55472e7/href</a></iframe><ul><li><a href="https://www.sciencedirect.com/science/article/pii/S1874548225000496">Enhancing cybersecurity in railways: Machine learning approaches for attack detection</a></li><li><a href="https://www.mdpi.com/2071-1050/15/10/8076">Design of Efficient Based Artificial Intelligence Approaches for Sustainable of Cyber Security in Smart Industrial Control System</a></li></ul><p>I’m talking here about AI that helps monitor and understand production environments a assistant, in other words.</p><h4>The obvious malicious thought</h4><p>Of course, the first time I saw this, my hacker’s mind immediately started listing all the malicious things you could do with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*hPXd2ocnTw7Qi1gQKmmOdQ.png" /></figure><p>And as for Claude (I’m not kidding) I won’t list them here, but solution vendors literally use Claude for the demos.</p><p>And as of the latest news, even though <a href="https://www.zscaler.com/blogs/security-research/anthropic-claude-code-leak">Anthropic suffered a unvolontary OSINT event</a>, Anthropic isn’t really in the habit of distributing models that run locally.</p><p>So this raises the question of on-premise deployment and remote access.</p><h4>The good side.</h4><p>So let’s set aside our biased perspective for a moment and think about it: the idea of having a natural language translator for control and monitoring systems is pretty crazy.</p><p>Control systems require a deep understanding of the various user interfaces and the environment inherent to any system; this can create a somewhat steep learning curve or adaptation process.</p><p>The problem here isn’t a lack of understanding of the system’s fundamentals, but rather the time required to grasp its structure.</p><p>In other word you can have the hability to understand the system , but you don’t have the time to do it.</p><p>Another example , anyone who has ever used TIA Portal (anf it’s god forsaken interface and logic , i hate you TIA) would understand the value of an AI that summarizes and contextualizes information, function blocks, and tags.</p><p>Well, it turns out it already exists.</p><p><a href="https://github.com/gangsterke/Tia-Portal-MCP-server">GitHub - gangsterke/Tia-Portal-MCP-server: Tia-Portal MCP server built to be able to export OPC UA nodeset files from a PLC</a></p><p>In this article, I’ll be focusing mainly on ””””real-time””””” monitoring, and there are two points to address:</p><ul><li>This is clearly not the best use case of LLM in the ICS environment for multiple reasons that we are going to speak about later.</li><li>In my opinion, the biggest advantage of AI would be in analyzing historical data to quickly analyze past data event, for example, provide context in the event of a breakdown or fluctuations in production (The analysis of historical data using LLMs could be the subject of a follow-up to this article) here an example of one of the first vendor of historian solutions to use an MCP server.</li></ul><p><a href="https://inductiveautomation.com/resources/article/what-is-mcp-understanding-the-model-context-protocol">What Is MCP? Understanding the Model Context Protocol</a></p><p>Another interesting use for LLMs would be their integration with a RAG. Imagine setting up a PC (not connected to any network) that hosts an LLM linked to a RAG, and feeding it all of your business continuity and disaster recovery plans, as well as various building plans, production-related information, and so on.</p><p>Now imagine a crisis strikes having this computer available could help sustain operations during the crisis, with a system that cannot be overwhelmed. Of course, it should be viewed for what it is a “support tool” but it could still be a good idea in situations like this.</p><p><a href="https://github.com/infiniflow/ragflow">GitHub - infiniflow/ragflow: RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge RAG with Agent capabilities to create a superior context layer for LLMs</a></p><p>This is a point I’ll try to elaborate on a bit more in the conclusions. The fact that LLMs are used solely for their intended purpose in this context, translating natural language into function calls or database queries means that only local, non-intrusive usage is required (such as reading documents or values linked to the SCADA HMI).</p><p>If an attacker gains access to a machine, the model it will only allow them to accelerate their understanding of the system (which is already a game changer if yout think about it).</p><p>It is true that they could still modify calls in the MCP or RAG to alter elements, but this requires additional actions on the attacker’s side.</p><h4>Defense in depth</h4><p>One of the important concepts that will emerge from this series of article is defense in depth.</p><p>You will understand it as we go along the Part 2 of the serie, but we can contain the LLM on a single local PC, which means we can reduce the attack surface associated with using this LLM.</p><p>OpenWebUI, one of the tools we will use to leverage the choose model, has user access management, which further reduces potential use by a user who has not yet completed their privilege escalation.</p><p>If we add to this the fact that the LLM runs locally and only interacts by reading with databases or a GUI that would be the connection point between the supervisory system and the industrial equipment, this considerably reduces possible attacks.</p><p>There is still a risk of a supply chain attack on the model itself.</p><p><a href="https://labs.itresit.es/2026/03/11/the-tensor-in-the-haystack-weightsquatting-as-a-supply-chain-risk/">The Tensor in the Haystack: Weightsquatting as a Supply-Chain Risk</a></p><h3>Conclusion.</h3><p>The topic is quite interesting because LLMs can be genuinely useful, but like any new technology, they can be implemented incorrectly, it is essential to envision implementations that take the broader context into account.</p><p>The topic of AI is rapidly gaining traction across various sectors; during my research, I came across a wide range of resources that are starting to discuss it , for exemple in this podcast.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F1JbQFFPdWoc%3Fstart%3D1022%26feature%3Doembed%26start%3D1022&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D1JbQFFPdWoc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F1JbQFFPdWoc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/08de380310a7a8aafa4b7ac4287980f8/href">https://medium.com/media/08de380310a7a8aafa4b7ac4287980f8/href</a></iframe><p>Players in the field are beginning to work internally on adapting traditional methods to AI, and I point to the integration of MCP into historian software as mentioned earlier in the article.</p><h4>Part 2 teasing</h4><p>To encourage you to read Part 2, here is an overview of the lab infrastructure I suggest setting up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p28PnX42VGjmBM68if4p8Q.png" /></figure><p><a href="https://medium.com/@biero-llagas/ai-llm-as-assistant-in-monitoring-scada-system-part-2-setup-and-secure-a-test-environment-7ea106d936ce">AI/LLM as assistant in monitoring SCADA system Part 2: setup and secure a test environment.</a></p><h3>About the Author</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>I am a freelance ICS security consultant and a teacher available for assignments in this field.</p><p>If you are interested, DM me on LinkedIn.<br><a href="https://www.linkedin.com/in/erwan-cordier/">https://www.linkedin.com/in/erwan-cordier/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f51c8b926ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RF interception the dumb way: parallel 16-channel sniffer on Zigbee.]]></title>
            <link>https://medium.com/@biero-llagas/rf-interception-the-dumb-way-parallel-16-channel-sniffer-on-zigbee-31dc94bc8b74?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/31dc94bc8b74</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[zigbee]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[sniffer]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Thu, 19 Mar 2026 11:38:22 GMT</pubDate>
            <atom:updated>2026-03-19T11:38:22.270Z</atom:updated>
            <content:encoded><![CDATA[<h3>Foreword</h3><p>It should also be noted that this article is a direct follow-up to my article on setting up an zigbee sniffing lab.</p><p>A quick note before we begin: I have used an LLM (Claude Opus 4.6), so I consider myself to be merely a co-author when it comes to the code.</p><ul><li><a href="https://medium.com/@biero-llagas/how-to-make-a-boilerplate-ieee-802-15-4-zigbee-sniffing-lab-b7c5f406b60a">How to make a boilerplate IEEE 802.15.4/ZigBee sniffing lab.</a></li><li><a href="https://medium.com/@biero-llagas/poc-modified-replay-attack-on-zigbee-in-2026-how-hard-can-it-be-2da75901fc7d">PoC: Modified replay attack on Zigbee in 2026 — How hard can it be ?</a></li></ul><h3>Disclaimer</h3><p>Here, I’ll outline one of many ways to set up a multi-listener on Zigbee. This article will follow a method that’s clearly not the best, but it works well enough to be functional.</p><p>Use your best judgment to choose the setup that you feel fit your need the most.</p><p>It’s worth noting that in some countries, unauthorized signal reception may be illegal.</p><h3>Introduction</h3><p>One of the problems I encountered while writing the last two articles on Zigbee was that I could only listen to a single channel.</p><p>However, as you now know, this protocol can transmit on 16 channels.</p><h4>So, what should I do ?</h4><p>The smart move would be to use an SDR with a wide enough frequency range to capture the 16 channels between 2.4 and 2.4835 GHz, then demodulate each channel and export them as PCAP files so we can analyze them.</p><p>But we’re not here to think smart — plus, I couldn’t get it to work with a HackRF (maybe skill issue i don’t know). So we’re going to go with a solution that doesn’t require us to use our brains.</p><h4>The easy solution.</h4><p>So, this solution is straightforward: you just need to find a radio device that supports the Zigbee stack and it doesn’t have to be very expensive.</p><p>Ideally, it should have a USB port so you can connect everything via USB and listen in on the traffic. Simple, right?</p><p>Well, there are plenty of boards that do that. Let’s try to find the most interesting one without spending too much. Then let’s go find the USB hub and take a look at it.supports the Zigbee stack — and it doesn’t have to be very expensive.</p><p>Ideally, it should have a USB port, so you can connect everything via USB and listen in on the traffic. Simple, right?</p><p>Well, there are plenty of boards that do that. Let’s try to find the most interesting one without spending too much. Then, let’s go find the USB hub and take a look at it.</p><h4>The cost-benefit ratio.</h4><p>The goal here is to keep costs as low as possible, ideally under 250 euros (which is lower than the price in France, (including VAT and shipping), for an Adalm Pluto, which, with its two listening channels — <a href="https://jjhorton.co.uk/posts/plutosdr2channel/">once configured</a> — could receive all 16 Zigbee channels).</p><p>I set myself an additional challenge: to create a system that could be used in a training setting and have 16 tablets available to distribute to small groups for testing purposes.</p><h3>The listener.</h3><h4>Why not WHAD ?</h4><p>The even simpler idea would have been to grab 16 NRF52840 dongle, set up a listener, and output the data to Wireshark — and that would have been the end of the story, right?</p><p>And indeed, that would have been the end of the story; the framework already exists, so this article would have taken three minutes to write. But hey, we’re not here to do simple things.</p><p>NOTE: If you really want to build a multi-channel listener without SDR, that’s the approach I recommend. I chose the other board just to spend some time working on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WRUUoioZTaSRGOjxGz-bCQ.png" /></figure><p>NOTE: You need to add 20% to the price for VAT in France, which brings the total cost to 170 euros (which is worth it if you use it for BLE + active Zigbee and the full range of features associated with WHAD, but a bit expensive if you just want to monitor the 16 channels).</p><h4>Cheaper</h4><p>The goal of this tool is to try to reduce costs. I looked to see if there was a cheaper board available. That’s when I came across the ESP32 H2 ZERO, a small board that supports the 2.4 GHz band but lacks Wi-Fi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iMoZJmr4rnLc88FV.jpg" /></figure><p>Cheaper than its counterpart by more than half (the final price will be half, since we’ll need a dongle).</p><h4>The antenna issue.</h4><p>Before I continue, I’d like to point out something I noticed after doing some research on the subject.</p><p>The ESP32 H2 modules sold on AliExpress have a design flaw, specifically with the antenna.</p><p>The antenna is the small red ceramic piece with “C3” marked on it. It’s a small antenna that, in many board designs, is located very close to the crystal, which causes interference. In the model shown in the photo, there is a keepout zone.</p><p><a href="https://docs.espressif.com/projects/esp-hardware-design-guidelines/en/latest/esp32h2/pcb-layout-design.html">https://docs.espressif.com/projects/esp-hardware-design-guidelines/en/latest/esp32h2/pcb-layout-design.htm</a>l</p><p><a href="https://raytac.blog/2023/10/25/exploring-the-influence-of-keep-out-zones-on-antenna-performance-in-layout/">Exploring the Influence of Keep Out Zones on Antenna Performance in Layout</a></p><p>So even among mini boards, the model offered is the most suitable, but it still has major issues because the antenna isn’t great.</p><p>However, the community has realized this and has come up with a solution.</p><p><a href="https://peterneufeld.wordpress.com/2025/03/04/esp32-c3-supermini-antenna-modification/">ESP32-C3 SuperMini ANTENNA MODIFICATION</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*_TgEdwD9807UiNdv.jpeg" /></figure><h4>Spoiler on electricity consumption.</h4><p>Here is the power consumption for the 16 dongles connected to the USB ports while the sniffing is in progress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVFHioHf_25ETn9B4iEerQ.jpeg" /></figure><p>So the consumption isn’t that high, and for now we’re just taking small sips.</p><h4>The USB hub.</h4><p>The problem, then, is that you need an additional power source to power the various USB devices, so I chose a USB hub with a built-in power supply to solve that issue.</p><p>NOTE: I didn’t know this, but there’s a compatibility issue between USB 2.0 and USB 3.2. However, the hub I have has USB 3.2 ports. To work around this, I added some USB adapters to the USB hub. It looks messy, but it works.</p><p><a href="https://www.pcm-cable.com/info/why-2-0-usb-devices-cannot-work-on-3-0-usb-por-86502221.html">https://www.pcm-cable.com/info/why-2-0-usb-devices-cannot-work-on-3-0-usb-por-86502221.html</a></p><h4>2 possible options for the listener.</h4><p>Espressif, the fabless company that designs the ESP32, provides a wealth of documentation and examples on how to use these various systems.</p><p>There are several options in the examples that might be of interest to us</p><ul><li><a href="https://github.com/espressif/esp-idf/tree/master/examples/openthread/ot_rcp">https://github.com/espressif/esp-idf/tree/master/examples/openthread/ot_rcp</a></li><li><a href="https://github.com/espressif/esp-idf/blob/v5.5/examples/ieee802154/ieee802154_cli/README.md">https://github.com/espressif/esp-idf/blob/v5.5/examples/ieee802154/ieee802154_cli/README.md</a></li></ul><p>The easy way will be to use the ot_rcp , there the sections 2.4.4 (Enable Debug Mode and Trace Logging) that speak about it.</p><p><a href="https://docs.espressif.com/projects/esp-zigbee-sdk/en/latest/esp32c6/developing.html#enable-debug-mode-and-trace-logging">https://docs.espressif.com/projects/esp-zigbee-sdk/en/latest/esp32c6/developing.html</a></p><p>Then make a FIFO pipe for all your listeners and you will be good.</p><h4>Adapt, improvise, overcome. : IEE_802154 cli to wireshark</h4><p>But I will try to adapt the IEE_802154 to my means, because I can do it.</p><p>This program therefore provides support for listening on a defined frequency and demodulating the IEEE 802.15.4 standard from received communications.</p><p>You can compile this code and upload it to the ESP32-H2,<br>Before doing so, you must install the ESD-IDF (Espressif IoT Development Framework), versions 5.5 or above (this is important; the new ESP32-H2 board won’t accept certain configurations from older ESP-IDF versions).</p><p>This framework will allow you to</p><ul><li>Define the target board.</li><li>Configure the communication channel for interacting with the board (in our case, USB JTAG).</li><li>Build the project, and flash it.</li></ul><h4>Initial instalations of ESP-IDF and flash of the board.</h4><pre># Install system requirement. <br>sudo apt update &amp;&amp; sudo apt upgrade -y<br>sudo apt install -y git wget flex bison gperf python3 \<br>  python3-pip python3-venv cmake ninja-build ccache \<br>  libffi-dev libssl-dev dfu-util libusb-1.0-0<br><br><br># Clone the repos<br>mkdir -p ~/esp<br>cd ~/esp<br>git clone -b v5.5 --recursive https://github.com/espressif/esp-idf.git<br>cd esp-idf<br><br># Activate the ESP-IDS env <br>## NOTE : do stat at eatch new terminal<br>. ~/esp/esp-idf/export.sh </pre><h4>Build , flash and test.</h4><p>Before you begin, don’t forget to set the serial port to USB serial/JTAG mode.</p><pre>idf.py menuconfig<br><br>Component config<br>  → ESP System Settings<br>    → Channel for console output<br>      → (•) USB Serial/JTAG Controller</pre><h4>Build &amp; flash</h4><pre>cd ~/esp/esp-idf/examples/ieee802154/ieee802154_cli<br><br># configure for the ESP32 H2<br>rm -rf build<br>idf.py set-target esp32h2<br><br># Build<br>idf.py build<br><br># detect your board (you can see it inside /dev/tty)<br># Connect your board<br>idf.py -p /dev/ttyACM0 flash</pre><h4>Test</h4><pre><br># go on the monitor mode<br>idf.py -p /dev/ttyACM0 monitor<br><br># once that done you will be able to intercepte packet data like it&#39;s nothing.<br># Enabme IEEE 802.15.4 subsystem<br>ieee802154&gt; esp154 -e<br># Select canal 11 or whatever<br>ieee802154&gt; channel -s 11<br># Enable promiscuitis mode<br>ieee802154&gt; promisc -e<br># run receptions<br>ieee802154&gt; rx -r 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*8zdyuKq3a5VSgiNSGHCqhA.png" /></figure><h4>Ok but where wireshark ?</h4><p>We now have a system that listens on a channel, and we have 16 dongle. How do we synchronize all of this? If we were using Whad, it would be simple — we’d just need to merge everything into a single file.</p><p>For our concept, it’s a bit more complicated, and we can break down the problem as follows:</p><ul><li>Retrieve the results from the ESP23 H2 dongle</li><li>Standardize and enrich the results (convert them to Wireshark format, add fields to analyze such as the channel and the packet ID)</li><li>Centralize them</li><li>Interpret them</li></ul><h4>PySerial</h4><p>With pyserial, we can communicate via USB/JTAG to connect to the ESP32 H2 and send commands to enable listening on a specific channel. To do this, we need to set a parameter specifying the device path (e.g., /dev/ttyACM0) and the channel we want it to listen on. This should look something like this:</p><ul><li>/dev/tty1CM0:11</li></ul><h4>The FIFO</h4><p>A named pipe operates on a FIFO (first-in, first-out) basis, which means that data flows from the first process that writes to the pipe to the first process that reads from it, the idea here is to create a FIFO from all the dongle to redirect on it , and interpret this with wreshark , with that whe will be able to see all the packet from the 16 dongle</p><p>The workflow is the following.</p><ul><li>Creates the FIFO at the specified path</li><li>Waits for a reader (Wireshark) to connect</li><li>Sends the global PCAP header</li><li>Streams the packets</li><li>If Wireshark disconnects → waits for a new connection</li></ul><pre>  ┌──────────┐  ┌──────────┐  ┌──────────┐<br>  │ ESP32-H2 │  │ ESP32-H2 │  │ ESP32-H2 │  ...<br>  │ Canal 11 │  │ Canal 12 │  │ Canal 13 │<br>  └────┬─────┘  └────┬─────┘  └────┬─────┘<br>       │              │              │<br>       └──────────────┼──────────────┘<br>                      │<br>              ┌───────▼────────┐<br>              │  Shared Queue  │<br>              └───────┬────────┘<br>                      │<br>              ┌───────▼────────┐<br>              │  FIFO Writer    │──→ /Path/to/zigbee.fifo<br>              └────────────────┘<br>                                      │<br>                              wireshark -k -i /Path/to/zigbee.fifo</pre><p>The following flags will therefore be important.</p><ul><li>Output from the FIFO pipe</li></ul><h4>Wireshark Me</h4><p>To read a FIFO pipe in wireshark you can just do that.</p><pre>wireshark -k -i zigbee.fifo </pre><h4>Some visual candy.</h4><p>We’re asking Claude to add some additional details:</p><ul><li>whether the packets are being detected correctly,</li><li>how many packets have been detected, and by which channel,</li><li>whether Wireshark is running properly so we can inspect the header.</li></ul><p>Here the script , you can test it.</p><p><a href="https://github.com/biero-el-corridor/ZMCL/blob/main/script/zigbee_capture.py">ZMCL/script/zigbee_capture.py at main · biero-el-corridor/ZMCL</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bd7TaP2NQGx__-xfZ2zuTw.png" /></figure><p>Here you have the full setup (yes i’s ugly , i don’t care).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TIVw2ZVvSjBmEGwHyb-gbw.jpeg" /></figure><h4>Make it portable.</h4><p>Now that we have our listening environment, why not make it portable?</p><p>It couldn’t be simpler — we just need to add a micro-PC to manage the ESP32 h2 and run the Python script.</p><p>For this, we’ll use a good old Raspberry Pi 4 and a battery that can output 12V at over 10W.</p><p>It would be simple to just create a Wireshark output on the Raspberry Pi, but the idea is to be able to take the Wireshark output with us. To do this, we can retrieve the FIFO output from a remote terminal connected via SSH.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*1893Hokri0-2trABX9v_hQ.png" /></figure><h4>RASPI configurations.</h4><p>You can perform the standard installation of Raspberry Pi</p><p><a href="https://howtoraspberrypi.com/enable-ssh/">How to activate SSH on the Raspberry Pi.</a></p><p>The idea of the Raspberry Pi and being able to connect to it remotely to run the script</p><pre># configurations on a key base auth on the pie. <br>ssh-keygen<br>ssh-copy-id USER_RASPI@IP_RASPI</pre><p>The final format looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*01iAIAZwdRYtsYWUElJR7w.jpeg" /></figure><p>We now have a “portable” Zigbee listening station. There isn’t a platform or any optimizations yet, but this could be a good topic for a potential Part 4.</p><h3>Conclusions.</h3><p>So there’s a lot to say here; the real solution would be to port WHAD to ESP, to avoid having to implement the entire pyserial component.</p><p>The antenna orientation is also not optimized; adding antennas as explained above could improve reception, and run actual range tests.</p><p>We would also need to create a better setup to build a truly portable system; my main inspirations are the projectbagbuilds.</p><p><a href="https://bagbuilds.com/products/cerambyx64-mod_01">Cerambyx64 MOD_01</a></p><p>Another solution would be to use an SPI connection instead of USB, with the collected packets managed via buffering; a project that another French developer has started is similar to this approach.</p><p><a href="https://github.com/GTBidouille/Whad_Hard">GitHub - GTBidouille/Whad_Hard</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31dc94bc8b74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PoC: Modified replay attack on Zigbee in 2026 — How hard can it be ?]]></title>
            <link>https://medium.com/@biero-llagas/poc-modified-replay-attack-on-zigbee-in-2026-how-hard-can-it-be-2da75901fc7d?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2da75901fc7d</guid>
            <category><![CDATA[philips-hue]]></category>
            <category><![CDATA[modified-replay-attack]]></category>
            <category><![CDATA[whad]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[zigbee]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Tue, 10 Feb 2026 15:25:18 GMT</pubDate>
            <atom:updated>2026-02-10T15:25:18.709Z</atom:updated>
            <content:encoded><![CDATA[<h3>Foreword</h3><p>It should also be noted that this article is a direct follow-up to my article on setting up an environment.</p><p><a href="https://medium.com/@biero-llagas/how-to-make-a-boilerplate-ieee-802-15-4-zigbee-sniffing-lab-b7c5f406b60a">How to make a boilerplate IEEE 802.15.4/ZigBee sniffing lab.</a></p><p>A quick note before we begin: this is the first project I have led using an LLM (Claude Opus 4.6), so I consider myself to be merely a co-author when it comes to the code.</p><p>This article is for educational purposes only and condemns any malicious actions outside the legal framework.</p><p>NOTE: The objective here is more of a walktrought. I know that there are many offensive frameworks on this protocol.l (<a href="http://github.com/riverloopsec/killerbee">killerbee</a> , <a href="https://github.com/PentHertz/Z-Attack-ng">Z-Attack-ng</a>, <a href="https://github.com/IoTsec/Z3sec">Z3sec</a>, <a href="https://github.com/BishopFox/zigdiggity">ZigDiggity</a>) for only cite a few. For once i am here to reinvent the wheel</p><p>NOTE 2: I am assuming that we already have the network key in this article, so I am taking a post-exploitation approach rather than a vulnerability search approach. To keep it very brief, we are going to reimplement normal Zigbee behavior.</p><h3>Bibliography</h3><p>Here are the resources that I found interesting and that motivated me to write this article (which I strongly recommend reading if this is a field that interests you).</p><ul><li><a href="https://personal.utdallas.edu/~shao/papers/wang_ccs22.pdf">https://personal.utdallas.edu/~shao/papers/wang_ccs22.pdf</a></li><li><a href="https://securelist.com/zigbee-protocol-security-assessment/118373/">https://securelist.com/zigbee-protocol-security-assessment/118373/</a></li><li><a href="https://lucidar.me/en/zigbee/autopsy-of-a-zigbee-frame/">https://lucidar.me/en/zigbee/autopsy-of-a-zigbee-frame/</a></li><li><a href="https://lucidar.me/fr/zigbee/zigbee-frame-encryption-with-aes-128-ccm/">https://lucidar.me/fr/zigbee/zigbee-frame-encryption-with-aes-128-ccm/</a></li><li><a href="https://sci-hub.red/10.1109/ICESS49830.2020.9301593">https://sci-hub.red/10.1109/ICESS49830.2020.9301593</a> (New Replay Attacks on ZigBee Devices for Internet-of-Things (IoT) Applications)</li><li><a href="https://eprint.iacr.org/2016/1047.pdf">https://eprint.iacr.org/2016/1047.pdf</a> (IoT Goes Nuclear: Creating a ZigBee Chain Reaction)</li><li><a href="http://wiki.newae.com/AES-CCM_Attack">http://wiki.newae.com/AES-CCM_Attack</a></li><li><a href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/ccm.html">https://docs.nordicsemi.com/bundle/ps_nrf52840/page/ccm.html</a></li></ul><h3>Glossary</h3><ul><li>ZCL (Zigbee CLuster Library)</li><li>HA (Home automations)</li><li>MIC (Message Integrity Code)</li><li>FCS (Frame Check Sequence)</li></ul><h3>Introductions</h3><p>While conducting documentary research on the first part, and focusing a little more on Zigbee security, I came across an article on Securedlist (which is basically the platform where Kaspersky distributes its research results).</p><p><a href="https://securelist.com/zigbee-protocol-security-assessment/118373/">https://securelist.com/zigbee-protocol-security-assessment/118373/</a></p><p>If I may simplify it, this article is incredible, but it provides few technical examples on how to redo the actions. See my article as a transcription of the “Spoofed packet injection” section.</p><h4>Lab evolutions.</h4><p>So, you understand, we are going to forge packets.</p><p>Before getting into the technical details of how to forge them, how to structure Zigbee packets, and what anti-replay protections are available, I think it’s important to first set up the environment.</p><p>So, based on the previous article, we have a listening station on one of the 15 channels offered by Zigbee on its 2.4GHz versions.</p><p>What we need now is something to transmit. For this, we will use the WHAD firmware and the Nordic Semi N52840 in USB dogle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/0*Ds0UqyPc_q59qgNH.jpg" /></figure><h3>What is WHAD ?</h3><p>From the official <a href="https://whad.readthedocs.io/en/latest/intro.html#what-is-whad">WHAD doc</a>.</p><blockquote>A lot of wireless hacking tools have been published by the cybersecurity community based on various hardware platforms and custom communication protocols specifically designed to work with associated software. This leads to hackers buying a lot of different hardware devices to only use them with their associated tools, while most hardware devices could be used with multiple tools if a compatible firmware were available. Why not make all these theoritically compatible devices able to communicate with a computer in a generic way, thus allowing generic tools to use them ?</blockquote><h4>How to install it ?</h4><p>We therefore need to flash the firmware on the N52840.</p><p><a href="https://whad.readthedocs.io/en/latest/device/compat.html#dev-ns-nrf52">Compatible devices - WHAD 1.2.12 documentation</a></p><p>NOTE: I had a little trouble installing nrfutil (caused by a skill issue), the cause was the version of Python (Python 3.14) when creating the venv, so I installed Python 3.10 from the source, because my package manager (apt) didn’t want to install it. Also be aware to follow the firmware upload functions and tu push the little bttuon (that is a side push putton) on top of the round one.</p><pre># install specific python3.10 <br>https://cloudcone.com/docs/article/how-to-install-python-3-10-on-debian-11/<br><br># Venv<br>python3 -m venv nrfenv_python-3.10<br>source nrfenv_python-3.10/bin/activate<br>pip install nrfutil<br><br># Instalations doc for the N52540<br>https://whad.readthedocs.io/en/stable/device/compat.html#makerdiary-nrf52840-mdk-usb-dongle<br><br># upload of the firware<br>nrfutil dfu usb-serial -pkg butterfly-fwupgrade.zip -p ttyACM0 -b 115200<br><br># lister les doggle présent.<br>whadup</pre><p>If the installation is done correctly, you should be able to detect the N52480 with the flashed firmware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*drYSandSrA7K6y6uXcLGAg.png" /></figure><p>To finish this section, we need to test it. To do this, we will use the winject function from WHAD with the .</p><p>To test it, we will take Zigbee captures from the first article, retrieve the contents of a packet, and perform the actions of turning the light on and off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hTaFmMXPxO8INVVVWYJBHg.png" /></figure><p>Then we try to resent the raw packet.</p><ul><li><a href="https://whad.readthedocs.io/en/latest/dot15d4/started.html">https://whad.readthedocs.io/en/latest/dot15d4/started.html</a></li><li><a href="https://whad.readthedocs.io/en/latest/cli/generic/winject.html">https://whad.readthedocs.io/en/latest/cli/generic/winject.htm</a>l</li></ul><pre>winject -i uart1 dot15d4 -c 15 6188e9514cc7de00004802c7de00001e8628a18000007af9cffeff6a4dfc00362f74bdbd59915df7fed8f21bd7160daf</pre><p>Now look at your monitoring and you should see the packet replaying.</p><p>In the end, we are left with the following configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*TMOSB4hVUQlJM5NY1pLCCg.png" /></figure><h4>ZCL HA</h4><p>In the SecureList article in the Crafting the Packet section, the Kaspersky team points out that they came across a custom ZCL (reminder: if you don’t know what a ZCL is, <a href="https://medium.com/@omaslyuchenko/hello-zigbee-world-part-4-zigbee-basics-e7039fbbe7b5">here’s a link</a>). That’s not the case for us. Here, Philips is based on the ZCL HA, with actions that have already been documented, which will greatly simplify the task for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*XelU19ptwl1ri4FPd_BbVQ.png" /></figure><h3>Anti-replay security measures.</h3><p>As you can imagine, Zigbee is a protocol that has now reached a certain level of maturity, so standard replay attacks do not work. It would be too easy to just take a packet via Gnuradio and send it back directly via WHAD.</p><p>To protect against this attack, there is a fairly common concept.</p><blockquote>Hide behind a layer of encryption, a simple security measure, in our case a counter.</blockquote><p>To put it simply, each packet contains several counters, some of which are present in the data encrypted by AES-CCM. These counters will be repeated with each new command, making it impossible to simply replay them, as the counters will no longer be valid.</p><p>NOTE: I will provide a relatively brief analysis here. If you would like to gain a deeper understanding of the structure of a Zigbee packet, here is an excellent resource.</p><p><a href="https://lucidar.me/en/zigbee/autopsy-of-a-zigbee-frame/">https://lucidar.me/en/zigbee/autopsy-of-a-zigbee-frame/</a></p><p>There are therefore two parts to a Zigbee packet in a comunications between two equipemnt : static elements and dynamic elements. <br>The static elements will generally be:</p><ul><li>Source MAC address</li><li>Source PAN ID</li><li>Destination PAN ID</li><li>Radius</li><li>Security level.</li><li>HA ZCL elements, excluding counters.</li></ul><p>You just need to retrieve them and apply them in static variables.</p><p>For the dynamic parts, it’s a little more complicated, let’s try to clarify things a little with the following diagram.</p><p>Here is the structure of our OFF command on the ZCL HA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A3hpDD5Crn760qJWumv0cA.png" /></figure><p>Here is my analysis of the management of the elements to be modified. They can be divided into two categories:</p><ul><li>Integrity control (which will manage the integrity check of the packet)</li><li>Security control (which will manage the counters)</li></ul><p>NOTE: The interesting thing here is the increment of 2 for the ZCL sequence number.</p><p>Note also that the frame counter increment is arbitrary. I chose +100 without any logical basis, simply because there was no security on this counter (by the way, for hackers who think they can overflow the frame counter, you’re not the first to ask this question).</p><p><a href="https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1243584/cc2652p-if-security-frame-counter-overflow-what-will-happen">https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1243584/cc2652p-if-security-frame-counter-overflow-what-will-happen</a></p><p>NOTE: The MIC is based on encrypted data, not decrypted data.</p><h4>Cyphering with AES-CCM</h4><p>I’m not going to talk about how to structure the encryption here, but here’s a source that does it beautifully.</p><p><a href="https://lucidar.me/en/zigbee/zigbee-frame-encryption-with-aes-128-ccm/">ZigBee frame encryption with AES-128-CCM*</a></p><p>NOTE: The only stuff to understand is that the zigbee command and anti-replay attack counter are cyphered with AES-CCM within the data sections, and you need to modify then to make the attack.</p><h3>Modification issue</h3><p>There is a problem with tshark and wireshark, which is that one depends on the other. So if I apply a decryption key in wireshark, the packet will also be decrypted in tshark.</p><p>You might say, so what? The problem is that my current workflow consists of the following steps:</p><ul><li>Acquire the pcap from RFswift (gnuradio to pcap).</li><li>Retrieve the pcap from the RFswift docker (docker cp).</li><li>Decrypt it using the network key (Python script).</li><li>Modify the content (Python script).</li><li>Re-encrypt and apply integrity checks (Python script).</li><li>Send it. (WHAD)</li></ul><p>So when do I know which packet I need to retrieve and modify? Good question.</p><p>We will use a Wireshark instance on RFswift to target the packet to be retrieved and a tshark instance to extract the packet values (Wireshark on RFswift will have our network key, while tshark on our machine will not).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*weU-qjI9mMez12iDvP7hYg.png" /></figure><p>My workflow is the following :</p><ul><li>Monitor the packets retrieved by gnuradio in real time, and note the number of the packet to be replayed.</li><li>Retrieve the generated pcap file from the RFswift docker in the background (with a crontab for exemple).</li><li>Run the Python script with the name of the pcap and the number of the desired packet.</li><li>Profit !!!!!!</li></ul><p>So we will give the pcap file and a packet number to be extracted and modified as inputs to the Python script.</p><h3>Implementations time.</h3><p>NOTE: First of all, I would like to remind you that in Zigbee communications, the coordinator speaks first, followed by an acknowledgment of successful reception from the endpoint. To our great delight, there is therefore no need to manage response challenges. Yay!</p><p>So here is the implementation created by Claude. It’s clearly not pretty; you have to add fields manually, and it’s more of a mix between Python and Bash than true automation, but hey, it works.</p><p>The important thing to remember is to run the bash script correctly to retrieve the pcap as you go along.</p><p><a href="https://github.com/biero-el-corridor/zigbee_modified_replay_attack_PoC">GitHub - biero-el-corridor/zigbee_modified_replay_attack_PoC: simple script to create modified replay attack with network key on zigbee</a></p><h3>Result</h3><p>To help describe what you have in the following capture (and yes, I know I’m on channel 15, and the packet is on channel 11, but it works fine on channel 11)</p><ul><li>On the right, you have the script that will parse the pcap file, modify the fields, and send the packet back via Winject.</li><li>On the left, you have the Wireshark view, which has the network key.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2sKvPBKel9Jg-alVD9Y0Ww.png" /><figcaption>As always , output in french : )</figcaption></figure><p>And normally with that, you will be able to turn off your light (yes, I forgot, but it goes without saying that you can turn the light on and off at the same time with the Zigbee2MQTT interface).</p><h3>Lab improvement.</h3><p>A quick aside about setting up the lab: WHAD also allows you to do RF hacking and recover pcap files, so theoretically we could significantly reduce the overhead by removing rfswift and the hackrf.</p><p><a href="https://whad.readthedocs.io/en/stable/cli/generic/wsniff.html">wsniff: generic sniffing tool - WHAD 1.2.11 documentation</a></p><pre>wsniff -w --format=raw -i uart1 dot15d4 -c 11</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xac8YOscns1g3crZzu7nWQ.png" /></figure><h3>Conclusion</h3><p>I think I have the same conclusions as the people at Securelist:</p><ul><li>Applying an additional layer of encryption at the application level can be a good start, as can rotating network keys to make the attacker’s job more difficult.</li></ul><p>I think I will modifying this article as the time pass and i’ll try to make the script a little cleaner and easier to use.</p><h3>About the Author</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>I am a freelance ICS security consultant and a teacher available for assignments in this field.</p><p>If you are interested, DM me on LinkedIn.<br><a href="https://www.linkedin.com/in/erwan-cordier/">https://www.linkedin.com/in/erwan-cordier/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2da75901fc7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Band-Aid on a broken arm: DIAScreen file password bypass (.dpa file)]]></title>
            <link>https://medium.com/@biero-llagas/band-aid-on-a-broken-arm-diascreen-file-password-bypass-dpa-file-dbcd2289da19?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbcd2289da19</guid>
            <category><![CDATA[ics-security]]></category>
            <category><![CDATA[anti-debugger]]></category>
            <category><![CDATA[educational-purpose]]></category>
            <category><![CDATA[cracking]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Sun, 08 Feb 2026 20:28:48 GMT</pubDate>
            <atom:updated>2026-02-08T20:28:48.452Z</atom:updated>
            <content:encoded><![CDATA[<h3>Foreword</h3><p>This article is part of a series of articles focused on reverse engineering EWS software to determine the security of project files and potentially bypass the security measures applied to them.</p><h4>!!!!!!!!!! for educational purpose only !!!!!!!!!!!!!!!!!!!!!!!!!!!!!</h4><h3>Tools</h3><ul><li><a href="https://github.com/x64dbg/ScyllaHide">ScyllaHyde</a></li><li><a href="https://x64dbg.com/">X32 dbg</a></li></ul><h3>Introductions</h3><h4>Delta</h4><p>Delta Electronics, Inc. (Chinese: 台達電子; also known as DELTA or Delta Electronics) is a Taiwanese electronics manufacturing company. Its headquarters are in Neihu, Taipei. It is known for its DC industrial and computer fans, data center rectifiers and switching power supplies. The company operates approximately 200 facilities worldwide, including manufacturing, sales, and R&amp;D centers.</p><h4>The Target : DIAStudio &amp; DIAScreen.</h4><p>Delta’s DIAStudio Smart Machine Suite is an integrated engineering software package designed to simplify and reduce the time required for the setup process in machinery systems. Tasks such as product selection (Delta’s HMIs, PLCs, servo drives and motors, AC motor drives), PLC programming, quantitative parameter setting, machine tuning and HMI integration can all be executed smoothly on one platform with DIAStudio’s key tools</p><ul><li><strong>DIAScreen: </strong>Provides wizards for configuration, communication, Operation Interface design, Variable Tag sharing with DIADesigner and DIADesigner-AX</li></ul><h4>How to do it ?</h4><p>I’m not going to lie to you, in fact the process is the same as in this article (but there is a subtlety that means you should also finish reading this article before clicking on the link I’m giving you)</p><p><a href="https://medium.com/@biero-llagas/recover-password-from-delta-dopsoft-4-dpa-d65ee08823bc">Recover password from DELTA DOPSoft 4 .dpa</a></p><p>There is always a problem with implementing the QcryptographicHash::addData(char const *, int) function, but this time on DIAscreen there is anti-debugging. But what is anti-debugging?</p><blockquote>Anti-debugging is a set of techniques used by software — common in malware and DRM-protected apps — to detect or hinder debuggers, preventing unauthorized analysis, reverse engineering, or tampering</blockquote><p>So, as things stand at present, we cannot open Cheat Engine or x32 dbg. If you try to do anything active with these tools, the software will close itself.</p><p>I’m not going to give you a lecture on anti-debugging here. I think that if you’re reading this article, it’s because you want to know how to bypass security. So I’ll get straight to the point.</p><h4>ScyllaHide</h4><p><a href="https://github.com/x64dbg/ScyllaHide">GitHub - x64dbg/ScyllaHide: Advanced usermode anti-anti-debugger. Forked from https://bitbucket.org/NtQuery/scyllahide</a></p><p>ScyllaHide is an advanced open-source x64/x86 user mode Anti-Anti-Debug library. It hooks various functions to hide debugging. This tool is intended to stay in user mode (ring 3). If you need kernel mode (ring 0) Anti-Anti-Debug, please see <a href="https://github.com/mrexodia/titanhide">TitanHide</a>. Forked from <a href="https://bitbucket.org/NtQuery/scyllahide">NtQuery/ScyllaHide</a>.</p><p>ScyllaHide supports various debuggers through plugins:</p><ul><li>OllyDbg <a href="http://www.ollydbg.de/">v1</a> and <a href="http://www.ollydbg.de/version2.html">v2</a></li><li><a href="https://x64dbg.com/">x64dbg</a></li><li><a href="https://www.hex-rays.com/products/ida/">Hex-Rays IDA</a> v6 (not supported)</li><li>TitanEngine v2 (<a href="http://www.reversinglabs.com/open-source/titanengine.html">original</a> and <a href="https://github.com/x64dbg/TitanEngine/">updated</a> versions)</li></ul><h4>How to add it to x32 dbg ?</h4><p>If you have followed some of my tutorials, I have this expression, never reinvent the wheel, so I suggest you watch a video on installation.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FwNhiR-U_sSI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DwNhiR-U_sSI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FwNhiR-U_sSI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/942e74663a0639bf786d2615956f1c8f/href">https://medium.com/media/942e74663a0639bf786d2615956f1c8f/href</a></iframe><p>After doing this, your x32dbg should not crash DIAScreen when you launch it.</p><p>Then just do the same actions as the DOPSoft article says, and you should be good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Zabs9EEXjc7_rRDgXuFkg.png" /></figure><h3>Conclusions</h3><p>Just try not to hide problems that have been easy to find for at least six years behind anti-debugging.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbcd2289da19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make a boilerplate IEEE 802.15.4/ZigBee sniffing lab.]]></title>
            <link>https://medium.com/@biero-llagas/how-to-make-a-boilerplate-ieee-802-15-4-zigbee-sniffing-lab-b7c5f406b60a?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7c5f406b60a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[zigbee]]></category>
            <category><![CDATA[hackrf]]></category>
            <category><![CDATA[gnu-radio]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 11:57:59 GMT</pubDate>
            <atom:updated>2026-02-01T11:57:59.556Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to make a boilerplate IEEE 802.15.4/ZigBee sniffing lab.</h3><h3>Foreword</h3><p>The objective here is to propose the setup of a lab for acquiring ZigBee frames, which could serve as a foundation for more advanced analysis. Yes, it is indeed possible to emulate this kind of environment, but in my case, creating the lab was an excuse to buy a smart light bulb.</p><h4>Glossary</h4><p>SDR: Software Defined Radio</p><h4>Protocol Presentation</h4><p>Here a ai generated sum up of the zigbee protocol</p><p><strong>What is ZigBee?</strong></p><p>ZigBee is a low-power, low-data-rate wireless communication standard based on the IEEE 802.15.4 physical and MAC layer specification. It is designed for short-range IoT applications such as smart home automation, industrial sensors, and building control systems. It is managed by the ZigBee Alliance (now called the CSA — Connectivity Standards Alliance).</p><p><strong>Key Characteristics</strong></p><p>ZigBee operates in the 2.4 GHz ISM band (globally) with 16 channels available, as well as sub-GHz bands in certain regions. It offers a data rate of up to 250 kbps, a typical range of 10 to 100 meters depending on the environment, and very low power consumption, which allows battery-operated devices to last months or even years. The protocol supports up to 65,000 devices per network.</p><p><strong>Network Topology</strong></p><p>ZigBee supports three network topologies: star, tree, and mesh. The mesh topology is the most common in practice, as it allows devices to relay messages through intermediate nodes, effectively extending the network’s range. There are three device roles in a ZigBee network: the <strong>Coordinator</strong>, which is the central node that manages the network and assigns addresses; <strong>Routers</strong>, which relay traffic and can have child devices; and <strong>End Devices</strong>, which are typically battery-powered leaf nodes that only send or receive data.</p><p><strong>Protocol Stack</strong></p><p>ZigBee is built on top of IEEE 802.15.4, which handles the physical layer (PHY) and the medium access control (MAC) layer. On top of that, ZigBee defines its own network layer (NWK), which manages routing and addressing, and an application layer (APL), which provides the profiles and clusters used by smart home devices (e.g., the ZigBee Home Automation or ZHA profile). Between the NWK and APL layers sits the Application Support Sub-Layer (ASS), which handles binding, grouping, and service discovery.</p><p><strong>Security Implementation</strong></p><p>Security in ZigBee is implemented primarily at the <strong>network layer</strong> and relies on <strong>AES-128 encryption</strong> (Advanced Encryption Standard with a 128-bit key). The main security mechanisms are as follows.</p><p>The <strong>Network Key</strong> is a 128-bit symmetric key shared across all devices in the network. It is used to encrypt and decrypt frames at the network layer using AES in CCM* mode (Counter with CBC-MAC), which provides both confidentiality and integrity. This key is distributed to devices when they join the network, typically by the coordinator.</p><p>A <strong>frame counter</strong> is included in each encrypted frame to prevent replay attacks. Each device maintains a monotonically increasing counter, and receivers reject any frame with a counter value lower than or equal to the last accepted one.</p><p>A <strong>Link Key</strong> can also be used for point-to-point encryption at the application layer, providing an additional layer of security between two specific devices. This is particularly relevant during the initial pairing process.</p><p><strong>Known Weaknesses</strong></p><p>Despite these mechanisms, ZigBee has several well-documented vulnerabilities. The network key is often distributed in cleartext during the initial joining process, making it susceptible to interception. Many consumer devices ship with default or well-known keys (such as the global trust center link key 5A:69:67:Bee:Al:lia:nce:09:99), which can be exploited if not changed. Additionally, since the network key is shared across the entire network, compromising a single device can potentially expose all traffic. These weaknesses are precisely why sniffing and key recovery are common attack vectors in ZigBee security research.</p><h3>The Tools</h3><h4>Hardware</h4><ul><li>HackRF (in my case it’s a PortaPack, but that doesn’t matter) (350–400 euros)</li><li>2.4 GHz antenna (bundled with the HackRF)</li><li>Sonoff Zigbee 3.0 USB Dongle Plus (20 euros)</li><li>Philips Hue bulb (<a href="https://www.zigbee2mqtt.io/devices/929002469202.html">https://www.zigbee2mqtt.io/devices/929002469202.html</a>) (20 euros)</li></ul><p>A total of approximately 400–440 euros.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*6lKBTzLGtmH_WdNOMAt2TA.png" /></figure><h4>Software</h4><ul><li><a href="https://rfswift.io/">RFSwift</a></li><li><a href="https://www.wireshark.org/">wireshark</a></li><li><a href="https://github.com/bkerler/GnuRadio-Wireshark-Example/tree/maint-3.10">https://github.com/bkerler/GnuRadio-Wireshark-Example/tree/maint-3.10</a></li><li><a href="https://www.zigbee2mqtt.io/">zigbee2mqtt</a></li><li><a href="https://mosquitto.org/">mosquitto</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iW3OTFJT0d8MYj1PH33DBw.png" /></figure><h3>Installation</h3><h4>Hardware</h4><p>For the hardware installation, it is normally plug and play. To detect your HackRF, run:</p><pre>hackrf info</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*-gTJl5740D5b6XLcrnR_Zw.png" /></figure><p>For the Sonoff, it is also plug and play, and for the Philips Hue bulb, it is the same, although you will need to perform certain steps to initialize it (<a href="https://www.zigbee2mqtt.io/devices/929002469202.html">https://www.zigbee2mqtt.io/devices/929002469202.html</a>).</p><p><strong>Software</strong></p><p>The software installation is divided into two parts:</p><p>The “Broker and manager” part (in blue), with the MQTT broker (Mosquitto) and Zigbee2MQTT. The “interception” part (in red), with RFSwift, which bundles everything together.</p><h4>Broker and manager</h4><p>The installation of the legitimate part is split into two steps: you must first install the MQTT broker, then Zigbee2MQTT.</p><p>For installing Mosquitto, I recommend the following tutorial:</p><p><a href="https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/">Install Mosquitto Broker Raspberry Pi | Random Nerd Tutorials</a></p><p><strong>NOTE 1:</strong> The installation works on Debian, so don’t worry if the tutorial says it is intended for Raspberry Pi.</p><p><strong>NOTE 2:</strong> In my case, the installation did not work until I commented out the following line in the file /etc/mosquitto/mosquitto.conf:</p><p>per_listener_settings true</p><p><strong>NOTE 3:</strong> Personally, I set up authentication. You will be asked for this during the Zigbee2MQTT configuration.</p><p>Next, you need to install Zigbee2MQTT. For this, I recommend the following tutorial:</p><p><em>Linux — Zigbee to MQTT bridge, get rid of your proprietary Zigbee bridge (</em><a href="http://www.zigbee2mqtt.io/"><em>www.zigbee2mqtt.io</em></a><em>)</em></p><p><a href="https://www.zigbee2mqtt.io/guide/installation/01_linux.html">Linux</a></p><p>Once on the configuration page, enable the web monitoring interface and apply the correct parameters. After that, you should be able to access the Zigbee2MQTT interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nphL7Z6eUtR7swduUz8pfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*yHdamyXivCOGV8Stu1sBlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9uxdREzFfSRyS73lMLpIw.png" /><figcaption>again sorry i am french , nobody can be perfect.</figcaption></figure><p>NOTE: We are not going to pair the light bulb now; we will wait until we have our sniffing station set up to do so. That’s done.</p><p>Now that we have our monitoring station, let’s move on to the sniffing station.</p><h4>Sniffing stations</h4><p>One of the challenges when working with SDR is installation and software compatibility. There are older tools that require specific dependencies. From experience, a significant portion of the time is spent installing and debugging software.</p><p>To address this problem, several projects have tried to bundle as many tools as possible into a stable environment. The most well-known is DragonOS, maintained by cemaxecuter:</p><ul><li><a href="https://cemaxecuter.com/">https://cemaxecuter.com/</a></li></ul><p>It is a great starting point, but the installation takes some time, the process is not scalable, and in general, I find its use cumbersome.</p><p>This is where RFSwift comes in — a Docker-based toolbox that bundles all the necessary tools. I would like to thank Mr. Dudek here, who is the maintainer of RFSwift and the owner of PentHertz:</p><p><a href="https://github.com/PentHertz/RF-Swift">https://github.com/PentHertz/RF-Swift</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*PyMmkApW3J8Riq8d.png" /></figure><p>Here is my workflow for its installation:</p><pre># RF-Swift GitHub<br>https://github.com/PentHertz/RF-Swift</pre><pre># Link to Dudek&#39;s video<br>https://www.youtube.com/watch?v=y5QCNphhGP4&amp;t=2446s</pre><pre># List all official images for RFSwift<br>rfswift images remote</pre><pre># Pull the Docker image from the PentHertz repository<br>rfswift images pull -i penthertz/rfswift:sdr_full</pre><pre># Create a new environment based on the defined Docker image<br>rfswift run -i sdr_full -n YOUR_ENVIRONMENT_NAME</pre><pre># Run the Docker container<br>rfswift exec -c YOUR_ENVIRONMENT_NAME</pre><pre># Stop the Docker container<br>rfswift stop -c YOUR_ENVIRONMENT_NAME</pre><pre>### Detect device<br>## RTLSDR<br># Open URH and detect the current RTL-SDR</pre><pre>## HackRF<br>hackrf_info</pre><pre>## Transfer files from host to Docker<br># Get the list of Docker containers<br>docker ps<br># Syntax: file | Docker ID | path<br>docker cp DOCKER_ID:/root/capture_1.pcap ./capture_1.pcap</pre><p>The great thing here is that you do not need to install the tools one by one. Inside the container, you already have the following tools available:</p><ul><li>HackRF dependencies</li><li>GNU Radio with the libraries related to IEEE 802.15.4</li><li>Wireshark</li></ul><p>There is one last element we need to cover: how do we intercept the requests sent over the air? For this, we will use GNU Radio. Since this is a well-researched topic (the acquisition and analysis of IEEE 802.15.4 communications and the ZigBee protocol stack), cemaxecuter made a great video explaining how to perform the acquisition (which can be replicated using RFSwift).</p><p>The GNU Radio file (flow graph) used in his video is the following:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fme_oCwZHaZ4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dme_oCwZHaZ4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fme_oCwZHaZ4%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f406b7b16c72e8597e0e7f23cba162d2/href">https://medium.com/media/f406b7b16c72e8597e0e7f23cba162d2/href</a></iframe><p>le fichier gnuradio (flow graph) qu’il utilise ici et le suivants</p><p><a href="https://github.com/bkerler/GnuRadio-Wireshark-Example/blob/maint-3.10/src/Wireshark-IEEE_802_15_4-001.grc">https://github.com/bkerler/GnuRadio-Wireshark-Example/blob/maint-3.10/src/Wireshark-IEEE_802_15_4-001.grc</a></p><p>All you need to do is transfer the .grc file into your RFSwift Docker container and launch it with GNU Radio.</p><p><strong>NOTE 1:</strong> In his video, between 8:02 and 10:00 minutes, cemaxecuter explains how to modify the .grc file to make it work. You need to do the same thing and change the source, since he does not use a HackRF.</p><p><strong>NOTE 2:</strong> For the source, you must select the HackRF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*SYAEtvRWlGyPT18khrRwtw.png" /></figure><p>Once this is done, you should see output in the debug field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*XA-zCkhclMaFfRjceiBGtw.png" /></figure><p>NOTE: i encurage you tu use the canal 11 , it’s the one used by the philips hue.</p><p>he Wireshark output is saved as a .pcap file in the /tmp directory of your Docker container. To access it, open a new terminal window, start a new session on your Docker container, and open the file with Wireshark.</p><p>To continue, try adding the smart light bulb to the Zigbee2MQTT web interface while simultaneously receiving messages on channel 11 via the HackRF.</p><p><strong>NOTE:</strong> Do not forget to refresh the file, because Wireshark does not automatically account for the fact that it is being filled in real time.</p><p>At the end, you should have something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8sw8_cjAMxrsrgUOy7DAnQ.png" /></figure><h4>Bonus: Decrypting the Packets</h4><p>As explained in the introduction, ZigBee packets are natively encrypted using an AES algorithm, along with what is called the network key.</p><p>Part of the objective of attacks on ZigBee will be to recover this network key in order to decrypt the data flows.</p><p>Wireshark has a built-in decoder for this. It is located in: <strong>Edit → Preferences → Protocols → ZigBee</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*eby2xoSUgH4VvQvIJ9z0bg.png" /></figure><p>Yes, I just leaked my network key (I have changed it since).</p><p>So the question is: where is this network key located? In our case, since we have direct access to Zigbee2MQTT, the network key can be found in several files. Here, we can see it in:</p><p>/opt/zigbee2mqtt/data/coordinator_backup.json</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*gjQ-9zrsvqOgTnC6Xko7Lw.png" /></figure><p>Once this is done, your packets should be automatically decrypted.</p><h3>Conclusions</h3><p>This article was more focused on the installation and setup of the environment. A follow-up may be written to dive a bit deeper into the use of different tools and the security applied to the ZigBee protocol.</p><h3>About the Author</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>I am a freelance ICS security consultant and a teacher available for assignments in this field.</p><p>If you are interested, DM me on LinkedIn.<br><a href="https://www.linkedin.com/in/erwan-cordier/">https://www.linkedin.com/in/erwan-cordier/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7c5f406b60a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recover password from DELTA DOPSoft 4 .dpa]]></title>
            <link>https://medium.com/@biero-llagas/recover-password-from-delta-dopsoft-4-dpa-d65ee08823bc?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d65ee08823bc</guid>
            <category><![CDATA[ics-security]]></category>
            <category><![CDATA[patching]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 17:09:49 GMT</pubDate>
            <atom:updated>2026-02-08T20:29:31.163Z</atom:updated>
            <content:encoded><![CDATA[<h3>Recover password from DELTA DOPSoft 4 .dpa protected file and patch password verifications from the software.</h3><h3>Foreword</h3><h4>!!!!!!!!!! for educational purpose only !!!!!!!!!!!!!!!!!!!!!!!!!!!!!</h4><p>This article is part of a series of articles focused on reverse engineering EWS software to determine the security of project files and potentially bypass the security measures applied to them.</p><p>The series includes the following items in addition to this one.</p><ul><li><a href="https://medium.com/@biero-llagas/cracking-like-its-2001-recover-password-from-beckoof-twincat-2-pro-protected-file-e3bd59561e7b">https://medium.com/@biero-llagas/cracking-like-its-2001-recover-password-from-beckoof-twincat-2-pro-protected-file-e3bd59561e7b</a></li></ul><p>NOTE 1: For the time being, the actions will remain in Proof of Concept format. So if you are here to get a direct patch without getting your hands dirty, this article is not for you.</p><p>NOTE 2: The goal here is not to completely reverse engineer the application, but just to achieve the objectives (password recovery and application patching), so it won’t really be reverse engineering or theft if there is a simple solution.</p><h3>Glossary</h3><ul><li>ACL :<a href="https://fr.wikipedia.org/wiki/Access_Control_List">Access Contol List</a></li><li>EWS Software : Engineering Workstations (EWS) are specialized computers used by engineers for designing, configuring, monitoring, and maintaining complex systems, especially in industrial automation (SCADA/PLC environments)</li></ul><h3>Tools</h3><ul><li><a href="https://cheatengine.org/">cheat engine</a></li><li><a href="https://x64dbg.com/">X32 dbg</a></li></ul><h3>Introductions</h3><h4>Delta</h4><p>Delta Electronics, Inc. (Chinese: 台達電子; also known as DELTA or Delta Electronics) is a Taiwanese electronics manufacturing company. Its headquarters are in Neihu, Taipei. It is known for its DC industrial and computer fans, data center rectifiers and switching power supplies. The company operates approximately 200 facilities worldwide, including manufacturing, sales, and R&amp;D centers.</p><h4>The Target : DOPSoft V4</h4><p>A word form DELTA EMEA</p><blockquote>DOPSoft V4 is engineering software used to design, configure, and program Delta Electronics HMI (Human Machine Interface) panels, specifically the DOP-100 series HMIs. Its main purpose is to create graphical operator screens and handle communication between the HMI and PLCs/other automation devices in industrial control systems</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/0*fNHTjUsd4vrpI5eu" /></figure><p>The DOPSoft (V4) software have reached its end of life (EOL) in May 2023, which in the world of industry is not that old (a little less than three years since this article was written).</p><p>The cool thing is that the software is available for free at the installation site, so this time you can repeat the steps I show you.</p><p><a href="https://downloadcenter.deltaww.com/en-US/DownloadCenter?v=1&amp;q=DIAScreen&amp;sort_expr=cdate&amp;sort_dir=DESC">Download Center</a></p><p>One thing should catch your attention when you arrive at the download page.</p><blockquote>“might be concerned with cyber security”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*zeMnS48Atszh6rUal5Za7g.png" /></figure><p>Here more context in their EOL term</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*lOLgkeJY7sUyav9DJcaRXg.png" /></figure><p>Buffer overlfow that cool , but that is not what we are interested in today.</p><p>Install it , and normaly you will see this screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0aqHlpOGJaHInf-Yr-_r-w.png" /></figure><p>NOTE: like for the other article in this series i will not go in the details of the use of the interface , the only stuff that interest us is the management of the protections of the prohect file.</p><h3>Create the protected file</h3><p>Create a random project for any GUI (the GUI version does not seem to have any impact on the management of project file security).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*68n8T7GrPO2JJzIB6nlCKA.png" /></figure><p>Once the project has been created, password protection must be enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*ZtBWvNBtC6fN61MwtqQfdg.png" /></figure><p>Let’s be a little playful and activate maximum security.</p><p>NOTE: like the Beckoof TwinCat 2 PLC Controle ther is a form of ACL in the project , you can apply password on defined group , and give rifht to those group in your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M6RSZkjkHtHBucvppCBfRA.png" /></figure><p>Save the project and try to reopen it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*KA8qWg0onQiXfFoQXylRUw.png" /></figure><p>You will be asked for the password</p><h3>Let’s dig deeper (Patch the diff and open any password protected file)</h3><p>NOTE: the next sections will be on how to retrieve the password of the file , if it’s sometions that you are interested in , go directly to this sections.</p><p>For the first step, we’ll start with Cheat Engine to see if we can find any clues about the password execution chain.</p><p>NOTE: The example password for this article will be “POTTER.”</p><p>Launch Cheat Engine, enter “potter” in the DOPSoft password field, and search for “POTTER” as a character string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*jZpWI7y0jGdest9U07CiLg.png" /></figure><p>That’s a good start.</p><p>Next, we’ll see if there are any actions taking place (right-click on the POTTER value in the step variable, then select “Find or what accesses this address”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*U1SZuOpmmhHbcitu-dmatQ.png" /></figure><p>Okay that something at least.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*F5_VwbxhS9eiINTkFoCNAg.png" /></figure><p>Let’s take a look at the first one and examine the assembler view. The first thing we can see is the function calls from the Qt5Core DLL.</p><p>The application is written with Qt Creator. I am not an expert in this framework, so I may say something silly about the use of some of these classes and functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*9YA6bH2kFhDCTyM21NmAHw.png" /></figure><p>avencon un peut and there we can see a function that might interest us (Qt5Core:QCryptogrphicHash::hash)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5ysQMuNNRJjwpCQpHGJAw.png" /></figure><p>According to the Qt Creator documentation, this class is used to generate hashes.</p><p><a href="https://doc.qt.io/archives/qt-5.15/qcryptographichash.html">https://doc.qt.io/archives/qt-5.15/qcryptographichash.html</a></p><p>And if we go a little further (in the executions flow), we can see that there are indeed two hashes in memory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*ZReJp4Tn7MC6d7E1XFSttg.png" /></figure><p>With practice, you can see that it has the form of sha256 (you can confirm this by the parameters applied to Qt5Core.qcryptographichash) or just by checking the password applied to confirm that this is indeed the case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PXn_PxGgT__5ghhYte-dIQ.png" /></figure><p>Indeed, the hash corroborates this.</p><p>So we can see that our password will be hashed. And potentially compared with the password in the project file. Let’s try to confirm this hypothesis.</p><p>With a little research, we can find this comparison.</p><p>Here, both hashes are in the stack, and they will be loaded into EAX (project file hash) and ECX (user input hash) respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DdFHRJwzw2LoW5wY0jXLPQ.png" /></figure><p>So if we patch for this comparison, and apply the recovery in the stack, the real password, and patch, we should be able to open it without any problems, right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x9YNYip5DK7qa-94bthuEg.png" /></figure><p>L’etsgo that work</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NuSun5vu53zo9StPSMDrwg.png" /></figure><p>NOTE: I haven’t extensively tested whether this patch could cause problems with TwinCat 2, but it seems to work without too many issues.</p><h4>Clear text password before hashing.</h4><p>Indeed, one of the objectives was to bypass security and also to recover the password for the project file.</p><p>For this one, I’ll spare you the messy screenshots, and we’ll get straight to the point.</p><p>The class <a href="https://doc.qt.io/archives/qt-5.15/qcryptographichash.html">https://doc.qt.io/archives/qt-5.15/qcryptographichash.html</a> contains functions, one of which may be of interest to us: addData.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*TvU55pVoMVxx5hwNSl-CKw.png" /></figure><p>This function, if I understand correctly, will apply an entry to the hashing function, and therefore apply a string to be hashed.</p><p>If we can place ourselves on the call to this function, we may be able to find the password for the file that will be hashed.</p><p>In x32 dbg, you can set breakpoints at certain locations. Try it in qt5core.dll, the function QcryptographicHash::addData(char const *, int).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hfcrVHY0E-gRZxM6B2c_8w.png" /></figure><p>We apply the breakpoint and launch the password comparison function as in part 1, and boom, we get the password applied by the user first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*puHe5I9rzBJoxFM51Sglbw.png" /></figure><p>And the file password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IBUWBoW6mLTrHQ-wMwB1ng.png" /></figure><p>Wow that was at least a entry level CTF challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*dZ1M3f4LFYXZl5eV" /></figure><h3>Conclusions</h3><p>Crypto implementations are quite difficult to do, and even more so when the system is self-contained and the entire process of checking/comparing is done directly in the file.</p><p>I therefore advise you to follow Delta’s advice and migrate to the latest application and avoid using this type of software. We have just discovered that there is in fact no security applied, just a layer of obfuscation.</p><h3>About the Author</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>I am a freelance ICS security consultant and a teacher available for assignments in this field.</p><p>If you are interested, DM me on LinkedIn.<br><a href="https://www.linkedin.com/in/erwan-cordier/">https://www.linkedin.com/in/erwan-cordier/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d65ee08823bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cracking like it’s 2001: Recover password from Beckoof TwinCat 2 (.pro) protected file.]]></title>
            <link>https://medium.com/@biero-llagas/cracking-like-its-2001-recover-password-from-beckoof-twincat-2-pro-protected-file-e3bd59561e7b?source=rss-83fd72d5c11d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3bd59561e7b</guid>
            <category><![CDATA[beckhoff]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[ics-security]]></category>
            <category><![CDATA[cheat-engine]]></category>
            <dc:creator><![CDATA[biero llagas]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 16:32:42 GMT</pubDate>
            <atom:updated>2026-02-08T20:29:03.304Z</atom:updated>
            <content:encoded><![CDATA[<h3>Foreword</h3><p>The idea behind this blog post came to me after reading this article. I therefore recommend that you read it.</p><p><a href="https://vrls.ws/posts/2025/04/red-team-compromising-critical-infrastructure-by-reversing-scada-software/">Red Team - Compromising Critical Infrastructure by Reversing SCADA Software</a></p><p>EWS software can be a good target , so here i am with a very old and easy one to bypass.</p><p>In the context ofgeneralist pentesting, software reverse engineering is often overlooked or quite rare because it takes a lot of time if you don’t have any specialization or at least some knowledge in this area.</p><p>The idea here is not to do things properly, but to get quick wins. The idea is to apply a very old method that still works in 2026, and it is generally one of the first techniques you learn, as well as a technique used in video game hacking.</p><h4>!!!!!!!!!! for educational purpose only !!!!!!!!!!!!!!!!!!!!!!!!!!!!!</h4><h3>Glossary</h3><ul><li>ACL :<a href="https://fr.wikipedia.org/wiki/Access_Control_List">Access Contol List</a></li><li>EWS Software : Engineering Workstations (EWS) are specialized computers used by engineers for designing, configuring, monitoring, and maintaining complex systems, especially in industrial automation (SCADA/PLC environments)</li></ul><h3>Introductions</h3><h4>Beckhoff</h4><p>Beckhoff Automation is a German technology company specializing in PC-based control and automation, founded by Hans Beckhoff in 1980, evolving from his parents’ electrical business in Verl, Germany, and known for innovations like</p><p><a href="https://www.google.com/search?q=EtherCAT&amp;client=firefox-b-e&amp;hs=FwVU&amp;sca_esv=4ba3af865432350d&amp;channel=entpr&amp;sxsrf=ANbL-n6uvbFr7UgQln_JjWAhrVtq7Uc2jQ%3A1768648763964&amp;ei=O3BraZHIOq6Fxc8PoeefkA8&amp;ved=2ahUKEwiC1P-RupKSAxWZSfEDHXT9CxEQgK4QegQIARAB&amp;uact=5&amp;oq=beckoff+wikipedia+englais&amp;gs_lp=Egxnd3Mtd2l6LXNlcnAaAhgCIhliZWNrb2ZmIHdpa2lwZWRpYSBlbmdsYWlzMgYQABgNGB4yBRAAGO8FMggQABiABBiiBDIFEAAY7wUyBRAAGO8FSOMMUPEBWIYMcAF4AZABAJgBzAagAbQQqgELMC40LjEuMS42LTG4AQPIAQD4AQGYAgigAuMQwgIWEAAYsAMY1gQYpgMYRxj4BRioAxiLA8ICChAAGLADGNYEGEfCAhwQLhiABBiwAxjRAxjSAxhDGMcBGKgDGIoFGIsDwgIGEAAYFhgemAMA4gMFEgExIECIBgGQBgmSBwsxLjQuMS4xLjYtMaAH8iOyBwswLjQuMS4xLjYtMbgH2RDCBwUwLjIuNsgHHIAIAA&amp;sclient=gws-wiz-serp"><strong>EtherCAT</strong></a> and integrated industrial PCs, I/O, drives, and software (TwinCAT) for global manufacturing and process automation.</p><h4>The target : twincat 2 PLC Control.</h4><p>Launched in 1996, TwinCat is a software suite that allows you to interface with and program PLCs.</p><p>To program it, you need the TwinCat 2 PLC Control software.</p><p>I’m not going to talk about how to program here.</p><p>When you create a project, you have the option of applying restrictions by group, which is a form of ACL proto.</p><p>Here, we are going to apply a password at Level 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*eFU5ZRfZtv0SLTMa4QHrPw.png" /><figcaption>Applications of the password for user group.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*ecvnydPlmZVbxhh7QfCVQg.png" /><figcaption>Applications of ACL to specific sections of the file.</figcaption></figure><p>Once you have applied the password, save the file in .pro format, and you will need a password for it.</p><p>NOTE: The password that i have applied for my file is “13371337&quot; (because leet is peak in the year 2000)</p><h3>The original gangster : cheat engine.</h3><p>Wikipedia say’s</p><blockquote>Cheat Engine (CE) is a memory scanner/debugger created by Eric Heijnen (“Byte, Dark”) for the Windows operating system in 2000. Cheat Engine is mostly used for cheating in computer games and is sometimes modified and recompiled to support new games. It searches for values input by the user with a wide variety of options that allow the user to find and sort through the computer’s memory. Cheat Engine can also create standalone trainers that can operate independently of Cheat Engine, often found on user forums or at the request of another user.</blockquote><p>A tutorial and cheat engine integration that I highly recommend. It’s great for understanding the basics of the software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*EsqYlB1RF-j27eSDVLbfzA.png" /></figure><p>Here a walktrought in case.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNib69uZJCaA%3Flist%3DPLF7E7487FE8AEA4D2&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNib69uZJCaA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNib69uZJCaA%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/19c1853dea6865bb739a6fb944e309c4/href">https://medium.com/media/19c1853dea6865bb739a6fb944e309c4/href</a></iframe><h3>Methodologie</h3><p>The idea here is to start from the assumption that the password is not in plain text in the file (which is true) but that it is compared at some point to the password provided by the user in order to decode it.</p><p>The idea here will therefore be as follows</p><ul><li>Check with Cheat Engine if the password is given and stored in memory.</li><li>See if actions access the latter in the context of a comparison with user input.</li><li>Try to modify the execution flow so that entering an incorrect password causes the file to be decrypted.</li></ul><h4>1: check password stored in memory</h4><p>Ok so o have try to open the file with the password “696969&quot; (again funny number whe are in the 2000)</p><p>We search by string and bam, we find both passwords (the one in the file and the one applied by the user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-rgi7-DLhDhgct1nWWNZKw.png" /></figure><h4>2: check if something access this address</h4><p>Then we will check if there are any elements that access the address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*HEqHfYmT101eP6eSZ-3k0A.png" /></figure><p>Then we restart the attempt to decrypt the file</p><p>Ok we have something.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*aCajDQSTZ-AkT39LE6W9Tw.png" /></figure><p>Follow in assembly , and we are good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qcf_hC5lqInQZrBGFjqFiw.png" /></figure><p>Okay, so what do we have here?</p><ul><li>jumps and conditional jumps (jmp, je)</li><li>pointers (a register surrounded by [] means that it is a pointer and that it will retrieve the contents of the address it points to)</li><li>and comparisons.</li></ul><p>Great, that’s a lot. Place a few breakpoints to see the contents of the registers and restart the password attempt.</p><p>Our first breakpoint occurs at “mov al,[esi]”. Let’s try to follow the contents of esi to see what will be stored in al.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*dKaGCQFyaQiqMARjj3FaKA.png" /></figure><p>And the incredible (really, it’s a bad CTF challenge) is that we can see the password applied by the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPjXG13v7KP9ZA8I8txTtw.png" /></figure><p>Okay, so something must be happening in your brain. If [esi] is placed in al and contains the password that the user has given, and a few instructions later we compare al to ah (which will take the contents of [edi]), then the password could be in al, right?</p><p>Bingo, it’s 1996, don’t forget, back then it was really easy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*Pq9-Un_RKJRutycUWmpHPw.png" /></figure><p>Okay, great, but now we have the password, we’d still like to do some cracking. So let’s go back to the days when changing a jump could give you the contents of an industrial system file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*czr7ZVGasppAnhK3" /></figure><h4>3: Try to modify the execution flow</h4><p>For those, try modifying the confitinos function, which is the result of comparing the two passwords, I (meaning Jump equal), replacing it with jmp (meaning JUMp).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*YzV4fuySG0l2jwAXRa4Yjg.png" /></figure><p>Remove the breack point , run and TADAAAAAA , you are a cracker</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*WVnHmLsMnX_CcPEczdk5LA.png" /></figure><p>NOTE: The jump you have modified appears to be used by other functions, so replace it to avoid freezing your TwinCat PLC Control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*CcLaL7LpjFBWVqi4TEVwRg.png" /></figure><h3>Conclusions</h3><p>A short blog post to remind you that practicing off-track (outside of Hack the Box, Try Hack Me, and other platforms) is possible and even quite easy if you look for it a little.</p><p>It’s really an old-school technique on old-school software. Spoiler alert: this technique is still valid for software in Big 2026.</p><h3>About the Author</h3><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <br>I am a freelance ICS security consultant and a teacher available for assignments in this field.</p><p>If you are interested, DM me on LinkedIn.<br><a href="https://www.linkedin.com/in/erwan-cordier/">https://www.linkedin.com/in/erwan-cordier/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3bd59561e7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>