Graphing Randomness in TCP Initial Sequence Numbers 145
Saint Aardvark writes "This is neat: Graphic visualization of how random TCP Initial Sequence Numbers really are for different OSs. It's a great way of seeing how secure a TCP stack really is. Cisco IOS is great; OS9, OpenVMS and IRIX aren't. Posted to the ever-lovin' BugTraq mailing list." This is a follow-up to the previous report.
amazing (Score:5, Funny)
New TCP/IP flags (Score:5, Funny)
That being said, the page *is* finally loading up so I'm going to go look at some pictures now.
Re:New TCP/IP flags (Score:2)
Re:New TCP/IP flags (Score:1, Troll)
Re:New TCP/IP flags (Score:2)
To misquote Douglas Adams: "There is another theory that states that this has already happened."
Such flags exist (Score:2)
I propose a new flag in the standard TCP/IP packet. We shall call this the Slashdot Flag.
There is already a flag in HTTP/1.1 (which operates on top of TCP) that allows Slashdot attacks to be detected. It's called the Referer: header. If the referer is slashdot.org then either refuse the visitor (bugzilla does this) or present a static page with low-resolution graphics.
Re:Such flags exist (Score:1)
And I just tried it, and it worked fine, so maybe they put a traffic limit on it too?
by bugzilla I referred to b.m.o (Score:1)
And I just tried [www.bugzilla.org], and it worked fine
I wasn't aware of www.bugzilla.org [bugzilla.org]. I was referring to bugzilla.mozilla.org [mozilla.org], which just refused me.
Re:by bugzilla I referred to b.m.o (Score:1)
Already Slashdotted (Score:5, Insightful)
Comment removed (Score:4, Informative)
3rd parties don't have the authority (Score:4, Insightful)
although "please use server xxx.xxx as the proxy" for submissions could be a solution
could even set up Apache to do that on a url therefore subtly circumventing the copyright problem, banners could be passed through.
Original report (Score:5, Informative)
http://razor.bindview.com/publish/papers/tcpseq.h
I find it interesting (Score:1, Interesting)
(To those tempted to reply that "they know it's secure", I'd like to point out that assumed security without testing is exactly what keeps getting MS in trouble)
Re:I find it interesting (Score:3, Informative)
Re:I find it interesting (Score:2)
From section 3 of the linked article:
"Several systems, such as Linux, use the same, satisfactory ISN generator as the one used a year ago, and because of that, are
not covered here in any more detail.
"
Re:I find it interesting (Score:2)
If Linux having an attack feasibility of 0.05% is satisfactory, compared with OpenBSD's 0.00% for example.
Re:I find it interesting (Score:2)
Correct.
and at the time of the last test, OpenBSD's attach feasibility was 5%, an order of magnitude worse.
No, the original article states that the release of OpenBSD tested at the time (2.8), had an attack feasibility of 3.05%. It also states that OpenBSD -current had an attack feasibility of 0.00%.
The level of bandwidth and time required to pull off a sub-0.05% feasability attack is so ridiculous that it it is completely impractical in the real world.
But increasing bandwidth and processor speed will eventually make brute force guessing of 32-bit ISNs feasible for the average attacker.
Linux is only 24bits wide. Thats a 128 times smaller area to guess than OpenBSD's and 3GHz P4's, broadband WAN's and Gigabit+ LAN's are upon us.
Why the hell not fix it?
Re:Um, Why no Linux in the report (Score:5, Informative)
>certainly more common than many of the other
>selections.
>
>Should we assume Linux matches *BSD or some other
>flavor? or do I need to read more carefully
You need to read more carefully.
GNU/Hurd (Score:1)
Understanding Randomness (Score:5, Insightful)
Re:Understanding Randomness (Score:1)
Re:Understanding Randomness (Score:1)
For example the typing you do or the network packets generated on the network are used to make the deterministic random number generator more random.
Re:Understanding Randomness (Score:2)
Unless, of course, they're mathematicians, in which case they have a host of very powerful techniques for getting quite good evaluations of randomness, and a wide selection of sophisticated algorithms for producing really good pseudo-random sequences.
In summary, you are both overstating the problem and ignoring the vast body of experience built up for dealing with it.
You can also buy true random number generator cards off the shelf if you *really* can't live with a software solution. But be warned, these are suceptible to external influences (biasing them) and tend to be quite slow compared to PRNG techniques (even good PRNGs).
Re:Understanding Randomness (Score:5, Interesting)
Cost: less than one dollar.
Re:Understanding Randomness (Score:2, Insightful)
Re:Understanding Randomness (Score:2)
The sources I'm referring to are the CPU and ambient temperature sensors and the fan RPM sensors. Now, once a system has been running for a while these numbers will tend to stabilize around a specific value for a given system and configuration (your fan speed and CPU temp shouldn't be fluctuating wildly!), but the last couple of bits ought to fluctuate some. (Depending on specific hardware and the driver that reads it.)
Re:Understanding Randomness (Score:1)
The link to the Trusted Computing Platform Alliance on the left is ominous. When Intel speaks of "building block" do they have Palladium in mind?
Re:Understanding Randomness (Score:3, Informative)
Re:Understanding Randomness (Score:1)
Most people consider throwing a dice and reading the number on the top a random value. Is it? In theory, if you could measure the mass, stability, material etc. of the dice, the force which threw it, the properties of the table it is going to land on, the circumstances (such as wind etc.) you could calculate the result in advance. Similary, if you could observe these electromagnetic fields around this circuit, you could predict the output. It only requires good sensors and processing power.
Now, next time go and measure the lottery balls and do some calculations before you select your numbers
Re:Understanding Randomness (Score:2)
Read up on "entropy" for an introduction.
A sequence is random if, no matter what you do, you can't predict it with more than the randomly-expected accuracy.
Most people consider throwing a dice and reading the number on the top a random value. Is it? In theory, if you could measure the mass, stability, material etc. of the dice, the force which threw it, the properties of the table [...]
Some processes are truly random. Various quantum effects (as far as we can tell). Things like thermal noise in circuits (which is what most electronic random-noise generators amplify). You correctly point out that it's hard to cancel all non-random inputs to a system that measures a truly random variable, but you can get very close (and have a value that approaches truly random probabilities within known tolerances).
In practice, even (good) pseudo-random sequence generators are close enough for most practical purposes.
Re:Understanding Randomness -- relevance to ISNs (Score:1)
You may think that having a duplicate quadruple is unlikely, but that isn't true. The most common quadruples are: your ip, your port just a bit bigger than 1024, your http proxy server ip, port 80.
Using a random local port also helps, though I don't know of systems that do that for TCP.
Re:Understanding Randomness (Score:1)
Actually, computers can be quite good at randomness. You know about linux's
I'm waiting for the day when the national lottery comes up 1,2,3,4,5 with a bonus ball of 6.
Why whould that number combination be a problem? It's just as likeley to occur as any other number set. In fact, if you are trying to pick a winning number, this would be a wise choice, since you are less likely to have to share the jackpot with someone else should you win (because most people believe that an obvious pattern like that is less likely to occur, and will avoid picking such sets).
Re:Understanding Randomness (Score:2)
Actually there was some discussion on the kernel mailing list recently about this. On, say, a rackmounted server you don't have mouse and keyboard interrupts, the only source of entropy is the timing of network events -- which in theory can be controlled by an outside entity (some other machine on the network). This leads to a theoretical non-randomness of
There was a patch offered for this but the side effects (taking much longer to generate an entropy pool) versus a practical assessment of the risk, were deemed not worth it.
Re:Understanding Randomness (Score:2)
Well, since the odds are only 1 in a million (literally) that it will ever happen, I wouldn't hold my breath.
Re:Understanding Randomness (Score:2)
The german lottery works with 6 picks from 49 possible, and the odds for ANY combination pulled from this are 1 to 13 billion IIRC
Re:Understanding Randomness (Score:1)
Maybe that's because the national lottery draws six balls plus the bonus ball....
Still, it would stop anyone winning the jackpot.
Re:Understanding Randomness (Score:1)
Re:Understanding Randomness (Score:2)
Re:Understanding Randomness (Score:2, Funny)
Re:Interesting... (Score:2)
At least I am seeing it very clearly.
And the moderators are on crack again.
Re:Interesting... (Score:2)
One year later, we find that both Windows 2000 SP2 and Windows XP still use essentially the same ISN generator
One might presume from this that the available graph is suitable for all of them.
I Doubt MS had anything to do with the content of the report. The authors simply saved space by showing one graph for all of them.
Which OS9? (Score:1)
Is it Microware's OS-9 [radisys.com], or Apple Mac OS 9?
Re:Which OS9? (Score:1)
Re:Which OS9? (Score:2)
Re:It's Microware (Score:2)
You mean like MacOS X 10?
Lessons in RNG (Score:2, Insightful)
Given that the server is slashdotted, here are a few facts about pseudo-random number generators:
Linear Congruential Generators are infamous for certain weaknesses, most notably that n-tuples fall "mainly on the planes": they lie on hyperplanes in higher dimensional space, depending on the additive and multiplicative parameters chosen.
This doesn't mean that they are any worse for cryptography purposes, because even if you choose parameters that aren't as bad, once the generator parameters are determined and a seed is found, the sequence is deterministic.
But, all is not lost. Modern generators often use shuffling techniques, where you keep track of a few dozen numbers at a time, and then pick one number to determine which of the pool to select, and a second number to replace that selected number. Even a poor LCG when accompanied by such a shuffling technique can perform well. Well, not a really poor one--IIRC randu had problems that shuffling would not fix. I believe the gnu lrand48 and friends use this shuffling technique, as well as CMUCL. I suppose this can be even better if you populate the initial pool of numbers from outside the pseudo-random sequence, so that the potential attacker has almost no shot at figuring out what you seeds are, but to scientists who aren't worried about cryptographic purposes, that is counter-productive. I believe that there are some generators that have been proven 'non-invertible'--you can not go backwards in the sequence except by performing brute force search. Whether or not TCP geeks use these is beyond my knowledge.
But, all is still not safe. You have to be careful about how you change your random number into a usable number. Often people use the high-order bits (e.g., they multiply by some number and then round off). This can be a mistake (of course depending on what your generator really is, and what your purposes are).
Re:Lessons in RNG (Score:2)
Interesting, but offtopic.
The TCP standard forbids to use random numbers as the initial sequence number. If you use random numbers, you cannot guarantee that the sequence number for one (dest_ip,dest_port,source_ip,source_port) tupel are monotonically increasing.
That monotonic increase, which should be faster than the network transfer rate, is needed to reduce the probability of data corruption from stale packets.
The solution are one way hash functions, as described in RFC 1948 [faqs.org]
I'm glad I got to look at this page this morning. (Score:1)
Extremely interesting, I'm probably just uninformed, but this has been one of the first examples I've seen where a 3d rendering has been used to express data in a way that makes any sense to me (I am mathematically challenged).
Mirror in case of further slashdotting (Score:2, Informative)
It's just a 133mhz netbsd box on a home adsl line though, but I figured the more the merrier.
Re:Mirror in case of further slashdotting (Score:2, Funny)
Gosh, what all those years of slashdot have done to me? I actually read "It's just a leemhz netbsd box" once or twice before turning off my automatic l337 translator.
I need to get out more
NextStep? (Score:2)
Re:NextStep? (Score:2)
One of the problems I have with the standard 3D card benchmarks is that they progress too quickly. My VoodooBanshee scored pretty well when it was bought, and I still use it in my 3rd machine, but I have no way of seeing how well it performs against the current crop because the benchmark tools are annual releases, and the scoring changes so much.
It would be good if these had a popular old system from 1, 2 and 3 years ago to run the same tests on. It would probably result in more sales from us 'dont really know/care' guys because we'd suddenly know that we are only 22% as good as a new card costing just £150.
Re:NextStep? (Score:1)
Any hw based ISN generators? (Score:4, Interesting)
Linux?? (Score:1)
Re:Linux?? (Score:4, Informative)
If you read the article is says:
AIX, NeXt, OS/400, Tru64, IRIX the worst (Score:1)
This is funny... (Score:1)
Compared to Standard-Unices, OpenVMS might offer superior security, mostly because of the privilege model it utilizes instead of giving all-powerful root privileges to many user space applications.
On the other hand, we've got OSs which have much more sophisticated security than OpenVMS.
First, there is IBM's AS/400, which has got a privilege model quite similar in extent to the one used in OpenVMS, but additionally it has object-based design, and therefore object-based security (type enforcement and such...). However, it lacks Mandatory Access Control, TCB, Trusted Path and some other things mostly required by military and/or government environments, and therefore it only achieves a C2 security rating.
And then there are a couple of really secure Trusted Unices/Unix-style OSs, like Trusted Solaris, the Pitbull Addon for Solaris and AIX, Trusted IRIX, or XTS/400.
Just talking about fine-grained privilege controls: Argus' Pitbull has got around 100 privileges, how many privileges are there on an OpenVMS box?
No OS has ever received an A1 security branding. And the only OS which has ever received a B3 security branding, is actually a Trusted Unix Environment, something like a Unix clone with some proprietary security mechanisms built into the kernel (OpenVMS was B1 or maybe B2, iirc).
---
Regarding secure TCP/IP initial sequence number generation, it does not take a Trusted OS to just generate secure sequence numbers.
About two months ago, I compared initial sequence number generation on the following OSs using nmap:
* Windows 95
* Windows ME
* Linux 2.2.x
* Windows 2000 (plain)
* Windows 2000 (with Norton Internet security installed)
* OS/2 Warp Server Advanced 4.0 (default install)
* Sun Solaris 7 x86 (with tcp_strong_iss set to 2)
The results where pretty interesting and also a bit surprising:
Windows 95 was worst (ok, that's not surprising
Then came OS/2, which was not much better, nmap rating ~ 1000
(BTW: does anyone have nmap results from OS/390 or OS/400?)
Even Windows ME was a bit better than OS/2, but still far away from being secure, nmap rating ~ 8000
There was little difference between Win2k with Norton's Firewall (~12000) and Win2k without the Firewall (~15000)
Linux' results were quite good, nmap rating approximately some hundred-thousands or millions
Solaris with tcp_strong_iss set to 2 seemed to offer really strong sequence number generation, so nmap just printed a lot of 9s
---
Additional information:
Here [nmap.org] is nmap.
Here [argus-systems.com] is Argus Systems (EAL4 security for Solaris/AIX)
Here [ibm.com] is IBM's AS/400
Here [getronicsgov.com] is Getronics (B3 secure Unix Environment running Unix and Linux applications)
And finally, here [compaq.com] is OpenVMS
Re:This is funny... (Score:1)
Well some no doubt do. But the bundled TCP/IP stack has been a poor relation for years, and the reaction of typical VMSers to TCP/IP problems is often "well the IP code was mostly written by UNIX guys, what do you expect"? However, anyone with a clue knows that basic Internet protocol improvements tend to appear first on BSD or Linux and work its way round.
Anyway TCPIP 5.1 (unpatched?) is hardly the latest, even for VMS. It long predates the initial article for a start; it would be interesting to know how current versions look.
Re:CORRECTION! (Score:1)
Windows 2000 WITHOUT Norton's Firewall had an nmap rating of ~ 12000, Windows 2000 WITH the Firewall achieved the better rating of course, approximately 15000.
What about home router sequence numbers? (Score:1, Interesting)
Re:What about home router sequence numbers? (Score:1, Informative)
Most of them have constant or +1 ISNs. Some advanced ones have +64k.
Re:What about home router sequence numbers? (Score:3, Informative)
Unless you don't trust people on your home lan, it's not much of an issue. Yes, it should be done right, but the only people that can exploit this are those within your network. If they are in your home, they can do much worse than hijack your session as you configure the router.
As for outbound traffic, if you connect to an outside website from an inside PC, it uses the ISN that the PC generated and doesn't change it or adds some simple fixed constant. It still retains all of the entropy of the original PC's ISN. Nobody from the outside should be able to connect to the configuration server in the "DSL router" device. Hence, nobody from the outside really sees the poor entropy of the DSLRouter's ISNs.
Only higher-end firewall products, ie: the cisco PIX, attempt to mangle the ISN generation as they translate hosts. Most of the simple products do not, and certianly none of the $100 DSL routers do.
Also good ISN generation is actualy important to more "commercial" grade routers, since these devices are sometimes deployed and administered remotely, generate tunnels, etc. Thus these routers/firewalls sometimes have exposed ports, or exposed client traffic on a public network as they are being reconfigured.
Of course, many are only configured localy, or over a local LAN, which makes the risk a lot lower, but also users on corprate lans are generaly less trusted than those in your own home.
Re:What about home router sequence numbers? (Score:2)
Re:What about home router sequence numbers? (Score:1)
Simple free products like OpenBSD with pf/nat do.
Re:What about home router sequence numbers? (Score:2)
In the context I meant it, I'd certianly not call OpenBSD a "simple product". By simple I meant "designed with minimal work".
OpenBSD has got a lot of well thought out and well placed security design. In that respect, I'd call it one of the higher end, carefuly engineered products.. even if it is free
"clearly it is a bunny rabbit" (Score:2, Funny)
Re:"clearly it is a bunny rabbit" (Score:2)
Wrong stack for OpenVMS (Score:2)
You are overlooking the fact that most OpenVMS installations use third party TCP/IP stacks, generally Multinet [process.com] or TCPware [process.com] from Process Software [process.com] (the CMU stack being largely defunct now), which do not suffer from this defect. This is largely because the initial implementation of DEC's TCP/IP stack, UCX, was buggy as hell and lacked many features, although it is finally starting to catch up.
Not that it matters much anyway. This predictable ISN weakness only threatens systems configured to trust others based solely upon their IP address (a bad idea). The only ways to crack a properly configured OpenVMS system currently involve (1)physical access to the console, (2) "social hacking" (tricking someone into telling you their password), or (3) packet sniffing for protocols which pass unencrypted passwords such as POP3 and telnet (easily solved by disabling such nonsecure protocols); three vulnerabilities which pose a threat to any OS, no matter how well designed. Nice having an OS which cannot be compromised via buffer overflow exploits (OpenVMS discards data from buffer overflows and raises an exception, always. Overflowing data cannot be executed).
Re:Buffer overflows on VMS (Score:1)
The only difference to many other OSs is, that applications do not have more privileges than are required to run the application, while on Linux for example many applications (like Sendmail or FTP-Servers) have Superuser-privileges, and therefore can override Discretionary Access Control.
I am almost absolutely sure, that it is possible to also run arbitrary code by exploiting buffer overflows on OpenVMS. But even if you could not, you can still modify data and pointert - that's enough to compromise security of a privileged program.
There are also Unix operating systems which have a privilege model, and some of them have got a much more fine grained privilege model than OpenVMS *PLUS* Trusted Computing Base Controls, File Security Flags and many other things.
So OpenVMS is by far not the most secure OS - personally, I think even OS/400 is more secure, because of its object-based design and its type-enforcment policies.
Re:Buffer overflows on VMS (Score:2)
I would love to see such code, as this does not jive with what I've observed in my own socket coding. When a buffer overflow occurs on a VMS socket_read() call (at least under Multinet), the overflowing data doesn't seem to even get written to memory, let alone passed to DCL (unlike the situation in Unix and Windows where overflowing data gets passed to the shell).
MOD PARENT UP (Score:2)
Small detail (Score:1)
They need (Score:1)
Stance for ISP web proxies (Score:1)
I could see what people are trying to mirror. I remember an article bitching about squid servers in ISP's, but I'm happy if I can get my stuff.
Will HPQ Sue? (Score:1)
IRIX INSECURE (Score:2)
The fact that they even have to mention that IRIX is insecure just shows how out of touch geekdom as a whole has become. Why even test IRIX for security holes? It's light years beyond swiss cheese.
UUUU Linux? (Score:1)
No linux? heh (Score:1)
Yes, Linux (Score:1)
RFC 1948 (Score:3, Interesting)
The idea is to add a bias to the sequence numbers that depends on the source address. A client will be able to predict his own sequence numbers but not the sequence numbers of others. The bias is calculated using a cryptographic hash of the connection ID and a secret value.
A TCP implementation that uses RFC 1948 may still get a very poor rating for initial sequence number predictability from tools like nmap.
Does anyone know any TCP stack that actually implements it?
For great security... (Score:2)
It's a great way of seeing how secure a TCP stack really is.
Yeah, right.
Try the following: plot 500 points with point i having x coordinate Fib(i + 37) % 97 and y coordinate Fib(i + 97) % 97 (where Fib(i) is the i-th Fibonacci number). They look random, but in fact are totally predictable!
Now imagine that someone got this right, and uses a crypto-secure PRNG to generate their TCP ISNs, seeding it with known-good random data. It would be nice to believe that this defeats all known TCP attacks! In fact, of course, their stack may be completely open to all kinds of attacks not involving ISN spoofing.
The graphics are amusing, but not particularly informative except in the negative case. There is no substitute for real security. Testing can only prove a system insecure. ISN attacks are not the biggest worry in most TCP applications.
What software made those graphs? (Score:1)
It looks like a neat tool for visualizing sets of numbers.
It reminds me of this awesome applet that shows frequency of numbers used on the net: numbers [turbulence.org]
When rulers go bad (Score:2)
[wisc.edu]
http://www.cs.wisc.edu/~kovar/hall.html
Weak ISNs, nmap's Idlescan (Score:2)
Re:Previously posted.... (Score:2, Interesting)
But it is still a nice article, illustrating Knuth's advice simply to plot random numbers to visually quickly judge the quality of a pseudo random number generator.
Re:Related story - (found on google) (Score:1)
For gawd's sake, the link has "goatse" in it.
Read the link... Linux did well the first time. (Score:2)
That said, the last test was for 2.2 - It would be useful to test 2.4 just for comparison. It sounded like 2.2 had a few *MINOR* flaws (Mainly a reduced number of bits of randomness, probably easily changed by changing the type of a variable or two) that despite being flaws, were insignificant. Something like a
Has 2.4 achieved a 0? (Or at least
Or what if the kernel developers accidentally screwed something up and 2.4 is worse than 2.2? (HIGHLY unlikely but still possible...)