From Nmap Scans to John the Ripper: Bypassing ISP DNS Hijacking on the HSGQ-X200DW ONT
# From Nmap Scans to John the Ripper: Bypassing ISP DNS Hijacking on the HSGQ-X200DW ONT
When an Internet Service Provider (ISP) enforces transparent DNS hijacking, standard network workarounds often hit a wall. This was the exact challenge we faced with the HSGQ-X200DW optical network terminal (ONT)—a Realtek/Boa SDK-based device that stubbornly resets configurations on reboot, lacks a traditional `nvram` interface, and locks users out of deep administrative control.
What started as a simple mission to bypass ISP DNS filtering quickly evolved into a full-scale network reconnaissance, credential cracking, and embedded systems troubleshooting adventure.
Phase 1: Mapping the Attack Surface with Nmap
Before touching any configuration files, we needed to understand what was running under the hood of the gateway (192.168.1.1). Firing up Nmap gave us our first look inside the black box. Scanning the device revealed three critical open ports keeping the system alive:
Port 23 (Telnet): The gateway to the underlying Linux shell.
Port 53 (DNS): Managed by dnsmasq actively intercepting and routing local requests through the ISP's servers.
Port 80 (HTTP): Running the lightweight Boa web server powering the local admin panel.
Phase 2: Unlocking Super Admin via John the Ripper
Standard administrator accounts on these devices are heavily restricted, preventing deep system modifications. Digging deeper into the firmware configurations, we located the primary super admin account: telecomadmin.
However, its password was stored as a cryptographic hash. Refusing to stay locked out, we extracted the hash and deployed John the Ripper to crack it. After running the cracker, the plaintext password yielded, granting us absolute root and super admin privileges over the device.
Phase 3: The CLI Battle & The dnsmasq Persistence Trap
Armed with root Telnet access, we bypassed the web UI restrictions to force dnsmasq to ignore the ISP and route traffic through clean, private DNS resolvers (76.76.2.1 and 76.76.10.1).
Manually injecting rules into `/var/dnsmasq.conf` instantly fixed `REFUSED` lookup errors, proving our logic was solid. However, because `/var/` lives in volatile RAM, power cycles wiped our changes. When we attempted to achieve persistence via custom startup scripts (`/var/config/rc.local`), we hit a classic boot-time race condition: the firmware's native init routine launched its own `dnsmasq` instance after our script, reclaiming Port 53 and locking us out again.
Phase 4: The Epiphany—The Web UI Solution
After verifying via a safe `reboot` that the hardware remained entirely unharmed and cleanly reverted to its default state, we realized that forcing CLI script persistence on a locked proprietary firmware wasn't worth the instability.
Instead, the cleanest and most robust solution was hiding right inside the web management console (`192.168.1.1`)[span_0](start_span)[span_0](end_span). By navigating to LAN -> DHCP Settings [span_1](start_span)[span_1](end_span):
1. We switched the DNS option from proxy/ISP mode to Set Manually [span_2](start_span)[span_2](end_span).
2. We entered `76.76.2.1` and `76.76.10.1` directly into the DHCP lease fields[span_3](start_span)[span_3](end_span).
Rather than fighting the router's internal DNS proxy daemon via volatile command-line hacks, the router now natively hands out clean, unfiltered DNS servers to every device connecting to the local Wi-Fi network—fully persistent across reboots and completely risk-free.
Final Thoughts
Sometimes, securing your network requires going all the way down the rabbit hole—from Nmap enumeration and cracking password hashes with John the Ripper to debugging embedded Linux race conditions over Telnet. But the ultimate lesson? Deep technical reconnaissance teaches you how a device ticks, but native configuration options often provide the safest path to victory.


Comments (0)
Sign in to leave a response.
No comments yet. Be the first.