Combining Port Knocking With OS Fingerprinting
michaelrash writes "Port knocking implementations are on the rise. I have just released fwknop; (the Firewall Knock Operator) at DEF CON 12. Fwknop implements both shared and encrypted knock sequences, but with a twist; it combines knock sequences with passive operating system fingerprints derived from p0f. This makes it possible to allow, say, only Linux systems to connect to your SSH daemon. Fwknop is based entirely around iptables log messages and so does not require a separate packet capture library. Also, at the Black Hat Briefings, David Worth has released a cryptographic port knock implementation based around one-time pads."
but is anyone out there using port knocking for serious security?
LK
"Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
With a large port knock routine say 20 ports or more, can't you be sure it's YOUR box that's comming in? More defense and limitations are good, sure, but why filter by OS? Is it in case someone gets by the knock?
thank goodness, if there's one thing a hacker can't get his hands on, it's a copy of Linux!
yuk yuk yuk
1. TCPWrappers (has to be be right IP and/or daemon)
2. Portknocking (has to have the right sequence)
3. Passive Fingerprinting (only Linux and BSD systems can connect)
4. Keys Only (you must have the correct DSA private key)
Usually unnecessary, yet very interesting - much like Slashdot itself....
dmiessler.com -- grep understanding knowledge
the bigger is the chance of screwing up. The point of port knocking is to have a simple and therefore less bug prone layer around real authentication systems like ssh, so that when a bug in ssh is found, portscanners don't find your vulnerable service. Complicated port knocking systems defeat the purpose of port knocking.
Until someone makes us a Nice Gnutella or other P2P sharing app that can use this + PGP encryption so we can set up our closed networks and avoid the Corperate Nazi???
People are gonna share, get over it.
While port knocking is by now an established technique, I do not think OS fingerprinting adds anything useful, because the ease of static replay attacks is left unchanged by OS fingerprinting.
Though not that easy, OS spoofing is not remarkably labour intensive, and setting up a "OS generator" who will replay the static attack with every known OS is a distinct possibility.
In other words, though a nice intellectual possibility, it is perhaps of rather limited application.
Now, mixing instead knocking and a cryptographic application seems to me instead more promising.
Thufir Hawat
Part-time Mentat
are techniques I've seen appearing for the last 10 years that are designed to compartment sections of the net. They make me sad, because that's definitely not what the net was intended to be, i.e. a global interconected network of machines to freely communicate. Instead, the net is slowly being segregated, and you'll soon have to show some sort of proof of identity to do anything other than HTTP. If you don't believe me, just consider how hard it is to do something as mundane as a DCC CHAT on IRC today, as opposed to, say, in 1994.
I realize the need for these things, basically forced upon us by the combination of commercial interests, shitty insecure OS, script kiddies and greedy crackers (not hackers), but all the same, I can't help realize that the internet of today is a far cry from what it was intended to be in terms of freedom of communication...
"A door is what a dog is perpetually on the wrong side of" - Ogden Nash
Not more - not less. All that portknocking does is shifting the security to a layer where it doesn't belong.
And even if you don't want others to see that there are services running on your host there are better solutions. e.g. sending a special string to some UDP port.
If someone can sniff your traffic and he knows about portknocking it's trivial for him to detect it. If someone can't sniff your traffic there's no advantage in using portknocking.
and that's just what they'll do
one of these days these ports
are gonna walk all over you........
A whole Slashdot story just to post your port knocker. Good job!
Am I the only one to wonder why the author made a deamon that watches iptable-logs and then modify the ruleset when a matching knock sequence is found instead of implementing a iptables match module instead?
Same goes for psad (by same author) -- I thought the purpose of iptables was to allow plug-in modules to be COMBINED.
This is a one-time password system, which uses hashes, just like S/Key does. This is NOT a one-time pad system.
To all those who are going to repeat the old "security by obscurity" mantra: there is NO clear distinction between good security and security by obscurity. Much of the mechanisms we implement (including passwords, cryptography and so forth) are based on the concept of keeping certain information needed to access the data secret from the attacker, making it difficult to find out or guess certain parameters.
;-)
There are some extreme cases of trivial security by obscurity, which is - indeed - as bad or worse than no security at all. In this case, however, there are security benefits of cryptographically-reinforced port knocking: it makes access to non-public services much more difficult, without the need to deploy complex technologies that are known to cause problems of their own (VPN, for example).
Passive fingerprinting is only a minor twist here, as it only requires the attacker to do more brute-forcing and low-level hacking than he'd otherwise have to do. But then, the Slashdot crowd should not complain something was done only because of the "wow factor"
I thought port knocking was definitively debunked as security through obscurity.
Use the recent match module and something like the following for requiring ports 1000, 2000 and 3000 to be knocked in order and within 30 seconds before allowing ssh from a particular host:Now you don't have to clutter the system with logs and a daemon that may run into trouble.
Would this if further developed simply allow a company say, like Microsoft to prevent people who are not using Windows to visit websites? If put on servers that would be trouble for many Linux users. Microsoft could just try to shrug it off saying that its not a "trusted" operating system. Anyone using say, frontpage or Windows Server could effectively just by using those products prevent "those dirty Open Source infidels" from viewing big websites. ...just a thought.
The passive operating system fingerprints are going to prove to be useless in preventing abuse. It boils down to this -- you can't trust any information gained exclusively from the user (even passively).
Writing software to spoof OS characteristics won't prove to be a challenge, esp. when you know what characteristics the other side is trying to detect. I just can't really see this system as bringing any added value at all.
Would be to implement invisible port knocking, that is one where there is no preceeding magic packet that would hint the attacker about the presence of port knocker.
You can encode plenty of bits of data into the initial sequence number, TTL, window size, timestamp options and so forth (you can probably stuff a TCP packet with up to 128 bits of data with no effort).
The port knocking daemon could then only allow connections for which this 128 footprint matches the one-time cryptographically generated password, silently dropping all other traffic.
OS detection combined with firewall rules is already implemented in OpenBSD.
That did happen before, didn't it?
/. story handy nor could I find it with a quick search, though...
I don't have the
I thought we Linuxboys found security through obscurity bad? Make sure your ssh daemon is secured with good passwords and that you are up to date with security patches, that all other ports are closed/firewalled and that should suffice?
I mean it seems cute and all, but what does it buy you that, for example, sending a UDP packet with an access code in it (perhaps specific to the time of day and other parameters) doesn't get you?
Has it been over a year since you last donated to the Electronic Frontier Foundation
One-time password systems make some sense here. One-time pads are operationally awkward and total overkill for the cryptographic needs of this application.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
Problem is, a bloody large percentage of webservers run apache as their httpd. Microsoft would need dominion of the server market in order to make this stick, even ignoring the legal side of things.
This makes it possible to allow, say, only Linux systems to connect to your SSH daemon.
You mean you could block all the leet blackhat Windows users from your box? You could really be in trouble if they were able to reach it...
Hey baby, you ever had your port knocked by a black hat?
We are one consciousness experiencing itself subjectively. Back to you with the weather, Bob!
How long before someone comes up with a port knocker called "Cypher Operated Combination Key Knocker"?
And wasn't he played by Mark Hamill?
We do not live in the 21st century. We live in the 20 second century.
Protecting a service with port knocking is only practical if gaining access to the service does not have to happen quickly. Protecting a web server with a port knocking scheme is not practical. However, if Microsoft wanted to build an extra layer into their OS so that their tcp stack would simply not allow a session to be established from any non-Microsoft OS, that is a different matter.
Also, at the Black Hat Briefings, David Worth has released a cryptographic port knock implementation based around one-time pads.
The summary is incorrect: David Worth's tool uses one-time passwords, not one-time pads. That's a good thing, because one-time pads would make the system really inconvenient to use.
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
If you'd read up on the hexi-dump.org site, you'd know how his work differs from traditional port knocking... yet everyone is discussing the limitations of the traditional approach... too busy reading slashdot to read technical stuff are we?
When you see their scan, close the ports - when you get a friendly port-knock, open them.
Oh, and here's the command I use to "knock open" my port 25: "ssh root@host.example.com /etc/init.d/postfix start".
...as I say every time this comes up. The more complicated the knock sequence, the less reliable it will be.
PHEM - party like it's 1997-2003!
But weren't you guys the same bastards complaining some sites locked non IE users out? And now you're doing the same thing?
I, for one, am using port knocking as an exclusive security measure on some of the servers I proudly administer. There is a problem, though, when I hear my coworkers shouting "someone is knocking!" I never know whether it is port knocking or those guys who are going to perform rubber hose cryptanalysis on me again... But now with the new techniuque of knocking fingerprinting I will probably be forced (no pun intended) to go back to passwords.
Sincerely,
Pan Tarhei Hosé, PhD.
"Homo sum et cogito ergo odi profanum vulgus et libido."
I personally would prefer a PGP public key encrypted token with the token being what ever is in the one time pad.
8 86 4815
Here are some methods from an earlier discussion, mine and some others.
http://slashdot.org/comments.pl?sid=104064&cid=
I'd go on a Vegan diet but the delivery time from Vega is too long. --brownkitty
They will never know.
Unless... they see their logs.
Your ISP may not be able to directly open your ports but they have to receive, handle and send every single inbound and outbound IP packet of yours, each of them containing source and destination port numbers.
If they don't know the easiest way to see whether you run any servers by just observing port numbers in your traffic, then, if I were you, I wouldn't want such imbeciles for my ISP.
Sincerely,
Pan Tarhei Hosé, PhD.
"Homo sum et cogito ergo odi profanum vulgus et libido."
Comment removed based on user account deletion
Exactly what is the difference between encrypted port knocking and SSL?
Well, I'll tell you what: SSL is fairly standard and widely used. It implements verified and constantly monitored algorithms. Bugs and security holes are being quickly fixed.
On the other hand, port knocking requires an intervention of a network admin to install, has no verified implementations, is theoretically and practically impossible to implement proper security with (since there is no handshake), and is good mostly for hiding backdoors in trojans.
However, the question is how likely it is to actually be under a replay attack?
If an attacker is able to listen to packets comming to the server in question, he must have access to one of those:
- Server in question - then the port-knocking of any kind can be defeated in a number of ways,
- One of the client machines - then the port-knocking of any kind can be easily defeated by a fairly quick analysis of the client program (since the attacker has access to client's machine, it's highly probable that he/she will be able to obtain access to the client program),
- A machine close to the server or the client (although with any secure network serious enough to employ port-knocking it's hard to imagine that it would use hubs or public wireless networks...),
- Networking equipment between the server and the client - now, port-knocking implemented against ISP is altogether not a good idea, since just by observing the traffic the ISP will be able to automatically detect any servers protected by port-knocking or not. If there is a question of security of networking systems, the bigger point is: is it easier to send a trojan email to one of the client machines or try to break into networking equipment run by some respectable ISP?
So, what kind of advantage does cryptographic port-knocking have compared to regular port-knocking? In my opinion, fairly close to none, since if the attacker can detect it, he/she most likely has already got access to at least one of the key machines - the client or the server.The major problem with AuthPF is that it requires that OpenSSH run... OpenSSH is by no means trusted by many people, I being one of them. Sure, just trust Theo and his "... it's not exploitable if PrivSep is on... " what BS
You're sorta missing the point.
Port knocking is used to protect private services, such as SSH, where the general public has no use for the service except for cracking, and the Port Knocking adds an extra layer of security. Adding OS Fingerprinting to this adds an extra layer of security in turn to the Port Knocking.
HTTP, on the other hand, is designed for public access, and for that reason neither Port Knocking nor OS Fingerprinting would be used on it. (Unless you're running an intranet server and you don't want people's home laptops connected, or something like that, but that is again a private service since it's on your local network and not designed to be used by everyone.)
Tired of free iPod sigs? Subscribe to my blacklist