How biielfont/genexis-pure-ed500 works
Project type and purpose
• This is not a conventional web or mobile app. It is a firmware–hacking documentation project for the Genexis Pure-ED500 router (Adamo).
• The goal is to explain how to gain persistent root, override bootloader arguments, hook into startup (preinit), manage passwords, and remove the TR-069 backdoor.
File structure
Top-level:
• README.md, extended.md, recovery.md, backdoor-removal.md – documentation of each hacking phase
• firmwares/ – collection of firmware images for various hardware revisions and custom ISPs
• scripts/ – cleanup and persistence helper scripts (e.g., cleanscript_persistant.sh)
• uboot/ – U-Boot images and UART console instructions
Key patterns:
• Two root banks: /rom (read-only factory image) vs / (overlayfs active root)
• Bootloader stage (U-Boot) → kernel & rootfs mount → preinit hook → init scripts (password sync, services) → JUCI web UI, SSH, TR-069 daemon
• The project documents how to intercept at bootloader (UART), modify bootargs, mount read-write root, and inject an exec /bin/sh in /etc/preinit for persistence.
README for additional insights
• Describes the two-bank overlayfs, password sync logic in /etc/init.d/passwords, and the TR-069 services (icwmp, icwmpd, icwmp_stund).
• Outlines sequence: UART→U-Boot interrupt→ altered bootargs to get shell → mount overlayfs → modify root passwords → add post-preinit hook → remove backdoor binaries and DHCP ACS settings.
a. Main components
1. Hardware: Genexis Pure-ED500 router with UART interface
2. Bootloader: U-Boot (serial console, bootargs)
3. Kernel & root filesystem
– /rom: factory, read-only
– overlayfs → /: active, read-write
4. Init system
– /etc/preinit hook (exec /bin/sh)
– /etc/init.d/passwords (credential sync)
– JUCI web UI (LUCI derivative)
– SSH daemon (port 22666)
– TR-069 client daemons (icwmp, icwmpd, icwmp_stund)
5. External ACS server (acs.adamo.es)
b. Relationships & interactions
• UART console connects to U-Boot → allows bootargs override
• U-Boot loads kernel → mounts /rom + overlayfs → executes /etc/preinit hook → yields root shell
• Once root shell available, scripts modify /etc/shadow and /etc/passwd in overlayfs root.
• Init scripts run: password sync, network services, web UI, SSH, TR-069 daemons.
• TR-069 daemons communicate with external ACS server.
• Hack removes/renames TR-069 binaries and disables ACS DHCP discover in JUCI to break remote management.
c. Architectural patterns & principles
• Layered boot stages: Bootloader → Kernel init → preinit hook → init scripts → services
• Overlay filesystem dual-bank strategy for persistence vs factory reset fallback
• Hooking startup scripts for shell persistence (exec /bin/sh at end of preinit)
d. Technologies, frameworks, libraries
• OpenWrt variant (Iopsys)
• JUCI web interface (based on uhttpd, uci)
• BusyBox shell tools
• UBI/UBIFS for firmware partitions
• U-Boot serial console
Detail
• Both banks (factory vs active), the injection points (bootargs, preinit), and the service startup flow
• Do not omit any stage of the boot-to-shell sequence or the password synchronization logic
• How firmware images stored in the project (firmwares/) map to the hardware’s UBI partitions but are external references