<?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 //DivByZero// on Medium]]></title>
        <description><![CDATA[Stories by //DivByZero// on Medium]]></description>
        <link>https://medium.com/@mroplus?source=rss-32b4aa34aa19------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mLyFpU0xmKgnkgVMLaxlVg.jpeg</url>
            <title>Stories by //DivByZero// on Medium</title>
            <link>https://medium.com/@mroplus?source=rss-32b4aa34aa19------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 10:19:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mroplus/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[Using HG8245X6 Family as ONT Bridge]]></title>
            <link>https://mroplus.medium.com/using-hg8245x6-family-as-ont-bridge-42014a22b99d?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/42014a22b99d</guid>
            <category><![CDATA[hg8245x6]]></category>
            <category><![CDATA[mikrotik]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Fri, 17 Jul 2026 22:45:53 GMT</pubDate>
            <atom:updated>2026-07-17T22:45:53.993Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using HG8245 Family as ONT Bridge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*9GQlwsng5TFsrr2iOpvYlw.png" /></figure><p>My ISP gave me an HG8245X6, a high-performance Wi-Fi 6 GPON Optical Network Terminal (ONT), but it’s heavily limited due to their customized firmware. I need to set up the internet connection and VoIP on my Mikrotik Ac3 so I can have my own VPN , NAT , Firewall Rules and … .</p><p>The first problem is that all passwords are encrypted on the ONT device. The second is that the ISP won’t provide my personal credentials for VoIP and PPPoE.</p><p>I discovered there’s a super admin on this device, and with that account I can copy the configurations, but they’re still all encrypted.</p><p>I’ve found two useful resources for credential decryption, as these devices use a hardcoded static encryption key!<br>1. <a href="https://gist.github.com/staaldraad/605a5e40abaaa5915bc7">https://gist.github.com/staaldraad/605a5e40abaaa5915bc7</a><br>2. <a href="https://andreluis034.github.io/huawei-utility-page/#cipher">https://andreluis034.github.io/huawei-utility-page/#cipher</a></p><p>Now I can fully decrypt the passwords and backup file, with the Internet on VLAN/Priority (20/0) using a PPPoE connection, and VoIP on VLAN/Priority (30/5) using IPoE.</p><p>We need to set up two WAN interfaces on the ONT device, one for Internet and another for VoIP, both using the same VLAN and priority.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*eTwurYm7TeiDZ5p6V8g9mw.png" /><figcaption>Internet Bridge</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*pJmD3VkpI8ZmK2AYxT4mNg.png" /><figcaption>VoIP Bridge</figcaption></figure><p>As you can see, there’s a binding option for both interfaces. My Mikrotik device is connected via LAN1 to the ONT device. At first, I used binding on LAN1 for the Internet, but when I set LAN1 binding for VoIP as well, the Internet binding was lost!</p><p>After hours of poking with the device, I came across an interesting section called “IPv4 VLAN Binding Configuration” under Route &gt; IPv4 VLAN Binding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*HkYSGkr9IsHh5F8ylONGxA.png" /><figcaption>IPv4 VLAN Binding Configuration</figcaption></figure><p>When we set up VLAN pairs, we can encapsulate packets from Mikrotik so the ONT can recognize them, and that’s basically the whole trick.</p><p>now we need to define 2 vlans on eth1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*wiHf8UsX_tUuf8eNu5zMhw.png" /><figcaption>vlan 20 for internet</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*AYb4O2OrHGyRYZea1iqz0w.png" /><figcaption>vlan30 for VoIP</figcaption></figure><p>Next, we need to set up a DHCP client on VLAN 30 (IPoE) and PPPoE on VLAN 20. Once that’s done, we’ll have the VoIP route to the private range (10.x range) and the PPPoE link established, but we still need to configure IPv6 on PPPoE.</p><p>Now we need to set up the IPv6 DHCP client like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*9LLWopWVDFyPSTjdTgclEw.png" /></figure><p>and now we can advertise the IPv6 Address to the desired devices.</p><p>For VoIP, we still need to add static routes. On the VoIP DHCP client, we should use the following script so that whenever DHCP issues a new IP, our custom route is automatically applied.</p><pre>{<br>    :if ($bound = 1) do={<br>        :local gw $&quot;gateway-address&quot;<br><br>        :local primary [/ip route find where comment=&quot;VOIP-Proxy&quot;]<br>        :local standby [/ip route find where comment=&quot;VOIP-Standby&quot;]<br><br>        :if ([:len $primary] = 0) do={<br>            /ip route add \<br>                dst-address=10.10.96.2/32 \<br>                gateway=$gw \<br>                comment=&quot;VOIP-Proxy&quot;<br>        } else={<br>            /ip route set $primary gateway=$gw<br>        }<br><br>        :if ([:len $standby] = 0) do={<br>            /ip route add \<br>                dst-address=10.10.97.2/32 \<br>                gateway=$gw \<br>                comment=&quot;VOIP-Standby&quot;<br>        } else={<br>            /ip route set $standby gateway=$gw<br>        }<br><br>        :log info (&quot;VoIP routes updated; gateway=&quot; . $gw)<br>    }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42014a22b99d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the Lumive Smart IR Remote Control]]></title>
            <link>https://mroplus.medium.com/a-journey-through-lumive-smart-ir-remote-control-d997af7a0b70?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/d997af7a0b70</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[lumive]]></category>
            <category><![CDATA[tuya]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[frida]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Thu, 23 Apr 2026 14:37:56 GMT</pubDate>
            <atom:updated>2026-04-23T14:46:02.354Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P8UwcmKo1ugI3oIx.jpg" /></figure><p>I recently bought a <a href="https://lumivestore.com/product/lumive-smart-ir-hub/?srsltid=AfmBOooi2DHmDRN2p23wZJxGcfIxVFBRc94qT5BNZf3wvDFCZms3-kH1">Lumive Smart IR Hub</a> to control my old AC, it has a <a href="https://play.google.com/store/apps/details?id=lumivestore.com.lumivesmart">android </a>application, but who wants just an app? I want full control over my device. As always, I’ve started analyzing it to see what I can do and to explore all the possibilities. :)</p><p>A few days ago, I created a <a href="https://github.com/MrOplus/frida-ide">GUI for Frida</a> integrated with Claude Code, which I used to analyze their application and understand how it communicates with and discovers the device.</p><p>at first I’ve found that Lumive app is just a re-branded app and it’s actually <a href="https://play.google.com/store/apps/details?id=com.tuya.smart&amp;hl=en">Tuya Smart Life</a> app</p><blockquote>Great findings. The app uses **Tuya IoT SDK** — the IR hub sends AC commands via `infraredPublishDps()` over MQTT/cloud. I’ll write a Frida hook that intercepts the actual runtime calls to capture: your device ID, auth token, exact IR DP payloads for AC commands, and temperature updates.</blockquote><p>well, i had no idea about Tuya SDK at first and tried to find more details, i’ve asked it how the app communicate withe api</p><pre>┌─────────────┐     HTTPS POST /api.json      ┌──────────────────────┐<br>│  Mobile App │ ─────── (AES-GCM, signed) ──► │  a1.tuyaeu.com       │ Cloud API<br>└─────────────┘                                └──────────────────────┘<br>       │                                                │<br>       │         MQTT (paho, port 1883/8883)            │ MQTT bridge<br>       │ ◄───────────────────────────────────────────── │<br>       │         mq.mb.tuyaeu.com                       │<br>       │                                                │<br>       │         TCP :6668 (LAN, AES-ECB)               │<br>       └──────────────────────────────────────► Gateway │ Local WiFi<br>                                                (192.168.100.x)</pre><p>I started digging into the app to find possible secrets, but no luck, everything was embedded in libthing_security.so , as im not good enough for ARM asm i asked frida-ide again to give me some hints.</p><blockquote><strong>GLOBAL_STRING — The Master Secret</strong></blockquote><blockquote>Stored as a `std::string` in the BSS segment at offset `0x39070`. It is a concatenation of four components separated by underscores:</blockquote><blockquote>{package_name}_{cert_sha256_colon_hex}_{bmp_key}_{app_secret}</blockquote><blockquote>For this app:</blockquote><blockquote>lumivestore.com.lumivesmart_F0:D4:50:22:BC:15:B2:B0:AC:B0:FE:00:5B:AA:89:B2:AB:E5:02:2F:27:E0:C6:84:E0:D2:F9:99:CF:F3:AD:07_58jdrdyypc7auq5jdxtrk9ksamqxmae3_utyufyvxuayfkkj8vwdvda9tpqpq49qu</blockquote><p>Well, that was the master secret, but the app was using derivation, so the HTTP signing key and the MQTT password were different but derived from a single key. Good progress!</p><p>The static HTTP signing key was computed once when app get installed and never change</p><pre>import hashlib<br><br>GLOBAL_STRING = (<br>    &quot;lumivestore.com.lumivesmart_&quot;<br>    &quot;F0:D4:50:22:BC:15:B2:B0:AC:B0:FE:00:5B:AA:89:B2:&quot;<br>    &quot;AB:E5:02:2F:27:E0:C6:84:E0:D2:F9:99:CF:F3:AD:07_&quot;<br>    &quot;58jdrdyypc7auq5jdxtrk9ksamqxmae3_&quot;<br>    &quot;utyufyvxuayfkkj8vwdvda9tpqpq49qu&quot;<br>)<br><br>SIGNING_KEY = hashlib.sha256(GLOBAL_STRING.encode()).digest()<br># = bytes.fromhex(&quot;14f42aba50e54e1418e7e78657bc1cbaad67c22ec79422f63a5f81eeaa285b01&quot;)</pre><p>so JNICLibrary.getSigningKey() was returning this key and Each HTTP request uses a fresh AES-128-GCM key derived from the request’s UUID and the ecode session value</p><pre>import hmac, hashlib<br><br>def get_encrypto_key(request_id: str, ecode: str | None) -&gt; bytes:<br>    # request_id = UUID4 string, 36 bytes<br>    key = request_id.encode(&quot;utf-8&quot;)<br>    suffix = (&quot;_&quot; + ecode) if ecode else &quot;&quot;<br>    msg = (GLOBAL_STRING + suffix).encode(&quot;utf-8&quot;)<br>    digest = hmac.new(key, msg, hashlib.sha256).digest()<br>    return digest.hex()[:16].encode(&quot;ascii&quot;)   # 16-byte key</pre><p>The ecode is an opaque token returned in the HTTP response header on the first authenticated request. The server uses it to bind per-session encryption keys to the session, preventing key replay across sessions.</p><blockquote><strong>*Reversed from:**</strong> libthing_security.so at ARM64 function offset ~0x13ed8 (named doCommandNative cmd=1 in Frida hook output). The function takes [requestId, ecode] via JNI GetStringUTFChars.</blockquote><p>All requests POST to https://a1.tuyaeu.com/api.json as application/x-www-form-urlencoded and every requests includes these query parameters :</p><pre>a=&lt;method&gt;          # API method name, e.g. &quot;thing.m.device.dp.publish&quot;<br>v=&lt;version&gt;         # API version, e.g. &quot;2.0&quot;<br>lang=en_US<br>os=Android<br>appVersion=1.2.4<br>sdkVersion=7.0.5<br>clientId=cdgcdes4tvtnkjmjdnru<br>deviceId=&lt;install_uuid&gt;<br>ttid=sdk_international@cdgcdes4tvtnkjmjdnru<br>chKey=e8e4f69c<br>et=3                # encryption type: 3 = AES-GCM<br>cp=gzip             # compression flag<br>ct=RN<br>time=&lt;unix_seconds&gt;<br>requestId=&lt;uuid4&gt;<br>timeZoneId=&lt;timezone&gt;<br>postData=&lt;base64_encrypted_body&gt;<br>sid=&lt;session_id&gt;    # only for authenticated calls<br>sign=&lt;hmac_sha256&gt;</pre><h3><strong>Signing Algorithm</strong></h3><p>The sign is computed by ThingApiSignManager.java:</p><pre>SIGN_FIELDS = {<br>    &quot;a&quot;, &quot;v&quot;, &quot;lat&quot;, &quot;lon&quot;, &quot;lang&quot;, &quot;deviceId&quot;, &quot;appVersion&quot;, &quot;ttid&quot;,<br>    &quot;isH5&quot;, &quot;h5Token&quot;, &quot;os&quot;, &quot;clientId&quot;, &quot;postData&quot;, &quot;time&quot;,<br>    &quot;requestId&quot;, &quot;et&quot;, &quot;n4h5&quot;, &quot;sid&quot;, &quot;chKey&quot;, &quot;sp&quot;,<br>}<br><br>def compute_sign(params: dict, encrypted_b64: str) -&gt; str:<br>    # Step 1: compute swap(md5(encrypted_postData)) for the postData field<br>    md5_hex = hashlib.md5(encrypted_b64.encode()).hexdigest()<br>    swapped = md5_hex[8:16] + md5_hex[0:8] + md5_hex[24:32] + md5_hex[16:24]<br><br>    # Step 2: filter params to SIGN_FIELDS, replace postData with swapped value<br>    sign_params = {k: str(v) for k, v in params.items()<br>                   if k in SIGN_FIELDS and v is not None and str(v) != &quot;&quot;}<br>    sign_params[&quot;postData&quot;] = swapped<br><br>    # Step 3: sort alphabetically, join with &quot;||&quot;<br>    parts = sorted(f&quot;{k}={sign_params[k]}&quot; for k in sign_params)<br>    string_to_sign = &quot;||&quot;.join(parts)<br><br>    # Step 4: HMAC-SHA256 with the static SIGNING_KEY<br>    return hmac.new(SIGNING_KEY, string_to_sign.encode(), hashlib.sha256).hexdigest()</pre><p>The swapSignString shuffle ([1][0][3][2]on 8-char chunks) is a Tuya-specific obfuscation found in ThingApiSignManager.swapSignString(). It makes the MD5 of the payload a non-trivial string to forge.</p><p>The postData field is not plain JSON but AES-128-GCM encrypted. This is Tuya’s et=3 mode (encryption type 3), replicated from AesGcmUtil.java.</p><pre>from cryptography.hazmat.primitives.ciphers.aead import AESGCM<br>import os, base64<br><br>def encrypt_request_body(payload_dict: dict, aes_key: bytes) -&gt; str:<br>    &quot;&quot;&quot;<br>    aes_key = get_encrypto_key(request_id, ecode)  # 16 bytes ASCII<br>    Returns Base64(12-byte-nonce + ciphertext + 16-byte-GCM-tag)<br>    &quot;&quot;&quot;<br>    plaintext = json.dumps(payload_dict, separators=(&quot;,&quot;, &quot;:&quot;)).encode()<br>    nonce = os.urandom(12)<br>    ct_tag = AESGCM(aes_key).encrypt(nonce, plaintext, None)<br>    return base64.b64encode(nonce + ct_tag).decode(&quot;ascii&quot;)</pre><p>The server response is a JSON envelope with an encrypted result field:</p><pre>{<br>    &quot;t&quot;: 1776532535351,<br>    &quot;sign&quot;: &quot;&lt;some_value&gt;&quot;,<br>    &quot;result&quot;: &quot;&lt;base64_encrypted_inner_response&gt;&quot;<br>}</pre><p>The result is decrypted with the same per-request AES key:</p><pre>def decrypt_response(b64_data: str, aes_key: bytes) -&gt; dict:<br>    raw = base64.b64decode(b64_data)<br>    nonce, ct_tag = raw[:12], raw[12:]<br>    plaintext = AESGCM(aes_key).decrypt(nonce, ct_tag, None)<br>    # Server sometimes gzip-compresses before encrypting<br>    # (signalled by x-content-compress: gzip response header)<br>    return json.loads(plaintext)</pre><p>Each request uses a fresh UUID -&gt; fresh requestId → fresh AES key. The server encrypts the response with the same ephemeral key. This means an attacker who captures one request-response pair gets nothing useful for future requests. However, since getEncryptoKey is fully deterministic from requestId + ecode` anyone who knows the GLOBAL_STRING and the ecode can recompute any past or future key. (what a shame)</p><h3><strong>Login Flow</strong></h3><p>Authentication is a two-step process , Pre-Login Token, Login with RSA-Encrypted Password</p><pre>POST /api.json<br>a=thing.m.user.username.token.get<br>v=2.0<br>postData={&quot;countryCode&quot;:&quot;964&quot;,&quot;username&quot;:&quot;user@example.com&quot;,&quot;isUid&quot;:false}</pre><p>Response contains:</p><p>- token : one-time session bootstrap token<br>- publicKey : RSA modulus (decimal string) for password encryption<br>- exponent : RSA public exponent (typically 65537)</p><pre>import hashlib<br>from cryptography.hazmat.primitives.asymmetric import padding as asym_padding<br><br># 1. MD5 the password<br>pwd_md5 = hashlib.md5(password.encode()).hexdigest()  # 32-char hex<br><br># 2. RSA-PKCS1v15 encrypt with server&#39;s public key<br>pub = RSAPublicNumbers(int(exponent), int(modulus)).public_key()<br>passwd_enc = pub.encrypt(pwd_md5.encode(&quot;ascii&quot;), asym_padding.PKCS1v15()).hex()<br><br># 3. Send<br>POST: a=thing.m.user.email.password.login<br>postData={&quot;countryCode&quot;:&quot;964&quot;,&quot;email&quot;:&quot;...&quot;,&quot;passwd&quot;:&quot;&lt;hex&gt;&quot;,&quot;ifencrypt&quot;:1,&quot;token&quot;:&quot;&lt;token&gt;&quot;}</pre><blockquote>LoginRepository.java lines ~703–706. The ifencrypt=1 flag tells the server the password is RSA-encrypted.</blockquote><p>The MQTT connection does not use a simple username/password from the API response. All three components are derived from constants already in the app and the ecode session token.</p><pre>def mqtt_password_from_ecode(ecode: str) -&gt; str:<br>    &quot;&quot;&quot;<br>    Reversed from libthing_security.so offset ~0x13ed8 (doCommandNative cmd=2).<br>    Input via JNI: [ecode]<br>    &quot;&quot;&quot;<br>    step1 = md5hex(GLOBAL_STRING)          # md5 the entire GLOBAL_STRING<br>    full  = md5hex(step1 + ecode)          # md5 the concatenation<br>    return full[8:24]                      # take characters 8–24 (16 chars)</pre><p>This produces a 16-character hex string that is the MQTT password.</p><pre>CLIENT_ID        = &quot;cdgcdes4tvtnkjmjdnru&quot;<br>CH_KEY           = &quot;e8e4f69c&quot;<br>PARTNER_IDENTITY = &quot;p1594250&quot;   # from login response<br><br>def mqtt_credentials(uid, sid, ecode):<br>    suffix    = md5hex(md5hex(CLIENT_ID) + ecode)[-16:]   # last 16 chars of MD5<br>    client_id = f&quot;{PARTNER_IDENTITY}/mb/{uid}&quot;<br>    username  = f&quot;{PARTNER_IDENTITY}_v1_{CLIENT_ID}_{CH_KEY}_mb_{sid}{suffix}&quot;<br>    password  = mqtt_password_from_ecode(ecode)<br>    return client_id, username, password</pre><pre>clientId = p1594250/mb/eu17764211994869ziAN<br>username = p1594250_v1_cdgcdes4tvtnkjmjdnru_e8e4f69c_mb_eu177642g11994869WziAN...&lt;32-char suffix&gt;<br>password = &lt;16 hex chars derived from ecode&gt;</pre><blockquote>dbpdpbp.java (MQTT connection setup) +UserConfigSessionLogoutManager.java:844.</blockquote><pre>smart/mb/in/{uid}           ← user-level DPS updates (all devices)<br>smart/mb/in/{deviceUUID}    ← per-device updates (UUID from device list)<br>smart/mb/out/{gatewayId}    ← outbound commands to a specific gateway</pre><p>Message Format :</p><pre>{<br>    &quot;protocol&quot;: 4,<br>    &quot;pv&quot;: &quot;2.2&quot;,<br>    &quot;t&quot;: 1713456789000,<br>    &quot;sign&quot;: &quot;&lt;md5_hex&gt;&quot;,<br>    &quot;data&quot;: &quot;&lt;base64_or_dict&gt;&quot;<br>}</pre><p>- data is either a plain JSON dict (no encryption) or a Base64-encoded AES-128-ECB ciphertext<br>- AES key: localKey[:16] padded to 16 bytes with null bytes<br>- Encryption: AES-128-ECB + PKCS7 padding</p><pre>def decrypt_mqtt_data(b64_data: str, local_key: str) -&gt; dict:<br>    raw = base64.b64decode(b64_data + &quot;==&quot;)<br>    key = local_key[:16].encode(&quot;utf-8&quot;).ljust(16, b&quot;\x00&quot;)<br>    cipher = AES.new(key, AES.MODE_ECB)<br>    raw_decrypted = cipher.decrypt(raw)<br>    pad = raw_decrypted[-1]<br>    return json.loads(raw_decrypted[:-pad])</pre><p>The payload after decryption is a nested envelope :</p><pre>{<br>    &quot;protocol&quot;: 4,<br>    &quot;s&quot;: &quot;&lt;devId_or_nodeId&gt;&quot;,<br>    &quot;t&quot;: 1713456789,<br>    &quot;data&quot;: {<br>        &quot;devId&quot;: &quot;&lt;sub_device_id&gt;&quot;,<br>        &quot;cid&quot;: &quot;&lt;node_id&gt;&quot;,<br>        &quot;dps&quot;: {&quot;101&quot;: true, &quot;102&quot;: &quot;0&quot;, &quot;103&quot;: 22}<br>    }<br>}</pre><p><strong>t_s.bmp— Key Material Hidden as an Image</strong></p><p>The BMP key component (58jdrdyypc7auq5jdxtrk9ksamqxmae3) is loaded from assets/t_s.bmp via:</p><pre>ThingNetworkInterface.setSecurityContent(<br>    ThingUtil.getAssetsData(context, &quot;t_s.bmp&quot;, &quot;soisiwoejre&quot;.getBytes())<br>);</pre><p>The second argument soisiwoejre is a <strong>decryption key</strong> for the BMP file — it is stored in plaintext in the Java code (bqpdbqq.java:1590). The BMP file is not actually a bitmap! it’s encrypted key material with a .bmp extension to evade static scanners.</p><p><strong>Extraction:</strong> <br>Hook <strong>ThingUtil.getAssetsData</strong> with Frida to capture the decrypted bytes after the BMP is loaded. The HMAC key derivation in mbedcrypto_md_hmac_starts will then have the exact key bytes.</p><p><strong>fixed_key.bmp— A Second Hidden Key File</strong></p><p>There are two BMP key files in the assets:</p><p>- `t_s.bmp` — contains the signing/MQTT key component (the bmp_key)</p><p>- `fixed_key.bmp` — contains the key for a secondary security layer (used for `ThingNetworkInterface` LAN protocol security content)</p><p>so, at this point, i was able to read device temperature , humidity , and even publish the IR Commands via MQTT but still no direct access to the device (sad)</p><p>i’ve found <a href="https://github.com/jasonacox/tinytuya">https://github.com/jasonacox/tinytuya</a> , a project that help to talk with your device via lan , but it required the device key , thanks to previous finding i was able to find the device key in http responses :) and it was working but i had no interest to use it for controling the device so i installed the Tuya Smart Life app , at first it was not able to find the device , but after hard resetting the device , it paired with it. the UI and other components was exactly same as the re-branded app, but there was a difference , it was able to pair with the Tuya Cloud , but WTF is Tuya Cloud now?</p><p>I’ve registered as developer on Tuya Cloud and created a test project , and i was able to link my app account to the cloud project , after i paired my account with the cloud project , it has found my device and sub devices (AC Remote) the actual product name (Smart IR Hub) was S09-CB3S-三期面板(带告警) and it has great apis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2YxNUx1xCdF12Eme-oZ9g.png" /></figure><p>so finally i was able to control the device via actual api so i’ve created a monitoring and scenario control app to control my AC !</p><p><a href="https://smart.koorosh.me/">Climate Observatory</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ErdbeP_a0NXZl98vFOGGrw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d997af7a0b70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transform your useless tablet into a picture frame powered by AI.]]></title>
            <link>https://mroplus.medium.com/turn-on-useless-tablet-into-a-picture-frame-by-ai-c16d95e250bd?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/c16d95e250bd</guid>
            <category><![CDATA[digital-photo-frame-wifi]]></category>
            <category><![CDATA[samsung-galaxy-tab-2]]></category>
            <category><![CDATA[digital-photo-frame]]></category>
            <category><![CDATA[photo-frames]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Thu, 19 Mar 2026 17:18:04 GMT</pubDate>
            <atom:updated>2026-03-19T17:20:40.964Z</atom:updated>
            <content:encoded><![CDATA[<p>if i was supposed to write this post 5–10 years ago , it would become a 5 A4 paper post , but now , it should be a single paragraph prompt =)</p><p>I had a Samsung Galaxy Tab 2, now completely useless, running Android 4. It no longer has access to Google Play or Google Play Services, and hardly supports any apps. I was using it as a display for my Grafana dashboards, but it wasn’t very practical, so I decided to repurpose it as a picture frame.</p><p>I used Omni ROM to add support for several modern libraries, though it doesn’t support audio. After enabling ADB access and connecting it to my computer, I asked Claude Code to create an app with a web UI for uploading and controlling it as a picture frame.</p><p>Using a Single Shot Prompt, the app was fully created, but since the device is too old, I had to make some modifications to support large images due to its limited heap size.</p><blockquote>Create an Android app targeting Android 7+ that functions as a digital photo frame. It should support receiving images via Bluetooth or through a UI hosted on connected Wi-Fi. The app needs to acquire a wakelock to prevent the display from turning off and should cycle through images one by one for a configurable duration set in the settings. It should also include a web UI interface to allow control via the web.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QAMUzadWtDB7xoSmc-lXhQ.png" /><figcaption>Web UI</figcaption></figure><p>Now I can upload images directly to the device using the web UI , it will cycle through the images with two different animations. here is the final result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kE0TasW3jEBb7D_QzinqJw.png" /></figure><p>I’ve decorated using the <a href="https://www.ikea.com/gb/en/p/nordhaegg-picture-ledge-pine-60601701/">NORDHÄGG picture ledge</a> and a <a href="https://www.ikea.com/gb/en/p/kalanchoe-potted-plant-flaming-katy-assorted-colours-70575155/">Kalanchoe potted plant</a> from IKEA.</p><p>Total Cost of hardware (inc. picture ledge, Pot, Device, Charger, Cable): ~= 15$</p><p>here is the Repo link (created by Claude)</p><p><a href="https://github.com/MrOplus/DigitalFrame">https://github.com/MrOplus/DigitalFrame</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c16d95e250bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WPA-Enterprise Implementation for better security]]></title>
            <link>https://mroplus.medium.com/wpa-enterprise-implementation-for-better-security-05a61380c03c?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/05a61380c03c</guid>
            <category><![CDATA[wpa]]></category>
            <category><![CDATA[802-1x]]></category>
            <category><![CDATA[freeradius]]></category>
            <category><![CDATA[enterprise-wpa2]]></category>
            <category><![CDATA[wpa2]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Tue, 08 Jul 2025 01:21:02 GMT</pubDate>
            <atom:updated>2025-07-08T01:25:48.417Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>WPA-Enterprise Implementation for better security</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*I8FmdaqWo79dYyhdVe7E0w.png" /><figcaption>macOS alert for weak WiFi Security</figcaption></figure><p>Have you ever noticed that when you connect to your WiFi, macOS marks it as having <em>Weak Security</em>?</p><p>In most cases, this is due to WiFi misconfigurations or outdated software on your hardware. Many older security protocols — such as WEP, WPA, and WPA2 (with pre-shared keys / TKIP ) — are now deprecated and considered vulnerable.</p><p>we’re currently facing a few challenges:</p><ol><li>WPA3 is not compatible with many devices.</li><li>Most existing routers do not support WPA3.</li></ol><p>But we can implement <strong>WPA Enterprise (802.1X with RADIUS authentication)</strong>, which not only improves security but also offers the following benefits:</p><ol><li>Centralized Access Control</li><li>Dynamic Encryption Keys</li><li>Authentication via RADIUS</li><li>Even ESP supports it!</li></ol><h3>How does WPA Enterprise actually work?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*pvjg_0IPGdf-PP5H.png" /></figure><p>WPA Enterprise relies on the <strong>802.1X standard</strong> and a <strong>RADIUS (Remote Authentication Dial-In User Service)</strong> server to authenticate users. Here’s a simplified breakdown of the process:</p><ol><li><strong>User Requests Access</strong><br> A device tries to connect to the WiFi network.</li><li><strong>Authentication Begins</strong><br> The WiFi router intercepts the connection and requests credentials (like a username/password or certificate) from the client.</li><li><strong>Credentials Forwarded to RADIUS</strong><br> The router forwards those credentials to the <strong>RADIUS server</strong>, which is often integrated with systems like <strong>Active Directory</strong>, <strong>LDAP</strong>, or a local user database.</li><li><strong>Validation</strong><br> The RADIUS server validates the credentials. If successful, it tells the router to grant access.</li><li><strong>Dynamic Key Exchange</strong><br> A unique encryption key (called a <strong>Pairwise Master Key</strong>, or PMK) is generated dynamically for that session. This ensures that each device gets its own encrypted channel.</li></ol><p>Now that we understand the key components, let’s move forward and implement a basic <strong>WPA2-Enterprise</strong> setup.</p><p>I’ll be using:</p><ul><li><strong>FreeRADIUS</strong> as the RADIUS server</li><li>A <strong>Raspberry Pi</strong> as the host machine for FreeRADIUS</li><li>A <strong>Domain</strong> that hosted on Cloudflare’s ZeroTrust</li></ul><p>First we need to install the Free Radius :</p><pre>sudo apt update &amp;&amp; sudo bapt install freeradius freeradius-utils</pre><p>next we need to install certbot :</p><pre>sudo apt-get install certbot</pre><p>as far as freeradius runs as freerad user we need to create a group and add freeradius user to that group so it can read the certificate files</p><pre>addgroup --system certs<br>adduser freerad certs</pre><p>due to short life of certbot certificates , we need to renew it every 3 month , and everytime we need to restart the freeradius so we need a hook :</p><pre>#!/bin/sh<br># /usr/local/sbin/certbot-post-hook<br>#  Ensure certificates are in the correct group<br>chgrp -R certs /etc/letsencrypt/live /etc/letsencrypt/archive<br>chmod 750 /etc/letsencrypt/live /etc/letsencrypt/archive<br><br>#  Restart FreeRADIUS<br>systemctl restart freeradius</pre><p>now you need to expose your host’s port 80 using your domain ( you can read my blog post : <a href="https://mroplus.medium.com/expose-your-local-services-like-a-pro-cf8a1f874cdf">https://mroplus.medium.com/expose-your-local-services-like-a-pro-cf8a1f874cdf</a> )</p><pre>certbot certonly \<br>        --standalone \<br>        --cert-name radius.example.com \<br>        -d radius.example.com \<br>        --post-hook /usr/local/sbin/certbot-post-hook</pre><p>now we have a valid certificate , it’s time to configure the freeradius,</p><p>first edit the following file /etc/freeradius/3.0/mods-enabled/eapand update the private_key_file and certificate_filebased on your domain name, here is a my configuration:</p><pre>eap {<br> default_eap_type = md5<br> timer_expire = 60<br> ignore_unknown_eap_types = no<br> cisco_accounting_username_bug = no<br> max_sessions = ${max_requests}<br> md5 {<br> }<br> gtc {<br>  auth_type = PAP<br> }<br> tls-config tls-common {<br>  private_key_file = /etc/letsencrypt/live/radius.example.com/privkey.pem<br>  certificate_file = /etc/letsencrypt/live/radius.example.com/fullchain.pem<br>  ca_file = /etc/ssl/certs/ca-certificates.crt<br>  ca_path = ${cadir}<br>  cipher_list = &quot;DEFAULT&quot;<br>  cipher_server_preference = no<br>  tls_min_version = &quot;1.2&quot;<br>  tls_max_version = &quot;1.2&quot;<br>  ecdh_curve = &quot;&quot;<br>  cache {<br>   enable = no<br>   lifetime = 24 <br>   store {<br>    Tunnel-Private-Group-Id<br>   }<br>  }<br>  verify {<br>  }<br>  ocsp {<br>   enable = no<br>   override_cert_url = yes<br>   url = &quot;http://127.0.0.1/ocsp/&quot;<br>  }<br> }<br> tls {<br>  tls = tls-common<br> }<br> ttls {<br>  tls = tls-common<br>  default_eap_type = md5<br>  copy_request_to_tunnel = no<br>  use_tunneled_reply = no<br>  virtual_server = &quot;inner-tunnel&quot;<br> }<br> peap {<br>  tls = tls-common<br>  default_eap_type = mschapv2<br>  copy_request_to_tunnel = no<br>  use_tunneled_reply = no<br>  virtual_server = &quot;inner-tunnel&quot;<br>  proxy_tunneled_request_as_eap = yes<br>  soh = no<br>  require_client_cert = no<br> }<br> mschapv2 {<br>  send_error = no<br>  identity = &quot;FreeRadius&quot;<br> }<br>}</pre><p>next , you need to define who going to call the radius server, so you have to edit /etc/freeradius/3.0/clients.conf and add the following block to the file:</p><pre>client wireless_ap {<br>    ipaddr = 192.168.100.1  # Your AP&#39;s IP<br>    secret = SomeSecrets<br>    require_message_authenticator = yes<br>    nas_type = other<br>    proto = *<br>}</pre><p>next add your users to the /etc/freeradius/3.0/mods-config/files/authorize</p><pre>alice        Cleartext-Password := &quot;alice_password&quot;<br>bob          Cleartext-Password := &quot;bob_password&quot;</pre><p>You can check the configuration by running :</p><pre>freeradius -XC </pre><p>if you see Configuration appears to be OK , means you are ready to run the server by systemctl restart freeradius</p><p>So what we need now is the IP Address of the Radius Server , and Secret that we have created earlier</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jBnSNfXfqry61iCXKg-Svw.png" /></figure><p>Configure the authentication method in your router like this and then you are ready to test the wifi connectivity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*M3kqeB2imwtbYcunsp6I7Q.png" /></figure><p>Leave identity as empty , and enter your username and password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*113XcQDbh95oQyg6y8rY6A.png" /></figure><p>verify your certificate and continue.</p><p>Now you are using WPA-Enterprise.</p><blockquote>On some routers, you can implement authorization and accounting also , that means you can set rate limits , usage limits and so many other policies per user.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05a61380c03c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turn your RaspberryPI into a NVR]]></title>
            <link>https://mroplus.medium.com/turn-your-raspberrypi-into-a-nvr-3f1cc58a8497?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f1cc58a8497</guid>
            <category><![CDATA[moonfire-nvr]]></category>
            <category><![CDATA[nvr]]></category>
            <category><![CDATA[network-video-recorder]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Tue, 04 Mar 2025 08:00:39 GMT</pubDate>
            <atom:updated>2025-03-04T18:23:38.478Z</atom:updated>
            <content:encoded><![CDATA[<p>In my previous <a href="https://medium.com/@mroplus/reviving-an-outdated-ip-camera-a-journey-through-legacy-tech-and-modern-solutions-671f8e3c7ac1">blog post</a>, I wrote about how I created a live stream for my old IPCamera device.</p><p>Well, it seems there is a much more easier solution than what I’ve done, and that’s the Moonfire NVR.</p><p>Moonfire NVR is an open-source security camera network video recorder. It saves H.264-over-RTSP streams from IP cameras to disk into a hybrid format: video frames in a directory on spinning disk, other data in a SQLite3 database on flash. It can construct .mp4 files for arbitrary time ranges on-the-fly. It does not decode, analyze, or re-encode video frames, so it requires little CPU. It handles six 1080p/30fps streams on a <a href="https://www.raspberrypi.org/products/raspberry-pi-2-model-b/">Raspberry Pi 2</a>, using less than 10% of the machine&#39;s total CPU.</p><p>So , All you need to do is to install Docker on RPI, and then execute the following commands :</p><p>First, Create a new user</p><pre>sudo useradd --user-group --create-home --home /var/lib/moonfire-nvr moonfire-nvr</pre><p>then create the configuration file</p><pre>echo &quot;&quot;&quot;<br>[[binds]]<br>ipv4 = &quot;0.0.0.0:8080&quot;<br>allowUnauthenticatedPermissions = { viewVideo = false }<br><br>[[binds]]<br>unix = &quot;/var/lib/moonfire-nvr/sock&quot;<br>ownUidIsPrivileged = true<br>&quot;&quot;&quot; &gt; /etc/moonfire-nvr.toml</pre><p>and create compose file after that</p><pre>mkdir /mnt/nvr &amp;&amp; cd /mnt/nvr/<br>echo &quot;&quot;&quot;<br>version: 3<br>services:<br>  moonfire-nvr:<br>    # The `vX.Y.Z` images will work on any architecture (x86-64, arm, or<br>    # aarch64); just pick the correct version.<br>    image: ghcr.io/scottlamb/moonfire-nvr:v0.7.11<br>    command: run<br><br>    volumes:<br>      # Pass through `/var/lib/moonfire-nvr` from the host.<br>      - &quot;/var/lib/moonfire-nvr:/var/lib/moonfire-nvr&quot;<br><br>      # Pass through `/etc/moonfire-nvr.toml` from the host.<br>      # Be sure to create `/etc/moonfire-nvr.toml` first (see below).<br>      # Docker will &quot;helpfully&quot; create a directory by this name otherwise.<br>      - &quot;/etc/moonfire-nvr.toml:/etc/moonfire-nvr.toml:ro&quot;<br><br>      # Pass through `/var/tmp` from the host.<br>      # SQLite expects to be able to create temporary files in this dir, which<br>      # is not created in Moonfire&#39;s minimal Docker image.<br>      # See: &lt;https://www.sqlite.org/tempfiles.html&gt;<br>      - &quot;/var/tmp:/var/tmp&quot;<br><br>      # Add additional mount lines here for each sample file directory<br>      # outside of /var/lib/moonfire-nvr, e.g.:<br>      # - &quot;/media/nvr:/media/nvr&quot;<br>      - &quot;./recordings:/recordings&quot;<br>      # The Docker image doesn&#39;t include the time zone database; you must mount<br>      # it from the host for Moonfire to support local time.<br>      - &quot;/usr/share/zoneinfo:/usr/share/zoneinfo:ro&quot;<br><br>    # Edit this to match your `moonfire-nvr` user.<br>    # Note that Docker will not honor names from the host here, even if<br>    # `/etc/passwd` is passed through.<br>    # - Be sure to run the `useradd` command below first.<br>    # - Then run `echo $(id -u moonfire-nvr):$(id -g moonfire-nvr)` to see<br>    #   what should be filled in here.<br>    user: 1001:1001<br><br>    # Uncomment this if Moonfire fails with `clock_gettime failed` (likely on<br>    # older 32-bit hosts). &lt;https://github.com/moby/moby/issues/40734&gt;<br>    # security_opt:<br>    # - seccomp:unconfined<br><br>    environment:<br>      # Edit zone below to taste.<br>      TZ: &quot;America/Los_Angeles&quot;<br>      RUST_BACKTRACE: 1<br><br>    # docker&#39;s default log driver won&#39;t rotate logs properly, and will throw<br>    # away logs when you destroy and recreate the container. Using journald<br>    # solves these problems.<br>    # &lt;https://docs.docker.com/config/containers/logging/configure/&gt;<br>    logging:<br>      driver: journald<br>      options:<br>        tag: moonfire-nvr<br><br>    restart: unless-stopped<br><br>    ports:<br>    - &quot;8080:8080/tcp&quot;<br>&quot;&quot;&quot; &gt; compose.yml<br>mkdir recordings<br>chown moonfire-nvr:moonfire-nvr recording<br></pre><p>now it’s time for configuration</p><pre>docker compose run --rm moonfire-nvr init<br>docker compose run --rm moonfire-nvr config</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXfepAcWbsoqwXIclg72tA.png" /></figure><p>create a directory under /recordings and then go to cameras and streams and add your IPCamera Credentials like the below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFmnMuHIdfWfAUfDDUNblg.png" /></figure><p>if your camera supports ONVIF you can add the ONVIF as well , so you can have the PTZ but my camera ONVIF is Insecure, so I’ve disabled that completely.</p><p>after that, create a user and set the permissions.</p><p>and it’s done you can now run the NVR</p><pre>docker compose up --detach moonfire-nvr</pre><p>if you open the port 8080 on your browser you can see all the recordings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4R8PugRIkPeb7rBeNgMo3g.png" /></figure><p>and Live Stream as well</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UQKv5Kcl7wzZyeqF423RWA.png" /></figure><p>So, That’s it!</p><p>Now you can add all your IP Cameras and turn your RPI into a Network Video Recorder.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f1cc58a8497" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reviving an Outdated IP Camera: A Journey Through Legacy Tech and Modern Solutions]]></title>
            <link>https://mroplus.medium.com/reviving-an-outdated-ip-camera-a-journey-through-legacy-tech-and-modern-solutions-671f8e3c7ac1?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/671f8e3c7ac1</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[cctv]]></category>
            <category><![CDATA[ip-camera]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[ffmpeg]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Fri, 21 Feb 2025 08:41:48 GMT</pubDate>
            <atom:updated>2025-02-21T08:41:48.255Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I acquired a Prolynx IP camera — only to discover it’s so outdated that it either requires a DVR or a Windows XP machine with ActiveX support to display its video feed. As someone with a passion for tinkering and reverse-engineering, I couldn’t resist diving in out of curiosity. Here’s the story of how I tackled this relic of technology, explored its quirks, and modernized its functionality using contemporary tools.</p><p>The Challenge: An Ancient IP Camera</p><p>The camera I purchased is a classic example of legacy IoT hardware. Its interface relies entirely on ActiveX, a technology that’s long been deprecated and unsupported on modern operating systems. When I tried to access the camera’s feed, I was greeted with a Windows XP-style interface prompting me to install ActiveX — or, more frustratingly, an updated version of it. Naturally, I didn’t have Windows XP or a DVR lying around, so I decided to get creative.</p><p>To investigate, I set up a virtual Windows XP environment using Hyper-V (Microsoft’s virtualization platform) and began capturing network packets to understand how the camera communicates. Here’s what I found:</p><ul><li><strong>Interface Glimpse</strong>: The camera’s web interface displayed a clunky, blue-themed control panel with options like brightness, saturation, and audio settings, all tied to ActiveX .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/0*r2SDpCJX5uxYzj-R" /></figure><ul><li><strong>Packet Capture</strong>: Using packet-sniffing tools, I uncovered that the camera streams video and audio over HTTP, with a poorly implemented protocol lacking proper RFC compliance . The packets revealed basic authentication and media data, but the implementation was far from secure or efficient.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*-GdEtVl1Hn80Nx1B" /></figure><p>This experience highlighted a common issue in IoT security: older devices often rely on outdated standards, making them incompatible with today’s systems and vulnerable to security risks.</p><p><strong>Diving Deeper</strong>: Analyzing the Protocol</p><p>The camera’s protocol was a mess. It didn’t properly adhere to HTTP standards, and the streaming mechanism was inefficient, relying on TCP-based communication for video and audio. I spent some time reverse-engineering the protocol, but as I dug deeper, I realized the effort wasn’t worth the headache. The nostalgia of working with such outdated tech reminded me of simpler times — like when I implemented the YMSG (Yahoo Messenger) protocol in just two days — but this camera’s quirks tested my patience.</p><p>Here’s what I learned about the protocol:</p><ul><li>It used a custom HTTP-based streaming approach, including video, motion detection, and audio data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/0*4XPub7qPibeBzYlt" /></figure><ul><li>The implementation lacked robust authentication, making it a potential target for unauthorized access.</li><li>The camera also supported RTSP (Real-Time Streaming Protocol), but only for one-way communication, despite claiming two-way capabilities.</li></ul><p>Modernizing the Solution</p><p>Since the ActiveX-based interface and HTTP streaming were impractical, I decided to leverage the camera’s RTSP support to bring it into the modern era. My goal was to stream the video feed via the web, bypassing the outdated client requirements. Here’s how I approached it:</p><ol><li>RTSP Streaming: I confirmed the camera supported RTSP, which is better suited for real-time audio/video streaming.</li><li>Web Integration: Since the camera only supported one-way communication, WebRTC (a two-way streaming protocol) wasn’t an option. I also noticed the output was already encoded in x264 (a modern video codec), so I didn’t need to transcode using MPEG-JS.</li><li>FFmpeg Magic: I used FFmpeg, the Swiss Army knife of multimedia processing, to convert the RTSP stream into HLS (HTTP Live Streaming). This format is widely supported by web browsers and mobile devices.</li><li>Node.js and Web Serving: Using Node.js and the fluent-ffmpeg library, I created a simple web server to execute FFmpeg, convert the stream, and serve the HLS files. I also integrated Cloudflare’s Zero Trust to securely expose the stream on a custom domain.</li></ol><p>The result? I now have:</p><ul><li>Full control over the camera’s functionality.</li><li>Live streaming accessible via the web.</li><li>Recorded output saved to my hard drive for later use (with custom rotation).</li></ul><p>You can check out the final setup <a href="https://github.com/MrOplus/mini-dvr-streamer">here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/0*Gn9yJCm7mS4-hi1-" /></figure><p>Lessons Learned</p><p>This project was a fascinating dive into the challenges of legacy IoT devices. Key takeaways include:</p><ul><li>Security Risks: Outdated devices like this camera often lack modern security features, such as strong authentication or regular updates, making them easy targets for hackers.</li><li>Creative Problem-Solving: By combining virtualization (Hyper-V), packet analysis, and modern tools like FFmpeg, I transformed an obsolete device into a functional part of my setup.</li><li>Patience is Key: Reverse-engineering poorly implemented protocols can be frustrating, but the satisfaction of a working solution makes it worthwhile.</li></ul><p>Conclusion</p><p>Reviving this Prolynx IP camera was a blend of nostalgia, technical challenge, and innovation. While the camera’s reliance on Windows XP and ActiveX is a relic of the past, modern tools like FFmpeg and Node.js allowed me to breathe new life into it. For anyone dealing with similar outdated IoT hardware, this approach — leveraging RTSP, HLS, and web technologies — can offer a practical solution.</p><p>If you’re curious about IoT security or enjoy tinkering with legacy tech, I’d love to hear your experiences in the comments below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=671f8e3c7ac1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Expose your local services like a pro]]></title>
            <link>https://mroplus.medium.com/expose-your-local-services-like-a-pro-cf8a1f874cdf?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf8a1f874cdf</guid>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[zero-trust]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Sun, 08 Dec 2024 14:21:41 GMT</pubDate>
            <atom:updated>2024-12-08T14:21:41.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SD9ooh1JNZMqLWSI.jpeg" /></figure><p>Have you ever wanted to expose your HTTP server, VNC, or even your RDP to the internet? You might think that a static IP address from your ISP is necessary, but you can use Cloudflare’s Zero Trust to achieve this instead.<br>First, point a domain to your Cloudflare account. Then, navigate to the <strong>Zero Trust</strong> section from the left menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*hbWBYWu0f0POXL8RgYsN-A.png" /></figure><p>Then navigate to Network &gt; Tunnels and create a new tunnel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*MtmQPSFfDvZ1Ec7ZLeeTOw.png" /></figure><p>Select Cloudflared tunnel type and choose a name for your tunnel.<br>now based on your Host OS download and install Cloudflared service :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b2ww1nxxbWOadnM9QiWf9g.png" /></figure><p>and wait until you see your tunnel connector in this section :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1wbfDFtak6fnj-f8ROVkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYJWd06H-lnkQkyNVS_hvg.png" /></figure><p>now you can expose all of your local host ports using your tunnel settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9eWU3X4JTm3BjldqpSqYg.png" /></figure><p>Now you can expose your localhost ports and all network ports accessible by your host machine to the internet. For example, if you have a Plex server running on http://10.20.30.40, you can use 10.20.30.40:port as the URL to redirect traffic from your subdomain to your host.</p><p>In this way, you can expose services like your IP camera, DVR, file server, media server, and many more to the internet. However, don’t forget to customize the security settings based on your needs. For instance, if you are exposing your IP camera or DVR to the internet, ensure you create an <strong>Application</strong> in the <strong>Access</strong> section for your service or service group and associate the appropriate policies with that application.</p><p>For example, I created an application for my ESXi server and attached a policy with the following rules:</p><pre>requires emails ending in : mydomain.tld<br>requires authentication method : otp</pre><p>Now, only people with an email address from my domain and who have enabled OTP can access my ESXi server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf8a1f874cdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Up and Running a Mail Server in 5 Minutes]]></title>
            <link>https://mroplus.medium.com/up-and-running-a-mail-server-in-5-minutes-4141ea7f09d1?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/4141ea7f09d1</guid>
            <category><![CDATA[dovecot]]></category>
            <category><![CDATA[mail-server]]></category>
            <category><![CDATA[postfix]]></category>
            <category><![CDATA[mailcow]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Wed, 12 Jun 2024 02:10:53 GMT</pubDate>
            <atom:updated>2024-06-12T02:10:53.630Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*pmgvhN6zaBYDa8hh" /></figure><p>I think creating and maintaining a mail server is one of the worst things that every single IT person wants to do. However, today I’m going to show you how you can make a mail server with an Administration GUI and a Mail Client in less than 5 minutes (or 2 minutes 😒).</p><p>Whenever you try to spin up a mail server, there are lots of things that you will encounter. If you work with Windows Server, you need to create an Active Directory, an Exchange Server, and spend many hours configuring the Exchange Server. If you work with Linux servers, you should be familiar with some software like Postfix, Dovecot, etc.</p><p>After all that, you have to set up your DNS servers to work with DKIM, SPF, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*vwocgsfzFPhOELHQYXPUwg.png" /><figcaption>That’s where the Mail Cow Moo’s in!</figcaption></figure><p>So, Mail Cow is a Dockerized mail server solution that contains:</p><ol><li>ACME : Auto SSL Certificates</li><li>ClamAV: Antivirus</li><li>DoveCot: IMAP/POP Server</li><li>MariaDB : Database Server</li><li>Memcached: Cache Server</li><li>Netfilter: Something Like Fail2Ban</li><li>Nginx: Web Server</li><li>Olefy: Antivirus</li><li>PHP</li><li>PostFix: Mail Transfer Agent</li><li>Redis: In Memory Storage</li><li>Rspamd: Spam Filter</li><li>SOGo: Mail Client Interface</li><li>Solr : Search Engine</li><li>Unbound : DNS Server</li><li>WatchDog : Monitoring</li></ol><p>All you need to run your own hosted mail server is a Public IP Address and a Domain Name</p><p>On your server (I use Ubuntu 22) first you should install docker<br>curl <a href="https://get.docker.com/">https://get.docker.com</a> | sh <br>Then you should clone the MailCow’s repo:</p><pre>cd /opt<br>git clone https://github.com/mailcow/mailcow-dockerized<br>cd mailcow-dockerized<br>./generate_config.sh<br>docker compose up -d </pre><p>That’s all! Your mail server is ready (almost). Now you can log in to your administration panel using the domain you provided at the config generation step. The default credentials are admin:moohoo .</p><p>Under the “Email” menu, go to “Configuration” and add a new domain. After that, if you click on the “DNS” button, all required/optional DNS records will show up. You need to add those records to your DNS server.</p><p>Now your mail server installation is complete, and you can create mailboxes/aliases.</p><p>you can now use the SOGo via Apps &gt; WebMail and use your email!.</p><p>Here is the Official Documentations of the MailCow project:</p><p><a href="https://docs.mailcow.email/getstarted/prerequisite-system/">https://docs.mailcow.email/getstarted/prerequisite-system/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4141ea7f09d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mesh VPN using Zero Trust]]></title>
            <link>https://mroplus.medium.com/mesh-vpn-using-zero-trust-ec7405d86e4b?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec7405d86e4b</guid>
            <category><![CDATA[mesh-networks]]></category>
            <category><![CDATA[zero-trust]]></category>
            <category><![CDATA[cloudflare]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Mon, 19 Feb 2024 00:11:09 GMT</pubDate>
            <atom:updated>2024-02-19T00:11:09.005Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xkk-F14YFp5i7t-K.png" /></figure><p>Cloudflare’s Zero Trust (previously known as Argo Tunnel) enables companies and individuals to connect their sites to each other using Cloudflare’s secure network. It’s free for the first 50 users (which means even small-sized companies can use it for free).</p><p>In this scenario, we are going to connect two different sites that are behind NAT/Firewall with no Static IP Address to each other. It’s completely easy.</p><p>First, we need to establish a secure tunnel to Cloudflare from our sites, which means we need a machine to run the Cloudflare agent. I’ve used a Raspberry Pi as the tunnel agent, but the agent can be installed on any kind of machine with x86/arm CPU. To install the agent, we need to add the Cloudflare repo to the apt source list.</p><pre>curl -L https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-archive-keyring.gpg &gt;/dev/null<br>echo &quot;deb [signed-by=/usr/share/keyrings/cloudflare-archive-keyring.gpg] https://pkg.cloudflare.com/cloudflared $(lsb_release -cs) main&quot; | sudo tee  /etc/apt/sources.list.d/cloudflared.list<br>sudo apt update<br>sudo apt install cloudflared</pre><p>Now, we need to create a tunnel in cloudflare, that can be created via Networks &gt; Tunnels.<br>After creating the tunnel, you have to install the cloudflared service using following command:</p><pre>sudo cloudflared service install &lt;TOKEN&gt;</pre><p>if you completed the steps correctly you have to see your connectors as healthy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cgkqNX01wENcmexhH5w_vg.png" /></figure><p>after creating both tunnels for both sites now we have to configure the routes.</p><p>we have two subnets:</p><ol><li>192.168.1.0/24 — Home</li><li>192.168.2.0/24 — Work</li></ol><p>so, we need to all traffics those points to 192.168.1.0/24 via Home and all traffics those points to 192.168.2.0/24 via Work just like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SZpG-7aBoFk8tub9bhs7Kg.png" /></figure><p>after creating both routes now it’s time to configure the device enrollment policies and routing exclusions.</p><h3>Device Enrollment And Routing Settings</h3><p>to enroll devices, we need to define an enrollment policy which can be defined under Settings &gt; Warp Client &gt; Device enrollment.</p><p>I’ve created a policy that forces all users to have a @mydomain.com email address:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Z0ejdZoDTX8rXZu2R6PYQ.png" /></figure><p>but still there is a problem, in Zero Trust’s default routing exclusion policy, 192.168.0.0/16 is excluded so all routes to this subnet being bypassed but there is a way, we have to delete those exclusions from the exclusion list via: Settings &gt; Warp Client &gt; Device Settings &gt; Profile Settings &gt; Split Tunnels</p><p>Now, we have the enrollment policy, route exclusion, and we are ready to go. all we need now is to install Warp Client and Sign in to our Cloudflare’s team domain. which can be done via Warp Client &gt; Preferences &gt; Account &gt; Login With Cloudflare Zero Trust</p><p>after that your Warp Client theme should be changed to Zero Trust</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*-EFRwvpHcXQlw8EGhJdALA.png" /></figure><p>after connecting to our Team’s Zero Trust, if we open our Home’s router page via 192.168.1.1we can verify that the routing is working:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zW-CRz9fo3eCymYfyt6sqg.png" /></figure><p>if the routing was not working we have to enable Proxy (and Warp to Warp if you want to establish warp gateway on your Mikrotik Device) via Cloudflare Zero Trust &gt; Settings &gt; Network &gt; Firewall &gt; Proxy</p><p>Now Using Cloudflare we can access to both networks and even route whole traffic via one of our tunnels using 0.0.0.0/0 CIDR.</p><p>we can even expose our services behind the NAT to the Internet for free and of course with free SSL thanks to Cloudflare.</p><p>to expose our internal services, we need to create a Public Hostname under our related tunnel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ga3IHaTx5QOn7LV6_NTxUg.png" /></figure><p>Now we can access our private network’s hosted service via our subdomain, easy, right? But is that even secure? It’s publicly available to everyone. Let’s make it more secure.</p><p>All we need to do is create an application under Zero Trust Access. First, let’s make an Access Group with your desired criteria, similar to a device enrollment policy. Then, create an application and select Self Hostedas the Application Type. Enter the application name and the related subdomain/domain.</p><p>If you create the application with *.domain.tld, you can reuse that application later when you create a public hostname for your domain and protect your L7 hostname using the same application.</p><p>If you create a hostname with SSH/VNC type, you can enable browser rendering for your hostname while creating its related application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec7405d86e4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evading Captive Portal Story (Part 1)]]></title>
            <link>https://mroplus.medium.com/evading-captive-portal-story-part-1-1eee5f94d019?source=rss-32b4aa34aa19------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eee5f94d019</guid>
            <category><![CDATA[wifi-security]]></category>
            <category><![CDATA[captive-portal]]></category>
            <category><![CDATA[wireless-network]]></category>
            <category><![CDATA[wifihacking]]></category>
            <dc:creator><![CDATA[//DivByZero//]]></dc:creator>
            <pubDate>Fri, 05 Jan 2024 21:57:13 GMT</pubDate>
            <atom:updated>2024-01-05T21:57:13.907Z</atom:updated>
            <content:encoded><![CDATA[<p>When I traveled for vacation, my hotel asked for 20 bucks for internet access. I wondered why I should pay for a service that should be included in the hotel amenities. So, I started searching for possible ways to evade the Captive Portal.</p><p>There were some methods, such as running an Evil Twin (part 2) or Mac Spoofing (part 3), but I decided to explore better options, like gaining access from the router/AP or bypassing the HTTP proxy server mechanism.</p><p>While scanning the router for information gathering, I discovered that the DNS server was forwarding DNS records to the internet! This means we can obtain DNS data without authentication — perfect!</p><p>Now, all I need is a way to proxy data over DNS. Let’s get our hands dirty. There’s a project called <a href="https://github.com/yarrick/iodine">Iodine</a>, With Iodine, you can send and receive data over DNS to your server.</p><p>To use iodine you need a domain, and two DNS records on your domain.</p><pre>TYPE  HOSTNAME  VALUE<br>A     tunip     YOUR_SERVER_ADDR  <br>NS    tun       tunip.domain.tld</pre><p>Now all we need to do is install Iodine on the server and connect to it using our client. I’ve used Ubuntu as the server.</p><pre>apt update &amp;&amp; apt install iodine<br>sudo iodined -f -c -P YourSecurePassword 10.0.0.1 tun.domain.tld</pre><p>to check your iodine server setup, you can use the following URL <a href="https://code.kryo.se/iodine/check-it/">https://code.kryo.se/iodine/check-it/</a> .<br>once the server setup got finished, now it’s time to setup the client side (Windows in my case)</p><pre>iodine.exe -f -P YourSecurePassword tun.domain.tld</pre><p>Once the connection setup was completed now you can access to your server via 10.0.0.1 to access your proxy server or use SSH for the SSH Tunnel.</p><p>now I’ve got connected to internet using my SSH Tunnel using following command:</p><pre>ssh -D 9090 root@10.0.0.1</pre><p>Notes for windows users: <br>if you are using windows, you might need the TUN/TAP driver (that you can download it via OpenVPN website)<br>on windows you may get different address for your tap driver sometimes, so you should check your tap driver IP address manually.<br>if you have WSL already, it’s much better to use iodine under WSL and expose the service to the host.</p><p>On Next part I will tell my story about the Hotel Evil Twin.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eee5f94d019" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>