2704n Plusnet Hack DIY
2704n Plusnet Hack DIY
You don’t need all the requirements, because I can supply the information needed, it’s
just if you want to do it step-by-step.
In the top corner on the PCB, it looks like the Serial connection, but its missing a few
components. After tracing some of the wires I can see what-is-what.
I bridged the thicker red lines (R327 & R328) and used the normal parameters:
115K, 8, N, 1. and I had the serial connection working.
Additional: I believe the connections on the right are the JTAG, but I did not peruse
that avenue.
So after a power up I got this info from the Port:
(I had to fudge some of this output. I did not save the original)
HELO
CPUI
L1CI
DRAM
----
PHYS
PHYE
DDR1
333H
SIZ3
SIZ2
RACE
PASS
----
ZBSS
CODE
DATA
L12F
MAIN
There maybe a command I can type here? But the ones I tried from the internet did
not work.
www.zlgmcu.com/mxic/pdf/NOR_Flash_c/MX25L6406E_DS_EN.pdf
I connected the pads to a parallel port, however you will need to lift the 2 power pins
from the board, to isolate the chip.
I used pin 1 from the parallel port to power the chip, it requires 20ma and that’s not
(normally) a problem.
I made a program to Read & Write the flash, in-order to understand the SPI Protocol
better. But I will not explain it here. You will be able to find a program from the
Internet to do it. (Remember it's 3.3v, 8MB)
0x000000 ++++++++++++++
+ CFE + < 0x580 – 0x97F = NVRAM
0x010000 ++++++++++++++
+ BCM TAG +
0x010100 ++++++++++++++
+ ROOT FS +
0x4A3100 ++++++++++++++
+ KERNEL +
0x5C1600 ++++++++++++++
+ EMPTY +
0x7E0000 ++++++++++++++
+ POSSIBLE +
+ BACKUP +
+ CONFIG ? +
0x7F0000 ++++++++++++++
+ CONFIG + < 40K is allocated
0x7FA000 ++++++++++++++
+ DEFAULT +
+ PASSWORDS +
++++++++++++++
CFE / NVRAM:
0x684 – stores the Board ID
0x69B – PSI size value (Persistent storage information)
0x808 – Serial Number
0x8FD – Some unknown string, looks like its bin-hex encoded.
0x97C – CRC32 of NVRAM (0x580 to 0x97F)
If you corrupt the nvram section and write it back. The next power on asks you for
some details (via the Serial Port). So the serial port works when it needs to !
I can’t remember… but… if you remove (zero out) the unknown string, the serial will
start outputting the normal Kernel log while it’s booting-up.
Changing the ROOT File System
For the missing html files I used this GPL source code:
http://oss.sky.com/SkyHD/SKY-IHR-2-1-s-3761-R-consumer-release.tar.gz
Because it uses the same Kernel version 2.6.30 (and even the same magic number)
This Kernel appears to have some missing options like UNIX98_PTY, so I compiled
a Static Telnet Binary from here. Using the Tool-chain from the Source above.
Some of web pages are locked from editing, it says something like:
“You are not allow to access this page”
192.168.1.254/lanvlancfg.html
192.168.1.254/mocacfg.html
192.168.1.254/qosqmgmt.html
192.168.1.254/rtdefaultcfg.html
192.168.1.254/adslcfgc.html
192.168.1.254/xdslcfg.html
192.168.1.254/dslbondingcfg.html
192.168.1.254/upnpcfg.html
192.168.1.254/dnsproxycfg.html
192.168.1.254/standby.html
192.168.1.254/bmu.html
192.168.1.254/wlcfg.html
192.168.1.254/wlsecurity.html
192.168.1.254/wlcfgadv.html
192.168.1.254/wlses.html
192.168.1.254/wlwapias.html
192.168.1.254/wlfon.html
192.168.1.254/voicemgcp_basic.html
192.168.1.254/voicentr.html
192.168.1.254/voicesip_basic.html
192.168.1.254/voicesip_advanced.html
192.168.1.254/voicesip_debug.html
192.168.1.254/voicedect.html
192.168.1.254/updatesettings.html
192.168.1.254/defaultsettings.html
192.168.1.254/seclogintro.html
192.168.1.254/sntpcfg.html
192.168.1.254/resetrouter.html
192.168.1.254/qsmain.html
192.168.1.254/tr69cfg.html
192.168.1.254/logout.html
192.168.1.254/logintro.html
192.168.1.254/logconfig.html
(I added on the ‘action=view’ to see them before adjusting any binaries)
When I disassembled the ELF binary, I saw a function called “isPageAllowed”.
loc_40B374:
li $s2, 0xC5FC
la $t9, isPageAllowed
addu $s2, $sp, $s2
move $a0, $s2
jalr $t9 # isPageAllowed
li $a1, 0xA
b loc_40B3F4 # Adjusted Here, (at first)
lw $gp, 0xED40 + var_0xED20($sp)
la $t9, log_log
lui $s0, 0x47
la $a3, strNotAllowed # "Not allowed to load..."
li $a2, 0xF86
li $a0, 3
addiu $a1, $s0, strHandle_request
jalr $t9 # log_log
I changed the instruction in the middle (via a Hex editor) and it ‘appeared’ to work.
But… after a short while I noticed that things stops responding and the Log was
complaining about file locking ???
So…
I looked in the function “isPageAllowed” and it makes reference to some lookup
authentication tables. At 0x8DD40 and 0x8E028 (binary file location).
When you login as ‘Admin’. You are Auth-Level 10 (0xA). I don’t know how to
increase the Admin’s auth-level. So I decreased the pages Auth levels instead.
Yahoo, it worked.
Limited config storage
This is a bit confusing…
The PSI value 0x28 (40K) is passed from the CFE/Bootloader to the Linux Kernel.
The binary programs httpd & libcms_core can store about 160K of config in memory.
The library program compressed the config from e.g. 37K to about 12K and passed it
to the Kernel to write to flash at 0x7F0000.
But at some point, it cuts the text config to 40K before its compressed?. This is not
the case if you upload the config as a ‘restore’ file.
I don’t really understand it, but if I change the CFE PSI value to 0x40 (64K) its helps
a lot, and it does not overwrite ‘Default Passwords’ part of the Flash (0x7FA000).
I have added about a dozen static MAC addresses, and 2 dozen simple outbound
firewall rules and it works OK.
By the way… why does my Korean TV need to talk to the Netherlands, Germany and
Microsoft HQ !. I only pressed 1 buton !
Recreating the new File System / Image:
On a Linux PC or VM: use ‘unsquashfs’ to extract the Root FS into a directory. You
can use the ‘hostTools’ in the sky source code.
After the additions & changes. Use ‘mksquashfs’ to get it back again:
../hostTools/mksquashfs ./plusnet-root-fs/ new-squashfs.bin –b 65536
–be –noappend –all-root
Then I (mostly) copied-n-pasted the file onto the original image (carful of the
increased size). But it might be better to use a Broadcom image creator like
imagetag3 or OpenWRT is going to have something.
So, at this point you have a whole image ready to burn. However it needs an
additional tag of 20 bytes at the bottom for the web GUI to accept it.
The first 4 bytes is the NOT CRC32 of the whole image (excluding this tag)
The next 4 bytes is the string “6318” – the CPU id
The next 4 bytes might not be needed, but put the CPU id in a byte format
(0x00 0x00 0x63 0x18)
The next 8 bytes are best left empty 0x00
I have tried to upload the Broadcom image (without the CFE or 20 byte footer tag).
But I can not get it to work.
The log identifies the 0x100 byte BCM tag at the top of the image, but it complains
that another tag is not found?
TIP: never write a whole-image without the CFE. Or you will defiantly need a
soldering iron, glasses and a steady hand.