Someone left port 22 open for 54 days

I found this interesting project.
Hows about changing root uname in openwrt? Is it possible?
Obvisually it would reduce the attacking vector while being in internet.

https://arman-bd.hashnode.dev/i-left-port-22-open-on-the-internet-for-54-days-here-s-who-showed-up

(uname is something different than user name).

The short answer is no.
The medium answer is still no.
The long answer requires a legal name change to Don Quichotte first - but the source is at your fingertips, so 'anything' is possible, as long you do it.

There is no excuse for leaving ssh open on your border gateway (even less for uid 0 and without requiring keys) either way, though. This is your router, not an internet server, and VPNs (wireguard) have become ubiquitous and easy to set up, use them.

I really have an appreciation for folks who take the time to put this type of system up and gather fascinating stats. Not the first one I've seen.

:+1:

I'm not using VPNs.

@anon22003091 Cool project

This is quite confusing. :slight_smile:
Is it possible to change the USERNAME to anything else than root?
Short answer is enough.

What are you looking for actually !?

change uname... basically no,
but uname in openwrt is just a symbolic link to busybox,
you can just rm /bin/uname

reduce attack ...
I've change ssh use different port other than 22.
and using key base authentication, password attack become impossible.
and you can create another user with root privilege,
put a " * " to root in passwd/shadow then nobody can use root to login.

That's the confusion I was on about, as I don't think they were after the /bin/uname at all (and removing the symlink is pointless, cat /proc/version gives you the same information, as does ls -1 /lib/modules/ and at least a dozen other methods), but the default username.

yes there are many ways.
let's login as root :joy:

Why not? Setting up a WireGuard VPN for secure remote access to your router/network is trivially easy.

This might be, but I don't need access from outside. :slight_smile:

The info that I can create another superuser and set the auth to "*" is useful, thx!

And I get that there are many ways to challenge possible router vulnerabilities, despite the fact, I would find it cool to set up a individual user by default, which is not called "root". Especially when we see from such experiments, that botnets scan this by default too, why keep this attack vector open? Not everyone is harden their systems and go with standard settings instead.

No matter how the username is:

Use key-based authentication. Disable password login. Move SSH off port 22. [...]

#1 Obscurity is not security.

#2 Changing the [user] name as a default would not help anyway since every attacker will know the new default [user] name.

#3 Audit all firewall rules and exposed ports before putting a config in production.

Obscurity is something like changing the port. Changing the username is adding a second vector to the credentials.

Every discussion on this forum about supporting any AAA feature ends up with developers raging about how they're married to the single root user. But I don't think users asking about wanting to use separate sets of credentials for logging are at all interested in linux kernel users.

I was a CISSP - no need to inform me about the algebra of this.
If the userID were changeable and each operator chose their own, that would help some, but if the default were changed, the attackers would know it.

Any listening port is going to be an opportunity for a vulnerability to be exposed/exploited before it's patched.

I would never expose sshd on any port or with any username. But behind a port-knocker, then perhaps.

  • Inbound SSH is blocked from WAN by default
  • Default WAN firewall behavior is reject, but it can be changed to drop
  • Regarding outbound, is it your desire to stop all use of SSH?

iptables has not been standard on OpenWrt for some years, so this is of little use to anyone.

I must have misunderstood the purpose of your post. I was inquiring if the user needed to access remote SSH servers.

I have wireguard on Openwrt behind Fritzbox, so I have port-forwarding set on fritz. Is there any way to check if someone tries to do something with it? Can someone actually do something with it?