bill’s blog

Just another WordPress weblog

Browsing Posts published in May, 2009

So tonight was cold damp rainy evening in Cambridge. After getting back from class and writing a paper for school, I sat in my hotel room contemplating another fast food dinner. Motivation was way low and as the rain fell harder leaving the room for dinner didn’t seem all that appealing! But it was calling out… “The best Tex-Mex east of the Mississippi!” How could I pass this up! OK… Border Cafe here I come! Motown and rock classics blasting from the PA…

Colored lights…

Walls covered with hot sauce murals…

My kind of place… Chips, Tecate, and awesome guacamole for starters! Now I’m a new convert to guacamole… It’s either really good or I won’t eat it… Let’s just say I finished the bowl! Next was Chimichurri Flank Steak… Cleared the plate on that one. A few more Tecate and a walk around Harvard Square finished the night. Glad I left my room! Thanks Alex for the tip!

So this week I’m in Boston to do some training… I really hadn’t planned on doing much after class… Grab a bite to eat and head back to my room and watch some TV. Fortunately for me, someone in class mentioned the Duck Tours less than 5 minutes walk from class. Goggle relieved the typical tourist trap but not having anything better to do I paid my $29.00 and hopped aboard. I was completely surprised.  The Ducks (or more accurately DUKWs) are vintage WWII amphibious vehicles. They were used during the war to transport troops and supplies into areas were conventional landing craft could not perform adequately! The tour guide (Johnny Baggadonitz) was engaging! He kept us occupied the entire time. I had to break away from the more than once to grab a few pictures to post here. I had a great time…

boston_1

Trinity Church has been honored as one of the “Ten Most Significant Buildings in the United States.” Like all structure built in the Back Bay, Trinity church rests on some 4500 wooden piles, each driven some 30 feet through the landfill.

boston_2

Longfellow Bridge… The Salt and Pepper shakers! Opened to the public on August 3, 1906, it connects Boston’s Beacon Hill with the Kendall Square in Cambridge. The decorative stone work was all hand cut!

Can you secure a network through access control systems only?

Security in not about relying on a single process to protect assets! A belts AND suspenders approach is the best way to minimize the risk of compromise. Access control list are only a small part of the equation! They relate to who will have access to a particular resource once they have been authenticated. The key here is ACLs support known users to the system NOT unknown users. Network security is a cat and mouse game. The smarter you get at protecting your assets; the hacker will always be one step away! As long as computers are accessible from the Internet they will always be at risk. Many vendors will tell you their product does it all! BUT in reality they don’t and they often fail miserably. Those companies that speak in terms parts to a security plan understand that a layered approach to computer security increases your chances at successfully defending your resources! SO what are these different layers and how are the applied?

First there are firewalls. Firewalls are designed to block unauthorized access while permitting outward communication (wikipedia.org, 2009). They sit on the perimeter of your network and the Internet. They control which packets are allowed to pass through to internal resources. Firewalls have a default set of attack signatures whereby they can tell when they are under attacked based on the type and frequency of the packets they “see”. Additionally, network administrators can programmed the device to apply complex rule sets that will determine if the traffic is legitimate or not! These rules bases can be set to allow or deny packets based on the port, source IP address, destination of the traffic, time of day, and contents of the packet. Firewalls can also be deployed within a network infrastructure to protect resources with higher protection needs such as medical information or financial records. They can be deployed on hosts within a secured network in keeping with the belts and suspenders approach… protect the network…protect the host!

Network Access Controls discover and evaluates endpoint compliance status, provisions the appropriate network access, provides remediation capabilities, if needed, and continually monitors endpoints for changes in compliance status (symantec.com, 2008). In other words, any device that connects into your network it is checked to make sure that it conforms to your minimum requirements before it will be allowed to use your protected resources. We (as network administrators) can take measures that minimize who can use our network by making sure that unused wall jacks are not connect to the network or using MAC address to filter to determine who can get an IP address but this will not stop an determined threat or the casual use of networked PDAs. Network Access Control devices proactively scan your network for new devices and agents are delivered to the device wanting access. The end-user agrees allow the agent to “attach” itself to the client and then when access is no longer needed deletes itself from the host machine. Symantec calls this technology, dissolvable agents!

Never under estimate the value of keeping your machines fully patched. Software Updates can insure that vulnerabilities are closed and cannot be used as an attack vector! Applying patches just to keep current is not always the best thing to do. Very often new bugs can be introduced into an otherwise stable environment. Understanding what services a system is offering and patching the system that is vulnerable. There’s no need to patch the httpd daemon if you’re not running/installed web services. Change management plans are a big part of this scenario!

Access Control Lists (or ACLs) is a permission-based method for securing resources (very often is relates to objects on a file system or in a database). In an ACL-based security model, when a subject requests to perform an operation on an object, the system first checks the list for an applicable entry in order to decide whether to proceed with the operation (wikipedia.org, 2009). ACLs allows for greater control over the access to files. In the standard POSIX model, there are owner, group and other permissions, each having read, write and execute attributes assigned to them… very restrictive especially considering that only one user and one group can be assigned to the file/directory. With ACLs, the options are much more varied! You can have multiple owners and multiple groups assigned to a file/directory. In addition, you have the following permissions attributes:

osx_acls_select
Figure 1. Available ACLs permissions attributes for OSX Server v10.5 (Heese, 2009)

NOTE: You can specify not only ALLOW permissons but also DENY permissions!
One thing to keep in mind when deploying ACLs is that not all file systems support them. Formatting your hard disk, writing data to disk and then discovering an un-supported file system can lead to a lot of wasted time!

Virus Protection is an overlooked aspect of file security. Very often people think in terms of protecting my computer. But it is more than that. Viruses can erase files but Trojans can allow others to gain access to your computer (whether it’s a personal computer or a file server). Critical data such as credit card numbers are often stored in databases and once a computer has been compromised, it’s only a matter of time before the data housed on that computer is lost. One thing to keep in mind when working on a server is never to browse the Internet (especially with root privileges). Much of the malware spread across the Internet takes advantage of vulnerabilities within certain OSs and browsers. Why take the risk. Yes it’s a pain in the bottom but think of all the hassles you’ll have to deal with should you host become compromised. To illustrate the point a little further, it has been recently reported that ATMs are being compromised by some very sophisticated pieces of malware. Now granted the ATMs themselves are being compromised but rather hardware security modules (or HSM) that encrypt and decrypt your PIN as it makes its way from the ATM to the bank clearinghouses are. Specially configured malware can be installed on these devices, and it grabs the decrypted PIN numbers out of memory and writes them to a log file that can be retrieved at a later date (Anderson, 2009).

The last item I want to touch on is log files and while not a security mechanism, it is something worthy of protecting. We often don’t put much thought into log files until there is a problem. Unfortunately, if your log files reside on the same host that’s been compromised, then you should consider that the log files have been altered. Why alter a log file? While many daemons will spit lots of information to syslog so will attempts (or more importantly FAILED attempts) to access a host be recorded. When an attacker is trying to compromise your system, one of the first things he will probably do is completely erase the log files, or erase evidence of his trespass out of those files. Moving you log files off of a host and onto a dedicated syslog server insure that you access can be properly evaluated without the fear that they may have been compromised.

Ultimately, security is NOT about set and forget. You must take an active role! It is not about one size fits all! One single solution will prevent you host from compromise! If you machine is out on the Internet long enough, it will get compromised. That’s not to say that the bad guys are looking for you. Remember we are dealing with computers. The bad guys let the computer work for them. Throwing as many obstacles in the path of the cracker will discourage only the most determined of individuals.

Resources:

Anderson, N., (2009, April 15), PIN-grabbing malware compromises bank networks, Retrieved on May 11th, 2009 from http://arstechnica.com/tech-policy/news/2009/04/pin-grabbing-malware-compromises-bank-networks.ars

Heese, B., (2009, May 11), Available ACLs permissions attributes for OSX Server v10.5

Unknown, (2008, December), Symantec™ Network Access Control, Retrieved on May4th 2009 from http://eval.symantec.com/mktginfo/enterprise/fact_sheets/b-datasheet_network_access_control_12-2008_12836809-3.en-us.pdf

Unknown, (2009), Main: Syslog Security Tip, Retrieved on May 11th, 2009 from http://www.syslog.org/wiki/Main/SyslogSecurityTip

Various, (2009, April 24), Access control list, Retrieved on May 6th, 2009 from http://en.wikipedia.org/wiki/Access_control_list

Various, (2009, May 4), Firewall, Retrieved on May 4th, 2009 from http://en.wikipedia.org/wiki/Firewall_(networking)

…in the midst of difficulties we are always ready to seize an advantage, we may extricate ourselves from misfortune.
- Sun Tzu, The Art of War, chapter 8 paragraph 9

But to live defeated and without glory, that is to die everyday!
- Napoleon I (1804)

ETHERAPE is an excellent “real-time” network-monitoring tool. It allows you the ability to see how your network is being utilized! The first time you start up Etherape you’ll know immediately what you are looking at. The larger the line the more traffic you’re seeing. Etherape separates out different types of traffic by color making it very easy to see which services of traffic are used the most relative to one another. Lastly, you can see which host is send verses, which is receiving the data. This is very important information. It will allow you to see whether the traffic is normal or not. For instance… Normally with http traffic, the server should be sending the vast majority of traffic out onto the wire. HTTP requests are far smaller then the actual content the server is putting out. However, if this is reversed and you see huge amounts of traffic coming in… and people are complaining they can’t get to the site… you may be the target of a Denial of Service attack! Simple yes BUT it does take a lot of the guesswork out of the troubleshooting process.

One nice feature to Etherape is that it has the ability to play back dump files. This comes in handy when you’re trying to analyze something that is happening when you’re not there to watch it. The down side to this is that there is no control over the speed of playback (therefore you’re watching packets fly by in real time). Ouch! Etherape doesn’t do much but what it does do it does nicely!

WIRESHARK like tcpdump uses the same libpcap library. So to that end you can make use of the same filters to capture/show only the traffic that relates to your specific area of concentration. Very often we are looking at a specific problem. It is always good to see the bigger picture and to that end one should be capturing all traffic at first to eliminate all variables (sometimes your traffic it simply being dropped). That would point you in a very different direction than if your packets were getting to the intended host but you were getting the wrong/inappropriate information back. Sometimes a machine will host many different services. You may want to filter out all traffic except the service that you’re having problems with. This is the sort of thing that filters would be great at. So let’s take a look at libpcap filters…

Let’s say we have a user who cannot log into their computer. Authentication is being provided from a server running Mac OSX v10.5. Their home directory also resides on the same host. The key thing here is that this user is trying to login from their Mac to an OpenDirectory server! There are a bunch of tools that you can use such as ping, traceroute, dscl, kinit and nslookup! BUT sometimes they can be deceiving! Based on the above info we need to make sure we are capturing traffic on the following ports: 53 for DNS, 88 for Kerberos, 389 for LDAP.

The first thing we could try is:

port 53

This will yield the results of a DNS query! OK yes you could do that using nslookup or dig… BUT those tools will not tell you how or what a host is sending for lookups. What is the query string that the host is sending? Perhaps you didn’t send the FQDN or better still the host is getting hung up on multiple search domains. DNS can be finicky!

Next filter…

port 88 and host 192.168.1.15

We know our KDC resides at 192.168.1.15 and Kerberos runs on port 88 by default. The granting of tickets should only yield 4 packets. If you’re seeing more than that perhaps the wrong password is being sent. We added the host IP address to make sure that we are actually seeing the right server. Additionally by looking through the packets we can make sure the Kerberos DOMAIN is being sent correctly.

One other really nice feature to Wireshark is that you can apply these same files to all the data already capture (whether it’s still in/tmp or in a pcap file).

Session Data is traffic that is the data exchanged between two hosts. This is data that is being sent on the wire real time (though analysis of the data can happen off-line). Now this can be expanded somewhat in so far as many “services” require more than two hosts for properly provide resources. One example of this is a web application connectivity issue. Really in this type of situation there are three machines that could be involved:

1. The client
2. The web server
3. The database server

The problem can be traced back to particular host/s and the problem is usually active when the data is collected.

Then there is Statistical Data. This differs from session data as it is captured over long periods of time. This traffic can be thought of in terms of trends (what does my traffic look like normally). This data could be the conversation between two hosts (again over a period of time). Or it could be data that is passed over a network link there by seeing the traffic of multiple hosts. Because this data is being captured all the time… we can see problems that happen at a specific point in time. Does the spike happen at a given hour every day? Does is build up gradually? Is it happening across the entire WAN? Or is it a local link problem? Very often in complex networks a virus update or service replication at another sight (which) you know nothing about could be affecting your traffic. Being able to say, “Hey this slowness only happens between 1:15 and 2:45 in the morning!” can quickly point to a particular cron job kicking off during those hours.

So what tools are out there to track session data?

Argus is a fixed-model Real Time Flow Monitor designed to track and report on the status and performance of all network transactions seen in a data network traffic stream (qosient.com, 2009). Argus (which is really an acronym for Audit Record Generation and Utilization System) is an open source tool comparable to Cisco’s NetFlow). Unfortunately, not everyone owns a Cisco router! Argus uses a server/client-based model for remote hosts. In other words, you don’t need the client if you’re only running it locally, however if you want to collect data from multiple points across your network you only need to install the client on those remote hosts! Argus currently stores the ‘log’ files on the file system as flat files but there are plans with the latest release to move them to MySQL. Argus can generate and read libpcap files, which is really handy. Additionally, you can export the data and generate graphs using Excel. The website has plenty of information on this tool: http://qosient.com/argus/.

So what tools are out there to track session data?

MRTG is a great tool. BUT underlying MRTG is RRDtools. This really is the heart of this piece of software. RRDtools is a logging and graphing tool that collects various pieces of information. It uses a Round Robin Database for its backend data storage (hence the name). That information can be quite varied! It can be used to track temperature, real estate pricing, CPU utilization… basically anything that generates numbers to keep track on data can be brought into RRDTools can then graphed! BUT what’s most important to us right now is network traffic. MRTG uses SNMP data to generate out its graphs. Another tool is SmokePing. It when used in conjuncture with MRTG can present a fuller picture of overall network status. SmokePing allows for the monitoring of IP based traffic and allows the administrator see the performance of a service overtime!

There are a plethora of free tools out there that are built upon RRDTools… check out http://oss.oetiker.ch/rrdtool/rrdworld/index.en.html for more of them!

Resources:

Unknown, (2009), Argus, Retrieved on May 1st, 2009 from http://qosient.com/argus/

TCPDUMP is a command line utility that enables an administrator (or anyone with certain sudo rights) to capture network traffic. It allows for the remote collection of packets (assuming you have access to a remote host). GUI based applications need to sit on the same wire as the traffic you’re trying to collect. This is not always possible especially if the network segment you’re trying to access is halfway across the globe. At a very basic level one can simply enter the following at a command prompt:

tcpdump -n -w ~/Desktop/dump_filename

(The –n flag tells tcpdump not to perform name lookups… No need to add erroneous packets for something you, as an administrator should already know! The –w tells tcpdump that you want to write the output to a file rather than STDOUT.)


NOTE: If you have more than one network interface, you will need to tell tcpdump which to use. This can be done by using the –i flag followed by the device number (en0, en1, etc.).

Keep in mind that when you tell tcpdump to write to file, you will not be returned to a command prompt until to tell tcpdump to exit. You should however see something similar to:

tcpdump: listening on en1, link-type EN10MB (Ethernet), capture size 96 bytes

You can exit tcpdump by pressing ‘^C’.

SO… Let’s look at one more tcpdump:

tcpdump -i en1 -vvv -n -w ~/Desktop/dump_filename_`date +%Y%m%d%H%M%S`.pcap

What have I done? Well we already know about the –I flag, the –n flag, and the –w flag. The –vvv makes sure that tcpdump capture the most it can (verbose capture). Sometimes you want to just see the connections other times you want to see what was sent. I’ve also added the date and time to the filename.

Soldiers must be treated in the first instance with humanity, but kept under control by means of iron discipline.
- Sun Tzu, The Art of War, chapter 9 paragragh 43