TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to MITM SD-Card?

10 pointsby sudonanohomeabout 1 year ago
Hi HN!<p>I own a small industrial automation business (Europe). Enshittification is reaching to us as well. We recently signed a contract to supporting a business of using new piece of automation hardware that can only store its state on SD cards. The hardware is VERY proprietary and exposes no APIs. SD card writes ain&#x27;t handled properly and files often get corrupted after power outages. My operators are diving around to clone SD cards and replace them all day. This is maddening. Contract is very attractive for the company so I would like to solve this on our own. We did our best to reach out to the manufacturer and they plainly deny any wrongdoing and refuse to fix their bugs (we are too small company to care).<p>So after a quick brainstorming with my engineering team, we discovered these wifi-enabled SD card products. They are all positioned at the photographer market segment and wifi interface is only accessible when manipulating files directly. We want to spin up our own product that would enable remote wireless upload of files on SD card. This way we can use git of controller&#x27;s state, remotely update controller even without APIs and so on.<p>We don&#x27;t need it to be compact and fit into sd card slot. My engineer is working on ESP32 based solutions where we use a MUX to switch SD between the controller and ESP. This unfortunately disconnects SD from controller and raises alarm, which is a problem. We know how to disable the alarm, but I would prefer we don&#x27;t.<p>I&#x27;m sure HN can recommend a better existing product or better architecture to develop.<p>Thanks!

6 comments

vitovitoabout 1 year ago
If the relative reliability of the SD card is an underlying cause (e.g. tons of writes wearing them out early causing corruption) you might also consider eMMC chips on SD card adapters. A discussion here: <a href="https:&#x2F;&#x2F;jamesachambers.com&#x2F;emmc-to-sd-card-adapters-explained&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jamesachambers.com&#x2F;emmc-to-sd-card-adapters-explaine...</a>
h2odragonabout 1 year ago
<a href="https:&#x2F;&#x2F;hackaday.com&#x2F;2022&#x2F;08&#x2F;08&#x2F;automated-microsd-card-swapping-helps-in-embedded-shenanigans&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hackaday.com&#x2F;2022&#x2F;08&#x2F;08&#x2F;automated-microsd-card-swapp...</a><p><a href="https:&#x2F;&#x2F;hackaday.com&#x2F;2014&#x2F;06&#x2F;08&#x2F;the-in-circuit-sd-card-switch&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hackaday.com&#x2F;2014&#x2F;06&#x2F;08&#x2F;the-in-circuit-sd-card-switc...</a><p>more links: <a href="https:&#x2F;&#x2F;hackaday.io&#x2F;project&#x2F;19783-sd-card-emulation" rel="nofollow">https:&#x2F;&#x2F;hackaday.io&#x2F;project&#x2F;19783-sd-card-emulation</a>
评论 #40190667 未加载
toast0about 1 year ago
Seems like it&#x27;s worth considering UPSes for the controllers as well? Depends on the details of the power outages, and the draw of the controllers, and if the controllers handle the equipment being unpowered even though the controller is.
b20000about 1 year ago
you need to use high quality sd cards such as sandisk extreme pro<p>also think about putting the machinery on some kind of UPS or backup power supply so it can be shut down properly
评论 #40205268 未加载
Nextgridabout 1 year ago
Some of the Wi-Fi enabled SD cards you&#x27;re mentioning (older models by now, but might still be available on eBay &amp; stuff) can be rooted and you can get a shell. Example: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;deckar01&#x2F;6d9b76bdef21eaab0568" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;deckar01&#x2F;6d9b76bdef21eaab0568</a> (I&#x27;m sure there are more models that are vulnerable to similar attacks)<p>One thing I would suggest keeping in mind with any kind of interference (regardless of how stable it is and how well it adheres to the SD spec &amp; maintains data integrity) is that if something happens to&#x2F;with the machinery this controller is handling, your modification can easily be blamed by the vendor, even if your modification isn&#x27;t actually at fault and it&#x27;s the vendor&#x27;s shitty software that&#x27;s at fault. The risk is double considering it doesn&#x27;t even seem to be able to manage not corrupting a standard SD card.
评论 #40190757 未加载
fuzzfactorabout 1 year ago
No MITM from me.<p>You&#x27;ve got some good advice from professionals.<p>My experience as a user may be something to consider.<p>There can be a big difference in performance between different kinds of SD cards, and especially the way they are formatted.<p>For one thing there is the SD Association, and their ever-evolving specs as well as their own proprietary (!, from Tuxera apparently since 2017) ever-evolving formatting tool available for download free on their website.<p><a href="https:&#x2F;&#x2F;www.sdcard.org&#x2F;downloads&#x2F;formatter&#x2F;faq&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.sdcard.org&#x2F;downloads&#x2F;formatter&#x2F;faq&#x2F;</a><p>Lots of users are not aware of this.<p>Still uses &quot;regular&quot; FAT32 for sizes from 2GB to 32GB, and exFAT from 32GB upward.<p>This can be good for things from manufacturers that might be expected to conform to the specification as it was at the time, whether intentional or not.<p>Sometimes it is worthwhile to compare the factory card layout&#x2F;format (and back it up for possible reinstatement) against that obtained after using various alternative formatting tools. Many times a subsequent tool will mimic the layout of the previous format unless the medium is zeroed or cleaned before re-partitioning &amp; re-formatting.<p>Also, for some hardware having limited software capabilities like cameras, it can be best to partition, format, and error-check using a full PC in a repeatable way before or after storing material on the SD card. OTOH, sometimes the only way a camera will access a card is if it is formatted on-board using it&#x27;s own simplified algorithm, after which it may or may not be able to be read or written by all PCs. You should be able to select your partitioning tools and formatting tools independently from each other for each type hardware, filesystem and application. Not always true in practice.<p>In some of these cases one strategy that sometimes seems best (and could be considered along the Windows mainstream) is to use recent Windows to Clean &amp; partition and format the drive. Especially for FAT32 or NTFS use. A built-in card reader on something like a laptop can be ideal. Or it can be garbage. For even more reliability with FAT32, you might go as far as booting to the DOS from W98SE to reformat &#x2F;quick which in DOS also allows you to fully label the volume. This may not actually be &quot;quick&quot; if you don&#x27;t have a rapidly-bootable DOS USB stick handy (or if your floppy has too many cobwebs), but generally you get the full 20th century FAT32 shebang like nothing ever since, with backup boot sector to boot, and with &#x2F;quick, it doesn&#x27;t start from scratch. The DOS Quick format (if it can) will be overlaid on the existing 21st century FAT32 layout that Windows 11 (or some other 21st century formatter) thinks is optimized for the media these days. So FAT32 pre-formatted on NT6 (or something), rather than having DOS try to figure it out on virgin solid-state media. Then finish it off by reformatting Quickly in DOS. That&#x27;s why they call it FAT32 ;)<p>For Windows users other than employing exFAT for larger drives, it can also be good to try putting 2 or more partitions on an SD card, the first a 32GB FAT32, followed by an NTFS volume(s) taking up the remainder of the drive. Or even a number of 32GB volumes, FAT32 or otherwise. Now that Windows 10&#x2F;11 has been able to access more than just the first partition on a removable drive.<p>Also, one investigative tool you may find interesting is called flashbench. It&#x27;s a little bit arcane and did what it was supposed to do years ago, hasn&#x27;t been updated since.