A 1-day reverse-engineering story

Bypassing Molekule's
NFC Filter DRM

Lorenzo Rizzotti · dreaming.codes

Bounty by fulu bounties

Who am I?

Lorenzo Rizzotti

21 · full-stack dev · CS @ UC Riverside

  1. 5 first computer
  2. 7 first code
  3. 9 Minecraft mods
  4. 16 freelance dev
  5. 20 UC Riverside
  1. ? Neuralink 😉

The problem

Molekule's purifiers used to work fully with any filter.

A firmware update added an NFC check that locked the smart features behind first-party filters.

Bounty rule: the fix must work without specialized tools.

My question

Hypothesis

Part 1

Hardware

Step 1: open it

Molekule teardown

What I found

SWD header

photo: FCC filing

ARM Cortex SWD

VCC 1
GND 3
GND 5
KEY 7
GND 9
2 SWDIO
4 SWCLK
6 SWO
8 NC
10 RESET

Improvise

· No proper SWD probe.
· A Raspberry Pi Pico in a drawer.
· So I flashed it as one. (debugprobe firmware)

Aside — two chips, not one

STM32F413VHT6 internal flash · code · what I dumped
MXIC MX25L1606E external SPI NOR · 2 MB · curiosity

Sitting right next to the MCU. Not needed for the attack. But I was curios to know what was inside

Reading external flash through the MCU

QUADSPI peripheral on the F413
maps the external flash into the CPU address space at 0x9000_0000 if operated in memory mapped mode

So from SWD's perspective, the second chip looks like regular memory.

Halt → dump_image → done

What was inside

What was inside

AWS IoT Core

Part 2

Traffic

Goal: see the traffic

The device speaks MQTT over TLS.

I want to be the man in the middle.

TLS interception

Locate the trust anchor

That's the trust anchor.

Forge + splice

Device's root of trust is now mine.

Write it back

Rogue AP + redirect

Same CA in the firmware and in the proxy → handshake succeedswe read every request in plaintext.

What I saw

The pivot

Part 3

App

Same rig, new target

I already had the MITM stack from before.

Install my CA on the phone.

Connect the phone to the network.

App says no

MITM up. Phone routed. App refuses to connect.

Frida gadget — step by step

The hook

Gadget is in-process. Now replace pinning methods with no-ops — before the first HTTPS call.

TLS handshake against my CA succeeds → app traffic in httptoolkit.

What the app talks to

What's in the messages

Try the cheapest patch first

Now make it permanent

Inside

Plain minified JS. Not Hermes.

Make it readable

Find the boolean in the bundle

Results

Outcome

Relevant skills

teardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmission
teardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmission
teardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmission
teardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmissionteardownsolderingARM Cortex-MSTM32SWD probingOpenOCDpicoprobefirmware dumpQUADSPI memory-mapped flashbinwalkOpenSSL / x509 DERcert swapbinary patching (dd)stringsreverse engineeringprotocol analysisMQTTAWS IoT CoreTLS interceptionMITMrogue Wi-Fi APhostapddnsmasqiptableslinux networkinghttptoolkitwire rewrite rulesdevice shadow analysisAndroid REAPK unpackapktoolsmali editingapksigneradbcertificate pinning bypassFrida gadgetOkHttp / TrustManager hooksReact Native / MetroJS deobfuscationPrettierHermes REpatchsubmission

Sole author.

What I'd do differently

Why Neuralink?

Q&A

Hardware MQTT trust boundaries §1201