DEV Community

Cover image for Your Cheap Home Router Has a Hidden CLI — Here's How I Found It
Amir Reza Dalir
Amir Reza Dalir

Posted on

Your Cheap Home Router Has a Hidden CLI — Here's How I Found It

🏚️ Chapter 1: The Budget

Let me set the scene.

Most of us don't get to choose our router. Your ISP comes to your house, puts a white plastic box on the wall, gives you a paper with the WiFi password, and leaves. That's it. That's your whole network now.

My box was a Huawei HG8240. A GPON terminal. This kind of device exists in millions of homes across Asia, the Middle East, South America — anywhere ISPs buy hardware in bulk and give it away for almost nothing. It's cheap. And it looks cheap too.

The Web UI: A Beautiful Prison

Every router comes with a web UI. You open a browser, type an IP address, and you get an admin panel. Fine.

But here's what nobody tells you: the web UI doesn't show you everything your router can do. You get WiFi settings, a MAC filter table, maybe port forwarding if you're lucky. The rest — advanced routing, VLAN management, QoS controls, real firewall rules, diagnostics — is either hidden behind an "advanced" tab that barely works, or just not there at all.

And some of these web UIs... okay, I don't want to insult anyone's work, but — frames inside frames. Pages that fully reload on every click. Buttons that do nothing when you press them. Session timeouts that kick you out while you're still typing a MAC address.

You learn to be fast and hope nothing crashes. It's not network administration — it's speedrunning.

fast typing

The Real Problem: Humans Required

But the bad design is not even the worst part. The real problem is more basic than that:

A web UI needs a human.

Every action needs your hands and your eyes. You can't write a script for it. You can't automate it. You can't connect it to anything else.

Want to add 10 devices to the whitelist? That's 10 rounds of click, type, save, wait, repeat. Want a script that blocks all devices at midnight and turns them back on in the morning? Not possible. Want to connect your router to your smart home or a monitoring tool? The web UI says: "No. Sit down. Click the button. Wait for the page to reload. That's your life now."

For a technical user, this is a dead end. A wall. A cage made of <iframe> tags.

The "Easy" Solution

Now, there's always the obvious answer: go to a store, drop your money, and buy a MikroTik RouterBoard. Problem solved. CLI out of the box. Full control. Done. 💸

And if money is no problem, why stop there? Get a Cisco managed switch. Get a rack. Get a server room. Put on a suit. Become a network engineer. Problem really solved.

money gone

But back in reality — where the ISP already gave us a router for free and we'd rather spend that money on coffee ☕ — let's work with what we have.

What If There Was Another Way?

A CLI changes everything. Every command the router supports — available directly. You can write scripts. You can automate tasks. You can connect it to other tools. You could set up your whole network in seconds instead of clicking through fifteen slow pages.

That's not a nice-to-have — that's the difference between controlling your router and being stuck with it.

And I was definitely stuck. Every time a new device needed WiFi access — open browser, type 192.168.1.1, log in, go through three menus, type a MAC address, click save, hope it works. Every. Single. Time.

Meanwhile, MikroTik and Cisco users had one-line CLI commands. Clean. Scriptable. Well documented.

And me? Clicking through a web panel like it was 2008. Because I had the budget router. The one nobody makes CLI tools for. The one nobody writes docs for. The one that's supposed to sit in the corner and never be questioned.

But I'm a developer. I question things.


🔍 Chapter 2: The Suspicion

It started with a port scan.

I don't remember exactly why I ran it — maybe I was bored, maybe curious, maybe it was one of those late nights where developers do things they probably shouldn't with nmap.

$ nmap 192.168.1.1
Enter fullscreen mode Exit fullscreen mode

And there it was in the output. Something unexpected.

Port 22. Closed.

Not filtered (that means a firewall is hiding it). Not absent (that means the service doesn't exist). Closed — that means something is right there, but it's not accepting connections.

Like a door that's locked, but you can see there's a room behind it.

SSH. On my cheap home router.

My heart beat a little faster. I tried to connect:

$ ssh root@192.168.1.1
ssh: connect to host 192.168.1.1 port 22: Connection refused
Enter fullscreen mode Exit fullscreen mode

Connection refused. Of course. 😑

But now I knew there was a door. I just needed to find the key.


📚 Chapter 3: The Documentation Nightmare

This is where the story gets painful.

I started looking for official Huawei documentation for the HG8240 series. What I found was... almost nothing useful.

Language Usefulness
Chinese Detailed — if you can read it
Portuguese Brazil-specific firmware only
English Machine-translated, barely usable
Russian Random blog posts, hit or miss
Indonesian "It works!" (no explanation)

There was no "Developer Guide." No "CLI Reference." No simple README with examples. Just small pieces here and there — a forum post from someone in Indonesia who said they enabled SSH but didn't explain how, a Russian blog with screenshots of XML files that looked useful but led nowhere, and PDFs. So many PDFs.

Seriously — PDFs. In 2026. Not a web page, not a wiki, not even a text file. PDFs. And not small ones — each one over 10MB, full of screenshots of admin panels I've never seen, for firmware versions I don't have, about features I wasn't looking for. I downloaded about a dozen of them. Opened each one hoping to find a CLI reference. Got 200 pages about how to set up PPPoE through the web panel instead. Thanks, Huawei.

I spent hours. Real hours. Not the "I searched for five minutes" kind. The kind where you have too many browser tabs open, half of them in Google Translate, comparing a Chinese PDF with a Portuguese forum thread because they both describe the same XML setting but with different names.

The Hard Truth

Here's what I want to say clearly: this is normal for consumer routers.

Huawei, ZTE, TP-Link — they all do this. They don't write documentation for people like us. Their real customer is the ISP, not the person at home. The ISP gets proper guides and setup tools. We get a web panel and nothing else.

But just because they don't tell you about something doesn't mean it's not there. It just means nobody thought you'd go looking.

The engineers who build these devices still leave traces behind. Config files have patterns. Firmware has help commands. Ports show up in scans. The information is out there — hard to find, badly written, in the wrong language — but it exists.

You just have to want it badly enough.


🔓 Chapter 4: The Configuration File

The answer came from the last place I expected: the web panel itself.

Yes, the irony was not lost on me.

I logged into the admin panel — not with the regular user, but with telecomadmin / admintelecom, the ISP-level account that most people never use. I went to:

Advanced → Maintenance Diagnostic → Configuration File Management

And there it was. A small button to download the router's full configuration as a file.

I had ignored it many times before. But I was desperate enough to try anything. I downloaded it. Made a backup copy first (always do this). Opened it in my IDE and... XML. Thousands of lines of XML.

Now — I got really lucky here. Some Huawei routers encrypt the config file when you export it. You download it, open it, and instead of readable XML you see random characters. Useless.

If that had happened to me, honestly? I probably would have closed my laptop and moved on with my life. Mystery over. The web panel wins.

But my config came out as plain, readable XML. That small bit of luck is the only reason this article exists.

A note for anyone following along — if your config file is encrypted, don't give up. People have already figured this out. There are Gists on GitHub with scripts that can decode and re-encode config files for different Huawei models. The process is: download the encrypted config → decode it with the script → make your changes → encode it back → upload it. Search for "huawei config decrypt HG8245" or "huawei gpon config encode decode" on GitHub Gists — people have been sharing these tools for years.

Anyway, back to my config. I started scrolling. And somewhere around line 400, in that wall of angle brackets, I found this:

<X_HW_CLISSHControl Enable="0" port="22" Mode="0" AluSSHAbility="0"/>
Enter fullscreen mode Exit fullscreen mode

I stared at it. Read it again. Read it a third time.

But let me tell you about the journey to find that line. Scrolling through this XML felt like Huawei was trying to break me personally. Thousands of lines of nested tags, no comments, no clear sections, no formatting. It looked like it was created by a machine that had never heard of indentation. I'm pretty sure this config format is older than most programming languages I use.

Anyway — back to the discovery:

SSH was not missing. It was not unsupported. It was just... turned off. In some firmware versions the line is there with Enable="0". In others it doesn't exist at all — you have to add it yourself. Either way, the feature is built into the firmware. It just needs to be turned on.

I kept reading. Found another flag:

<AclServices ... SSHLanEnable="0" ... />
Enter fullscreen mode Exit fullscreen mode

Two zeros. Two flags. That's all that stood between a "dumb" web-only router and one with a full command-line interface.

The Surgery

The fix was almost too simple:

Step 1 — Add or change the X_HW_CLISSHControl line to Enable="1". Make sure to place it before X_HW_CLITelnetAccess in the XML:

<X_HW_CLISSHControl Enable="1" port="22" Mode="0" AluSSHAbility="0"/>
Enter fullscreen mode Exit fullscreen mode

Step 2 — Find SSHLanEnable and change the zero to one:

<AclServices ... SSHLanEnable="1" ... />
Enter fullscreen mode Exit fullscreen mode

Step 3 — Upload the changed config through the same admin page. The router rebooted on its own.

Then I waited. Watched the lights blink. Watched them go steady. Opened my terminal. And typed:

$ ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa root@192.168.1.1
root@192.168.1.1's password: ********
Enter fullscreen mode Exit fullscreen mode

The -o HostKeyAlgorithms=+ssh-rsa flags are needed because these routers use an older SSH algorithm that new SSH clients block by default. Also, only the root user can connect — the password is printed on the back of the device.

And then...

WAP>
Enter fullscreen mode Exit fullscreen mode

celebration

A prompt. A real command prompt. On my budget router. 🎉

I typed help. A long list of commands appeared — WiFi, routing, VLAN management, diagnostics. This router had a whole operating system hiding behind that web panel the entire time.

WAP> display wifi filter                                # List filtered devices
WAP> add wifi filter index 1 mac AA:BB:CC:DD:EE:FF     # Whitelist a device on SSID-1
WAP> del wifi filter index 1 mac AA:BB:CC:DD:EE:FF     # Remove from whitelist
Enter fullscreen mode Exit fullscreen mode

The locked door was open. And the room behind it was huge.


🚀 Chapter 5: Now What?

The CLI was open. And suddenly, everything that was impossible through the web UI became easy.

I could write a bash script to add ten devices in two seconds. I could set up a cron job to block everything at midnight. I could send the output of display wifi filter to grep and build a monitoring tool. The CLI turned my "dumb" router into something I could actually write code against.

And that's what I did — I wrapped these SSH commands into a small macOS app called WMac using Expect scripts to handle the old SSH connection. But that's just one example. The point isn't the app — the point is that once you have CLI access, you can build anything on top of it.

The locked door led to a whole building.


🌍 Chapter 6: The Bigger Mystery

Here's where I stop talking about my story and start talking about yours.

I did all of this on one router — the Huawei HG8240 — because that's what I have at home. I don't have a ZTE. I don't have a TP-Link. I can't test them, so I won't pretend to know what's inside them.

But here's what I believe: most cheap home routers are hiding something like this.

These devices are not built from zero. They share the same chips, the same firmware base, the same design. The same factories in Shenzhen that make Huawei's GPON terminals also make ZTE's, and many other brands you've never heard of. If Huawei's firmware has SSH built in but turned off, there's a good chance the router on your shelf does too.

The problem is always the same — nobody tells you. The docs are bad, in the wrong language, written for someone else, about a different firmware version, on forums in countries you've never been to, in threads from 2019.

But the information is out there. That's the biggest thing I learned from this whole experience. Bad documentation doesn't mean no documentation. The answers are just harder to find. But they can be found.


🎬 Your Turn

That's my story. One cheap router. One hidden CLI. A lot of bad docs and late nights.

But the real point of this article is not about my router — it's about yours. Here's a simple guide to start:

Step What to Do What to Look For
1 nmap 192.168.1.1 Closed ports (not filtered — closed)
2 Download config from admin panel XML/JSON with disabled settings
3 Search for Enable="0" SSH, Telnet, SNMP — anything turned off
4 Read the bad docs Google Translate is your friend
5 Get a shell, type help See what commands are available

The worst thing that can happen is you learn something about your router. The best thing? You find a whole hidden interface that was always there, waiting for someone curious enough to look.


I solved this mystery for one router. There are thousands of models out there that nobody has looked into yet. If you've explored your cheap home router and found hidden features — SSH on a ZTE, telnet on a TP-Link, a CLI on some ISP box nobody knows about — tell me in the comments.

The more you share, the fewer people have to suffer through web panels.

Sometimes the cheapest hardware has the best-hidden secrets. You just have to read the bad docs.


The tool I built from this is open source: github.com/dalirnet/wmac — give it a ⭐ if this was useful.

Follow me on GitHub @dalirnet for more weekend hacks like this.

Top comments (1)

Collapse
 
trkaplan profile image
Tuncay Kaplan

Impressive work, appreciate it 👏