12 ms·
Extracting firmware from embedded devices [pdf]
- spreadnode 6y agoIf you can get a shell and it has some sort of network connection I've had success with just moving /dev/mtdblockX off with tftp/ftp/curl/wget etc. Then you can just extract what you need with binwalk or your preferred tool.
- undecisive 6y agoI've got a bunch of broadband / wifi routers that I've been itching to have a go at - this is very useful info on equipment needed and first steps!
- officialchicken 6y agoaka "Find the JTAG" and upload someone else's precompiled firmware, it's way better than root access and just as safe in the hands of a novice!
- raxxorrax 6y agoI would guess standard programming interfaces to be deactivated and further programming happening only through a bootloader. Don't actually know if that is common practice, but that is how I learned it. Some smaller MCU have alternative pin functions for the SPI/JTAG pins.
- woodrowbarlow 6y agosometimes. less often than you'd think.
- Tarragon 6y agoA lot of embedded programmers don’t come to it in any formal way. They’ll make it to shipping a product without ever having heard about the idea of blowing the security fuses. For those that do know to do it it’s different. Before you blow the fuses you need to to be damn sure of your bootloader and that you will never want to debug something in the field. A lot of companies don’t give you the time before putting it into production. Then once it’s in production you work on the next product instead of hardening the last one.
- pantalaimon 6y agoIt's also a big hassle and if you have nothing to hide, why go through the effort?
- acka 6y ago(Supposed) FCC regulations[0]. To prevent users from using non-compliant firmware on their devices, i.e. locked bootloader which will only boot OEM-supplied signed firmware. [0] https://www.wired.com/2016/03/way-go-fcc-now-manufacturers-locking-routers/ https://www.wired.com/2016/03/way-go-fcc-now-manufacturers-l...
- blutack 6y agoSigrok/Pulseview is also compatible with that fake Salae logic analyser hardware if you want an open source solution. https://sigrok.org/wiki/MCU123_Saleae_Logic_clone https://sigrok.org/wiki/MCU123_Saleae_Logic_clone
- zwieback 6y agoDidn't know there were Salae clones. The original is awesome (we have many of them) but a bit pricey. I use the newer mixed-signal one all the time, the EE's sometimes won't believe when you just show them digital traces but if you can show mixed signal that goes farther.
- joezydeco 6y agoDigilent's Analog Discovery 2 is my new Saleae. It has all the usual protocol analysis stuff but also has more built-in goodies like a terminal and scripting tools. On top of that you get a lot more analog thingies including voltmeters, voltage supplies, and waveform generators. And APIs! Python and LabVIEW... https://store.digilentinc.com/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply/ https://store.digilentinc.com/analog-discovery-2-100msps-usb...
- deleted 6y ago[deleted]
- antoniuschan99 6y agoI got a cheap logic analyzer (salae-like clone) and used sigrok this summer to debug a bug (took a week and turns out I never actually turned on the component from the gpio). Trying to match the SCL and SDA lines to the datasheet was a great. Want to get an oscilloscope next :)
- dokem 6y agoWhen it comes to scopes do your self a favor and get a real one from eBay and don’t muck around with the home brew stuff.
- linker3000 6y agoShameless plug for a low-cost JTAG/SPI/UART/I2C tool/platform (works with OpenOCD etc.) if you don't mind ordering your own PCBs & components and doing a bit of soldering (Well, you ARE all hackers...) https://github.com/linker3000/shukran https://github.com/linker3000/shukran
- omgtehlion 6y agoNo way I will touch any FTDI device after the mess they did ~5 years ago...
- Randor 6y agoI would not recommend opening the linked PDF file. The link above to the PDF file is causing a BSoD on my fully patched Windows 10 sandbox. I've tested it three times, firing up WinDbg to see if I can locate the cause.
- raxxorrax 6y agoAnd the author knows about hacking hardware! Cannot confirm this however, I am still on 1903 though.
- deleted 6y ago[deleted]
- taneq 6y agoWhat are you opening it in?
- Shared404 6y agoDo not know what GP is opening it in, but it appears to be causing issues for GitHub's renderer.
- wltprgm 6y agoThe last time I opened a pdf file in Chrome/Firefox in Github PDF renderer, the computer ran out of RAM. The pdf file I opened definitely didn't require so much RAM at all. Alternative solution: download and open it locally
- chrisstan 6y agoPDF works fine with chrome browser internal pdf viewer.
- jve 6y agoWin 10 v2004 and Chrome viewer works. Also saw first 2 pages listed on github before I hit download.
- cptnapalm 6y agoI have an old IBM mainframe which has a card only known as the Camel Card. There's practically no information about it beyond that it exists. Having looked at the chips on it, there does seem to be an FPGA on it. What sort of equipment and software would be needed to extract that?
- gvb 6y agoYou need to provide more information before your question can be answered (if it can be answered): * Chip manufacturer (Xilinx? Altera? Other?) - typically a logo on the chip. * Chip part number (typically the first row of letters and numbers on the chip - typically the second row is the date of manufacture in the form YYww where ww is the week of manufacture - all numbers are useful) Is there a 10 pin or 14 pin header near the chip? If so, check for power and ground on the appropriate pins for a standard JTAG pinout. https://www.google.com/search?q=jtag+connector+pinout https://www.google.com/search?q=jtag+connector+pinout If the card has a clearly identifiable JTAG connector and is a common FPGA, you should be able to look up the chip part number on the manufacturer's web site and find the software tools that support that chip. You will need to figure out which JTAG interface the tool set supports - if it is a newer toolset, it probably supports a relatively inexpensive USB-attached JTAG. If it is an older toolset, it may need a specific, often expensive and likely no longer available JTAG interface.
- cptnapalm 6y agoI seem to remember that it is an Altera FLEX 10K; I did scribble it down in a notebook. Thank you for common date information to look for. The machine was released in 1999, so I'm going to assume very much "older".
- pjc50 6y agoBad news: even if you get the bitstream out, there isn't full reverse engineering of what it means for anything other than a few Lattice Semiconductor parts. But the required steps would be to identify how it loads the bitstream by looking at the pins which control this. Quite often this is from an external SPI device. That can simply be read out with e.g. "bus pirate" device. Otherwise, a suitable JTAG may give you access.
- rootsudo 6y agoGreat info and PDF - matches what I know and did not know about the picobus!
- mobilio 6y agoIf you're interested here are next steps: 1) Flash layout https://openwrt.org/docs/techref/flash.layout https://openwrt.org/docs/techref/flash.layout 2) Bootloader https://www.denx.de/wiki/U-Boot https://www.denx.de/wiki/U-Boot
- the_only_law 6y agoI've tried my hand at hardware hacking a few times only to hit dead ends. Most recently I wanted to dive into a minor security vulnerability and some other oddities I found in the web interface of a cable modem by trying to get OS access. The details were a bit fuzzy, but I easily identified a UART, however sniffing it wasn't giving me much. There didn't ever appear to be a shell and mostly it was just outputting diagnostic info like channel bonding attempts. I couldn't manage to figure it what exactly it was running. Some things pointed to a stripped down Linux, some pointed to a custom OS (including a strange Chinese github repository that was probably less than legal) and some very weeks hints pointed to something like VxWorks, but i don't remember the UART ever given any sort of boot information. I tried to use a bus pirate to dump the flash a few times but always came up with a bad image. On an interesting note, this was the first time I saw a real life MIPS device though. There were also what looked like a few different UARTs but only the one had any data coming off it. Eventually I got a little to liberal poking around with a multimeter and shorted something, killing the device. I'm just really bad with this stuff in general I guess lol. This was just a cheapo cable modem, so if I ever want to pick up again I just have to order a new one of the same model and try to remember the tools. I do have other devices I need to investigate however, that would be expensive or near impossible to replace if I killed them. I'm mildly worried about doing much with those for the time being.
- bobberkarl 6y agoI`m trying to extract/replace the firmware of an old Harman Kardon Receiver. How can i go around it?
- lxe 6y agoVery fun writeup! I'm getting back into hardware, and things like finding UARTs and JTAG pins feels like Hollywood-style hacking. Love reading articles like these.
- pjbk 6y agoFunny how JTAG these days is synonym with in-circuit debugger. The original use of the port was to support IC interconnect testing, and for high density boards it still is. For external parallel and serial memories you can use the boundary scan registers to bit bang the pins and read the inputs. In fact, that was a popular way to program external memories on fresh boards if they didn't come with embedded bootloaders. Even if you don't have the scan configuration file of a particular chip for your tool, they are very standard and easy to figure out. No desoldering required!
- monocasa 6y agoIt kinda makes sense though. The expansion from boundary scan to debug is just extending the scan chain to all the flip flops in the random logic too, not just the one's controlling the pads.
- dialamac 6y agoThat’s a bit of a stretch though... jtag for ice/debug at that point just becomes another serial bus interface with a high level protocol controller.. you’re not literally extending any scan chain in most cases. The jtag port was coopted for this purpose simply for the pragmatic reason that it’s a good use of pin real estate.. nothing more.
- monocasa 6y agoThose high level protocol controllers came later to speed the process up and allow debug without exposing ridiculous amounts of IP to the debugger vendor. Originally it was just access to the full internal scan chain.
- dialamac 6y agoIt’s a little more to it than that... I think you are severely understating the necessity of “speeding up the process.” IP concerns aside, an internal scan chain may still not give you features such as practical monitor mode debugging with any useful level performance. The point is, debugging in general is better served by dedicated hardware, at that point putting it on the jtag bus vs any other serial bus is more a basic pragmatic issue.
- garfieldnate 6y agoMy dream would be to know enough to be able to reverse my favorite electronic device, a Casio Ex-Word dictionary. I uploaded some PCB pictures here: https://electronics.stackexchange.com/questions/522340/unknown-component-in-an-electronic-dictionary/522344?noredirect=1#comment1344263_522344 https://electronics.stackexchange.com/questions/522340/unkno... It's such an advanced piece of equipment, and I'm unable to find most of the components listed on it, plus the major processors are under epoxy blobs. I feel totally overwhelmed just looking at it and not knowing where to start. I wish I could have an expert examine the device with me in real life and help me walk through it a bit; using random bits of online resources still leaves me feeling lost. I would love to have a resource that teaches elements of hardware hacking step-by-step by reverse engineering cheap electronics I can get my actual hands on, starting with simple and moving on to complex items.