By INIT_6
Hardware Hacking 101...
Introduction
INIT_6:
Disclaimer….
Hack responsibly, Hack only things that belong to you or have written permission. Even then check if you are allowed to by your government. In addition, some companies are sue happy, so be careful.
Especially with hardware hacking always assume you are going to break it. If you can’t afford throwing it out of a window on 635 (don’t thats littering) don’t mess with it.
Goals
Introducing basic hacking techniques:
UART - Universal Asynchronous Receiver-Transmitter
UART is a computer hardware device for asynchronous serial communication in which the data format and transmission speeds are configurable.
The electric signaling levels and methods are handled by a driver circuit external to the UART. A UART is usually an individual (or part of an) integrated circuit (IC) used for serial communications over a computer or peripheral device serial port.
One or more UART peripherals are commonly integrated in microcontroller chips.
UART Connection
UART Connection Settings -- 115200 8N1
JTAG - Joint Action Test Group
JTAG implements standards for on-chip instrumentation in electronic design automation as a complementary tool to digital simulation.
It specifies the use of a dedicated debug port implementing a serial communications interface for low-overhead access without requiring direct external access to the system address and data buses.
The interface connects to an on-chip test access port (TAP) that implements a stateful protocol to access a set of test registers that present chip logic levels and device capabilities of various parts.
JTAG Connection
TDI (Test Data In)
TDO (Test Data Out)
TCK (Test Clock)
TMS (Test Mode Select)
TRST (Test Reset) optional.
SPI - Serial Peripheral Interface
SPI is a synchronous serial communication interface specification used for short distance communication, primarily in embedded systems. Typical applications include Secure Digital cards and liquid crystal displays.
SPI devices communicate in full duplex mode using a master-slave architecture with a single master. The master device originates the frame for reading and writing. Multiple slave devices are supported through selection with individual slave select (SS) lines.
Sometimes SPI is called a four-wire serial bus, The SPI may be accurately described as a synchronous serial interface, but it is different from the Synchronous Serial Interface (SSI) protocol,
SPI Connection
SCLK: Serial Clock (output from master)
MOSI: Master Output Slave Input, or Master Out Slave In (data output from master)
MISO: Master Input Slave Output, or Master In Slave Out (data output from slave)
SS: Slave Select (often active low, output from master)
Firmware
Firmware is a specific class of computer software that provides the low-level control for the device's specific hardware. Firmware can either provide a standardized operating environment for the device's more complex software or, for less complex devices, act as the device's complete operating system, performing all control, monitoring and data manipulation functions.
Typical examples of devices containing firmware are embedded systems, consumer appliances, computers, computer peripherals, and others. Almost all electronic devices beyond the simplest contain some firmware.
Firmware - Why would you want it?
Firmware - How To Obtain It
Hardware
JTagulator - Bruteforce pins looking for possible jtag connections. $200
Buspirate - Supports SPI, UART, 1,2,3-Wire, etc. $30
SHIKRA - Supports SPI, JTAG, UART $45
OSEPP FTDI - Supports UART $15
Saleae - Logic Analyzer $400 - $1,000 ( up to $10,000)
Oscilloscope - Analyze signals $100 - $20,000
Hardware Extras
Caliper - For detailed measurements $40
Digital Multimeter - Read voltages, Continuity, etc $10 - $100+
Soldering iron $40 - $200 (Get one with replaceable tips and power control)
Jumper wires - Male-to-Male, Female-Male, Female-Female $10
breadboards, solder, flux, desoldering braid, tweezers, masking tape ~$20
Screwdriver - with security bits, torx, start, etc ~$50
Solder or Not to Solder
Connectors
SAM8116-ND - For AT&T Routers
SOIC clips - Clip onto chips directly
Bed Of Nails - “Pogo” pins
Bed Of Nails - “Pogo” pins
Software
OpenOCD - JTag software
minicom/screen - To connect to devices
Binwalk - Firmware Analysis Tool
Flashrom - a utility for identifying, reading, writing, verifying and erasing flash chips.
Cross-Compiler - For creating executables for your target system.
grep/xxd/hexedit/sed/awk/etc
Resources
Resources
Identifying Interfaces: External
Examples of External Interfaces
Examples of External Interfaces
Examples of External Interfaces
Identifying Interfaces: Internal
Examples of Internal Interfaces
Examples of Internal Interfaces
Examples of Internal Interfaces
Examples of Internal Interfaces
Examples of Internal Interfaces
Examples of Internal Interfaces
Examples of Internal Interfaces
Hacking the AT&T router.
U-Boot
****************************************************************
****************************************************************
************************$
U-Boot 1.3.3(8.99.57.502881) (Aug 21 2014 - 02:40:44)
CPU: Broadcom BCM63268 v8.0 64 kB I-Cache 32 kB D-Cache
BOARD: Pace Broadcom BCM63168D0
DRAM: 256 MB
Clearing heap 4259840 bytes from 8fb84000 to 8ff94000
NAND: BCMNAND: Bootcfg=40000001 Cfg=15142200 CsAndNor=0 Base=0 Acc=f7001010 Id=ecf10095
BCMNAND: System strap=1fff5bf 2048,11,1
BCMNAND: NAND: AccControl=f7001010
BCMNAND: Nand Part Name: Samsung K9F1G08U0{A/M} LP
BCMNAND: size=128MB, block=128KB, page=2048B, spare=64
BCMNAND: Init done: 0
OOB[1/131072]ff ff cf 69 ff ff 99 a6 42 6f 6f 74 43 6f 64 65
OOB[2/262144]ff ff 96 ff ff ff 3 f 42 6f 6f 74 43 6f 64 65
OOB[3/393216]ff ff cf 0 ff ff f ff 42 6f 6f 74 43 6f 64 65
OOB[4/524288]ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
OOB scan: Found pattern mismatch at 4/524288
Fixed up MTD partition to mtdparts=mtd-0:524,288(loader),1,048,576(mtdoops),-(tlpart)
OpenTL: Going to add mtd partition tlpart
Creating 1 MTD partitions on "nand0":
Creating 1 MTD partitions on "nand0":
0x00180000-0x080 00 000 : "tlpart"
OPENTL: add_mtd for tlpart
nflaattach: pages per unit=64 shift=17 sectors_per_page=4
TL_debug: before mount mediasize=64768 size=64768 partiton 0 to 1012 spares=85
Adjusting virtual blocks 1012 to account for 30 bb blocks
Adjusting virtual blocks 982 to account for 1 stat blocks
resetting statsBlock statistics Num Used=1007 Num Free=5 Bad=0
TL_debug: after mount stat_blocks=1 virt=982 head_pages=1
geometry wasted 252 sectors
nand_geom: cap=251132 cyl=980 nhead=16 nsectors=16
OPENTL: Found new opentla
OpenTL: get_dev hook called
Ground out the Flash NAND Chip Data out
Dumping the Firmware
#!/bin/bash
i=0
while :
do
printf "nand dump %x\n" $i > /dev/ttyUSB0;
sleep 1;
i=$(($i+2048));
done
Sprinkle a little Magic
Lots of ‘sed’ commands cleaning up the minicom NAND dump.
Then a couple tries of using xxd to get the data to binary.
Then lots of binwalk magic. Then some dd manual extraction and back to binwalk then some openssl.
Of course lots of google searches
The LOOT!!!!
root:$6$/z.UcPQG97QWFJsL$.T/mo4akJRnLYsSZGRaqm8zmpcmMOz55Ld48m5udtYUPZklSe8jq5E8WbryW6mDnF.D05FJxVf0nsAp0JsD8t1
root:$6$k1zVhu1pxS98iHZQ$79mbio8cbDg1hFPrSVicv3suoY2dQVDDAoyaBdytDsydySrr3KCpvSF8d7H9t71p7qTJiay/pA4kyXllr9UHf0
root:$1$5zGvtsff$OB4a1jpuQ9tSxAhrcN2tc1
root:$1$LXs4rDvW$l.YK/hPrC/.WbArp34kcZ0
root:$1$dfadif91$Q5FtHoUn91vcZWTIH7KRJ/
More Loot!!!
adm - base64:UdkvPYjKWN1hl2xhJMx3WA==
dslf-config - base64:o/2Qz2bEiJtpV7d3hjB8HA==
dslf-reset - base64:98x0toxtKqBthqmfl8tKig==
Several Certs - Known to be part of the EAP-TLS auth process
root_rsa Key1
root_rsa Key2
"acs_url">https://cwmp.c01.sbcglobal.net/cwmp/services/CWMP
"keycode">52HP-2374-2262-22AT-F2BQ
"bootstrapped_keycode">52HP-2374-2262-22AT-F2BQ
"connreq_port">3479
"connreq_username">00D09E-13151N005006
"connreq_passwd">Uh3xGGuQzTESPMrp
Credits….
HASH - Thanks bud for soldering all the things.
https://www.nomotion.net/blog/exploring-att-u-verse-5268ac-dsl-modem-part-1/
http://www.grandideastudio.com/wp-content/uploads/jtagulator_slides.pdf
All the images I stole without permission.
Contact
WhiskeyNeon