packetfu followup

I went back to packetfu today (see here for my first talk about it) for a large collection of pcaps I have (about 30GB worth) hoping to use it to help me quickly get an overview of what I’ve seen.

Fortunately, a lot of the hoops I had to jump through previously are now non-issues; using gem to install pcaprub and packetfu itself made it dead simple. Even more fortunately, I didn’t bother trying it on my Mac initially, guessing – correctly, as it turns out – that RAM usage would go through the roof. I ^C’ed my test ruby script, pasted from my first post on the subject, after it hit 7.5GB resident on my 8GB test machine. I have Ruby 1.9.1 on that box, so I don’t think there’s much more I can do to optimise. Sadly, I guess I’m stuck with tcpdump and looping shell scripts for the time being, and I’ll try to follow up with the author, although I don’t know what help I can provide.

What is a driveby download?

If you fall victim to malware, you might hear that the vector for infection is a “driveby download.” What is a driveby download, and how does it happen?

A driveby download is when you inadvertently or mistakenly download software. It may or may not actually execute, and it may or may not actually leave a persistent installation behind post-execution. Whether it does either or both of these things can depend on your user’s permissions on your computer, and also on the presence of software vulnerabilities. Driveby downloads may take advantage of vulnerabilities in your operating system or installed applications in order to perform a privilege escalation attack, where they can gain greater control over your computer than your current user actually has permissions for.

The most common way to fall victim to a driveby download is to visit an otherwise-innocent website that has been somehow compromised by an attacker. Like privilege escalation, there are many ways an attacker may do this, but the common feature is generally some Javascript in the page that causes your browser to redirect to a new website, often without you being aware that it’s happened. Javascript is not the only attack method; some attackers may also or instead use Java applets or ActiveX controls to deliver software.

Even if a driveby does not actually permanently install software, it can still cause damage. It may execute in memory only, and be used to send spam, conduct network scanning, or any other activity that a normal user of the system might perform. Some malware might, for example, connect to all your network drives and enumerate files you can see while logged in, evaluating them for confidential or personal information of a certain sort, and deliver those files back to the attacker.

Credential theft, mitigations thereof

It was with some interest that I read an Infosec Island post about forcing transport security whilst connecting to various websites, but I want to counter-recommend some advice given.

The information on STS is correct, so far as I know – I don’t use the plugin myself – but it was with a bit of horror that I noted the author recommended using a VPN as partial mitigation against this attack.  We considered and rejected this advice for our own advisory (my own nearly identical blog post on it is here) when discussing Firesheep.

A VPN may be configured with a split tunnel – that is, traffic destined for the organisation hosting the VPN goes through the secure tunnel, but other traffic does not.  In other words, a split tunnel VPN does nothing to protect you against credential theft of the sort being discussed.

Our own VPN will be configured in such a manner, which is counter to the practise at many large companies, but which we believe is the only workable way when scaling out to thousands of users with uncontrolled access points.  The last thing we want is for our VPN to be hammered by BitTorrent traffic the instant somebody forgets, or for people to complain to us that their home network stops working as soon as they fire up the VPN.

Before following Mr. Coates’ advice, find out how your VPN works.  The illusion of security is worse than none at all.

Firesheep: black hats for the masses

The following will also be used as part of my day job.  To ITSec types, it’s likely old hat, but it may be new to some of my readers.  Some terminology in here is my-job-specific, but I did try to generalize it as much as possible.

What is it?

Firesheep is a readily-available and easily-installed add on for Firefox, a commonly-used web browser.  It allows the person using it to, within certain parameters, steal web cookies used for authorization on many common websites, mostly social networking but also, most notably, Hotmail.  This is a form of attack commonly known as sidejacking.  Note that while this document largely talks about uw-wireless, everything about that network applies equally to any open or unsecured wireless network, such as uw-guest or those commonly found in coffee shops, restaurants, and other places offering free service to customers.

Please note that discussing a tool does not condone its use.  In particular, the use of Firesheep on a campus network is a violation of the principles laid down in the Guidelines on Use of Waterloo Computing and Network Resources and, as noted by these Guidelines, is subject to discipline under the appropriate University Policy or Policies.  Use of Firesheep here, or anywhere else, may furthermore violate local laws and regulations on privacy, mischief, or wiretapping.

What does it mean?

Firesheep makes it easy for anybody who can click a mouse to be able to access these websites as if they were the person whose credentials they’ve stolen – and that person may not even be aware of the accesses.

How does it work?

The victim has to be on the same wireless access point, using the same wireless network, as the attacker.  That implies a certain physical proximity.  The wireless network must be open, and the victim must be using the network at the same time as the attacker, and must be accessing these sites (but see below, the victim may not necessarily know they were using a particular website, embedded content can cause problems).

When Firesheep is started, the attacker’s computer starts passively watching the network for authentication credentials.  When it sees such, it saves them and presents an icon for the attacker to click; this allows the attacker to easily access the website as the victim.

It should be noted that a user may inadvertently access a website.  Many websites will have badges to follow the site’s author on Twitter, or link to them on Facebook.  Sometimes the simple act of loading that website can cause your browser to send and receive authentication cookies, and therefore expose this information to the attacker.

I don’t use social networks.

Firesheep doesn’t only work on social networks, so you still may not be safe.  Web services as varied as Evernote, Cisco, eBay, Amazon, and Slicehost have had Firesheep handlers written for them.

Why doesn’t the University stop it from happening?

This attack takes advantage of two weaknesses in the way victims might access vulnerable websites.

The first weakness is that open networks are precisely as the name implies.  All clients transmit all data unencrypted using their wireless radio.  Like any radio, anybody can listen in.  This means that unless the client takes extra precautions to encrypt data, such as using TLS/SSL encryption on the data stream itself, that data is exposed for anybody within range who’s listening.  This means that many websites which do encryption properly, such as almost all banking websites, are not vulnerable to authentication theft in the way that Firesheep accomplishes it.

The second weakness is in the way the vulnerable websites perform authentication and authorization.  Without getting too technical, these sites rely on cookies, and merely having that cookie implies both that you are who you say you are, and you’re allowed to access the content you’ve requested.  Not all websites have this issue; as noted, banking websites don’t rely on this model.  Other sites such as GMail and corporate applications at the University of Waterloo don’t either, and so your credentials there are safe from this attack.

What can I do to protect myself?

The simplest thing you can do is not use open wireless networks.  These are ones which do not require a key or password to access.  uw-wireless is one such network, but many coffee shops and restaurants and other companies provide such networks for the convenience of their customers.  This also affords attackers certain conveniences.

The next-best thing is to not use sites vulnerable to Firesheep attack whilst connected to an open wireless network.  Be aware that some sites you visit may effectively force you to give up your credentials anyway, as noted under How Does It Work?

Some clients customized for use by some social networks, such as Tweetdeck, may allow these networks to be used in a manner that does not expose authorization credentials to Firesheep.  That does not necessarily mean that these clients always operate in a safe manner.

Some people have authored Firefox extensions which could potentially warn you about the use of Firesheep on your network segment.  The use of these extensions (the most commonly mentioned are FireShepherd and BlackSheep) is prohibited on University wireless networks, as they have a deleterious effect on the operation of the campus network and, not incidentally, of the remote service.

Networked printers are cool

In lieu of actual content, I give you a fake commercial:

80386 clone: $2500
Paying university tuition to teach yourself how to use the above: $20,000
Getting paid to rickroll a group of co-workers' insecure networked printers: priceless.

The downside was I lost sanity points when one of them recognized what I’d done, and started singing at me.  Remember folks, just because the printer has an ACL doesn’t mean that ACL is respected.