Mitigating the Next Stuxnet Worm

On July 18 at the FOSE 2011 Conference in Washington, DC , I was one of two speakers who addressed the topic, “Situational Awareness – Mitigating the Next Stuxnet”.  In my remarks, I noted that the Stuxnet worm secretly infected 12,000 computers in five Iranian nuclear facilities over a year-long period without detection. The attacks began 2009 and weren’t discovered until July 2010. I stated that there is no way that this attack could have happened had Iran had a reasonably competent level of internal cyber security which was commiserate with the stated importance of those facilities to that nation.

A look at this diagram shows the nine different ways that the Iranians unwittingly gave the Stuxnet worm major assistance in accomplishing its mission without detection:

      Static screen shot from an animated presentation illustrating Iran’s cyber security incompetence

As this diagram speaks volumes for itself, for brevity’s sake I will comment here on only two of the nine different ways the Stuxnet worm was able to propagate for so long to so many thousands of machines without detection:

  • In a real-time process control facility (common example: SCADA/DCS), the user-monitored graphical user interfaces on Human Machine Interface (HMI) machines can be manipulated at will to display whatever an attacker –or an attacker’s malware– wants. This includes forcing the display to show normal facility operations data, even though the machinery or processes may be operating abnormally as a result of an in-progress attack. Use of this tactic in an offensive military worm should not have been a surprise, as vulnerability assessment Red Teams including those managed by yours truly have used such attacks as part of process control assessment work as far back as 2001.

A low footprint, high return way of preventing such manipulation is to use off-the-shelf software to monitor file-level changes to all mission critical applications such as HMI software, database executable files and major portions of the HMI underlying host operating systems.  A pattern of file changes that spreads on its own from machine to machine across the network is indicative of a stealthy malware attack. An example: the MD-5 or SHA hash value of BOOTVID.DLL changing across a network without detection by anti-virus software likely indicates the spread of a stealthy new malware specimen.

  • Malware propagation across a network environment generally produces abnormal patterns of traffic which deviate from previously baselined traffic patterns.  These patterns can be detected by routine manual analysis even in the absence of detection by Intrusion Detection Systems (IDS), although many IDS systems can be calibrated to detect such traffic deviances.  Basic examples of patterns to look for include new peer-to-peer machine connections, server-to-workstation connections, a pattern of changed connections from workstations to servers, or outbound traffic changes or pattern of new outbound data egress attempts.Any pattern of changes that spreads on its own across the network without alerts from anti-virus software may be a strong indication of an in-process stealthy malware attack. Example: a burst in a specific pattern of DNS queries which spreads from machine to machine across a network.

In conclusion, it should be calming to realize that in the end, the Stuxnet worm was just software. Complex groundbreaking software, admittedly yes, but still just software.  The Stuxnet had no magical powers or superhero ways of taking over its target networks.  It was merely software that relied on the same avenues of attacks and network communication protocols which have been widely discussed for many years as being significant problem areas. Stuxnet  could have been beaten by an appropriate level of internal defense which was commiserate with the importance of those facilities to that nation.

Now that the Stuxnet code is in the wild, we can surmise that the next great attack will only build on the ground breaking path laid by Stuxnet worm.  This should be a wake up call to our nation.  The question is, are we listening?  Time will tell soon enough.

Posted in Security Articles | 7 Comments

A Cost-Based Analysis of User Effort in Security

This article does a fantastic job of quantifying the somewhat nebulous idea of why end users generally tend to make decisions about security that seem poor. Looking at the cost analysis comparing the price of end user time to the actual losses, it’s clear that many of the basic traditional wisdoms surrounding daily web usage are a huge hassle with little payoff.

In other words, the average user would spend far more time attempting to maintain strong passwords and check every URL and SSL certificate than he/she is likely to lose by failing to do so. The article goes much deeper into the math leading to those conclusions, but it’s not necessary to whip out a calculator to know he’s right.

In my opinion, this solidifies the fact that much of the burden of end user protection is shifted up the chain. While one user may only see a few pennies per year of realized risk, the organizations serving all of those end users will see substantially more loss, as it is all aggregated. By the same token, organizations serving end users are in a position to much more economically deploy countermeasures, and have access to more data which allows them to do so effectively.

The other angle on this is that the more transparent security controls become to end users, the more effective they’ll be. This paper covers directly the effort needed to validate SSL and read URLs. Other controls like virus scanning at the perimeter, IPS, and well-implemented least-access principal (while not without issues of their own) are considerably less likely to require end user effort to be effective, and therefore be a better answer in that regard than any amount of awareness training.

Posted in Commentary | Leave a comment

SSL is now Vulnerable… What’s your Plan B?

There have been numerous reports recently that a new Man-in-the-Middle attack has been developed which works on the previously secure SSL 3.0 and TLS 1.0. The details of exactly what can be done with this attack have yet to be fully explored, but the bigger point is: what do you do now?

Well… As I’ve declared many, many times before, you must assume that everything will be compromised at some point, so it should be planned for. Since it’s not likely that SSL 4.0 (or whatever spec will prevent this new attack) is going to be codified and deployable for some time, you have to have backup plans.

Realistically, there are two main things you can do as someone who uses SSL/TLS to secure data in transit. The first is you can do your part to be sure that there is no Man-in-the-Middle attack happening on your end of the connection. While ISP-level man-in-the-middle attacks aren’t impossible (or even really difficult if you have access to a big enough line and BGP), they’re certainly not common, so the “last mile” is what needs to be protected most. On the server end, there’s the issue of shared hosting. Even when running on a dedicated piece of hardware, you will still be sharing a switch with other servers. Any other rogue server on the same physical subnet is in a position to perform ARP poisoning or simple timing attacks on your data streams (metasploit.com had this issue a while back). Setting static ARP for the gateway is a good way to prevent that, but getting your servers in-house or in a reputable colo goes a long way as well. On the client end, static ARP entries may not be a reasonable method due to a more static environment, but physically and electronically auditing your network to see what’s attached is very doable. Keep a healthy dose of paranoia about you when doing so, and be sure to keep the wifi locked down.

The second line of defense against this new attack is mostly in monitoring your environment and attempting to detect issues before they get out of hand. The new SSL/TLS attack itself is supposedly very hard to detect at the end points using current methods, as the attack deals in the (re)negotiation portion of the conversation, which isn’t fully protected by the math that binds the certificates together. So, detection needs to occur elsewhere. Looking for abnormal protocol usage (in the wrapped protocols) or errors dealing with additional data would be a place to start. Monitoring the applications and data being accessed would also likely show some trace of a successful attack.

Unfortunately, there’s no single good defense which has been developed yet, so it’s best to diversify your efforts. Of course, you knew something like this would happen eventually, and all of these defenses (and many more) are already deployed, right? ;-)

Posted in Security Articles | Tagged | Leave a comment

A Place for Everything, Everything in its Place

As with all New Year seasons, everyone chimes in with predictions for the year to come, along with retrospectives of what the previous year brought. While not strictly a seasonal occurrence, many such writings/articles/declarations/rants/etc. contain rather outlandish predictions and assertions which are meant to be shocking at worst, and visionary at best.

Recently, I’ve seen several pieces which fall into this category, and would like to toss my own two cents on the pile. The one that sort of kicked off my initiative to write this was a posting by Adriel Desautels which appeared on the Snosoft blog and on the pentesting mailing list. The post asserts that vulnerability scanners don’t work. The point is made that vulnerability scanning is not an effective tool because the core pieces fall on the tail end of vulnerability research and the scanners themselves aren’t accurate. On the accuracy part, the claim is made that his best case experience with scanning tools is 30% accuracy (that’s obviously a guesstimate, as no hard data is provided). Adriel’s conclusion is that the best replacement for a vulnerability scanner is a well-trained penetration testing team which conducts its own research.

Of course, as with many outlandish claims, I disagree. Going down the list, I’d have to say first that of course vulnerability scanners have a huge amount of value, and definitely have their place. His estimate of 30% accuracy I suspect to be completely made up, and will continue to until I see some sort of data to back it up. Also, no reference point is given on that number. Is it 30% of all vulnerabilities that ever have been or ever will be known about a system? What is 100% then? Is this counting false positives and negatives (or just one of them, or neither)?

My experience with Nessus, Saint, nCircle, and others has shown the whole class of tools to be hugely useful, so long as you look at them in the right context. What’s important to keep in mind is exactly the title of this post. All tools have their place, and all needs have a set of tools which address them best. Vulnerability scanners are generally useful in two roles. The first is in a one-time look at a network. I use Nessus whenever I assess a client’s network for the first time. That’s because in addition to pointing out vulnerabilities, it gathers tons of data. What’s best is that it does this automatically. I could use a collection of 20 or more tools to enumerate hosts and poll their various services for data, but that’s a waste of time when a vulnerability scanner will do all of it for me. While the vulnerability scanner is doing its thing, I’m free to do a walk of the premises, talk to staff, or take a nap. All of these are much better uses of my time than running individual tools manually. When the initial scan is done, I can then take closer looks at specific hosts and services with more specific tools if need be. My time at a client site is usually quite limited, so it’s important for me to make the best use of it.

The other case where a vulnerability scanner is very useful is where a whole network needs to be monitored for change. Because the vulnerability scanner is pretty consistent in what it does and very broad in what it covers, and because the whole process is automated, scans can be done in intervals very easily. Data sets can then be compared over time to show trends in vulnerability and give hard data about where the most vulnerability probably is. I want to key in on the fact that I say “probably” in the last sentence for a reason. Vulnerability scanners are plenty of useful, but what they aren’t is perfect. Adriel’s article is pretty much centered around the main weakness of any automated security tool, which is that they can’t see everything, and a good deal of security is in the soft/squishy part (the people and organization). Additionally, he makes the point of the lag time between vulnerability discovery and detection by scanner, but we’ll get back to that. Backing up a bit, the reason you can’t use a vulnerability scanner to identify where vulnerability in your network definitely is, is because of a lack of comprehensiveness of the tool, and the sheer complexity of vulnerability.

Vulnerability scanners can’t tell you that your policy is terrible or that the structure of your network is poor. They can’t tell you that Frank in accounting took home all of your company’s customer data, and they can’t even begin to detect your lack of visibility into the traffic flowing across your WAN. What they can do for you (and me), however, is catch low-hanging vulnerabilities and report them in an automated manner and allow us to use our time handling other tasks. As with all tools in all industries, you can’t expect a tool meant for one task to be the end-all, be-all solution to something as conceptually large and complex as “security.”

To address the issue of lag time between vulnerability discovery and detection by a vulnerability scanner, I believe this is a moot point. This lag exists in all tools and solutions in one form or another, and where one tool or solution might have a lower lag than others, it can’t be considered comprehensive. Specifically, Adriel suggests that teams of security professionals replace vulnerability scanners functionally in organizations. This is just plan silly for a variety of reasons. First is cost. an internal team of security professionals is simply out of the question financially for most organizations. Contracting out the service just once is also expensive compared to even the most expensive vulnerability scanners (Nessus goes for $1200/year/scanner, nCircle is upwards of $30k for the initial installation). Getting a team of specialists to do even the basics of what a vulnerability scanner can do is a waste.

However, sticking to the title of this article, I believe that all tools and solutions have their place and that there is a proper process to attack any problem. For security, you first need to perform gap analysis. In the early stages of reaching a secure state, tools like vulnerability scanners are extremely useful, because they allow you to efficiently identify and address the most numerous and obvious flaws. A security professional’s role here shouldn’t require much direct interaction with the systems at all. Automated tools will churn up enough information to get an idea of where things stand, and help to identify major problems. This is your typical Vulnerability Assessment; a broad process which should take a shallow look at the whole organization, identify major and core issues, and develop a plan for action. This sets the current state and outlines a goal state.

The middle parts of the process require different tools for different reasons. The vulnerability scanner is still very useful here for the tracking of remediation and detection of new minor issues, but gives way to higher-end planning and consulting which aims to set up controls which proactively secure the network, and do so in intelligently redundant layers. The latter parts of a security ramp-up are where the vulnerability scanner becomes a minor player in that it is used to catch smaller issues which fall through the more proactive steps put in place to take care of issues before they cause vulnerability. Also, this phase of the process is where penetration testing becomes relevant. As is stated in this rather controversial prediction by Brian Chess, penetration testing should be used as testing is in the scientific process. That is, penetration testing should be used to test a theory. The theory should be something along the lines of: “security control ABC should stand up to XYZ types of attack, and those attacks should trip some sort of alarm when a certain point is reached.” In other words, a security control is designed and put in place earlier in the process, then needs to be stress tested to prove that it is working as expected. This is exactly how we’ve approached penetration testing (especially since we make it very distinct from our vulnerability assessment service) since day one here at White Badger.

So to sum up, early in the security ramp-up process (where most organizations haven’t even started), automated tools like vulnerability scanners have a huge amount of value because they allow for a large amount of data to be collected and acted on in a very efficient manner. As the process goes on, the more automated tools give way to more specialized tools used to assess certain specific hosts/services/vulnerabilities. At the end of the process, penetration testing is performed, and that is almost entirely manual. The best (in my opinion, the best are the most realistic, regardless of scale) penetration tests will combine attack methods from all different angles to properly estimate the success rate of exploiting a vulnerability.

Vulnerability scanners aren’t worthless. That’s like saying that a table saw is worthless because all woodworking can be done with a screwdriver and a utility knife. The worth of a tool is directly proportional to its cost and benefit. Vulnerability scanners generally have a low cost relative to their closest alternatives, and a high payoff so long as the expectation is reasonable. They have their place in the security process and won’t be replaced functionally by an adjacent tool any time soon.

Posted in Commentary, Security Articles | Leave a comment

Another Good Reason to Stay Paranoid

This article on physorg.com was posted a little while ago and gives an excellent example of how important it is to stay paranoid (or develop a healthy sense of it). In short, a photograph of physical keys can be used to duplicate them. All that is required is a shot showing all of the details, which can be snapped at quite a distance with the right lens. While it definitely is more of a threat to residential-grade stuff than Medeco government/military-grade locks, it’s a great example that threats are everywhere. It’s important to always assume every part of your organization is vulnerable to some extent, and to plan for it. Doing so will ensure that you are considerably more prepared for the time when (not if) something fails.

Posted in Security Articles | Tagged | 1 Comment