HN Simulatornew | past | comments | lists | submitlogin

It's impossible to detect an open wireguard port as no response is generated unless you have the correct key. SSH on the other hand is easily scanned for.
help



> unless you have the correct key

To be clear, this is not about the pre-shared key. What you need is a hash of the server's public key for the initial handshake. The PSK is only used after that.


I guess this is similar to BitVise obfuscated handshake. My understanding is the server accepts packets but is completely unresponsive until it's had the "secret knock" on the door.

Without that the attacker can't see what the server is and can't start SSH negotiations and so can't start an attack.

This is like code we had in the 1980s for comms but also for typing cheat codes into games. There is no feedback at all to the user until the passphrase has been successfully entered.


There's nothing obfuscated about the Wireguard handshake. It's publicly a wireguard handshake and you can even see each side's public key in cleartext.

The only thing hidden about it is that the server doesn't respond if it doesn't know your public key.


Yes, that's the obfuscated part - the server doesn't respond.

> It's impossible to detect an open wireguard port as no response is generated unless you have the correct key


But you can detect a running WireGuard stream. I hope they (Jason) can improve this in v2.

Network Hiding Protocol (NHP) is a work in progress that will offer a standardized way to hide TCP ports as well. It’s a knock based protocol.

I would hardly consider that "dangerous."

The practice that WireGuard employs here is called "Silence is a Virtue"[0]. That's done to provide DoS mitigation[1] and to prevent other classes of attacks. To quote the paper[0]:

> Several classes of attacks are avoided by not allowing unauthenticated packets to influence any state.

WireGuard servers not responding to unauthenticated clients is a design decision that leads to an advantage, because implementations won't need to allocate any dynamic memory for them. Even further, the protocol can be implemented in such a way, that servers won't need to allocate any dynamic memory for any client. To quote the paper[0] again:

> And more generally, it is possible to implement WireGuard in a way that requires no dynamic memory allocation at all, [...]

On the other hand, SSH servers MUST[2] give a response to all clients and will allocate dynamic memory for unauthenticated peers AFAICS.

So in practice, this means that unauthenticated peers can force OOM errors on SSH servers, where the WireGuard protocol — by design — makes this impossible. SSH DoS mitigations have to be done through other means, e.g. upstream services, which no non-enterprise uses in practice.

Whether or not to decide if that's "dangerous" for you, is up to each individual.

[0]: https://www.wireguard.com/papers/wireguard.pdf (5.1 Silence is a Virtue)

[1]: https://www.wireguard.com/protocol/#dos-mitigation

[2]: https://www.rfc-editor.org/info/rfc4252/#section-5.1


All TCP servers must allocate memory per client. Wireguard is cutting across abstractions for efficiency.

Actually a TCP server could also choose to ignore a client, but only based on the client's IP address and only if you hook into the kernel or use iptables -j DROP

Actually a UDP server also has to allocate memory per client, it's just that it can choose to free it immediately and treat the same client as a new client when it comes back. Then the bottleneck is bandwidth.


All TCP servers must allocate memory per client.

No idea about real implementations but is there no stack which allows to preallocate and reuse that memory, for instance for each client's initial negotation phase? So only allocation is needed once the decision is made to continue with the client? That would, at least to me, seem like a rather logical thing to do.


AFAICS your suggestion is exactly what's achieved with UDP and WireGuard, but you're not making the differentiation between kernel and user space. UDP shifts the responsibility of segment handling to the application side, and that can be an advantage to mitigate DoS attacks.

Datagram sockets (UDP) are "connectionless sockets" and the receiving end can stream any segments into pre-allocated memory. Meaning, the kernel streams segments to the application side, where static memory can be emptied and reused, either after allocation limit, after a timeout or after the first unusable segment has been reached.

The issue with TCP here lies in its built-in reliability features. Fixing out-of-sequence segments, and the detection of missing or erroneous segments requires intermediate state. These allocations need to be kept as long as we expect the corrected segments on the kernel side. The application side doesn't need to care for individual segments and only ever sees valid packages. This segment handling is entirely up to the network stack, and there's nothing the application level can do individually. That's up to system-wide TCP settings (tcp_fin_timeout, tcp_keepalive_time, tcp_retries2, tcp_syn_retries, ...)[0].

So the issue with every exposed TCP port is that its memory configurations are applied solely per system/kernel, and not per application. I would be hesitant to run other networking applications on a system alongside an exposed SSH server, but wouldn't be that hesitant alongside an exposed WireGuard server.

[0]: https://www.kernel.org/doc/html/latest/networking/ip-sysctl....


So you'd allocate memory per negotiating client. The hypothetical DoS attacker will stack up clients in the negotiation phase if that's where you hold the memory.

> Wireguard is cutting across abstractions for efficiency.

*and security.

SSH uses TCP, WireGuard uses UDP. Like you wrote, the bottleneck in bandwidth could annoy my ISP more, and trigger its DDoS protection, than it annoys the network stack on my VPN server.


> easily scanned for.

unless you use IP whitelisting


By definition that would not be a public, open port.

i don’t think so. i whitelist my vpn IP for ssh into a few machines and when i forget to turn my VPN on and try to access it, i get “permission denied (public key)”. whereas if i close port 22 entirely i get “network not reachable”.

You’re both right. If sshd is enforcing the whitelist you should see what you see. If instead you’ve got some kind of firewall mediating the traffic, then you should be invisible to anyone outside the whitelist.

I assumed GP meant whitelisting an IP in a firewall - which just drops the packets and means the port scanner or bot will timeout rather than get denied. Typically in any cloud compute environment you'd have a deny all policy and then add permits for specific service ports/ips .

Or TCPMD5, which I have tried to sell to openssh, even sending patches, as I recall.

With the major drawback that TCPMD5 doesn't work through NAT.


TCPMD5 is a really terrible hack. Authentication is better done at either the application layer, or the VPN layer.

I'm not saying it's perfect, but unlike at the application layer, TCPMD5 also protects against RST attacks and other shenanigans.

VPN, sure, but you don't have a VPN directly to every endpoint you'll SSH to.


If you want to be protected against RST attacks, why not use QUIC?

Doesn't even have to be QUIC. Can be any UDP-based protocol.

Let's put it this way: There is a large difference in the size of the patch to enable TCPMD5 in SSH, and switching it to QUIC.

Having written applications that use QUIC as transport, I'd also say that there's more complexity, both in code and operations, than from the simple stream that TCP provides.

So "why not QUIC" is a question that means "instead of just fixing the gap, that's a tiny patch that in one fell swoop protects against RST attacks, post-quantum attacks, zero days in OpenSSH, and system enumeration, why don't you just rewrite the entire architecture to use another protocol and reimplement such protection instead?".

So your suggestion is not wrong so much as it is "why don't you just…".


Which is great if you're always behind a particular IP. As for the rest of the world...

I've had success allow listing the whole IPv6 ASN block my ISP owns. It cuts down on all the drive by attempts and if someone on my ISP's network was trying to break in they'll still need to defeat SSH before I notice the stream of failed login attempts and report them.

I have the naive hope that as a paying customer of my ISP they'll take my abuse report involving a fellow customer seriously.


I receive a /56 delegation from my ISP. I've been with them for the last four or five years, since they ran fiber through my neighborhood.

Allegedly this /56 can change, but it's been the same for as long as I have been a customer. But the CPE/ONT has been powered the whole time. That is, we've only lost power for a couple of minutes since then.

Even with all of this I've been hesitant to use the IPv6 range as a whitelist.

So, are you suggesting that you've white listed a larger range than what the ISP assigns you? Because, for me, that would be essentially white listing every Verizon FiOS customer, and I'd rather not do that.


> Because, for me, that would be essentially white listing every Verizon FiOS customer, and I'd rather not do that.

That's fair, all I can say is in the six years I've been doing this I've never seen any login attempts but I guess it depends on your ISP and how willing you'd think they'd be to help if you actually did have a fellow customer (or more likely a compromised IoT device) attacking you.

Realistically I'm not worried they'll ever be able to break into SSH, my firewall rule is more to cut down the drive by junk filling my logs which potentially obscures a true targeted attack.


Well if you currently "whitelist" the whole Internet, narrowing it down to Verizon Fios customers would be quite a reduction.

Yes, this is true. But my thought was more "allow Verizon FiOS or nobody at all"

We have some whitelists covering most of Google Cloud - Compute Engine and various other services. It's surprisingly effective, because Gcloud does try to detect and stop abuse within their cloud, and they do take action on abuse reports. And it blocks all the other hosts around the world that are more attacker-friendly.

Don't forget to add the IP blocks of your new provider, if you ever decide to switch...

Tailscale bridges that gap nicely for what it’s worth.

Yup. Since figuring out how to get it to advertise a route to my home private up range (from my home server which is always connected) I just leave Tailscale on most of the time I’m not at home and I’m always able to connect to anything at home. I don’t even have to make that my exit node, which is great because my DOCSIS uplink speed is crap.

This is an argument for security-through-obscurity.

The phrase "security thru obscurity" is something that people parrot because they heard it somewhere and it makes them feel smart. In reality, all cybersecurity is security thru obscurity. There's nothing else but obscurity. The entire field of encryption is literally obscuring.

A thinking person understands that security, like obscurity, is just a matter of degree, and the only lever you have is increasing the cost for the attacker by increasing obscurity. Security isn't binary, it's a matter of degree in the form of cost.


Obscure as in "I'm using a port nobody can guess" and obscure as in "I multiplied two large primes together that nobody can guess" are very different. Crypto is definitely obscuring, but it is muddying the waters too much to conflate them.

Technically that’s only because the port is 2 bits of secrecy. If port numbers were 128 bits we’d be having a different conversation I think.

Just to nipick, that's 2 bytes, so 16 bits of secrecy (a bit less if you choose to avoid other well-known port numbers).

EDIT: And on a practical level, the port number is sent as plaintext in the packet header, and generally much easier to snoop on than a secret sent in the data.


A given ip and port combo is 80 bits on an ip6 subnet, however that information is quite likely to leak in various exposed logs, so in reality it is less.

Not really, because the port is observable over the wire. It’s no bits of secrecy once comms have been watched. That’s the difference between real security and security through obscurity.

Entropy is a meaningful aspect to effective security though. An open SSH server will get hammered by a massive amount of bots every day, flooding your logs with worthless garbage.

Whereas a wireguard setup using a nonstandard port would require an individual malicious operator to MITM your traffic to your homelab, then additionally attempt attack the service themselves. It would be so rare that even a single occurance is extraordinarily unlikely to ever occur. As a result, you could have real-time phone notifications for such an event, and be notified on an incorrect key exchange or other invalid packet instantly. Or just aggressively fail2ban any IP range that makes an invalid handshake.

Effective security is achieved through layers, the goal is just raising the opportunity cost enough that it will realistically not be compromised without severely hindering functionality.


Don't you thus merely turn off logs?

Though there is a point to be made to also make obscurity a layer of your defence strat (albeit not effective for all threat models, and brittle).

After all, most organisations dont put out their whole network design, serverpark documentation and infra architecture out in the open. It usually goes by many names, like 'company secret', 'internal knowledge', 'NDA', but in the end its all just obscurity.

For me it just another layer of the onion. I don't really consider it security, though I do qualify it as some sort of defence.


There's a reason militaries don't paint their tanks bright pink...

No one expects camo paint to stop a projectile, that's what the armor is for. But in an ideal scenario you don't get hit by the projectile in the first place, and that's what the camo is for.


Militaries have in the past used bright colours, for good reasons. Muted camo colours being good is a contingent fact dependent on a particular range of technological development, not an absolute law.

There are some niche settings where bright/high contrast camo makes sense (mostly in settings like the open ocean where hiding is impossible, so camo takes a different role, trying to confuse the attacker as to the type and movement direction of the vessel, etc).

I think the metaphor is still reasonable in the general case.


> There's a reason militaries don't paint their tanks bright pink

Drifting from the thread a little, but the RAF did paint some Spitfires pink in WW2 as that was deemed the best camouflage.

https://theaviationist.com/2026/08/24/story-of-the-colorful-...


Yeah, planes (and to some extent, ships) have different camouflage requirements.

Its funny that people who use the phrase security thru obscurity ALWAYS use the secret port as example.

Articulate for me what you think is the difference.


> In reality, all cybersecurity is security thru obscurity.

No, that's not what that word means. "Obscurity" means low/no entropy. If you're leaning on a "secret" int between 0 and 65,536 then it's going to break. If your secret is a random int between 0 and 2^2048 then that's not "obscurity", that's an actual secret.


Thank you.

Security through obscurity means "as long as nobody knows our process we're safe"

Which is true in cryptography, knowing that primes are used does not suddenly make it surmountable.

If your security is that the ssh port is x, REGARDLESS of how many bits there are, it's security through obscurity. Someone reading the process would immediately know.

If your process is randomly picking a port, then that's not. You'd have to figure out how to communicate that port to your users though.


My process: I walk up to the computer, open the lid, type in root and hunter2retnuhandback. Then I click login.

It's not secure now you know the process, but was it security through obscurity?


Yes. Although still protected (I assume) by physical security, which isn't nothing.

My process: I type SSH root@123.45.67.89 and type in hunter2retnuhandback

As long as nobody knows the password we're safe, so passwords are security thru obscurity?

> the practice of concealing the details or mechanisms of a system to enhance its security

By that Wikipedia definition, Wireguard is more obfuscated than SSH because it won't reveal that it exists to unauthorized users. This enhances its security.

Your example creates a binary that begs the question: how much entropy does it take to advance from obscurity to secret? "Defense in depth" implies many layers of imperfect obfuscation/secrets.


Where is obscurity defined as low/no entropy?

In at least one HN commenter's mind, apparently.

"Security through obscurity" generally implies systems that rely on their algorithms, protocols, and deployment details being "obscured".

If you can publish the source code of your system, as Wireguard does, and it's still secure, then it's not relying on security through obscurity.

If you can crack a system because you have access to its source code or know its port number, that system is relying on security through obscurity.


Port numbers might not be defined in source code. The point is, being able to guess a port number and being able to guess a secret key is just a matter of magnitude of entropy.

That's a way you can characterize it, but it's not what security by obscurity means. Generalizing it to "entropy" misses the point of the term.

It's really just a general variant of Kerckhoffs's principle, that a cryptographic system should be secure even if everything about the system, except secrets, are public. Which is why we use secret managers just for secrets.

If you embed a secret in Javascript sent to the browser or in a mobile app, that's security by obscurity.

If a system is insecure when port numbers are known, that's security by obscurity.

Besides, the port number is always somewhere, whether in config files, Terraform, k8s manifests, Ansible etc. Security should not depend on any of those being obscured, partly because that information is difficult to secure - they're widely available within an organization, and much easier to obtain than properly managed secrets. Data like that also can't easily be "rotated" in the event of a disclosure.


I don't think this really distills it though. A secret port defined in an env var is obscure if everything but the port number is known.

Secret keys are always somewhere too. Port numbers can be rotated just as easily as secret keys can. You can store port numbers in extremely secure secret stores if you want. A system secured by a secret key is insecure if the secret key is known.

I'm not trying to be obtuse. But when you get down to it, "obscurity" is just some vibes-based line in the sand.


unless its 4, of course

RSA actually is security through obscurity, where the obscurity is that nobody will figure out practical factoring.

That's not security through obscurity, you have all the details about the algorithm and you still can't break it.

Security through obscurity would be inventing a custom homemade cipher that's trivial to break once you understand how it works.


It's merely one of many potential layers of security. The problem that infamously keeps coming up in industry around insecure crypto implementations/algos is that they ONLY have obscurity to their benefit, something that does not scale when distributed (see: Crypto1).

Passwords, keys, and even bound ports are security through obscurity. The goal is to just not have that as your ONLY layer of security. A password for one user's account, that only they know, is fine. A default admin password for a router brand that has the web interface exposed to the internet by default, is not.


"obscurity" in a security context means that the protocol is secret. Good cryptography is secure even if everyone knows how it works.

> In reality, all cybersecurity is security thru obscurity.

I'm usually not here to debate semantics, but good god, trusting in cryptographically secure algorithms is a much stronger promise of security than something like, say, port-knocking.

Just because the math behind these algorithms are being put under a lot more pressure than we could imagine a decade ago doesn't mean we should throw the baby out with the bathwater. If anything, it's a good thing to validate that our assumptions are true, and correct the assumptions we had incorrect.


>I'm usually not here to debate semantics, but good god, trusting in cryptographically secure algorithms is a much stronger promise of security than something like, say, port-knocking.

That’s his point though. That some forms of obscurity are much stronger and aren’t bad.


> There's nothing else but obscurity. The entire field of encryption is literally obscuring.

They're conflating cryptographically secure math with all manners of obscurity through security as being the same. Do you not see how dangerous and silly that claim is?

> A thinking person understands that security, like obscurity, is just a matter of degree, and the only lever you have is increasing the cost for the attacker by increasing obscurity. Security isn't binary, it's a matter of degree in the form of cost.

This doesn't make sense, and honestly sounds like AI-generated ragebait.


The NSA itself has a secret suite of cryptographic primitives for this exact reason.

https://en.wikipedia.org/wiki/NSA_Suite_A_Cryptography


I run an SSH server on an obscure port, it's been up there for about 10 years.

I get about 50-100 unwanted hits a day trying to authenticate from all over the world. I recently opened another one and it didn't get any unexpected hits. I strongly suspect my IP and obscure port was picked up by a port scan at some stage and is now on some kind of list being passed around.

I don't see the high port as security as such, but it's a layer in reducing the noise. It's probably like having a staff entrance round the side of a public building, it still needs security but there is much less unwanted traffic.


Interesting. On my side -- since the XZ-supply-chain attack and the RegreSSHion bugs back in 2024 -- I switched all my SSH-reachable servers over to non-standard SSH ports (in the range 10,000 to 65,000). This initially led to a sharp decline of SSH probing/less failed login attempts in `/var/log/auth.log`, like one attempt every few days, which mostly were just unsophisticated, random port scans.

However as of late, there are again quite a lot of failed login attempts being logged by my sshd instances. Say, do you have a few historical numbers on the failed login attempts?

Like, I was suspecting that with the advent of AI based exploiting actual exploitation attempts have become more aggressive/more thorough. What do your numbers say in that regard?


Sorry I don't have any hard stats to hand. I let the SSH Server auto block IPs based on failed attempts and also geo-locked to allow UK only[1], in those cases it logs "Rejected SSH Connection" so not exactly sure what the "attacker" sees. I get a lot from blocked addresses, so that will be repeated "attacks" but haven't spent time analysing in any depth.

Before they're block reported client versions seem to be mainly SSH-2.0-Go or SSH-2.0-ZGrab ZGrab SSH Survey with the occasional Ubuntu.

[1] This caught me out when I was on holiday once and needed to get in. Had to sign up for a VPN which exited in the UK to get through.

Previously I had the firewall doing some of the geo-locking but currently behind a managed one and apparently it's not capable.


Yes! Thank you for saying this. It bugs me when people don't understand this. Of course, cryptographic obscurity has some measurement of obscurity associated with it, which is why it is valuable.

“Security through obscurity” refers to the algorithm not any key material.

Yes, it refers to it somewhat obscurely.

The difference between someone educated in a field and someone who's not is that the educated person knows what the field's terms of art mean.

Every field uses terminology that can't always be fully understood just by examining the term itself, which is what everyone in this thread saying things like "all security is obscurity" etc. is doing. That's called equivocation - using two different meanings of a word as though they have the same meaning.


A thinking person knows the obscurity in that saying means "knowing how the security works", nothing more, nothing less

Encrypted port traffic on open protocol (like HTTPS) is not obscure. You know all the algorithms involved and you can access it.

You fundamentally misunderstood everything about that saying


Explain how one time pad is security by obscurity.

Because the pad is not visible to those you want to keep the communication secure from. The pad is 'obscured'.


The phrase is imprecise in its meaning. No dictionary definition of obscure would make it apparent. But the point is that some information has to be held back, even if it is only the key. That's what is obscure.

Everything’s made up. Stay woke.

Your argument is like when my son whistles. Sounds good to you and not so much for the other people in the room. So: yeah! sure! go all yolo and beat a point regarding your private use of language into the ground, but at least consider that your way of defining these words actually removes a significant distinction from the meanings of at least one way to put them all together.


We just call those secrets in the biz.

On a theoretical level no amount of cost will crack a one time pad but since the world is not theoretical, I guess the argument still stands.

It's just dark turtles all the way down

This is an absurd reduction and nobody serious things ACLs on source IPs are on the same spectrum as encryption. These things are qualitatively different.

Port knocking or source IP filtering is trivially defeated by an attacker that can observe any traffic in the chain of a legitimate traffic exchange. The entire class of things people call “security through traffic obscurity” are these trivial things that only help against bulk automation.

These are extra things you sprinkle on to buy you more time from 0-day bot farms (not 0-day dedicated attackers who have watched your traffic), but they are not a replacement for real security that gives you well bounded guarantees through cryptography.

The people who think “it’s all security bro” are the ones who end up losing their crypto money when their ISP gets BGP hijacked by a dedicated attacker. “The IP was hardcoded, how could they possibly take over!?!?”


This fundamentally misunderstands the distinction between cryptographic secrecy and security through obscurity. Much of cryptography is indeed based on keeping a secret, but that secret is the key, not the algorithm or the security mechanism itself.

Modern cryptography is explicitly designed around the assumption that an attacker knows the algorithm, understands how it works, and can examine its implementation. Security should hold even when all of that is public, provided the key remains secret. That's the principle behind Kerckhoffs's principle.

Security through obscurity, by contrast, relies on hiding the design, implementation, or inner workings of a system as a security measure. The distinction matters because if discovering how the system works is enough to compromise it, then you've built a fragile security model.

Nobody disputes that security is a matter of degree or that increasing an attacker's cost matters. The disagreement is about what you're relying on to impose that cost. A strong cryptographic system relies on the difficulty of breaking the cryptography without the key, not on the attacker being unaware of how the system works. Conflating those two concepts doesn't make them equivalent.


Is a password security through obscurity, since it’s just some not-well-known (known by one) string?

Security through obscurity mostly refers to the attacker not knowing how the system works, not hiding information.


Yes, it is. And code is data. "Security through obscurity" is all that exists.

Cryptography is, in good part, about the practice of using mathematics for the assurance of sufficiently sophisticated obscurity.

The trope of "security through obscurity bad" does not survive scrutiny, because it was never meant to. It's a "practical sense" shorthand, not something to actually deeply consider like this. It falls apart immediately when you do.


Sophisticated obscurity is the key.

Most obscurity is not sophisticated. The things the users are doing aren't much different than a kid hiding behind a sofa and they think their dad doesn't know where they are any longer.


I really do wonder how the cookie will crumble with hardness assumptions in this regard.

The currently trending story may be that it is only a matter of time before the frontier AI labs crack all crypto and then we're hosed, but it's also possible they find hardness proofs and better constructions instead.

Though maybe their focus is not pointing that way right now / counterarguments may continue to be more discoverable.


Nothing wrong with security through obscurity, even in its most naive form of changing your port ranges and stuff like that. It's only a problem when some obscurity is the only method of securing.

Obscurity adds layers of security, and security is all about layering and increasing the difficulty, not about some perfect binary solution secure vs not secure.


There's nothing wrong with obscurity, as long as it's not your only line of defence.

No, it’s a demonstration of obscurity by design.

It doesn’t back up any claims about the benefits of SBO.


Layered security*

Defense-in-depth does not use security-through-obscurity alone, but obscurity can still be a valuable part of a complete strategy. You should know better than "obscurity makes a system less secure"

Security-through-obscurity is another slice of Swiss cheese, albeit one with a big hole.



Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: