Let’s walk through a practical example: You want to repack the firmware to force-enable Telnet on port 2323.

ZTE often uses CRC32 or MD5 headers. After repacking:

To repack successfully, you must understand the structure. The ZTE F671Y typically runs a Linux kernel with a SquashFS or JFFS2 root filesystem.

Using binwalk on a stock firmware file reveals:

DECIMAL       HEXADECIMAL     DESCRIPTION
0             0x0             uImage header, header size: 64 bytes, image name: "uImage"
64            0x40            Linux kernel ARM
...
2359296       0x240000        SquashFS filesystem, little endian, version 4.0

A repack involves:

  • Extract components:
  • Modify components:
  • Rebuild filesystem:
  • Reconstruct firmware image:
  • Signature/verification bypass:
  • Flashing:
  • Validation:
  • Recreate the SquashFS image (use the same block size as original):

    mksquashfs squashfs-root new_rootfs.squashfs -comp lzma -b 131072
    

    Replace the original SquashFS part in the extracted firmware directory.


    Here are common changes people repack for:

    | Change | Path / Action | |--------|----------------| | Enable telnet | Edit /etc/init.d/telnet or add a startup script | | Remove ISP branding | Modify /usr/share/web/*.html or .asp files | | Increase Wi-Fi power | Edit /etc/config/wireless (if OpenWrt-based) | | Add custom DNS | Modify /etc/resolv.conf or dhcp client script |

    Example – enable hidden telnet:

    echo "#!/bin/sh" > ./etc/init.d/enable_telnet
    echo "telnetd -l /bin/sh &" >> ./etc/init.d/enable_telnet
    chmod +x ./etc/init.d/enable_telnet
    ln -s ../init.d/enable_telnet ./etc/rc.d/S99telnet