Hi, thanks for sharing all this useful information. I managed to get root on a locked P-2812HNU-F1 with the latest Telfort firmware, will share a howto later. I'd rather keep this firmware bc of vectoring support, but I would like to store local settings (ssh keys, dnsmasq & iptables config). However, everything is mounted as readonly or tmpfs so changes are lost upon reboot. Now, I don't understand how the Zyxel writes configuration to its persistent memory. It is clearly able to do so with webgui config changes.
All webgui changes appear to pass through /usr/bin/ccctest, which (I assume) modify and write config.rom to the NAND flash. However, I can't find how it does so. Curiously, it seems to have been build using the openwrt toolchain (from `strings`):
/opt/lantiq/UGW-5.4-SW/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/sys-include
/home/cjalee/vr9/KPN/311TUE8b1/build/sysapps/libccc/core/include
In /etc/init.d/rcS, it mounts /mnt/preNAND/extfs.img as /mnt/NAND, then copies /mnt/NAND/etc/* to /etc.
I'll probably manage to rebuild a modified squashfs extfs.img, but how to write it to preNAND ?
Output from `mount`:
rootfs on / type rootfs (rw)
/dev/root on / type yaffs2 (ro,relatime)
/proc on /proc type proc (rw,relatime)
/sys on /sys type sysfs (rw,relatime)
/proc/bus/usb on /proc/bus/usb type usbfs (rw,relatime)
tmpfs on /etc type tmpfs (rw,relatime)
none on /tmp type tmpfs (rw,relatime)
tmpfs on /var type tmpfs (rw,relatime)
tmpfs on /e-data type tmpfs (rw,relatime)
tmpfs on /i-data type tmpfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
mdev on /dev/mdev type tmpfs (rw,relatime)
/dev/mtdblock4 on /mnt/Config type yaffs2 (rw,relatime)
/dev/mtdblock3 on /mnt/firmware type yaffs2 (rw,relatime)
/dev/loop0 on /mnt/NAND type squashfs (ro,relatime)
/dev/loop0 on /usr type squashfs (ro,relatime)
/dev/loop0 on /root type squashfs (ro,relatime)
/dev/loop0 on /home type squashfs (ro,relatime)
/dev/sda1 on /var/mnt/usb/sda1 type vfat (rw,relatime,uid=99,gid=99,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=utf8,shortname=mixed,errors=remount-ro)
/dev/sda1 on /e-data/USB_USB_DISK_20_PMAP3A506489_1 type vfat (rw,relatime,uid=99,gid=99,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=utf8,shortname=mixed,errors=remount-ro)
Now, I have mounted /dev/mtdblock1 (auto using rw/yaffs) and it seems to be the partition where the preNAND/extfs.img is stored.
So my questions:
1. Could I just overwrite this img file on /dev/mtdblock1?
2. Do I need to mount it as yaffs or yaffs2? (both seem to work)
3. Is there a way to make a backup of the current firmware so that I can restore it if I brick it? Highly likely ;)
4. How can I block firmware pushes by my ISP? How are they distributed? See below for open ports.
TIA!
# netstat -len
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:18888 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.1:139 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:10001 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:2001 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:7676 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.1:445 0.0.0.0:* LISTEN
tcp 0 0 :::37964 :::* LISTEN
tcp 0 0 :::9999 :::* LISTEN
tcp 0 0 :::80 :::* LISTEN
tcp 0 0 :::53 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 :::23 :::* LISTEN
tcp 0 0 :::443 :::* LISTEN
udp 0 0 0.0.0.0:2709 0.0.0.0:*
udp 0 0 0.0.0.0:2710 0.0.0.0:*
udp 0 0 0.0.0.0:161 0.0.0.0:*
udp 0 0 0.0.0.0:53 0.0.0.0:*
udp 0 0 0.0.0.0:67 0.0.0.0:*
udp 115240 0 0.0.0.0:1900 0.0.0.0:*
udp 0 0 0.0.0.0:7677 0.0.0.0:*
udp 0 0 :::53 :::*
raw 0 0 0.0.0.0:2 0.0.0.0:* 7
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 1792 /var/syslog
unix 2 [ ACC ] STREAM LISTENING 1636 /var/run/celld.sock
(Last edited by gwillem on 4 Feb 2017, 13:19)